@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
}

:root {
  --bg: #0c0d0f;
  --bg-2: #141518;
  --surface: #17181b;
  --surface-hi: #1d1f23;
  --surface-press: #24262b;
  --hair: rgba(255, 255, 255, 0.1);
  --hair-hi: rgba(255, 255, 255, 0.22);
  --text: #f4f5f7;
  --muted: #8e939c;
  --faint: #5d626b;
  --plex: #ebaf00;
  --r-lg: 18px;
  --r-md: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t: 120ms;
  --pad: clamp(20px, 3.2vw, 40px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body {
  background:
    radial-gradient(120% 70% at 50% -10%, #1a1c20 0%, rgba(26, 28, 32, 0) 60%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 55%);
  background-color: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: calc(var(--pad) * 0.8) var(--pad) calc(var(--pad) * 0.6);
  gap: clamp(18px, 2.6vh, 28px);
}

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }

header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
h1 { font-size: 30px; font-weight: 500; letter-spacing: -0.01em; }
.hdr-r { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.btn {
  border: 0;
  height: 72px;
  min-height: 72px;
  padding: 0 20px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px var(--hair);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform var(--t) ease-out, background-color var(--t) ease-out;
}
.btn:active { transform: scale(0.97); background: rgba(255, 255, 255, 0.09); }

.toggle {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px var(--hair), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.toggle .thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  transition: transform 220ms var(--ease);
}
body.menu .toggle .thumb { transform: translateX(100%); }
.toggle button {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
    min-width: 112px;
    height: 72px;
    min-height: 72px;
  padding: 0 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.toggle button[aria-selected="true"] { color: var(--text); }
.toggle svg { width: 18px; height: 18px; flex: none; }

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--plex);
  color: #141414;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
}

.surface {
  position: relative;
  background: linear-gradient(180deg, var(--surface-hi), var(--surface));
  border-radius: var(--r-lg);
  border: 0;
  text-align: left;
  box-shadow: inset 0 0 0 1px var(--hair), inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform var(--t) ease-out, box-shadow var(--t) ease-out, background-color var(--t) ease-out;
}
.surface:active {
  transform: scale(0.97);
  background: linear-gradient(180deg, var(--surface-press), var(--surface-hi));
  box-shadow: inset 0 0 0 1px var(--hair-hi), 0 0 0 4px rgba(255, 255, 255, 0.04);
}
.surface:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.6); outline-offset: 3px; }
.surface.plex { box-shadow: inset 0 0 0 2px var(--plex), 0 0 24px rgba(235, 175, 0, 0.1); }
.surface.plex:active { box-shadow: inset 0 0 0 2px var(--plex), 0 0 0 4px rgba(235, 175, 0, 0.16); }

main { flex: 1 1 auto; }
.slot { position: relative; min-width: 0; }
.slot.is-hidden { display: none !important; }
.rm {
  display: none;
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: #2a2c31;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 2px 6px rgba(0, 0, 0, 0.5);
  color: var(--text);
}
.rm svg { width: 20px; height: 20px; }
.rm::before { content: ""; position: absolute; inset: -14px; }
body.editing .rm { display: flex; }
body.editing #bEdit { background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22); }
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  align-content: start;
}
.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 14px 14px;
  aspect-ratio: 1 / 0.86;
  min-height: 150px;
}
.app .mark {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}
.app .mark img { max-width: 78%; max-height: 64px; width: auto; height: auto; object-fit: contain; }
.app .name {
  max-width: 100%;
  font-size: 19px;
  font-weight: 500;
  color: #e3e6ea;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app .badge { position: absolute; top: 12px; right: 12px; }

.list { display: none; flex-direction: column; gap: 8px; }
.row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 74px;
  padding: 8px 20px 8px 8px;
  border-radius: var(--r-md);
}
.row:active { transform: scale(0.985); }
.row .mark {
  flex: none;
  width: 88px;
  height: 58px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}
.row .mark img { max-width: 70px; max-height: 36px; object-fit: contain; }
.row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row .name {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.row .desc {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .chev { flex: none; width: 26px; height: 26px; color: var(--faint); }

body.menu .grid { display: none; }
body.menu .list { display: flex; }

#hiddenServices { flex-direction: column; gap: 10px; }
#hiddenServices[hidden] { display: none !important; }
#hiddenServices h2 { font-size: 22px; font-weight: 500; }
.hidden-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 74px;
  padding: 8px 12px 8px 8px;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--surface-hi), var(--surface));
  box-shadow: inset 0 0 0 1px var(--hair);
}
.hidden-row .mark {
  flex: none;
  width: 88px;
  height: 58px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.28);
}
.hidden-row .mark img { max-width: 70px; max-height: 36px; object-fit: contain; }
.hidden-name { flex: 1; font-size: 22px; font-weight: 500; }

.note {
  margin-top: auto;
  padding-top: 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

@media (orientation: landscape) and (max-height: 820px) {
  body { padding-top: 20px; padding-bottom: 10px; gap: 16px; }
  .note { padding-top: 0; }
}
@media (orientation: portrait) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .surface:active, .row:active, .btn:active { transform: none; }
}
