@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/static/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }

:root {
  --bg: #08090b;
  --surface: #101319;
  --surface-2: #171b23;
  --surface-3: #1e232c;
  --line: rgba(255, 255, 255, .075);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #f2f5f9;
  --muted: #a3adbe;
  --faint: #6d7688;
  --accent: #e7b567;
  --accent-ink: #1b1205;
  --accent-soft: rgba(231, 181, 103, .13);
  --ok: #5bd39a;
  --ok-soft: rgba(91, 211, 154, .13);
  --danger: #ff8080;
  --danger-soft: rgba(255, 128, 128, .13);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .55);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .3);
  --r-lg: 20px;
  --r: 14px;
  --r-sm: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Barlow Condensed', 'Inter', sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --stage-max: 1180px;
}

[data-theme='light'] {
  --bg: #f6f3ec;
  --surface: #fffdf9;
  --surface-2: #f2ede3;
  --surface-3: #e7e0d3;
  --line: rgba(28, 22, 10, .12);
  --line-strong: rgba(28, 22, 10, .26);
  --text: #191510;
  --muted: #5d564a;
  --faint: #857c6c;
  --accent: #8a5a10;
  --accent-ink: #fffaf0;
  --accent-soft: rgba(138, 90, 16, .13);
  --ok: #1c8f5f;
  --ok-soft: rgba(28, 143, 95, .12);
  --danger: #c2352f;
  --danger-soft: rgba(194, 53, 47, .1);
  --shadow-lg: 0 24px 60px rgba(24, 28, 40, .16);
  --shadow-sm: 0 6px 18px rgba(24, 28, 40, .1);
}

* { box-sizing: border-box; }

/* The base colour must live on <html>: mobile browsers paint the overscroll/canvas area from
   the root element, so a colour set only on <body> leaves bare canvas past the document. */
html {
  min-height: 100%;
  background-color: var(--bg);
  background-image:
    radial-gradient(1400px 900px at 8% -4%, var(--accent-soft), transparent 68%),
    radial-gradient(1100px 800px at 102% -2%, rgba(90, 140, 255, .06), transparent 62%);
  background-repeat: no-repeat;
  background-attachment: scroll;
  background-size: 100% 100%, 100% 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ layout */
.shell { position: relative; z-index: 1; display: grid; min-height: 100dvh; }

.sidebar { display: none; }

.stage {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: 84px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.search-field {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.search-field:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-field svg { width: 18px; height: 18px; color: var(--faint); flex: none; }
.search-field input {
  flex: 1;
  min-width: 0;
  height: 42px;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 15px;
}
.search-field input::placeholder { color: var(--faint); }
.search-field input:focus { outline: none; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-clear {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px;
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #7a4be0));
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}
.avatar-top { display: none; }

.view {
  width: 100%;
  max-width: var(--stage-max);
  margin: 0 auto;
  padding: 18px 14px 40px;
}

/* ------------------------------------------------------------------- rail */
.rail {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(16px);
  border-top: 1px solid var(--line);
}
.rail-item {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-height: 48px;
  padding: 5px 2px;
  border-radius: 12px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .01em;
  transition: color .16s var(--ease);
}
.rail-item svg { width: 22px; height: 22px; }
.rail-item.is-active { color: var(--accent); }
.rail-item.is-active span { font-weight: 600; }

/* ------------------------------------------------------------------- hero */
.hero { padding: 26px 2px 10px; }
.eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(38px, 8.4vw, 62px);
  line-height: .96;
  letter-spacing: .005em;
  text-transform: none;
  margin-bottom: 10px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted); max-width: 46ch; font-size: 14.5px; }

.chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 14px 2px 4px;
  margin: 0 -14px;
  padding-inline: 14px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: all .16s var(--ease);
}
.chip.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 12px;
}
.section-head h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.section-head span { font-size: 12.5px; color: var(--faint); }

/* ------------------------------------------------------------------ cards */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 10px;
}
.card {
  display: grid;
  gap: 7px;
  text-align: left;
  border: 0;
  background: none;
  padding: 0;
  animation: rise .34s var(--ease) both;
}
.card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.card-poster img { width: 100%; height: 100%; object-fit: cover; }
.card-plate {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  background:
    linear-gradient(155deg, color-mix(in srgb, var(--accent) 26%, var(--surface-2)), var(--surface-2) 62%);
  color: var(--text);
  font-family: var(--display);
  font-size: 30px;
  line-height: 1;
  text-align: center;
}
.card-plate span { opacity: .9; }
.card-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 3px 7px;
  border-radius: 6px;
  background: #0b0d11;
  color: #f7f8fb;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.card-supporter {
  position: absolute;
  bottom: 7px;
  right: 7px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 700;
}
.card-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (hover: hover) {
  .card:hover .card-poster {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
  }
}

/* -------------------------------------------------------------- skeletons */
.sk { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--r); }
.sk::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 7%, transparent), transparent);
  animation: shimmer 1.25s infinite;
}
.sk-card { display: grid; gap: 7px; }
.sk-poster { aspect-ratio: 2 / 3; }
.sk-line { height: 11px; border-radius: 6px; }
.sk-line.short { width: 55%; }

/* ------------------------------------------------------------------ empty */
.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
}
.empty b { color: var(--text); font-size: 15px; }
.empty p { font-size: 13.5px; max-width: 42ch; }
.empty svg { width: 30px; height: 30px; color: var(--faint); }

/* --------------------------------------------------------------- requests */
.req-list { display: grid; gap: 9px; }
.req-row {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  animation: rise .3s var(--ease) both;
}
.req-thumb {
  position: relative;
  width: 46px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-3);
}
.req-thumb img { width: 100%; height: 100%; object-fit: cover; }
.req-thumb .card-plate { font-size: 15px; padding: 4px; }
.req-main { min-width: 0; display: grid; gap: 2px; }
.req-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-sub { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-trail { font-size: 11px; color: var(--faint); margin-top: 2px; }
.req-note {
  grid-column: 1 / -1;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 7px 9px;
}
.req-side { display: grid; gap: 6px; justify-items: end; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--muted);
}
.pill[data-status='requested'] { background: var(--surface-3); color: var(--muted); }
.pill[data-status='approved'], .pill[data-status='searching'],
.pill[data-status='downloading'], .pill[data-status='processing'] {
  background: var(--accent-soft); color: var(--accent);
}
.pill[data-status='available'] { background: var(--ok-soft); color: var(--ok); }
.pill[data-status='declined'], .pill[data-status='failed'] { background: var(--danger-soft); color: var(--danger); }
.pill[data-status='cancelled'] { background: var(--surface-3); color: var(--faint); }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  font-size: 12px;
  color: var(--faint);
  min-height: 28px;
}
.link-btn:hover { color: var(--danger); }

/* ------------------------------------------------------------------ admin */
.queue-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  animation: rise .3s var(--ease) both;
}
.queue-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.queue-title { font-size: 14.5px; font-weight: 600; }
.queue-meta { font-size: 12px; color: var(--faint); }
.queue-actions { display: flex; gap: 7px; align-items: center; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: transform .14s var(--ease), background .16s var(--ease), border-color .16s var(--ease);
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: transparent; }
.btn-lg { min-height: 48px; padding: 12px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 34px; padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }

/* ------------------------------------------------------------------ sheet */
.sheet {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  width: 100%;
  max-width: 100%;
  max-height: 92dvh;
  margin: 0 auto;
  position: fixed;
  inset: auto 0 0 0;
}
.sheet::backdrop { background: rgba(4, 5, 7, .62); backdrop-filter: blur(5px); }
.sheet[open] { animation: sheetUp .3s var(--ease); }
.sheet-card {
  display: flex;
  flex-direction: column;
  max-height: 92dvh;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.sheet-grab {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: var(--line-strong);
  margin: 9px auto 0;
  flex: none;
}
#sheet-body { overflow-y: auto; overscroll-behavior: contain; }

.sheet-hero { position: relative; padding: 16px 16px 12px; }
.sheet-hero-art {
  position: absolute;
  inset: 0 0 auto 0;
  height: 150px;
  background-size: cover;
  background-position: center 30%;
  opacity: .3;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent);
}
.sheet-hero-inner { position: relative; display: grid; grid-template-columns: 74px 1fr; gap: 13px; }
.sheet-poster { width: 74px; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface-2); }
.sheet-poster img { width: 100%; height: 100%; object-fit: cover; }
.sheet-head { display: grid; gap: 3px; align-content: start; padding-right: 30px; }
.sheet-head h3 { font-size: 18px; font-weight: 700; line-height: 1.2; }
.sheet-head .meta { font-size: 12.5px; color: var(--muted); }
.sheet-overview {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  max-height: 4.8em;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, #000 72%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent);
}
.sheet-type { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.tag {
  font-size: 9.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent);
}
.sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}
.sheet-close:hover { color: var(--text); }

.sheet-steps { padding: 4px 16px 0; display: grid; gap: 18px; }
.step { display: grid; gap: 8px; }
.step-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.step-label b { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.step-label span { font-size: 11.5px; color: var(--faint); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.seg-btn {
  min-height: 46px;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  text-align: left;
  display: grid;
  gap: 1px;
  transition: all .16s var(--ease);
}
.seg-btn b { font-size: 13px; font-weight: 600; color: var(--text); }
.seg-btn small { font-size: 10.5px; color: var(--faint); }
.seg-btn.is-on { border-color: var(--accent); background: var(--accent-soft); }
.seg-btn.is-on b { color: var(--accent); }

.field-select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field-note {
  width: 100%;
  min-height: 66px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  resize: vertical;
}
.field-note::placeholder { color: var(--faint); }

.season-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.season {
  min-width: 54px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  display: grid;
  justify-items: center;
  line-height: 1.15;
}
.season small { font-size: 9.5px; font-weight: 500; color: var(--faint); }
.season.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.episode-list { display: grid; gap: 5px; max-height: 260px; overflow-y: auto; }
.ep {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  text-align: left;
  font-size: 13px;
}
.ep.is-on { border-color: var(--accent); background: var(--accent-soft); }
.ep-num { font-size: 11px; font-weight: 700; color: var(--accent); }
.ep-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-date { font-size: 10.5px; color: var(--faint); }
.ep.is-upcoming { opacity: .62; }
.ep.is-upcoming .ep-date { color: var(--accent); }

.sheet-foot {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 8px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--surface) 72%, transparent);
  border-top: 1px solid var(--line);
}
.sheet-hint { font-size: 11.5px; color: var(--faint); text-align: center; }
.sheet-warn {
  font-size: 12.5px;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 9px;
  padding: 8px 10px;
}

/* --------------------------------------------------------------- account */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  display: grid;
  gap: 14px;
}
.who { display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: center; }
.who .avatar { width: 46px; height: 46px; font-size: 16px; }
.who b { font-size: 15.5px; display: block; }
.who small { color: var(--faint); font-size: 12.5px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row > div { display: grid; gap: 1px; }
.row b { font-size: 13.5px; font-weight: 600; }
.row small { font-size: 12px; color: var(--faint); }

/* ----------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(74px + env(safe-area-inset-bottom));
  transform: translate(-50%, 14px);
  z-index: 60;
  max-width: min(92vw, 420px);
  padding: 11px 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-3) 92%, black);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-size: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ gate */
.gate {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 20px;
}
.gate-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  max-width: 380px;
  padding: 30px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}
.gate-card h1 { font-family: var(--display); font-size: 34px; line-height: 1; }
.gate-card p { color: var(--muted); font-size: 13.5px; }
.gate-card small { color: var(--faint); font-size: 11.5px; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); }
.brand-mark svg { width: 19px; height: 19px; }
.brand-mark-lg { width: 46px; height: 46px; border-radius: 13px; }
.brand-mark-lg svg { width: 28px; height: 28px; }

/* ------------------------------------------------------------ animations */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes sheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- desktop */
@media (min-width: 861px) {
  .shell { grid-template-columns: 236px 1fr; }
  .rail { display: none; }
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 20px 14px;
    border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 55%, transparent);
  }
  .brand { display: flex; align-items: center; gap: 9px; padding: 2px 6px; }
  .brand-text { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
  .brand-text span { color: var(--accent); }
  .side-nav { display: grid; gap: 2px; }
  .nav-item {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 10px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 500;
    transition: background .16s var(--ease), color .16s var(--ease);
  }
  .nav-item svg { width: 19px; height: 19px; }
  .nav-item:hover { background: var(--surface-2); color: var(--text); }
  .nav-item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .nav-badge {
    font-style: normal;
    font-size: 10.5px;
    font-weight: 700;
    min-width: 19px;
    padding: 1px 5px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    text-align: center;
  }
  .side-foot { margin-top: auto; }
  .side-user { display: grid; grid-template-columns: 32px 1fr; gap: 9px; align-items: center; padding: 8px; border-radius: 11px; background: var(--surface-2); }
  .side-user .avatar { width: 32px; height: 32px; font-size: 12px; }
  .side-user-text { min-width: 0; display: grid; }
  .side-user-text b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-user-text small { font-size: 10.5px; color: var(--faint); }
  .stage { padding-bottom: 0; min-height: 100dvh; }
  .topbar { padding: 12px 26px; gap: 16px; }
  .search-field { max-width: 520px; }
  .avatar-top { display: none; }
  .view { padding: 26px 26px 60px; }
  .hero { padding: 44px 0 6px; }
  .results-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 18px 14px; }
  .chips { margin: 0; padding-inline: 0; }
  .sheet { inset: 0; max-height: 100dvh; display: grid; place-items: center; padding: 24px; }
  .sheet-card { width: min(620px, 100%); max-height: 88dvh; border-radius: var(--r-lg); }
  .sheet[open] { animation: none; }
  .sheet[open] .sheet-card { animation: sheetUp .24s var(--ease); }
  .sheet-grab { display: none; }
  .sheet-steps { padding-inline: 20px; }
  .sheet-hero { padding: 20px 20px 12px; }
  .sheet-hero-art { height: 190px; }
  .sheet-poster { width: 88px; }
  .sheet-foot { padding: 14px 20px 18px; }
  .req-row { grid-template-columns: 52px 1fr auto; padding: 12px; }
  .req-thumb { width: 52px; height: 72px; }
  .toast { bottom: 26px; }
}

/* ------------------------------------------------------------- idle blocks */
.how {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  margin-top: 26px;
}
.how-step {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.how-step em {
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 700; font-style: normal;
}
.how-step b { display: block; font-size: 13px; font-weight: 600; }
.how-step small { font-size: 12px; color: var(--faint); }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest button {
  min-height: 34px; padding: 6px 12px; border-radius: 999px;
  border: 1px dashed var(--line-strong); background: none;
  color: var(--muted); font-size: 12.5px;
}
.suggest button:hover { border-style: solid; color: var(--text); }
@media (min-width: 861px) {
  .how { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
