/* Drama Library: app shell, views, show page, player. No build step. */

/* ---------- Tokens ---------- */
:root {
  --bg: #141414;
  --bg-elev: #181818;
  --surface: #1c1c1c;
  --surface-2: #262626;
  --surface-3: #333333;
  --modal: #181818;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4f4;
  --text-2: #bcbcbc;
  --muted: #8c8c8c;
  --accent: #e50914;
  --accent-hover: #f6121d;
  --accent-ink: #ffffff;
  --accent-weak: rgba(229, 9, 20, 0.16);
  --explore: #54b9c5;
  --focus: #ffffff;
  --vip: #d0a868;
  --vip-weak: rgba(208, 168, 104, 0.13);
  --danger: #ff6b6b;
  --good: #46d369;
  --heart: #ff4d6d;
  --scrim: rgba(0, 0, 0, 0.72);
  --glass: rgba(20, 20, 20, 0.94);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
  --skel-shine: rgba(255, 255, 255, 0.05);
  --rank-stroke: #5a5a5a;
  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 10px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --tab-h: 60px;
  --top-h: 56px;
  --gutter: 16px;
  --rg: 8px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
@media (min-width: 1024px) { :root { --top-h: 68px; --gutter: clamp(28px, 4vw, 60px); } }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f5f6; --bg-elev: #ffffff; --surface: #ffffff; --surface-2: #ececef; --surface-3: #dfdfe4; --modal: #ffffff;
    --border: rgba(20, 20, 30, 0.09); --border-strong: rgba(20, 20, 30, 0.18);
    --text: #141414; --text-2: #404048; --muted: #6a6a74;
    --accent: #d40812; --accent-hover: #b8060f; --accent-ink: #ffffff; --accent-weak: rgba(212, 8, 18, 0.1); --explore: #1b7f8c; --focus: #141414;
    --vip: #9a6b1f; --vip-weak: rgba(176, 125, 40, 0.12); --danger: #c64545; --good: #1d8a43; --heart: #d6315a;
    --scrim: rgba(10, 10, 15, 0.55); --glass: rgba(245, 245, 246, 0.95); --shadow: 0 18px 48px rgba(20, 20, 40, 0.2);
    --skel-shine: rgba(255, 255, 255, 0.6); --rank-stroke: #9a9aa4;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f5f6; --bg-elev: #ffffff; --surface: #ffffff; --surface-2: #ececef; --surface-3: #dfdfe4; --modal: #ffffff;
  --border: rgba(20, 20, 30, 0.09); --border-strong: rgba(20, 20, 30, 0.18);
  --text: #141414; --text-2: #404048; --muted: #6a6a74;
  --accent: #d40812; --accent-hover: #b8060f; --accent-ink: #ffffff; --accent-weak: rgba(212, 8, 18, 0.1); --explore: #1b7f8c; --focus: #141414;
  --vip: #9a6b1f; --vip-weak: rgba(176, 125, 40, 0.12); --danger: #c64545; --good: #1d8a43; --heart: #d6315a;
  --scrim: rgba(10, 10, 15, 0.55); --glass: rgba(245, 245, 246, 0.95); --shadow: 0 18px 48px rgba(20, 20, 40, 0.2);
  --skel-shine: rgba(255, 255, 255, 0.6); --rank-stroke: #9a9aa4;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + var(--safe-t)); }
html.lock { overflow: hidden; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased;
  min-height: 100dvh; overflow-x: hidden;
}
h1, h2, h3, h4 { letter-spacing: -0.015em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; color: #fff !important; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip:focus { top: calc(12px + var(--safe-t)); }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
kbd { font: 500 11.5px/1 var(--font); color: var(--muted); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px; background: var(--surface); }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s4); border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font-size: 14.5px; font-weight: 600; transition: background .15s, border-color .15s, transform .1s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { min-height: 36px; padding: 0 var(--s3); font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn svg.i { width: 18px; height: 18px; }
.btn.fav[aria-pressed="true"] { color: var(--heart); border-color: color-mix(in srgb, var(--heart) 40%, transparent); background: color-mix(in srgb, var(--heart) 12%, transparent); }
.btn.fav[aria-pressed="true"] svg.i, .icon-btn.fav[aria-pressed="true"] svg.i { fill: currentColor; }
.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); transition: background .15s, color .15s;
  text-decoration: none;
}
.icon-btn:hover:not([disabled]) { background: var(--surface-3); color: var(--text); }
.icon-btn[disabled] { opacity: .35; cursor: default; }
.icon-btn.ghost { background: transparent; border-color: transparent; }
.icon-btn.ghost:hover:not([disabled]) { background: var(--surface-2); }
.icon-btn.fav[aria-pressed="true"] { color: var(--heart); }
.linkish { border: 0; background: none; padding: 6px 0; color: var(--accent); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; text-decoration: none; min-height: 32px; }
.linkish:hover { color: var(--accent-hover); }
.linkish svg.i { width: 16px; height: 16px; }

/* ---------- Shell ----------
   Phone: a fixed top bar (logotype, search, settings) and a bottom tab bar.
   Desktop: the sidebar markup becomes a Netflix-style top navigation bar.
   Both start transparent over the Home billboard and turn solid once the page scrolls. */
.topbar, .sidebar { isolation: isolate; }
.topbar::before, .sidebar::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--glass); opacity: 1; transition: opacity .35s ease; }
.topbar::after, .sidebar::after { content: ""; position: absolute; inset: 0 0 -36px; z-index: -2; pointer-events: none; opacity: 0; transition: opacity .35s ease;
  background: linear-gradient(180deg, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, .35) 55%, transparent 100%); }
html.on-home:not(.scrolled) .topbar::before, html.on-home:not(.scrolled) .sidebar::before { opacity: 0; }
html.on-home:not(.scrolled) .topbar::after, html.on-home:not(.scrolled) .sidebar::after { opacity: 1; }
html.on-home:not(.scrolled) .topbar, html.on-home:not(.scrolled) .sidebar { color: #fff; --text: #fff; --text-2: rgba(255, 255, 255, .82); --muted: rgba(255, 255, 255, .7); }
.sidebar { display: none; }
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: calc(var(--top-h) + var(--safe-t));
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--safe-t) calc(6px + var(--safe-r)) 0 calc(var(--gutter) + var(--safe-l));
  color: var(--text);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; min-height: 44px; flex: none; }
.logotype { font: 400 27px/1 var(--display); letter-spacing: .03em; color: var(--accent); text-transform: uppercase; white-space: nowrap; padding-top: 3px; text-shadow: 0 1px 10px rgba(0, 0, 0, .25); }
.wordmark { font-size: 9.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; padding-left: 10px; border-left: 1px solid currentColor; line-height: 1.25; opacity: .9; }
.topbar-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; font-size: 16px; }
.topbar-title:empty { visibility: hidden; }
html:not(.on-home) .topbar .wordmark { display: none; }
.topbar-actions { display: flex; gap: 0; margin-left: auto; }
.topbar .icon-btn.ghost { color: inherit; }
.topbar .icon-btn.ghost:hover:not([disabled]) { background: rgba(127, 127, 127, .16); }

main { padding: calc(var(--top-h) + var(--safe-t) + var(--s4)) calc(var(--gutter) + var(--safe-r)) calc(var(--tab-h) + var(--safe-b) + var(--s6)) calc(var(--gutter) + var(--safe-l)); min-height: 60vh; }
html.on-home main { padding-top: 0; padding-left: 0; padding-right: 0; }
main:focus { outline: none; }
.view { max-width: 1480px; margin: 0 auto; }
#view-home { max-width: none; }
.home-pad { padding: calc(var(--top-h) + var(--safe-t) + var(--s6)) var(--gutter) 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 0 var(--safe-r) var(--safe-b) var(--safe-l);
  background: var(--glass); backdrop-filter: saturate(150%) blur(16px); -webkit-backdrop-filter: saturate(150%) blur(16px);
  border-top: 1px solid var(--border);
}
.tabbar a, .tabbar button {
  position: relative; height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none; letter-spacing: .01em;
  -webkit-tap-highlight-color: transparent;
}
.tabbar svg.i { width: 23px; height: 23px; }
.tabbar [aria-current="page"] { color: var(--text); }
.tabbar a[aria-current="page"] svg.i { fill: currentColor; }
.tabbar a[data-nav="browse"][aria-current="page"] svg.i, .tabbar a[data-nav="calendar"][aria-current="page"] svg.i { fill: none; stroke-width: 2.4; }
.nav-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; }
.tabbar .nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); }

@media (min-width: 1024px) {
  .topbar { display: none; }
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: row; align-items: center; gap: var(--s5); position: fixed; inset: 0 0 auto 0; z-index: 40;
    height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) calc(var(--gutter) + var(--safe-r)) 0 calc(var(--gutter) + var(--safe-l)); color: var(--text);
  }
  .sidebar .brand { order: 0; margin-right: var(--s3); }
  .logotype { font-size: 32px; }
  .wordmark { font-size: 10px; }
  .side-nav { order: 1; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: row; gap: 2px; }
  .sidebar a[data-nav] {
    position: relative; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: 4px;
    color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 14px; transition: color .2s;
  }
  .side-nav a[data-nav] svg.i { display: none; }
  .sidebar a[data-nav]:hover { color: var(--text); }
  .sidebar a[aria-current="page"] { color: var(--text); font-weight: 700; }
  .side-search {
    order: 2; margin-left: auto; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
    border: 0; background: none; color: inherit; border-radius: 50%; transition: background .2s;
  }
  .side-search span, .side-search kbd { display: none; }
  .side-search:hover { background: rgba(127, 127, 127, .18); }
  .side-foot { order: 3; display: flex; align-items: center; }
  .side-foot a[data-nav] { width: 40px; padding: 0; justify-content: center; border-radius: 50%; }
  .side-foot a[data-nav] span, .side-stats { display: none; }
  .side-foot a[data-nav]:hover { background: rgba(127, 127, 127, .18); }
  .side-foot a[aria-current="page"] svg.i { stroke-width: 2.4; }
  main { padding: calc(var(--top-h) + var(--s6)) var(--gutter) var(--s7); }
  html.on-home main { padding: 0 0 var(--s7); }
  html { scroll-padding-top: calc(var(--top-h) + 16px); }
}

.offline {
  position: fixed; left: 0; right: 0; top: calc(var(--top-h) + var(--safe-t)); z-index: 39; text-align: center; font-size: 13px; font-weight: 500;
  padding: 8px var(--gutter); background: var(--vip-weak); color: var(--text); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}

/* ---------- Page headers ---------- */
.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s3); margin: 0 0 var(--s4); }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.2; }
.page-head .sub { color: var(--muted); font-size: 14px; }
.page-head .spacer { flex: 1; }
@media (min-width: 1024px) { .page-head h1 { font-size: 30px; } }

/* ---------- Cards ---------- */
.card { display: block; text-align: left; padding: 0; border: 0; background: none; border-radius: var(--radius); min-width: 0; text-decoration: none; color: inherit; -webkit-touch-callout: none; }
.cover {
  position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border);
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s ease, transform .45s var(--ease); }
/* Shimmer while the cover image loads; core.js adds .ok to the cover on load or error. */
.cover:has(> img):not(.ok)::before { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--skel-shine), transparent); animation: shimmer 1.4s infinite; }
.cover:has(> img):not(.ok) .fallback { visibility: hidden; }
.cover img.loaded { opacity: 1; }
.cover::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--border); pointer-events: none; }
@media (hover: none) { .card:active .cover img.loaded { transform: scale(.97); } }
.card:focus-visible { outline: none; }
.card:focus-visible .cover { outline: 2px solid var(--focus); outline-offset: 2px; }
.cover .fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: var(--s3); text-align: center; font-weight: 600; color: var(--muted); font-size: 13px; }
.cover .tl { position: absolute; left: 6px; top: 6px; display: flex; gap: 4px; }
.cover .br { position: absolute; right: 6px; bottom: 6px; }
.badge-sm {
  display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 600;
  color: #fff; background: rgba(10, 10, 14, 0.66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); white-space: nowrap;
}
.badge-sm.vip { color: #f3d9a8; }
.badge-sm.new { background: var(--heart); }
.badge-sm.heart { width: 24px; height: 24px; padding: 0; justify-content: center; border-radius: 12px; color: var(--heart); }
.badge-sm.heart svg.i { width: 13px; height: 13px; fill: currentColor; }
.progress-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.18); }
.progress-bar span { display: block; height: 100%; background: var(--accent); }
.progress-bar.red { left: 6px; right: 6px; bottom: 6px; height: 4px; border-radius: 2px; overflow: hidden; background: rgba(160, 160, 160, .55); }
.progress-bar.red span { width: 100%; background: #e50914; transform-origin: left center; }
.card-title {
  margin-top: var(--s2); font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { margin-top: 2px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.card-meta .up { color: var(--good); font-weight: 600; }
.card-snip { margin-top: 4px; font-size: 12.5px; line-height: 1.4; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Top 10 cards: a giant outlined numeral half behind the cover (Netflix style) */
.card.ranked { display: flex; align-items: flex-end; position: relative; container-type: inline-size; }
.card.ranked .rank {
  /* Bebas Neue: cap height 0.7em and, at line-height 1, the baseline sits 0.2em above the box bottom.
     bottom:-0.2em puts the baseline on the card's bottom edge; 112cqw makes the digits ~95% of the cover height. */
  position: absolute; left: -1%; bottom: -0.2em; z-index: 0; pointer-events: none; user-select: none;
  font: 400 120px/1 var(--display); font-size: 112cqw; letter-spacing: -0.06em; color: var(--bg);
  -webkit-text-stroke: 3px var(--rank-stroke); paint-order: stroke fill; transition: -webkit-text-stroke-color .2s;
}
.card.ranked .ranked-body { position: relative; z-index: 1; margin-left: 44%; width: 56%; }
.card.ranked > .card-title, .card.ranked > .card-meta { display: none; }
.card.ranked:hover .rank, .card.ranked:focus-visible .rank { -webkit-text-stroke-color: var(--text-2); }

/* ---------- Grid ---------- */
.grid { display: grid; gap: var(--s5) var(--s3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 800px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5) var(--s4); } }
@media (min-width: 1280px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1560px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ---------- Skeletons / states ---------- */
.skel { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 6px; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--skel-shine), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-card .cover { box-shadow: none; }
.skel-line { height: 12px; margin-top: var(--s2); }
.skel-line.short { width: 45%; height: 10px; }
.state { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--s8) var(--s4); color: var(--text-2); }
.state .state-icon { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--muted); margin-bottom: var(--s4); }
.state .state-icon svg.i { width: 26px; height: 26px; }
.state.error .state-icon { color: var(--danger); }
.state.heart .state-icon { color: var(--heart); background: color-mix(in srgb, var(--heart) 12%, transparent); }
.state h3 { margin: 0 0 var(--s1); font-size: 17px; font-weight: 700; color: var(--text); }
.state p { margin: 0 0 var(--s4); font-size: 14.5px; color: var(--muted); max-width: 380px; }
.state.compact { padding: var(--s6) var(--s4); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.18); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-more { display: flex; justify-content: center; padding: var(--s6) 0; min-height: 92px; }

/* ---------- Home: billboard ---------- */
.bb {
  position: relative; overflow: hidden; isolation: isolate; color: #fff; background: #000;
  height: min(152vw, 86svh); min-height: 460px;
}
.bb-slides { position: absolute; inset: 0; }
.bb-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .9s ease; }
.bb-slide.on { opacity: 1; z-index: 2; }
.bb-slide.prev { opacity: 1; z-index: 1; transition: none; }
.bb-art { position: absolute; inset: 0; display: none; }
.bb-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(28px) saturate(1.25) brightness(.8); transform: scale(1.18); }
.bb-poster { position: absolute; inset: 0; overflow: hidden; background: #000; }
.bb-poster img, .bb-poster video.pv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
video.pv { opacity: 0; transition: opacity .6s ease; background: transparent; pointer-events: none; }
.pv-on > video.pv { opacity: 1; }
.bb-scrim { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, transparent 18%),
    linear-gradient(0deg, var(--bg) 0%, rgba(0, 0, 0, .86) 14%, rgba(0, 0, 0, .55) 38%, transparent 62%); }
.bb-info {
  position: absolute; z-index: 3; left: calc(var(--gutter) + var(--safe-l)); right: calc(var(--gutter) + var(--safe-r)); bottom: 54px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.bb-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .01em; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.top10-badge { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 24px; height: 26px; background: var(--accent); color: #fff; border-radius: 2px; font: 400 13px/0.8 var(--display); letter-spacing: .02em; padding-top: 2px; }
.top10-badge b { font-size: 7.5px; font-weight: 400; letter-spacing: .08em; line-height: 1; }
.bb-title {
  margin: 10px 0 6px; font: 400 clamp(40px, 11vw, 56px)/0.92 var(--display); letter-spacing: .01em; text-transform: uppercase;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .55); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-wrap: balance;
}
.bb-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 0; font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .86); }
.bb-meta span + span::before { content: "·"; margin: 0 8px; opacity: .7; }
.bb-log { margin: 10px 0 0; max-width: 46ch; font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, .88); text-shadow: 0 1px 8px rgba(0, 0, 0, .6);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; opacity: 0; transition: opacity .5s ease; }
.bb-log.in { opacity: 1; }
.bb-log:empty { display: none; }
.bb-actions { display: flex; gap: 10px; margin-top: 16px; width: 100%; justify-content: center; }
.bb-actions .btn { flex: 1 1 0; min-width: 0; max-width: 170px; }
@media (max-width: 799px) { .bb-actions .btn.bb-more { flex: 0 0 46px; padding: 0; gap: 0; font-size: 0; } }
.bb-ctrl { position: absolute; z-index: 4; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; align-items: center; gap: 12px; pointer-events: none; }
.bb-ctrl > * { pointer-events: auto; }
.bb-mute { position: absolute; right: calc(var(--gutter) + var(--safe-r)); bottom: 0; }
.bb-pips { display: flex; gap: 2px; }
.bb-pip { position: relative; width: 30px; height: 24px; border: 0; padding: 10px 3px; background: rgba(255, 255, 255, .38) content-box; border-radius: 0; cursor: pointer; }
.bb-pip .fill { position: absolute; left: 3px; right: 3px; top: 10px; height: 4px; background: #fff; transform: scaleX(0); transform-origin: left center; }
.bb-pip.on .fill { animation: pipfill 8s linear forwards; }
.bb-pip:hover { background-color: rgba(255, 255, 255, .6); }
.bb.paused .bb-pip.on .fill { animation-play-state: paused; }
.bb.static .bb-pip.on .fill { animation: none; transform: none; }
@keyframes pipfill { to { transform: none; } }
.bb.skel-bb { background: var(--surface); }
.bb.skel-bb .bb-info { align-items: center; }
.bb.skel-bb .skel { background: var(--surface-2); }

/* Desktop: wide cinematic billboard with the cover blown up behind and the poster framed on the right */
@media (min-width: 800px) {
  .bb { height: clamp(500px, 47vw, 800px); min-height: 0; }
  .bb-art { display: block; }
  .bb-poster { inset: 13% calc(var(--gutter) * 2.2) 26% auto; aspect-ratio: 2 / 3; height: auto; border-radius: var(--radius-lg); box-shadow: 0 30px 80px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .08); }
  .bb-poster img, .bb-poster video.pv { object-position: center; }
  .bb-scrim { background:
    linear-gradient(0deg, var(--bg) 0%, var(--bg) 8%, color-mix(in srgb, var(--bg) 78%, transparent) 19%, transparent 40%),
    linear-gradient(180deg, rgba(0, 0, 0, .6) 0%, transparent 16%),
    linear-gradient(77deg, rgba(0, 0, 0, .86) 0%, rgba(0, 0, 0, .55) 32%, transparent 62%); }
  .bb-info { left: calc(var(--gutter) + var(--safe-l)); right: auto; bottom: 30%; width: min(44vw, 620px); align-items: flex-start; text-align: left; }
  .bb-eyebrow { font-size: clamp(14px, 1.15vw, 18px); }
  .top10-badge { width: 28px; height: 30px; font-size: 15px; }
  .top10-badge b { font-size: 8.5px; }
  .bb-title { font-size: clamp(56px, 6vw, 104px); margin: 14px 0 10px; }
  .bb-meta { justify-content: flex-start; font-size: clamp(14px, 1.05vw, 16px); }
  .bb-log { font-size: clamp(15px, 1.2vw, 19px); max-width: 52ch; -webkit-line-clamp: 3; }
  .bb-actions { justify-content: flex-start; width: auto; margin-top: 22px; }
  .bb-actions .btn { flex: none; max-width: none; }
  /* Controls sit on the framed poster: mute at its top right, pips under it. */
  .bb-ctrl { inset: 0; bottom: 0; display: block; }
  .bb-ctrl .bb-mute { position: absolute; top: calc(13% + 14px); right: calc(var(--gutter) * 2.2 + 14px); bottom: auto; }
  .bb-pips { position: absolute; top: calc(74% + 10px); right: calc(var(--gutter) * 2.2); }
}

/* Netflix buttons */
.btn.play { background: #fff; color: #000; border-color: transparent; border-radius: 6px; font-weight: 700; }
.btn.play:hover { background: rgba(255, 255, 255, .78); }
.btn.play svg.i { width: 22px; height: 22px; }
.btn.glass { background: rgba(109, 109, 110, .7); color: #fff; border-color: transparent; border-radius: 6px; font-weight: 700; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.btn.glass:hover { background: rgba(109, 109, 110, .45); }
.btn.glass[aria-pressed="true"] svg.i { color: var(--good); }
.btn.lg { min-height: 46px; padding: 0 20px 0 16px; font-size: 16px; gap: 10px; }
@media (min-width: 1024px) { .btn.lg { min-height: 52px; padding: 0 28px 0 22px; font-size: 18px; } .btn.lg svg.i { width: 26px; height: 26px; } }
.round-btn {
  width: 40px; height: 40px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  border: 2px solid rgba(255, 255, 255, .5); background: rgba(42, 42, 42, .6); color: #fff; transition: border-color .15s, background .15s, transform .15s;
}
.round-btn:hover { border-color: #fff; background: rgba(60, 60, 60, .8); }
.round-btn:active { transform: scale(.94); }
.round-btn svg.i { width: 20px; height: 20px; }
.round-btn.solid { background: #fff; border-color: #fff; color: #000; }
.round-btn.solid:hover { background: rgba(255, 255, 255, .8); }
.round-btn.solid svg.i { margin-left: 2px; }
.round-btn.sm { width: 32px; height: 32px; }
.round-btn.sm svg.i { width: 16px; height: 16px; }
.round-btn.fav[aria-pressed="true"] { color: var(--heart); border-color: var(--heart); }
.round-btn.fav[aria-pressed="true"] svg.i { fill: currentColor; }
.round-btn[data-hc="list"][aria-pressed="true"], .round-btn[data-sact="list"][aria-pressed="true"] { border-color: #fff; }

/* ---------- Home: rows ---------- */
.rails { position: relative; z-index: 3; display: flex; flex-direction: column; gap: 26px; padding-top: 10px; }
.rails > div:empty { display: none; }
.rails > div[id] { display: flex; flex-direction: column; gap: 26px; }
.rails > div[id]:empty { display: none; }
#bywSlot > div:empty { display: none; }
@media (min-width: 800px) { .bb + .rails { margin-top: calc(-1 * clamp(70px, 8vw, 150px)); } .rails, .rails > div[id] { gap: clamp(28px, 3vw, 44px); } }
.rail-head { display: flex; align-items: baseline; gap: 10px; padding: 0 calc(var(--gutter) + var(--safe-r)) 0 calc(var(--gutter) + var(--safe-l)); margin-bottom: 8px; min-height: 26px; }
.rail-head h2 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1024px) { .rail-head h2 { font-size: clamp(17px, 1.35vw, 22px); } }
.rail-link { display: inline-flex; align-items: baseline; gap: 12px; color: inherit; text-decoration: none; max-width: 100%; }
.rail-link > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rail-link .explore { display: inline-flex; align-items: center; gap: 0; font-size: 13px; font-weight: 600; color: var(--explore); opacity: 0; transform: translateX(-10px); transition: opacity .3s ease, transform .3s ease; white-space: nowrap; }
.rail-link .explore svg.i { width: 15px; height: 15px; stroke-width: 2.6; }
.rail:hover .explore, .rail-link:focus-visible .explore { opacity: 1; transform: none; }
@media (hover: none) { .rail-link .explore { opacity: 1; transform: none; font-size: 0; } .rail-link .explore svg.i { width: 18px; height: 18px; color: var(--text-2); } }
.rail-head .rail-sub { display: none; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (min-width: 1024px) { .rail-head .rail-sub { display: block; } }
.rail-head .spacer { flex: 1; }
.rail-pages { display: none; gap: 2px; align-self: center; opacity: 0; transition: opacity .25s; }
.rail-pages i { width: 12px; height: 2px; background: color-mix(in srgb, var(--text) 30%, transparent); }
.rail-pages i.on { background: var(--text); }
@media (hover: hover) and (min-width: 800px) { .rail-pages { display: flex; } .rail:hover .rail-pages { opacity: 1; } }
.rail-body { position: relative; }
.rail-track {
  --n: 3.25;
  display: grid; grid-auto-flow: column; gap: var(--rg);
  grid-auto-columns: calc((100% - (var(--n) - 1) * var(--rg)) / var(--n));
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 4px calc(var(--gutter) + var(--safe-r)) 6px calc(var(--gutter) + var(--safe-l)); scroll-padding-inline: calc(var(--gutter) + var(--safe-l));
}
.rail-track::-webkit-scrollbar { display: none; }
.rail-track > * { scroll-snap-align: start; }
@media (min-width: 560px) { .rail-track { --n: 4.3; } }
@media (min-width: 800px) { .rail-track { --n: 5.3; } }
@media (min-width: 1024px) { .rail-track { --n: 6; } }
@media (min-width: 1280px) { .rail-track { --n: 7; } }
@media (min-width: 1680px) { .rail-track { --n: 8; } }
.rail-track.top10 { --n: 2.25; }
@media (min-width: 560px) { .rail-track.top10 { --n: 3.2; } }
@media (min-width: 800px) { .rail-track.top10 { --n: 4; } }
@media (min-width: 1280px) { .rail-track.top10 { --n: 5; } }
@media (min-width: 1680px) { .rail-track.top10 { --n: 6; } }
.rail .card-title { font-size: 13px; font-weight: 500; color: var(--text-2); margin-top: 6px; -webkit-line-clamp: 1; }
.rail .card-meta { font-size: 12px; }
@media (hover: hover) and (min-width: 1024px) { .rail .card:not(.cw-card) .card-meta { display: none; } }
.rail-chev { display: none; }
@media (hover: hover) and (min-width: 800px) {
  .rail-chev {
    display: flex; align-items: center; justify-content: center; position: absolute; top: 4px; bottom: 6px; z-index: 4; width: calc(var(--gutter) - 4px);
    border: 0; padding: 0; background: rgba(20, 20, 20, .55); color: #fff; opacity: 0; transition: opacity .2s ease, background .2s;
  }
  .rail-chev.prev { left: 0; border-radius: 0 4px 4px 0; }
  .rail-chev.next { right: 0; border-radius: 4px 0 0 4px; }
  .rail-chev svg.i { width: 30px; height: 30px; stroke-width: 2.6; transition: transform .2s ease; }
  .rail-chev:hover { background: rgba(20, 20, 20, .75); }
  .rail-chev:hover svg.i { transform: scale(1.25); }
  .rail:hover .rail-chev, .rail-chev:focus-visible { opacity: 1; }
  .rail-body.at-start .rail-chev.prev, .rail-body.at-end .rail-chev.next { visibility: hidden; }
}
.skel-rail .rail-head .skel { width: 180px; height: 20px; }

/* Continue watching */
.cw-card { position: relative; }
.cw-link { display: block; color: inherit; text-decoration: none; }
.cw-link:focus-visible { outline: none; }
.cw-link:focus-visible .cover { outline: 2px solid var(--focus); outline-offset: 2px; }
.cw-resume {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: #fff; font-size: 13px; font-weight: 700; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .2s ease;
}
.cw-resume .round-btn { width: 46px; height: 46px; pointer-events: none; }
.cw-card:hover .cw-resume, .cw-link:focus-visible .cw-resume { opacity: 1; }
.cw-x {
  position: absolute; top: 6px; right: 6px; z-index: 3; width: 30px; height: 30px; border-radius: 50%; padding: 0; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .4); background: rgba(20, 20, 20, .72); color: #fff; opacity: 0; transition: opacity .2s ease, transform .15s;
}
.cw-x svg.i { width: 16px; height: 16px; }
.cw-x:hover { border-color: #fff; transform: scale(1.08); }
.cw-card:hover .cw-x, .cw-x:focus-visible { opacity: 1; }
@media (hover: none) { .cw-x { opacity: 1; top: 4px; right: 4px; } }

/* ---------- Hover card (desktop) ---------- */
.hc {
  position: fixed; z-index: 45; background: var(--modal); color: var(--text); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .7), 0 0 0 1px var(--border); opacity: 0; transform: scale(0.7407); will-change: transform, opacity;
  transition: transform .26s var(--ease), opacity .2s ease;
}
.hc.in { opacity: 1; transform: none; }
.hc.out { opacity: 0; transform: scale(0.7407); transition-duration: .18s; }
.hc-media { position: relative; aspect-ratio: 3 / 4; background: #000; cursor: pointer; overflow: hidden; }
.hc-media > img, .hc-media > video.pv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hc-media .fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; text-align: center; font-weight: 600; color: var(--muted); }
.hc-media::after { content: ""; position: absolute; inset: auto 0 0; height: 30%; background: linear-gradient(0deg, var(--modal), transparent); pointer-events: none; }
.hc-mute { position: absolute; right: 10px; bottom: 12px; z-index: 2; opacity: 0; transition: opacity .3s; }
.pv-on > .hc-mute { opacity: 1; }
.hc-body { padding: 4px 14px 16px; }
.hc-btns { display: flex; align-items: center; gap: 8px; }
.hc-btns .round-btn { width: 36px; height: 36px; }
.hc-btns .round-btn svg.i { width: 18px; height: 18px; }
.hc-btns .spacer { flex: 1; }
.hc-title { margin-top: 12px; font-weight: 700; font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hc-tags { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: center; min-height: 18px; }
.hc-tags .free { color: var(--good); }
.hc-tags i { font-style: normal; color: var(--muted); }
/* Two lines are reserved up front so the card's height (used to keep it on screen) doesn't change when details arrive. */
.hc-syn { margin: 8px 0 0; font-size: 12.5px; line-height: 1.45; min-height: 2.9em; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 500; text-decoration: none; transition: background .15s, color .15s;
}
.tag:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Browse ---------- */
.browse-layout { display: block; }
.browse-tools { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.browse-tools .count { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; margin-left: auto; }
.filter-btn .n { min-width: 20px; height: 20px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; line-height: 20px; padding: 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.chips:empty { display: none; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 6px 0 12px; border-radius: 999px;
  background: var(--accent-weak); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-size: 13px; font-weight: 500;
}
.fchip svg.i { width: 15px; height: 15px; }
.fchip:hover { border-color: var(--accent); }
.fchip.clear-all { background: transparent; border-color: transparent; color: var(--accent); padding: 0 8px; font-weight: 600; }

.filters {
  position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; max-height: 86dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-top: 1px solid var(--border-strong); box-shadow: var(--shadow);
  transform: translateY(102%); transition: transform .3s var(--ease); visibility: hidden;
}
.filters.open { transform: none; visibility: visible; }
.filters-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s3) var(--s3) var(--s2) var(--s5); border-bottom: 1px solid var(--border); }
.filters-head h2 { margin: 0; font-size: 17px; }
.filters-body { overflow-y: auto; overscroll-behavior: contain; padding: var(--s2) var(--s5) var(--s4); }
.filters-foot { display: flex; gap: var(--s2); padding: var(--s3) var(--s5) calc(var(--s3) + var(--safe-b)); border-top: 1px solid var(--border); }
.filters-foot .btn { flex: 1; }
.fgroup { padding: var(--s4) 0; border-bottom: 1px solid var(--border); }
.fgroup:last-child { border-bottom: 0; }
.fgroup > h3, .fgroup > label.h { display: block; margin: 0 0 var(--s3); font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.seg { display: flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 12px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--text-2); min-height: 38px; border-radius: 9px; font-size: 13.5px; font-weight: 600; transition: background .15s, color .15s; padding: 0 8px; }
.seg button:hover { color: var(--text); }
.seg.tight button { padding: 0 2px; font-size: 13px; min-width: 0; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 0 0 1px var(--border-strong); }
.opt-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; overscroll-behavior: contain; }
.opt {
  display: flex; align-items: center; gap: var(--s2); min-height: 40px; padding: 0 10px; border-radius: 10px; border: 0; background: transparent; text-align: left; color: var(--text-2); font-size: 14px;
}
.opt:hover { background: var(--surface-2); color: var(--text); }
.opt .on { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt .oc { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.opt[aria-pressed="true"] { background: var(--accent-weak); color: var(--text); font-weight: 600; }
.opt[aria-pressed="true"]::before { content: ""; width: 6px; height: 6px; border-radius: 3px; background: var(--accent); flex: none; }
.field { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); font-size: 16px; }
.field:focus { border-color: var(--accent); outline: none; }
.field + .opt-list { margin-top: var(--s2); }
.select-wrap { position: relative; }
.select-wrap select { -webkit-appearance: none; appearance: none; padding-right: 36px; }
.select-wrap svg.i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.select-wrap svg.i.rot { transform: translateY(-50%) rotate(90deg); }
.filter-scrim { position: fixed; inset: 0; z-index: 44; background: var(--scrim); }
@media (min-width: 1024px) {
  .browse-layout.with-filters { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--s6); align-items: start; }
  .filters {
    position: sticky; top: calc(var(--top-h) + var(--s4)); left: auto; right: auto; bottom: auto; max-height: calc(100dvh - var(--top-h) - 2 * var(--s4)); transform: none; visibility: visible;
    border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: none; transition: none;
  }
  .filters:not(.open) { display: none; }
  .filters-head { padding: var(--s3) var(--s3) var(--s3) var(--s4); }
  .filters-body { padding: 0 var(--s4) var(--s4); }
  .filters-foot { display: none; }
  .filter-scrim { display: none; }
  .browse-layout.with-filters .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1440px) { .browse-layout.with-filters .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ---------- Search palette ---------- */
.search-layer { position: fixed; inset: 0; z-index: 70; }
.search-scrim { position: absolute; inset: 0; background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .18s var(--ease); }
.palette {
  position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg);
  padding-top: var(--safe-t); animation: rise .2s var(--ease);
}
.palette-field { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s2) var(--s2) var(--s4); border-bottom: 1px solid var(--border); }
.palette-field > svg.i { color: var(--muted); }
.palette-field input { flex: 1; min-width: 0; height: 52px; border: 0; background: transparent; font-size: 17px; outline: none; -webkit-appearance: none; appearance: none; }
.palette-field input::-webkit-search-cancel-button { display: none; }
.palette-results { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--s2) var(--s2) calc(var(--s5) + var(--safe-b)); }
.palette-foot { display: none; gap: var(--s4); padding: var(--s2) var(--s4); border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.palette-foot kbd { margin-right: 3px; }
.pgroup { margin: var(--s2) 0 var(--s3); }
.pgroup h3 { margin: 0; padding: var(--s2) var(--s3); font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; display: flex; justify-content: space-between; align-items: center; }
.pgroup h3 button { text-transform: none; letter-spacing: 0; }
.pitem { display: flex; gap: var(--s3); align-items: center; width: 100%; padding: var(--s2) var(--s3); border-radius: 12px; border: 0; background: transparent; text-align: left; color: inherit; min-height: 44px; }
.pitem .cover { width: 44px; flex: none; border-radius: 8px; }
.pitem .pi { min-width: 0; flex: 1; }
.pitem .pt, .pitem .pm { display: block; }
.pitem .pt { font-weight: 600; font-size: 14.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pitem .pm { font-size: 12.5px; color: var(--muted); }
.pitem .ps { font-size: 13px; color: var(--text-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.pitem .ps mark { background: var(--accent-weak); color: var(--text); border-radius: 3px; padding: 0 1px; }
.pitem.recent { min-height: 44px; }
.pitem.recent svg.i { color: var(--muted); width: 18px; height: 18px; }
.pitem[aria-selected="true"], .pitem:hover { background: var(--surface-2); }
.pitem.see-all { color: var(--accent); font-weight: 600; justify-content: center; }
@media (min-width: 700px) {
  .palette { inset: 10dvh auto auto 50%; transform: translateX(-50%); width: min(680px, calc(100vw - 32px)); max-height: 76dvh; border-radius: var(--radius-lg); border: 1px solid var(--border-strong); box-shadow: var(--shadow); background: var(--surface); padding-top: 0; animation: pop .18s var(--ease); }
  .palette-foot { display: flex; }
  .palette-results { padding-bottom: var(--s2); }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes pop { from { opacity: 0; transform: translateX(-50%) scale(.97); } }

/* ---------- Show page ----------
   Phone: full screen with a tall cover-art header. Desktop: a centered Netflix-style modal sheet. */
.scrim { position: fixed; inset: 0; z-index: 49; background: var(--scrim); animation: fade .25s ease; }
.show {
  position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column;
  animation: rise .25s var(--ease); --sh-bg: var(--bg);
}
.show-bar {
  display: flex; align-items: center; gap: var(--s2); flex: none; height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) calc(8px + var(--safe-r)) 0 calc(6px + var(--safe-l));
  background: var(--bg); position: relative; z-index: 5; isolation: isolate;
}
.show:not(.theater) .show-bar { position: absolute; top: 0; left: 0; right: 0; background: transparent; }
.show:not(.theater) .show-bar::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--glass); opacity: 0; transition: opacity .3s ease; }
.show:not(.theater) .show-bar.scrolled::before { opacity: 1; }
.show:not(.theater) .show-bar:not(.scrolled) .icon-btn { background: rgba(0, 0, 0, .5); color: #fff; border-radius: 50%; }
.show-bar .ic-close { display: none; }
.show-bar-title { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .2s; }
.show-bar.scrolled .show-bar-title, .show.theater .show-bar-title { opacity: 1; }
.show-bar-actions { display: flex; gap: 2px; }
.show:focus, .show:focus-visible { outline: none; }
.show-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.show-body { padding: 0 0 calc(var(--s7) + var(--safe-b)); }
.sh-pad, .sh-main { padding-left: calc(var(--gutter) + var(--safe-l)); padding-right: calc(var(--gutter) + var(--safe-r)); }
@media (min-width: 1024px) {
  .show {
    inset: 32px 0 0; margin: 0 auto; width: min(960px, calc(100vw - 48px)); border-radius: var(--radius-lg) var(--radius-lg) 0 0; overflow: hidden;
    background: var(--modal); --sh-bg: var(--modal); box-shadow: 0 24px 80px rgba(0, 0, 0, .75); animation: modalIn .3s var(--ease);
  }
  .show.theater { width: min(1280px, calc(100vw - 48px)); inset: 24px 0 0; }
  .show-bar { position: absolute !important; top: 14px; right: 14px; left: auto !important; height: auto; padding: 0; background: none !important; }
  .show-bar::before { display: none; }
  .show-bar-title, .show-bar-actions { display: none; }
  .show-bar .ic-back { display: none; }
  .show-bar .ic-close { display: block; }
  #showBack { width: 40px; height: 40px; border-radius: 50%; background: #181818 !important; color: #fff !important; border: 0; }
  #showBack:hover { background: #2a2a2a !important; }
  .sh-pad, .sh-main { padding-left: 44px; padding-right: 44px; }
}
@keyframes modalIn { from { opacity: 0; transform: translateY(28px) scale(.97); } }

.sh-hero { position: relative; height: min(122vw, 66svh); overflow: hidden; isolation: isolate; color: #fff; background: #000; }
.sh-art { position: absolute; inset: 0; }
.sh-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.sh-poster { display: none; }
.sh-hero::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, transparent 20%), linear-gradient(0deg, var(--sh-bg) 0%, color-mix(in srgb, var(--sh-bg) 70%, transparent) 22%, transparent 55%); }
.sh-hero-info { position: absolute; z-index: 2; left: calc(var(--gutter) + var(--safe-l)); right: calc(var(--gutter) + var(--safe-r)); bottom: 12px; color: var(--text); }
.sh-hero-info h1 { margin: 0; font: 400 clamp(38px, 10.5vw, 52px)/0.95 var(--display); letter-spacing: .01em; text-transform: uppercase; text-wrap: balance;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sh-hero.skel-hero .sh-art { border-radius: 0; }
.sh-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.sh-actions .btn.play { flex: 1 1 auto; min-height: 44px; font-size: 16px; padding: 0 22px 0 18px; }
.sh-actions .round-btn { width: 44px; height: 44px; }
.sh-hero .round-btn { color: #fff; }
.sh-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 14px; font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sh-meta .plays { color: var(--muted); }
.sh-about { display: grid; gap: 14px; }
.sh-tags { font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.sh-tags .lbl { color: var(--muted); }
.taglink { color: var(--text); text-decoration: none; }
.taglink:hover { text-decoration: underline; }
.sh-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; }
@media (min-width: 560px) { .sh-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .sh-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 14px; } }
.sh-grid .card-title { font-size: 13px; -webkit-line-clamp: 2; }
.sh-grid .card-meta { font-size: 12px; }
@media (min-width: 1024px) {
  .sh-hero { height: 480px; }
  .sh-art img { filter: blur(26px) saturate(1.2) brightness(.75); transform: scale(1.2); }
  .sh-poster { display: block; position: absolute; z-index: 1; top: 44px; right: 72px; bottom: 56px; aspect-ratio: 2 / 3; width: auto; border-radius: var(--radius); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
  .sh-poster img { opacity: 1; }
  .sh-hero::after { background: linear-gradient(77deg, rgba(0, 0, 0, .7) 0%, transparent 60%), linear-gradient(0deg, var(--sh-bg) 0%, color-mix(in srgb, var(--sh-bg) 60%, transparent) 18%, transparent 50%); }
  .sh-poster { z-index: 0; }
  .sh-hero-info { left: 44px; right: 360px; bottom: 36px; color: #fff; }
  .sh-hero-info h1 { font-size: clamp(48px, 4.6vw, 72px); text-shadow: 0 2px 18px rgba(0, 0, 0, .5); }
  .sh-actions { margin-top: 20px; }
  .sh-actions .btn.play { flex: none; min-height: 46px; font-size: 17px; padding: 0 30px 0 24px; }
  .sh-meta { padding-top: 6px; font-size: 15px; }
  .sh-about { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; }
}
/* Theater: the player takes over and the header becomes compact. */
.show.theater .sh-hero { height: auto; background: none; color: var(--text); overflow: visible; }
.show.theater .sh-art, .show.theater .sh-poster, .show.theater .sh-hero::after { display: none; }
.show.theater .sh-hero-info { position: static; padding: 6px calc(var(--gutter) + var(--safe-r)) 0 calc(var(--gutter) + var(--safe-l)); color: var(--text); }
.show.theater .sh-hero-info h1 { font-size: 34px; text-shadow: none; }
.show.theater .sh-actions .btn.play { flex: 0 1 auto; }
.show.theater .round-btn { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.show.theater .round-btn.fav[aria-pressed="true"] { color: var(--heart); border-color: var(--heart); }
@media (min-width: 1024px) {
  .show.theater .sh-hero-info, .show.theater .sh-pad, .show.theater .sh-main { padding-left: 0; padding-right: 0; }
  .show.theater .sh-hero-info { padding-right: 56px; }
}
.pill {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 3px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; border: 1px solid var(--border-strong);
}
.pill.free { background: transparent; color: var(--good); border-color: color-mix(in srgb, var(--good) 50%, transparent); }
.pill.vip { background: var(--vip-weak); color: var(--vip); border-color: transparent; }
.pill.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.pill svg.i { width: 13px; height: 13px; }
/* Episodes: grid or list */
.seg.ep-view { padding: 2px; border-radius: 6px; flex: none; }
.seg.ep-view button { min-height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 4px; }
.ep-list { display: flex; flex-direction: column; }
.ep-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 36px; align-items: center; gap: 12px; min-height: 60px; padding: 10px 8px;
  border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); text-align: left; border-radius: 0; transition: background .15s;
  -webkit-touch-callout: none; user-select: none;
}
.ep-row:first-child { border-top: 1px solid var(--border); }
.ep-row:hover { background: var(--surface-2); }
.ep-row .n { font-size: 22px; font-weight: 600; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.ep-row .t b { display: block; font-size: 15px; font-weight: 600; }
.ep-row .t small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; font-variant-numeric: tabular-nums; }
.ep-row .go { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.ep-row .go svg.i { width: 15px; height: 15px; }
.ep-row:hover .go { border-color: var(--text); color: var(--text); }
.ep-row.current { background: var(--accent-weak); }
.ep-row.current .n, .ep-row.current b { color: var(--accent); }
.ep-row.watched b { color: var(--text-2); font-weight: 500; }
.ep-row.ext .go { border-style: dashed; }
.ep-prog { display: block; width: min(220px, 100%); height: 3px; margin-top: 6px; background: color-mix(in srgb, var(--text) 18%, transparent); border-radius: 2px; overflow: hidden; }
.ep-prog span { display: block; height: 100%; background: var(--accent); transform-origin: left center; }
.ep-tip { margin: var(--s3) 0 0; font-size: 12.5px; color: var(--muted); }
.schedule { display: flex; align-items: center; gap: 10px; margin-top: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); font-size: 14px; color: var(--text-2); }
.schedule svg.i { color: var(--accent); }
.schedule b { color: var(--text); font-weight: 600; }
.schedule .dotlive { width: 8px; height: 8px; border-radius: 4px; background: var(--good); flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 18%, transparent); }
.resume { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: var(--s4); padding: var(--s3) var(--s3) var(--s3) var(--s4); border-radius: var(--radius); background: var(--accent-weak); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.resume p { margin: 0; flex: 1 1 200px; font-weight: 600; font-size: 14.5px; }
.resume p span { display: block; font-weight: 400; color: var(--text-2); font-size: 13px; }
.sec { margin-top: var(--s6); }
.sec > h2 { margin: 0 0 var(--s3); font-size: 17px; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.sec > h2 small { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.synopsis { font-size: 15px; line-height: 1.65; color: var(--text-2); white-space: pre-line; margin: 0; }
.synopsis.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.avail { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }
.avail-label { font-size: 12.5px; color: var(--muted); margin-top: var(--s4); font-weight: 600; }
.src {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600;
}
.src:hover { background: var(--surface-2); color: var(--text); }
.src .ce { font-weight: 500; color: var(--muted); font-size: 12px; }
.src[aria-pressed="true"] { background: var(--accent-weak); border-color: var(--accent); color: var(--text); }
.src.vip { border-style: dashed; }
.src svg.i { width: 13px; height: 13px; color: var(--vip); }
.notice { display: flex; gap: var(--s3); padding: var(--s4); border-radius: var(--radius); background: var(--vip-weak); color: var(--text-2); font-size: 14px; margin-top: var(--s4); }
.notice svg.i { color: var(--vip); margin-top: 2px; }
.notice b { display: block; color: var(--text); font-weight: 700; margin-bottom: 2px; }

.eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: var(--s2); }
.ep {
  position: relative; min-height: 44px; aspect-ratio: 1.15; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; transition: background .12s, border-color .12s; -webkit-touch-callout: none; user-select: none;
}
.ep:hover { border-color: var(--border-strong); background: var(--surface-3); }
.ep.watched { color: var(--muted); background: transparent; font-weight: 500; }
.ep.watched::before { content: ""; position: absolute; left: 50%; bottom: 6px; width: 4px; height: 4px; border-radius: 2px; background: var(--muted); transform: translateX(-50%); opacity: .7; }
.ep.ext { border-style: dashed; color: var(--muted); background: transparent; }
.ep.ext::after { content: "↗"; font-size: 10px; position: absolute; top: 2px; right: 5px; opacity: .8; }
.ep.current { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.ep { border-radius: 4px; }
.ep.current::before { display: none; }
.eps-skel { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: var(--s2); }
.eps-skel div { aspect-ratio: 1.15; border-radius: 10px; }
.spark-wrap { padding: var(--s4); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.spark-wrap svg { display: block; width: 100%; height: 72px; overflow: visible; }
.spark-wrap .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-wrap .area { fill: var(--accent-weak); stroke: none; }
.spark-meta { display: flex; justify-content: space-between; gap: var(--s3); font-size: 12.5px; color: var(--muted); margin-top: var(--s2); font-variant-numeric: tabular-nums; }
.spark-meta b { color: var(--text); font-weight: 600; }

/* Player (theater) */
.theater-grid { display: block; }
.player { margin: 0 0 var(--s4); }
.frame {
  position: relative; width: min(100%, calc((100dvh - var(--top-h) - var(--safe-t) - 120px) * 9 / 16)); min-width: 220px; aspect-ratio: 9 / 16; margin: 0 auto;
  background: #000; overflow: hidden;
}
.frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.frame .overlay { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: var(--s3); text-align: center; padding: var(--s5); background: rgba(0,0,0,.72); color: #ddd; font-size: 14px; }
.frame .overlay.show { display: flex; }
.frame .overlay .btn { color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }
.frame .overlay .err { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.08); color: var(--danger); }
.frame .next-up { position: absolute; left: 12px; right: 12px; bottom: 64px; display: none; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(15,15,20,.85); color: #fff; font-size: 13.5px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.frame .next-up.show { display: flex; }
.frame .next-up span { flex: 1; }
.frame .next-up .btn { min-height: 36px; color: #fff; background: rgba(255,255,255,.14); border-color: transparent; }
.player-ctrl { display: flex; align-items: center; justify-content: center; gap: var(--s2); margin-top: var(--s3); padding: 0 calc(var(--gutter) + var(--safe-r)) 0 calc(var(--gutter) + var(--safe-l)); }
.player-ctrl .label { font-size: 14px; font-weight: 600; min-width: 120px; text-align: center; font-variant-numeric: tabular-nums; }
.player-ctrl .label small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.show.theater #secEps { order: 1 !important; }
.player-keys { display: none; text-align: center; font-size: 12px; color: var(--muted); margin-top: var(--s2); }
.player-keys kbd { margin: 0 2px; }
@media (min-width: 560px) { .frame { border-radius: var(--radius); } }
@media (min-width: 1024px) {
  .show.theater .theater-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s6); align-items: start; padding: 28px 32px 0; }
  .show.theater .player { position: sticky; top: 0; margin: 0; }
  .show.theater .frame { width: calc((100dvh - 24px - 190px) * 9 / 16); max-width: 520px; }
  .player-keys { display: block; }
}

/* ---------- Calendar ---------- */
.cal-layout { display: flex; flex-direction: column; gap: var(--s5); }
.cal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s3); }
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s2); }
.cal-nav h2 { margin: 0; font-size: 18px; font-weight: 700; flex: 1; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-dow { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 6px 0; }
.cal-day {
  position: relative; min-height: 48px; aspect-ratio: 1; border-radius: 10px; border: 1px solid transparent; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 6px; gap: 4px; font-size: 14px; font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.cal-day:hover { background: var(--surface-2); }
.cal-day.out { color: var(--muted); opacity: .45; }
.cal-day.today .dn { background: var(--text); color: var(--bg); border-radius: 999px; min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.cal-day[aria-pressed="true"] { background: var(--accent-weak); border-color: var(--accent); color: var(--text); }
.cal-dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; max-width: 80%; }
.cal-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--accent); }
.cal-dots i.pred { background: transparent; border: 1.5px dashed var(--accent); opacity: .75; width: 7px; height: 7px; }
.cal-legend { display: flex; gap: var(--s4); font-size: 12.5px; color: var(--muted); padding: var(--s3) var(--s2) 0; flex-wrap: wrap; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 8px; height: 8px; border-radius: 4px; background: var(--accent); display: inline-block; }
.cal-legend i.pred { background: transparent; border: 1.5px dashed var(--accent); }
.day-list { display: flex; flex-direction: column; gap: var(--s2); }
.day-list h3 { margin: 0 0 var(--s1); font-size: 16px; font-weight: 700; }
.drop { display: flex; align-items: center; gap: var(--s3); padding: var(--s2); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.drop.pred { border-style: dashed; background: transparent; }
.drop .cover { width: 48px; flex: none; border-radius: var(--radius-sm); }
.drop .di { flex: 1; min-width: 0; }
.drop .dt { font-weight: 600; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-decoration: none; color: inherit; }
.drop .dm { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.drop .dm b { color: var(--accent); font-weight: 700; }
.week { display: flex; flex-direction: column; gap: var(--s3); }
.week-day h3 { margin: 0 0 var(--s2); font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
@media (min-width: 1024px) {
  .cal-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); align-items: start; gap: var(--s6); }
  .cal-week { display: none; }
  .cal-day { aspect-ratio: 1.25; }
  .cal-card { padding: var(--s4); }
}

/* ---------- Favorites ---------- */
.fav-list { display: grid; gap: var(--s2); grid-template-columns: 1fr; }
@media (min-width: 800px) { .fav-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); } }
@media (min-width: 1400px) { .fav-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fav-row { display: flex; gap: var(--s3); align-items: center; padding: var(--s2); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.fav-row .cover { width: 64px; flex: none; border-radius: var(--radius-sm); }
.fav-row a.fi { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.fav-row .ft { font-weight: 600; font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fav-row .fm { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.fav-row .newb { display: inline-flex; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--heart); color: #fff; font-size: 11.5px; font-weight: 700; align-items: center; }
.footer-link { margin-top: var(--s6); display: flex; justify-content: center; }

/* ---------- Settings ---------- */
.settings { max-width: 640px; display: flex; flex-direction: column; gap: var(--s5); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s5); }
.panel h2 { margin: 0 0 var(--s1); font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: var(--s2); }
.panel h2 svg.i { color: var(--accent); }
.panel > p { margin: 0 0 var(--s4); color: var(--muted); font-size: 14px; }
.panel label.lbl { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-2); }
.panel .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin-top: var(--s4); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s4); min-height: 44px; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 15px; border: 0; background: var(--surface-3); flex: none; transition: background .2s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s var(--ease); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.stat { padding: var(--s3) var(--s4); border-radius: var(--radius); background: var(--surface-2); }
.stat b { display: block; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); }
.inline-note { font-size: 13.5px; color: var(--text-2); background: var(--surface-2); border-radius: var(--radius); padding: var(--s3) var(--s4); }

/* ---------- Accounts ----------
   Account button (phone top bar, desktop nav), its menu, the sign-in sheet and the admin Users list. */
.avatar {
  width: 30px; height: 30px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 800; line-height: 1; text-transform: uppercase;
}
.acct-btn {
  min-width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 7px; border: 0; border-radius: 22px; background: transparent; color: inherit; font-size: 14px; font-weight: 600;
  -webkit-tap-highlight-color: transparent; transition: background .15s;
}
.acct-btn:hover { background: rgba(127, 127, 127, .16); }
.acct-btn .acct-label { display: none; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Narrow phones: the "Short Dramas" tag line gives way so search, settings and the account button fit. */
@media (max-width: 459px) { .topbar .wordmark { display: none; } }
@media (min-width: 1024px) {
  .side-foot { gap: 6px; }
  .acct-btn { height: 40px; min-width: 40px; }
  .acct-btn:not(.on) { padding: 0 14px 0 10px; border: 1px solid var(--border-strong); }
  .acct-btn:not(.on) .acct-label, .acct-btn.on .acct-label { display: inline; }
  .acct-btn.on { padding: 0 12px 0 5px; }
}
.acct-menu {
  position: fixed; z-index: 75; min-width: 220px; max-width: calc(100vw - 16px); padding: 6px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); animation: rise .15s var(--ease);
}
.acct-head, .acct-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; }
.acct-head { border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.acct-who { display: flex; flex-direction: column; min-width: 0; }
.acct-who b { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-who small { font-size: 12.5px; color: var(--muted); }
.acct-who small:empty { display: none; }
.acct-menu [role="menuitem"] {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font-size: 14.5px; font-weight: 500; text-align: left;
}
.acct-menu [role="menuitem"]:hover, .acct-menu [role="menuitem"]:focus-visible { background: var(--surface-2); }
.acct-menu [role="menuitem"] svg.i { color: var(--text-2); }
.acct-row { padding: 0; }
.acct-row .avatar { width: 40px; height: 40px; font-size: 17px; }

.auth-layer { position: fixed; inset: 0; z-index: 80; }
.auth-scrim { position: absolute; inset: 0; background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .18s var(--ease); }
.auth-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100dvh - var(--safe-t) - 12px); overflow-y: auto; overscroll-behavior: contain;
  padding: var(--s3) calc(var(--gutter) + var(--safe-r)) calc(var(--s5) + var(--safe-b)) calc(var(--gutter) + var(--safe-l));
  background: var(--modal); border-radius: 16px 16px 0 0; border-top: 1px solid var(--border-strong); box-shadow: var(--shadow);
  animation: rise .22s var(--ease);
}
.auth-top { display: flex; align-items: center; gap: var(--s2); margin-right: -8px; }
.auth-top h2 { flex: 1; margin: 0; font-size: 21px; font-weight: 800; }
.auth-lede { margin: 2px 0 var(--s4); color: var(--muted); font-size: 14px; }
.auth-tabs { margin-bottom: var(--s4); }
.auth-tabs [aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 0 0 1px var(--border-strong); }
.auth-form { display: flex; flex-direction: column; }
.auth-form .lbl { display: block; font-size: 13px; font-weight: 600; margin: var(--s3) 0 6px; color: var(--text-2); }
.auth-form .lbl:first-child { margin-top: 0; }
.auth-form .hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.auth-error { min-height: 20px; margin: var(--s3) 0; font-size: 14px; font-weight: 600; color: var(--danger); }
.auth-error:empty { min-height: 0; margin: var(--s2) 0; }
.auth-form .btn.primary { min-height: 48px; font-size: 15.5px; }
@media (min-width: 700px) {
  .auth-sheet {
    left: 50%; right: auto; bottom: auto; top: 12dvh; width: min(420px, calc(100vw - 32px)); max-height: 80dvh; transform: translateX(-50%);
    padding: var(--s4) var(--s5) var(--s5); border-radius: var(--radius-lg); border: 1px solid var(--border-strong); animation: pop .18s var(--ease);
  }
  .users-sheet { width: min(520px, calc(100vw - 32px)); }
}
.user-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.user-list li { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.user-list li:last-child { border-bottom: 0; }
.role-tag { display: inline-block; vertical-align: 1px; margin-left: 4px; padding: 2px 6px; border-radius: 6px; background: var(--accent-weak); color: var(--text); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.signin-panel .state .state-icon { color: var(--accent); background: var(--accent-weak); }
.signin-panel .state p { max-width: 420px; }
.signin-actions { justify-content: center; margin-top: 0; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 12px); transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: var(--s2); align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: var(--shadow); animation: rise .2s var(--ease); }
.toast svg.i { width: 18px; height: 18px; }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
@media (min-width: 1024px) { .toasts { bottom: 24px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .skel::after { display: none; }
  .hc, .hc.in, .hc.out { transform: none !important; }
  .bb-slide { transition: none !important; }
  .cover:has(> img):not(.ok)::before { display: none; }
}
