@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #0a0a0a;
  --surface: #101014;
  --surface-2: #17171d;
  --line: #24242c;
  --fg: #f4f2ee;
  --fg-dim: #a5a3a0;
  --fg-faint: #6c6a68;
  --bone: #eadfcb;
  --bone-dim: #c9bda6;
  --radius: 14px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --header-h: 58px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  overscroll-behavior: contain;
}

body { overflow-x: hidden; }
body.no-scroll { overflow: hidden; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; border-radius: 6px; }

/* circular icon button — used by the player back arrow and search close.
   Without this the bare <svg> renders at its natural size (the giant chevron). */
.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--fg);
  transition: background 160ms var(--ease), transform 120ms var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- floating pill navbar (desktop) ---------- */
.navwrap {
  position: fixed;
  left: 50%; top: 20px;
  transform: translateX(-50%);
  z-index: 60;
  width: min(1180px, calc(100vw - 6rem));
  height: 58px;
  display: none;
  pointer-events: none;
  transition: opacity 420ms var(--ease), transform 420ms var(--ease);
}
.navbar {
  pointer-events: auto;
  display: flex; align-items: center; gap: 4px;
  width: 100%; height: 58px;
  padding: 8px 10px;
  border-radius: 26px;
  background: rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(42px) saturate(1.5);
  -webkit-backdrop-filter: blur(42px) saturate(1.5);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 24px 70px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.nav-brand {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  background: rgba(234, 223, 203, 0.14);
  color: var(--bone);
}
.nav-brand svg { width: 21px; height: 21px; }

.nav-items { display: flex; align-items: center; gap: 2px; min-width: 0; margin-left: 4px; }
.nav-spacer { flex: 1; }

.nav-item {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px;
  border-radius: 16px;
  font-size: 14px; font-weight: 600;
  color: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
  transition: background 200ms var(--ease), color 200ms var(--ease), transform 120ms var(--ease);
}
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { color: rgba(255, 255, 255, 0.95); background: rgba(255, 255, 255, 0.08); }
.nav-item:active { transform: scale(0.96); }
.nav-item.on { color: rgba(255, 255, 255, 0.98); background: rgba(255, 255, 255, 0.22); }

/* ---------- floating tab bar (touch) ---------- */
.tabbar {
  position: fixed;
  left: 50%; bottom: calc(14px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 60;
  display: flex; align-items: center; gap: 2px;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(42px) saturate(1.5);
  -webkit-backdrop-filter: blur(42px) saturate(1.5);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.07),
    0 20px 50px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}
.tab {
  width: 50px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.55);
  transition: background 200ms var(--ease), color 200ms var(--ease), transform 120ms var(--ease);
}
.tab svg { width: 21px; height: 21px; }
.tab:active { transform: scale(0.92); }
.tab.on { color: #fff; background: rgba(255, 255, 255, 0.2); }

body.player-open .tabbar, body.player-open .navwrap { opacity: 0; pointer-events: none; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 78svh;
  display: flex;
  align-items: flex-end;
  padding: 0 16px 26px;
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 700ms var(--ease); }
.hero-bg img.on { opacity: 1; }
.hero::after {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 8, 10, 0.72) 0%, rgba(8, 8, 10, 0.12) 34%, rgba(8, 8, 10, 0.86) 78%, var(--bg) 100%),
    linear-gradient(90deg, rgba(8, 8, 10, 0.7) 0%, rgba(8, 8, 10, 0) 62%);
}

.hero-inner { width: 100%; max-width: 560px; }
.hero-logo { max-height: 92px; width: auto; margin-bottom: 14px; filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.6)); }
.hero-title { font-size: clamp(30px, 8vw, 46px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; margin: 0 0 12px; }
.meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--fg-dim); font-size: 13px; margin-bottom: 12px; }
.meta-row .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--fg-faint); }
.pill-tag { border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: 11px; color: var(--fg-dim); }
.hero-overview {
  color: var(--fg-dim); font-size: 14px; line-height: 1.55; margin: 0 0 18px;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { display: flex; gap: 10px; align-items: center; }

.btn-play {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--fg); color: #0a0a0c;
  font-weight: 600; font-size: 15px;
  padding: 0 22px; height: 48px; border-radius: 999px;
  transition: transform 120ms var(--ease), opacity 160ms var(--ease);
}
.btn-play:hover { opacity: 0.9; }
.btn-play:active { transform: scale(0.97); }
.btn-play svg { width: 18px; height: 18px; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 18px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); color: var(--fg);
  backdrop-filter: blur(10px); font-weight: 500; font-size: 15px;
  transition: background 160ms var(--ease), transform 120ms var(--ease);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.16); }
.btn-ghost:active { transform: scale(0.97); }
.btn-ghost svg { width: 18px; height: 18px; }

/* ---------- rows ---------- */
.view-top { padding-top: calc(var(--safe-t) + 18px); }
@media (min-width: 900px) { .view-top { padding-top: 96px; } }

main { padding-bottom: calc(96px + var(--safe-b)); }
.row { margin: 26px 0; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 16px; margin-bottom: 12px; }
.row-title { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.row-count { font-size: 12px; color: var(--fg-faint); }

.rail {
  display: flex; gap: 12px;
  overflow-x: auto; overflow-y: hidden;
  padding: 2px 16px 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }

.card { flex: none; width: 132px; scroll-snap-align: start; text-align: left; }
.card-art {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease);
}
.card:hover .card-art { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6); }
.card:active .card-art { transform: scale(0.975); }
.card-art img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 420ms var(--ease); }
.card-art img.on { opacity: 1; }
.card-art { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.055), 0 10px 26px rgba(0, 0, 0, 0.22); }
.card:hover .card-art { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 18px 40px rgba(0, 0, 0, 0.55); }

.progress-strip { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.22); }
.progress-strip > i { display: block; height: 100%; background: var(--bone); }

.badge-4k {
  position: absolute; top: 7px; right: 7px;
  background: rgba(8, 8, 10, 0.74); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px; padding: 1px 5px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.06em; color: var(--bone);
}

/* grid for search / library */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 16px 12px; padding: 0 16px; }
.grid .card { width: auto; }

/* ---------- detail sheet ---------- */
.sheet-scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(4, 4, 6, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity 260ms var(--ease);
}
.sheet-scrim.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; z-index: 90;
  left: 0; right: 0; bottom: 0;
  max-height: 92svh;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateY(101%);
  transition: transform 340ms var(--ease), visibility 340ms var(--ease);
  padding-bottom: calc(26px + var(--safe-b));
}
.sheet.open { transform: translateY(0); }
.sheet-grab { width: 38px; height: 4px; border-radius: 2px; background: #3a3a44; margin: 9px auto 0; position: sticky; top: 9px; }

.sheet-art { position: relative; aspect-ratio: 16 / 9; overflow: hidden; margin-top: -13px; }
.sheet-art img { width: 100%; height: 100%; object-fit: cover; }
.sheet-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(16, 16, 20, 0) 45%, var(--surface) 100%); }
.sheet-body { padding: 0 18px; margin-top: -22px; position: relative; }
.sheet-title { font-size: 25px; font-weight: 700; letter-spacing: -0.03em; margin: 0 0 9px; }
.sheet-overview { color: var(--fg-dim); font-size: 14px; line-height: 1.6; margin: 14px 0 18px; }
.sheet-actions { display: flex; gap: 10px; margin: 16px 0 6px; }
.sheet-actions .btn-play { flex: 1; justify-content: center; }

.cast-rail { display: flex; gap: 14px; overflow-x: auto; padding: 4px 0 6px; scrollbar-width: none; }
.cast-rail::-webkit-scrollbar { display: none; }
.cast { flex: none; width: 68px; text-align: center; }
.cast img, .cast .cast-blank { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.cast-name { font-size: 11px; margin-top: 6px; line-height: 1.3; color: var(--fg-dim); }
.section-label { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); margin: 20px 0 10px; }

.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 10px; }
.spec { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; }
.spec dt { font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--fg-faint); margin: 0 0 3px; }
.spec dd { margin: 0; font-size: 13px; font-weight: 500; }

.play-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(234, 223, 203, 0.07);
  border: 1px solid rgba(234, 223, 203, 0.2);
  border-radius: var(--radius); padding: 12px 13px;
  font-size: 12.5px; line-height: 1.5; color: var(--bone-dim); margin-top: 14px;
}
.play-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--bone); }

/* ---------- series episodes ---------- */
.season-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: none; }
.season-chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 15px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; color: var(--fg-dim);
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.chip.on { background: var(--fg); color: #0a0a0c; border-color: var(--fg); }

.ep-list { display: flex; flex-direction: column; gap: 2px; }
.ep {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 12px 10px; border-radius: var(--radius); text-align: left;
  transition: background 150ms var(--ease);
}
.ep:hover { background: var(--surface-2); }
.ep:active { transform: scale(0.99); }
.ep-num { width: 26px; flex: none; text-align: center; font-size: 15px; font-weight: 600; color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.ep-body { flex: 1; min-width: 0; }
.ep-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-meta { font-size: 11.5px; color: var(--fg-faint); margin-top: 2px; }
.ep-prog { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.16); margin-top: 7px; overflow: hidden; }
.ep-prog > i { display: block; height: 100%; background: var(--bone); }
.ep-play { width: 17px; height: 17px; flex: none; color: var(--fg-faint); }

/* ---------- search ---------- */
.search-layer {
  position: fixed; inset: 0; z-index: 85;
  background: rgba(8, 8, 10, 0.96);
  backdrop-filter: blur(22px);
  padding: calc(var(--safe-t) + 10px) 0 0;
  display: none; flex-direction: column;
}
.search-layer.open { display: flex; }
.search-bar { display: flex; align-items: center; gap: 10px; padding: 0 12px 12px; }
.search-input {
  flex: 1; height: 46px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--fg); font-size: 16px; padding: 0 14px;
}
.search-input::placeholder { color: var(--fg-faint); }
.search-results { flex: 1; overflow-y: auto; padding-bottom: calc(30px + var(--safe-b)); }
.empty { text-align: center; color: var(--fg-faint); font-size: 14px; padding: 60px 20px; }

/* ---------- player ---------- */
.player {
  position: fixed; inset: 0; z-index: 100;
  background: #000;
  display: none;
}
.player.open { display: block; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }

.player-ui { position: absolute; inset: 0; opacity: 1; transition: opacity 300ms var(--ease); }
.player-ui.hidden { opacity: 0; pointer-events: none; }

.player-top {
  position: absolute; inset: 0 0 auto 0;
  padding: calc(var(--safe-t) + 10px) 14px 34px;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.78), transparent);
}
.player-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-sub { font-size: 11.5px; color: var(--fg-dim); }

.player-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.big-play {
  pointer-events: auto;
  width: 78px; height: 78px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: grid; place-items: center;
  transition: transform 160ms var(--ease), background 160ms var(--ease);
}
.big-play:active { transform: scale(0.92); }
.big-play svg { width: 32px; height: 32px; }

.seek-hint {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: var(--fg);
  background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(10px);
  border-radius: 999px; padding: 14px 18px;
  opacity: 0; transition: opacity 200ms var(--ease);
}
.seek-hint.show { opacity: 1; }
.seek-hint.left { left: 10%; }
.seek-hint.right { right: 10%; }
.seek-hint svg { width: 22px; height: 22px; }

.player-bottom {
  position: absolute; inset: auto 0 0 0;
  padding: 40px 14px calc(14px + var(--safe-b));
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.86), transparent);
}
.scrub-row { display: flex; align-items: center; gap: 11px; margin-bottom: 4px; }
.time { font-size: 11.5px; color: var(--fg-dim); font-variant-numeric: tabular-nums; min-width: 42px; }
.time.right { text-align: right; }

.scrub {
  position: relative; flex: 1; height: 26px;
  display: flex; align-items: center; cursor: pointer; touch-action: none;
}
.scrub-track { position: relative; width: 100%; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.24); overflow: hidden; }
.scrub-buffer { position: absolute; inset: 0 auto 0 0; background: rgba(255, 255, 255, 0.34); }
.scrub-fill { position: absolute; inset: 0 auto 0 0; background: var(--bone); }
.scrub-knob {
  position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%;
  background: var(--bone); transform: translate(-50%, -50%);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  transition: width 140ms var(--ease), height 140ms var(--ease);
}
.scrub:active .scrub-knob { width: 17px; height: 17px; }

.ctrl-row { display: flex; align-items: center; gap: 4px; }
.ctrl-row .spacer { flex: 1; }
.ctrl-btn {
  height: 44px; min-width: 44px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 10px; font-size: 13px; font-weight: 500;
  transition: background 160ms var(--ease), transform 120ms var(--ease);
}
.ctrl-btn:hover { background: rgba(255, 255, 255, 0.1); }
.ctrl-btn:active { transform: scale(0.94); }
.ctrl-btn svg { width: 21px; height: 21px; }
.ctrl-btn.on { color: var(--bone); }

.menu {
  position: absolute; right: 14px; bottom: calc(78px + var(--safe-b));
  min-width: 190px; max-height: 46svh; overflow-y: auto;
  background: rgba(20, 20, 25, 0.94); backdrop-filter: blur(22px);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px; display: none;
}
.menu.open { display: block; }
.menu-label { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); padding: 8px 10px 5px; }
.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 10px; border-radius: 9px; font-size: 13.5px; text-align: left;
  transition: background 140ms var(--ease);
}
.menu-item:hover { background: rgba(255, 255, 255, 0.08); }
.menu-item .check { width: 15px; flex: none; color: var(--bone); }
.menu-item .check svg { width: 15px; height: 15px; }

.player-msg {
  position: absolute; inset: 0; display: none; place-items: center; padding: 26px;
  background: rgba(8, 8, 10, 0.94); text-align: center;
}
.player-msg.show { display: grid; }
.player-msg-inner { max-width: 380px; }
.player-msg h3 { font-size: 19px; margin: 0 0 9px; letter-spacing: -0.02em; }
.player-msg p { color: var(--fg-dim); font-size: 14px; line-height: 1.6; margin: 0 0 20px; }
.player-msg .btn-play { margin: 0 auto 10px; }

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--bone);
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-wrap { position: absolute; inset: 0; display: none; place-items: center; pointer-events: none; }
.loading-wrap.show { display: grid; }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, #1f1f27 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  :root { --header-h: 66px; }
  .navwrap { display: block; }
  .tabbar { display: none; }
  main { padding-bottom: 60px; }
  .hero { min-height: 82svh; padding: 0 40px 52px; }
  .hero-inner { max-width: 620px; }
  .hero-overview { -webkit-line-clamp: 4; line-clamp: 4; font-size: 15px; }
  .row-head, .rail, .grid { padding-left: 30px; padding-right: 30px; }
  .card { width: 168px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 22px 18px; }
  .sheet { left: 50%; right: auto; transform: translate(-50%, 101%); width: min(760px, 94vw); border-radius: var(--radius-lg); bottom: 3vh; max-height: 90svh; border: 1px solid var(--line); }
  .sheet.open { transform: translate(-50%, 0); }
  .search-results .grid { padding-top: 6px; }
  .player-top { padding: 22px 26px 40px; }
  .player-bottom { padding: 44px 26px 22px; }
}

/* ---------- sign in ---------- */
.login-body { display: grid; place-items: center; min-height: 100svh; margin: 0; }
.login-wrap { width: 100%; padding: 24px; }
.login-card { max-width: 340px; margin: 0 auto; text-align: center; }
.login-mark {
  width: 62px; height: 62px; margin: 0 auto 18px;
  display: grid; place-items: center; border-radius: 20px;
  background: rgba(234, 223, 203, 0.13); color: var(--bone);
}
.login-mark svg { width: 32px; height: 32px; }
.login-title { font-size: 27px; font-weight: 700; letter-spacing: -0.03em; margin: 0 0 6px; }
.login-sub { color: var(--fg-dim); font-size: 14px; margin: 0 0 24px; }
.login-form { display: flex; flex-direction: column; gap: 10px; }
.login-input {
  height: 50px; border-radius: 14px; padding: 0 16px; font-size: 16px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--fg);
}
.login-input::placeholder { color: var(--fg-faint); }
.login-input:focus { outline: none; border-color: rgba(234, 223, 203, 0.45); }
.login-btn { justify-content: center; width: 100%; }
.login-btn:disabled { opacity: 0.6; }
.login-error { color: #ff6b6b; font-size: 13px; margin: 14px 0 0; }

/* ---------- profile picker ---------- */
.profiles {
  position: fixed; inset: 0; z-index: 95;
  background: var(--bg);
  display: none; place-items: center; padding: 24px;
}
.profiles.open { display: grid; }
.profiles-inner { width: 100%; max-width: 620px; text-align: center; }
.profiles-title { font-size: clamp(22px, 6vw, 32px); font-weight: 700; letter-spacing: -0.03em; margin: 0 0 30px; }
.profile-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.profile {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 6px; border-radius: 16px;
  transition: transform 160ms var(--ease);
}
.profile:hover { transform: translateY(-3px); }
.profile:active { transform: scale(0.96); }
.profile-face {
  width: 92px; height: 92px; border-radius: 22px;
  display: grid; place-items: center;
  font-size: 32px; font-weight: 600; letter-spacing: -0.02em;
  background: var(--surface-2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 12px 30px rgba(0, 0, 0, 0.4);
  transition: box-shadow 200ms var(--ease);
}
.profile:hover .profile-face { box-shadow: 0 0 0 2px var(--bone), 0 16px 36px rgba(0, 0, 0, 0.55); }
.profile-name { font-size: 14px; font-weight: 500; color: var(--fg-dim); }
.profile:hover .profile-name { color: var(--fg); }
.profile-face.guest { background: rgba(234, 223, 203, 0.1); color: var(--bone); }

.nav-avatar, .tab-avatar {
  width: 40px; height: 40px; flex: none; margin-left: 4px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(234, 223, 203, 0.18); color: var(--bone);
  font-size: 14px; font-weight: 700;
  transition: transform 120ms var(--ease), background 180ms var(--ease);
}
.nav-avatar:hover, .tab-avatar:hover { background: rgba(234, 223, 203, 0.3); }
.nav-avatar:active, .tab-avatar:active { transform: scale(0.93); }
.tab-avatar { width: 44px; height: 40px; border-radius: 14px; }

/* ---------- rail scroll arrows (pointer devices only) ---------- */
.row { position: relative; }
.rail-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  width: 70px;
  height: 62%;
  min-height: 84px;
  display: none;
  place-items: center;
  border-radius: 22px;
  color: #fff;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.09),
    0 14px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 0;
  transition: opacity 300ms var(--ease), background 200ms var(--ease), transform 160ms var(--ease);
}
.rail-arrow svg { width: 26px; height: 26px; }
.rail-arrow.left { left: 6px; }
.rail-arrow.right { right: 6px; }
.rail-arrow:hover { background: rgba(0, 0, 0, 0.58); }
.rail-arrow:active { transform: translateY(-50%) scale(0.96); }
.rail-arrow[hidden] { display: none !important; }

@media (hover: hover) and (min-width: 900px) {
  .rail-arrow { display: grid; }
  .row:hover .rail-arrow { opacity: 1; }
  .rail-arrow:focus-visible { opacity: 1; }
}

.profile-face svg { width: 34px; height: 34px; }
.profile-name { text-transform: capitalize; }

/* The closed sheet used to peek above the bottom edge on desktop: it is offset
   bottom:3vh but only translated by 101% of its own (tiny, empty) height, so the
   transform could never clear the offset. Hide it outright when closed. */
.sheet { visibility: hidden; pointer-events: none; }
.sheet.open { visibility: visible; pointer-events: auto; }
@media (min-width: 760px) {
  .sheet { transform: translate(-50%, calc(100% + 6vh)); }
  .sheet.open { transform: translate(-50%, 0); }
}
