/* ---- /assets/core/fonts.css ---- */
/* Self-hosted, latin-subset variable fonts. 2 files total, swap, no layout shift. */
@layer tokens {
  @font-face {
    font-family: "Inter";
    src: url("./fonts/inter-var.woff2") format("woff2-variations"),
         url("./fonts/inter-var.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
      U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
      U+2212, U+2215, U+FEFF, U+FFFD;
  }

  @font-face {
    font-family: "Manrope";
    src: url("./fonts/manrope-var.woff2") format("woff2-variations"),
         url("./fonts/manrope-var.woff2") format("woff2");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
      U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
      U+2212, U+2215, U+FEFF, U+FFFD;
  }
}

/* ---- /assets/core/tokens.css ---- */
/* ==========================================================================
   MovieState — design tokens · "Obsidian & Signal"
   Single source of truth. Nothing outside this file may hard-code a colour,
   radius, shadow, spacing step or duration. PRD §5.
   ========================================================================== */

/* --- One @layer order for the whole site ---------------------------------- */
@layer tokens, reset, base, layout, components, pages, utilities;

@layer tokens {
  :root {
    /* Type ---------------------------------------------------------------- */
    --font-display: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    /* Desktop/global type scale (mobile overrides live in base.css) -------- */
    --fs-3xl: 32px;
    --fs-2xl: 26px;
    --fs-xl: 20px;
    --fs-lg: 17px;
    --fs-md: 15px;
    --fs-sm: 13.5px;
    --fs-xs: 12.5px;

    --lh-tight: 1.15;
    --lh-snug: 1.35;
    --lh-copy: 1.8;

    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-black: 800;

    --tracking-tight: -0.02em;
    --tracking-normal: 0;
    --tracking-wide: 0.08em;

    /* Spacing -------------------------------------------------------------- */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 24px;
    --sp-6: 32px;
    --sp-7: 48px;
    --sp-8: 64px;

    /* Radii ---------------------------------------------------------------- */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-pill: 999px;

    /* Motion --------------------------------------------------------------- */
    /* A31: tokens that components already referenced but nobody had defined — their absence silently
       dropped whole declarations (no border, no shadow), which is how the action buttons lost their
       surface. Defined once here so a missing token can never erase a style again. */
    --r-xs: 6px;
    --maxw: var(--container);
    --card-radius: var(--r-md);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.35);
    --font-body: var(--font-ui);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --dur-hover: 180ms;
    --dur-panel: 320ms;
    --dur-fade: 180ms;
    --dur-tap: 96ms;

    /* Layout --------------------------------------------------------------- */
    --container: 1754px;
    --gutter: 32px;
    --header-h: 56px;
    /* the sticky pill bar parks directly under the header, safe-area included */
    --hdr: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    --rail-w: 72px;
    --tabbar-h: 56px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-l: env(safe-area-inset-left, 0px);
    --safe-r: env(safe-area-inset-right, 0px);
    --safe-t: env(safe-area-inset-top, 0px);

    /* Layers --------------------------------------------------------------- */
    --z-rail: 20;
    --z-header: 40;
    --z-tabbar: 45;
    --z-sheet: 60;
    --z-modal: 70;
    --z-toast: 80;
    --z-boot: 90;

    /* Focus ---------------------------------------------------------------- */
    --ring-w: 2px;
    --ring-offset: 2px;

    /* Motion keyframes shared by the shimmer language --------------------- */
    --shimmer-dur: 1.4s;
  }

  /* ====================== DARK — the default canvas ====================== */
  :root,
  :root[data-theme="dark"] {
    color-scheme: dark;

    --bg: #06070a;
    --bg-2: #0c0e13;
    --surface: #111419;
    --surface-2: #171b22;
    --surface-3: #1e242c;
    --card: #12161c;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);

    --txt: #f2f5f8;
    --txt-2: #a7b0bc;
    --txt-3: #7a8391;   /* 13.7 — was #6b7483: 4.27:1 on #06070a, under WCAG AA. Now 5.26:1 */

    --accent: #ff3b4e;
    --accent-ink: #1a0407;
    --accent-soft: rgba(255, 59, 78, 0.14);
    --accent-ring: rgba(255, 59, 78, 0.45);

    --mint: #2dfc9c;
    --mint-ink: #04231a;
    --mint-soft: rgba(45, 252, 156, 0.14);

    --violet: #7c5cff;
    --violet-soft: rgba(124, 92, 255, 0.16);

    --gold: #f5c151;
    --gold-soft: rgba(245, 193, 81, 0.14);

    --danger: #ff5a5a;
    --ok: var(--mint);
    --warn: var(--gold);

    --scrim: linear-gradient(180deg, rgba(6, 7, 10, 0) 0%, rgba(6, 7, 10, 0.55) 45%, rgba(6, 7, 10, 0.94) 100%);
    --spotlight: radial-gradient(60% 50% at 50% 0%, rgba(255, 59, 78, 0.16) 0%, rgba(124, 92, 255, 0.08) 42%, rgba(6, 7, 10, 0) 72%);
    --glass: rgba(12, 14, 19, 0.72);
    --inner-stroke: inset 0 1px 0 rgba(255, 255, 255, 0.06);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45), 0 24px 64px rgba(0, 0, 0, 0.5);

    --grain-opacity: 0.02;
    --img-plate: linear-gradient(135deg, #1a1f27 0%, #12161c 100%);
  }

  /* ====================== LIGHT — warm paper ============================= */
  :root[data-theme="light"] {
    color-scheme: light;

    --bg: #f6f6f9;
    --bg-2: #ffffff;
    --surface: #ffffff;
    --surface-2: #f1f2f7;
    --surface-3: #e7e9f0;
    --card: #ffffff;
    --line: rgba(12, 12, 28, 0.1);
    --line-strong: rgba(12, 12, 28, 0.18);

    --txt: #101019;
    --txt-2: #4a4e5e;
    --txt-3: #686d7b;   /* 13.7 — was #787c8c: 3.85:1 on #f6f6f9, under WCAG AA. Now 4.79:1 */

    --accent: #d4061b;
    --accent-ink: #ffffff;
    --accent-text: #d41200;           /* accent-as-text on paper: 5.4:1 (the fill red is only 4.4:1) */
    --accent-soft: rgba(212, 6, 27, 0.1);
    --accent-ring: rgba(212, 6, 27, 0.4);

    --mint: #0b8f5e;
    --mint-ink: #ffffff;
    --mint-soft: rgba(11, 143, 94, 0.12);

    --violet: #5b32e8;
    --violet-soft: rgba(91, 50, 232, 0.1);

    --gold: #a66a00;
    --gold-soft: rgba(166, 106, 0, 0.12);

    --danger: #c1121f;
    --ok: var(--mint);
    --warn: var(--gold);

    --scrim: linear-gradient(180deg, rgba(246, 246, 249, 0) 0%, rgba(246, 246, 249, 0.6) 45%, rgba(246, 246, 249, 0.96) 100%);
    --spotlight: radial-gradient(60% 50% at 50% 0%, rgba(212, 6, 27, 0.1) 0%, rgba(91, 50, 232, 0.06) 42%, rgba(246, 246, 249, 0) 72%);
    --glass: rgba(255, 255, 255, 0.78);
    --inner-stroke: inset 0 1px 0 rgba(255, 255, 255, 0.9);

    --shadow-sm: 0 1px 2px rgba(16, 16, 25, 0.06), 0 2px 8px rgba(16, 16, 25, 0.06);
    --shadow-lg: 0 8px 24px rgba(16, 16, 25, 0.1), 0 24px 64px rgba(16, 16, 25, 0.12);

    --grain-opacity: 0;
    --img-plate: linear-gradient(135deg, #e7e9f0 0%, #f1f2f7 100%);
  }

  /* --- Gutter rhythm (PRD §5: 16 / 24 / 32) ------------------------------ */
  @media (max-width: 767px) {
    :root { --gutter: 16px; }
  }
  @media (min-width: 768px) and (max-width: 1023px) {
    :root { --gutter: 24px; }
  }
}

/* ==========================================================================
   Identity layer — amendment A9 (owner, 16 Nov 2026)
   Black + red is the common language; the *special* is a cool acid lime that no
   streaming brand owns, used only where it means something (active marker, rating,
   "new" badge). Never as body text on light — on paper it is a fill with ink text.
   ========================================================================== */
@layer tokens {
  :root,
  :root[data-theme="dark"] {
    --accent-2: #c8f751;          /* acid lime — the signature */
    --accent-2-ink: #10160a;      /* text that sits on the lime */
    --accent-2-soft: rgba(200, 247, 81, 0.14);
    --accent-2-line: rgba(200, 247, 81, 0.42);
    --header-glass: rgba(8, 9, 12, 0.72);
    --tabbar-glass: rgba(10, 11, 15, 0.86);
    --drawer-bg: #0b0d12;
    --backdrop: rgba(3, 4, 6, 0.62);
  }
  :root[data-theme="light"] {
    --accent-2: #6f8a00;          /* same hue, pushed to readable contrast on paper */
    --accent-2-ink: #ffffff;
    --accent-2-soft: rgba(111, 138, 0, 0.12);
    --accent-2-line: rgba(111, 138, 0, 0.34);
    --header-glass: rgba(250, 250, 253, 0.82);
    --tabbar-glass: rgba(255, 255, 255, 0.92);
    --drawer-bg: #ffffff;
    --backdrop: rgba(10, 12, 24, 0.38);
  }
}

/* ==========================================================================
   Identity v2 — amendment A10 (owner, 22:24, 16 Nov 2026)
   "Black + red is far too common." So each theme gets its own pairing:
     dark  canvas #06070A  ×  accent #A2FF00 (acid green)
     light canvas #FFFFFF  ×  accent #FF1900 (signal red)
   Both keep a two-colour signal system: --accent leads (buttons, active marker,
   brand), --accent-2 is the counter-signal (LIVE dot, NEW tag) so the palette never
   reads as one flat hue. Ink on accent is always chosen for a real contrast ratio.
   ========================================================================== */
@layer tokens {
  :root,
  :root[data-theme="dark"] {
    /* solid chrome: the top bar, the tab bar and the pill bar are OPAQUE. A translucent
       bar over posters read as "broken/transparent" on a real phone (Devid, 17 Nov). */
    --chrome-bg: #06070a;
    --chrome-line: rgba(255, 255, 255, 0.09);
    --chrome-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.9);
    --line-2: rgba(255, 255, 255, 0.12);
    --accent-glow: rgba(162, 255, 0, 0.3);

    --accent: #a2ff00;                /* the brand hue — indicators, rules, dots */
    --accent-solid: #a2ff00;          /* the fill used behind ink (15.1:1 with #08130A) */
    --accent-ink: #08130a;            /* near-black text on the acid green */
    --accent-text: #a2ff00;           /* accent colour used AS text: 16.1:1 on the canvas */
    --accent-soft: rgba(162, 255, 0, 0.12);
    --accent-ring: rgba(162, 255, 0, 0.5);
    --accent-2: #ff2d46;              /* counter-signal: LIVE, NEW, alerts */
    --accent-2-ink: #ffffff;
    --accent-2-soft: rgba(255, 45, 70, 0.16);
    --accent-2-line: rgba(255, 45, 70, 0.45);
    --spotlight: radial-gradient(60% 50% at 50% 0%, rgba(162, 255, 0, 0.13) 0%, rgba(162, 255, 0, 0.04) 45%, rgba(6, 7, 10, 0) 72%);
  }
  :root[data-theme="light"] {
    --chrome-bg: #ffffff;
    --chrome-line: rgba(12, 12, 28, 0.1);
    --chrome-shadow: 0 10px 30px -18px rgba(16, 16, 25, 0.28);
    --line-2: rgba(12, 12, 28, 0.16);
    --accent-glow: rgba(230, 18, 0, 0.28);

    --accent: #ff1900;                /* the owner's exact signal red — non-text roles */
    --accent-solid: #e61200;          /* same hue, one step deeper: white ink now clears AA (4.65:1) */
    --accent-ink: #ffffff;
    --accent-text: #d41200;           /* accent-as-text on paper: 5.4:1 (the fill red is only 4.4:1) */
    --accent-soft: rgba(255, 25, 0, 0.09);
    --accent-ring: rgba(255, 25, 0, 0.38);
    --accent-2: #5f7a00;              /* readable olive-lime for tags on paper */
    --accent-2-ink: #ffffff;
    --accent-2-soft: rgba(95, 122, 0, 0.12);
    --accent-2-line: rgba(95, 122, 0, 0.34);
    --spotlight: radial-gradient(60% 50% at 50% 0%, rgba(255, 25, 0, 0.07) 0%, rgba(255, 25, 0, 0.02) 45%, rgba(255, 255, 255, 0) 72%);
  }
}

/* ---- /assets/core/base.css ---- */
/* ==========================================================================
   MovieState — reset + base typography + global primitives
   Mobile is the primary canvas (PRD §5.1): every size below is tuned on 390px
   first, then widened. No component styling lives here.
   ========================================================================== */

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }

  * { margin: 0; }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
    -webkit-tap-highlight-color: transparent;
  }

  body {
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    background: var(--bg);
    color: var(--txt);
    font-family: var(--font-ui);
    font-size: var(--fs-md);
    line-height: var(--lh-snug);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    overscroll-behavior-y: none;
  }

  img, picture, video, canvas, svg { display: block; max-width: 100%; }
  img, video { height: auto; background: var(--img-plate); }
  svg { fill: currentColor; }

  input, button, textarea, select { font: inherit; color: inherit; }
  button { background: none; border: 0; padding: 0; cursor: pointer; }

  a { color: inherit; text-decoration: none; }

  ul, ol { list-style: none; padding: 0; }

  table { border-collapse: collapse; width: 100%; }

  :where(h1, h2, h3, h4, h5, h6) {
    font-family: var(--font-display);
    font-weight: var(--fw-black);
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-tight);
    text-wrap: balance;
  }

  p { text-wrap: pretty; }

  /* Keyboard focus is always visible, never on mouse click (PRD §5). */
  :focus { outline: none; }
  :focus-visible {
    outline: var(--ring-w) solid var(--accent);
    outline-offset: var(--ring-offset);
    border-radius: var(--r-sm);
  }

  ::selection {
    /* A10 rule: a fill that carries text uses --accent-solid, so white stays at 4.72:1 in light */
    background: var(--accent-solid);
    color: var(--accent-ink);
  }

  /* Scrollbars: dark-aware, unobtrusive, never a layout jump. */
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
  }
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-track { background: transparent; }
  *::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: var(--r-pill);
    border: 3px solid var(--bg);
  }
  *::-webkit-scrollbar-thumb:hover { background: var(--txt-3); }
}

@layer base {
  /* ---- Type scale: mobile 28/22/18/16/14/12.5 → desktop 32/26/20/17/15/13.5 */
  h1, .t-3xl {
    font-size: clamp(28px, 1.2vw + 24px, var(--fs-3xl));
  }
  h2, .t-2xl {
    font-size: clamp(22px, 0.9vw + 19px, var(--fs-2xl));
  }
  h3, .t-xl {
    font-size: clamp(18px, 0.5vw + 16px, var(--fs-xl));
  }
  h4, .t-lg {
    font-size: clamp(16px, 0.35vw + 15px, var(--fs-lg));
    font-weight: var(--fw-bold);
    letter-spacing: var(--tracking-normal);
  }
  body, .t-md { font-size: clamp(15px, 0.2vw + 14.5px, var(--fs-md)); }
  .t-sm { font-size: clamp(14px, 0.2vw + 13.5px, var(--fs-sm)); }
  .t-xs { font-size: var(--fs-xs); }

  .t-copy { line-height: var(--lh-copy); }
  .t-muted { color: var(--txt-2); }
  .t-faint { color: var(--txt-3); }
  .t-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .t-eyebrow {
    font-family: var(--font-ui);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--txt-3);
  }
  .t-num { font-variant-numeric: tabular-nums; }

  /* ---- Layout primitives ------------------------------------------------ */
  .container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }
  .container-wide { max-width: none; }

  .stack { display: flex; flex-direction: column; }
  .row { display: flex; align-items: center; }
  .row-between { display: flex; align-items: center; justify-content: space-between; }
  .row-gap-2 { gap: var(--sp-2); }
  .row-gap-3 { gap: var(--sp-3); }
  .row-gap-4 { gap: var(--sp-4); }

  /* ---- Surface primitives (no component may re-invent these) ------------ */
  .surface {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm), var(--inner-stroke);
  }
  .hairline { border-top: 1px solid var(--line); }

  .scrim-bottom { background: var(--scrim); }

  /* Signature: radial spotlight wash behind the hero only (PRD §5).
     `overflow: clip` keeps the bleed from creating horizontal scroll. Rule: a .spotlight
     container never wraps a sticky/fixed bar, so clipping stays invisible. */
  .spotlight { position: relative; isolation: isolate; overflow: clip; }
  .spotlight::before {
    content: "";
    position: absolute;
    inset: -10% -20% auto -20%;
    height: min(680px, 70vw);
    background: var(--spotlight);
    z-index: -1;
    pointer-events: none;
  }

  /* Signature: film grain, dark mode only, 2% (token-driven). */
  .grain { position: relative; }
  .grain::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
    z-index: 1;
  }

  /* ---- Shimmer skeleton language (one site-wide, PRD §5) ---------------- */
  .skeleton {
    position: relative;
    overflow: hidden;
    background: var(--surface-2);
    border-radius: var(--r-md);
    color: transparent;
  }
  .skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    animation: ms-shimmer var(--shimmer-dur) var(--ease) infinite;
  }
  @keyframes ms-shimmer { to { transform: translateX(100%); } }

  /* ---- Touch contract: 44px floor (PRD §5.1.2) -------------------------- */
  .tap {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* ---- Utilities -------------------------------------------------------- */
  .sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .skip-link {
    position: absolute;
    top: -100px;
    left: 8px;
    z-index: var(--z-toast);
    /* A10 rule: a fill that carries text uses --accent-solid, so white stays at 4.72:1 in light */
    background: var(--accent-solid);
    color: var(--accent-ink);
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: var(--r-md);
    font-weight: var(--fw-semibold);
    transition: top var(--dur-hover) var(--ease);
  }
  .skip-link:focus-visible { top: calc(var(--safe-t) + 8px); }

  .no-scroll { overflow: hidden; }

  .fade-in { animation: ms-fade calc(var(--dur-fade) * 2) var(--ease) both; }
  @keyframes ms-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

  /* ---- Reduced motion: keep opacity, drop transforms (PRD §5) ---------- */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
    .skeleton::after { animation: none; opacity: 0.35; }
  }

  /* ---- Print: nothing but the words ----------------------------------- */
  @media print {
    body { background: #fff; color: #000; }
    .skeleton::after, .grain::after, .spotlight::before { display: none; }
  }
}

/* ==========================================================================
   P11 — mobile safety net. Every surface already lays itself out with grid and
   clamp(), so this block only covers the three things that break a page on a
   360px phone regardless of layout: media wider than its container, a long
   unbroken word (a title like "Don't Look Now…" or a URL), and a table.
   ========================================================================== */
img, svg, video, iframe, canvas, picture { max-width: 100%; }
iframe { border: 0; }
h1, h2, h3, h4, .card__title, .dt-title { overflow-wrap: anywhere; }
table { max-width: 100%; }

/* a scroll container is the correct answer for a wide table, never a squeezed one */
.ms-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }

/* ── Ad containers ────────────────────────────────────────────────────────────────────────────────
   Devid's rule, and the last word on it: an ad renders exactly as the network's own code says. No scaling, no
   clipping, no forced height, and no scroll box either. The slot is a plain block that gives the banner its
   space and otherwise stays out of the way. */
ms-slot {
  display: block;
  max-width: 100%;
  margin-block: 18px;
  margin-inline: auto;
}
ms-slot:empty { display: none; }
ms-slot iframe { border: 0; }
ms-slot img { display: block; }

/* ---- /assets/core/nav-feedback.css ---- */
/* ==========================================================================
   P11 — Navigation feedback.

   The site is a multi-page app on a static host: a click means a real document
   request, and on a phone that is 300-900 ms of nothing. Before this sheet the
   page changed colour under the cursor and then sat still, so a visitor pressed
   again, or thought the button was broken. Now every navigation answers within
   one frame: a brand-coloured progress bar, the page dims, and the control that
   was pressed shows a busy state. All of it is removed by the new document.
   ========================================================================== */

html[data-nav="1"]::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 2147483000;
  background: linear-gradient(90deg, var(--accent-solid), var(--mint), var(--accent-solid));
  background-size: 220% 100%;
  animation: msNavBar 1.15s linear infinite;
  pointer-events: none;
}

html[data-nav="1"]::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 2147482999;
  background: var(--accent-soft);
  pointer-events: none;
}

@keyframes msNavBar {
  0% { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}

/* the page that is being left recedes instead of vanishing: no flash of white, no sudden jump */
html[data-nav="1"] body {
  opacity: .62;
  transition: opacity .16s var(--ease, ease);
  cursor: progress;
}

/* the control the visitor actually pressed */
.is-busy {
  position: relative;
  cursor: progress !important;
  opacity: .72;
}

a.is-busy::after,
button.is-busy::after {
  content: "";
  position: absolute;
  inset: auto 6px 6px auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--accent-solid);
  border-right-color: transparent;
  animation: msBusySpin .7s linear infinite;
}

@keyframes msBusySpin { to { transform: rotate(360deg); } }

/* Posters fade in once decoded, so a grid never pops into place row by row.
   They are visible by default on purpose: a poster must never depend on JavaScript having run. If the
   script is blocked, slow or broken, the artwork still shows; the class only adds the entrance. */
.card__img { opacity: 1; }

.card__img.is-loaded { animation: msImgIn .3s var(--ease, ease) both; }

@keyframes msImgIn {
  from { opacity: .35; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-nav="1"]::before { animation: none; background: var(--accent-solid); }
  html[data-nav="1"] body { opacity: 1; }
  .card__img { opacity: 1; }
  a.is-busy::after, button.is-busy::after { animation: none; }
}

/* ---------- the feed answers a chip in the same frame ---------- */
@keyframes msCardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* a skeleton card occupies the same box as a real card, so the grid never jumps height */
.card--sk { pointer-events: none; }
.card--sk .card__title,
.card--sk .card__meta { display: block; }

/* while a genre is loading, the chips stop accepting taps: one press, one result */
.chip-row[aria-busy="true"] .chip { opacity: .55; pointer-events: none; }
.chip-row[aria-busy="true"] { cursor: progress; }

@media (prefers-reduced-motion: reduce) {
  .card { animation: none !important; }
}

/* a freshly swapped grid enters as one movement */
.card--enter { animation: msCardIn .3s ease both; }
@media (prefers-reduced-motion: reduce) { .card--enter { animation: none; } }

/* ---- /assets/core/components.css ---- */
/* ==========================================================================
   MovieState — component layer (PRD 1.1 / §5.1: every component ships with
   default · hover · active · focus-visible · disabled · loading · empty)
   Tokens only. Mobile-first: the 390 canvas is the design, 768/1440 adapt.
   States are declared twice on purpose — once for real user input (:hover,
   :active, :focus-visible, :disabled) and once for the design sheet, which has
   to render all seven states side by side via [data-state].
   ========================================================================== */
@layer components {
  /* ---------------------------------------------------------------- Btn --- */
  .btn {
    --btn-bg: var(--surface-2);
    --btn-fg: var(--txt);
    --btn-bd: var(--line);
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    gap: var(--sp-2); min-height: 44px; padding: 0 var(--sp-4);
    border: 1px solid var(--btn-bd); border-radius: var(--r-sm);
    background: var(--btn-bg); color: var(--btn-fg);
    font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semibold);
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: transform var(--dur-tap) var(--ease), background var(--dur-hover) var(--ease),
      border-color var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
  }
  .btn svg { width: 18px; height: 18px; flex: none; }
  .btn:hover { background: var(--surface-3); border-color: var(--line-strong); }
  .btn:active { transform: scale(0.975); }
  .btn:focus-visible { outline: none; box-shadow: 0 0 0 var(--ring-w) var(--accent-ring); }
  .btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
  .btn--primary { --btn-bg: var(--accent-solid); --btn-fg: var(--accent-ink); --btn-bd: transparent; }
  .btn--primary:hover { background: var(--accent-solid); filter: brightness(1.08); }
  .btn--ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--txt-2); }
  .btn--ghost:hover { background: var(--surface-2); color: var(--txt); }
  .btn--danger { --btn-bg: transparent; --btn-bd: var(--danger); --btn-fg: var(--danger); }
  .btn--danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
  .btn--sm { min-height: 36px; padding: 0 var(--sp-3); font-size: var(--fs-xs); }
  .btn--icon { width: 44px; padding: 0; flex: none; }
  .btn--block { width: 100%; }
  .btn--loading { color: transparent !important; pointer-events: none; }
  .btn--loading::after {
    content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid currentColor; border-top-color: transparent;
    color: var(--btn-fg); animation: ms-spin 700ms linear infinite;
  }
  @keyframes ms-spin { to { transform: rotate(360deg); } }

  /* --------------------------------------------------------- Pill / Chip --- */
  .pill {
    display: inline-flex; align-items: center; gap: 7px;
    min-height: 36px; padding: 0 14px; border-radius: var(--r-pill);
    border: 1px solid var(--line); background: var(--surface);
    color: var(--txt-2); font-size: var(--fs-xs); font-weight: var(--fw-medium);
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease);
  }
  .pill:hover { color: var(--txt); border-color: var(--line-strong); background: var(--surface-2); }
  .pill:focus-visible { outline: none; box-shadow: 0 0 0 var(--ring-w) var(--accent-ring); }
  .pill[aria-selected="true"], .pill[aria-pressed="true"], .pill--active {
    background: var(--accent-solid); color: var(--accent-ink); border-color: var(--accent-solid);
  }
  .pill[disabled], .pill[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
  .pill__count { font-variant-numeric: tabular-nums; opacity: 0.6; font-size: 11px; }

  /* ------------------------------------------------------------ Pill bar --- */
  /* Home chips and catalogue genres are the same component: one row of premium pills that
     scrolls sideways under the header. The catalogue used to render a block of wrapping
     ovals (display:block, no scroll) — that is the "scattered pills" defect Devid saw. */
  .pills {
    position: sticky; top: var(--hdr); z-index: 30;
    display: flex; align-items: center; gap: 8px;
    margin-inline: calc(-1 * var(--gutter));
    padding: 10px var(--gutter);
    background: var(--chrome-bg);
    border-bottom: 1px solid var(--chrome-line);
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x proximity;
    /* without this the first pill snaps to the container edge and eats the gutter */
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none; -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  }
  .pills::-webkit-scrollbar { display: none; height: 0; }
  /* markup compatibility: the home feed wraps its chips in .chip-row, the catalogue does not */
  .pills .chip-row { display: contents; }
  .pills .pill, .pills .chip {
    flex: none; scroll-snap-align: start;
    min-height: 40px; padding: 0 16px; border-radius: var(--r-pill);
    background: var(--surface); border: 1px solid var(--line); color: var(--txt-2);
    font-size: var(--fs-sm); font-weight: 600; letter-spacing: -0.005em; white-space: nowrap;
    transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease),
                border-color var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease);
  }
  .pills .pill:hover, .pills .chip:hover {
    background: var(--surface-2); color: var(--txt); border-color: var(--line-strong); transform: translateY(-1px);
  }
  .pills .pill:active, .pills .chip:active { transform: scale(0.97); }
  .pills .pill[aria-current="page"], .pills .pill[aria-selected="true"], .pills .chip[aria-selected="true"] {
    background: var(--accent-solid); border-color: var(--accent-solid); color: var(--accent-ink);
    box-shadow: 0 8px 20px -12px var(--accent-glow);
  }
  .pills .pill[aria-current="page"]:hover, .pills .chip[aria-selected="true"]:hover { color: var(--accent-ink); }
  @media (max-width: 1023px) {
    .pills .pill, .pills .chip { min-height: 44px; }
  }
  /* PRD §5.1.2 touch contract: 44x44 minimum. Under 1024 the pointer is a thumb. */
  @media (max-width: 1023px) {
    .pill, .chip { min-height: 44px; min-width: 44px; }
    .chip { padding: 0 14px; }
    .btn--sm { min-height: 44px; }
    .btn--icon { width: 44px; min-width: 44px; }
  }

  .chip {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 32px; padding: 0 10px; border-radius: var(--r-sm);
    background: var(--surface-2); color: var(--txt-2);
    font-size: var(--fs-xs); font-weight: var(--fw-medium); text-decoration: none;
    border: 1px solid transparent; cursor: pointer;
    transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
  }
  .chip:hover { color: var(--txt); background: var(--surface-3); }
  .chip:focus-visible { outline: none; box-shadow: 0 0 0 var(--ring-w) var(--accent-ring); }
  .chip--accent { background: var(--accent-soft); color: var(--accent); }
  .chip[disabled] { opacity: 0.4; pointer-events: none; }

  /* --------------------------------------------------------------- Badge --- */
  .badge {
    display: inline-flex; align-items: center; gap: 5px;
    min-height: 20px; padding: 0 7px; border-radius: 5px;
    font-size: 11px; font-weight: var(--fw-bold); letter-spacing: 0.06em; text-transform: uppercase;
    background: rgba(0, 0, 0, 0.62); color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  }
  .badge--live { background: var(--accent-2); color: var(--accent-2-ink); border-color: transparent; }
  .badge--new { background: var(--accent-solid); color: var(--accent-ink); border-color: transparent; }
  .badge--hdr { background: rgba(0, 0, 0, 0.62); color: var(--accent); border-color: var(--accent-2-line); }
  .badge__dot {
    width: 6px; height: 6px; border-radius: 50%; background: currentColor;
    animation: ms-live 1.8s var(--ease) infinite;
  }
  @keyframes ms-live { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.82); } }

  /* -------------------------------------------------------------- Rating --- */
  .rating { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); color: var(--txt-2); }
  .rating__stars { position: relative; display: inline-block; line-height: 0; }
  .rating__stars svg { width: 13px; height: 13px; }
  .rating__base { color: var(--line-strong); }
  .rating__fill {
    position: absolute; inset: 0; overflow: hidden; color: var(--accent); white-space: nowrap;
    width: calc(var(--rating, 0) * 100%);
  }
  .rating__value { font-variant-numeric: tabular-nums; font-weight: var(--fw-semibold); color: var(--txt); }

  /* ---------------------------------------------------------------- Card --- */
  .card {
    position: relative; display: block; text-decoration: none; color: inherit;
    border-radius: var(--r-md); outline: none;
    -webkit-tap-highlight-color: transparent;
  }
  .card__media {
    display: block; position: relative; overflow: hidden; border-radius: var(--r-md);
    background: var(--img-plate); aspect-ratio: 2 / 3;
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease);
  }
  .card--16x9 .card__media { aspect-ratio: 16 / 9; }
  .card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .card__img--fallback { display: grid; place-items: center; color: var(--txt-3); font-size: var(--fs-xs); }
  .card__scrim {
    position: absolute; inset: 0; opacity: 0; pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,0.06) 0%, rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 100%);
    transition: opacity var(--dur-hover) var(--ease);
  }
  .card__tl, .card__br { position: absolute; display: flex; gap: 5px; }
  .card__tl { top: 8px; left: 8px; }
  .card__br { bottom: 8px; right: 8px; }
  .card__duration {
    padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: var(--fw-semibold);
    background: rgba(0, 0, 0, 0.72); color: #fff; font-variant-numeric: tabular-nums;
  }
  .card__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,0.22); }
  .card__progress span { display: block; height: 100%; background: var(--accent); }
  .card__body { padding: var(--sp-2) 2px 0; display: grid; gap: 3px; }
  .card__title {
    font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: 1.28; color: var(--txt);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .card__meta {
    display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--txt-3); }
  .card__meta i { font-style: normal; opacity: 0.5; }
  .card:hover .card__media { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
  .card:hover .card__scrim { opacity: 1; }
  .card:hover .card__title { color: var(--accent); }
  .card:active .card__media { transform: scale(0.985); }
  .card:focus-visible { box-shadow: 0 0 0 var(--ring-w) var(--accent-ring); }
  .card:focus-visible .card__media { box-shadow: var(--shadow-lg); }
  /* the card is one link: there is deliberately no CTA slot above or below it (A10) */

  /* ---------------------------------------------------------------- Rail --- */
  .rail { display: grid; gap: var(--sp-3); }
  .rail__head { display: flex; align-items: center; gap: var(--sp-3); }
  .rail__title { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); }
  .rail__more {
    margin-left: auto; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--txt-2);
    text-decoration: none; min-height: 44px; min-width: 44px; padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .rail__more:hover { color: var(--accent); }
  .rail__track {
    display: grid; grid-auto-flow: column; grid-auto-columns: 42vw; gap: var(--sp-3);
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch; padding-bottom: 4px;
    scrollbar-width: none;
  }
  .rail__track::-webkit-scrollbar { display: none; }
  .rail__track > * { scroll-snap-align: start; }
  @media (min-width: 640px) { .rail__track { grid-auto-columns: 176px; gap: var(--sp-4); } }
  @media (min-width: 1024px) { .rail__track { grid-auto-columns: 196px; } }

  /* ------------------------------------------------------------ Skeleton --- */
  .sk { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--r-sm); }
  .sk::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--txt) 7%, transparent) 45%, transparent 90%);
    background-size: 200% 100%; animation: ms-shimmer 1.4s linear infinite;
  }
  @keyframes ms-shimmer { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
  .sk--poster { aspect-ratio: 2 / 3; border-radius: var(--r-md); }
  .sk--16x9 { aspect-ratio: 16 / 9; border-radius: var(--r-md); }
  .sk--line { height: 12px; }
  .sk--line-sm { height: 10px; width: 55%; }
  .sk--chip { height: 30px; width: 84px; border-radius: var(--r-pill); }
  .sk--btn { height: 44px; width: 132px; }
  @media (prefers-reduced-motion: reduce) { .sk::after, .badge__dot { animation: none; } }

  /* --------------------------------------------------- Empty / Error state --- */
  .state {
    display: grid; justify-items: center; gap: var(--sp-2); text-align: center;
    padding: var(--sp-6) var(--sp-4); border: 1px dashed var(--line-strong);
    border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 60%, transparent);
  }
  .state__icon {
    width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
    background: var(--surface-2); color: var(--txt-3);
  }
  .state__icon svg { width: 22px; height: 22px; }
  .state__title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
  .state__body { font-size: var(--fs-xs); color: var(--txt-3); max-width: 34ch; line-height: 1.6; }
  .state--error { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
  .state--error .state__icon { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

  /* --------------------------------------------------------------- Toast --- */
  .toast {
    display: inline-flex; align-items: center; gap: var(--sp-3);
    min-height: 44px; padding: var(--sp-2) var(--sp-4) var(--sp-2) var(--sp-3);
    border-radius: var(--r-md); background: var(--surface-3); color: var(--txt);
    border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
    font-size: var(--fs-sm); max-width: min(92vw, 420px);
  }
  .toast__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); flex: none; }
  .toast--ok .toast__dot { background: var(--ok); }
  .toast--warn .toast__dot { background: var(--warn); }
  .toast--error .toast__dot { background: var(--danger); }
  .toast__close { margin-left: auto; }

  /* ---------------------------------------------------------------- Hero --- */
  /* The one place with a primary CTA is the hero — cards stay single links (A10). */
  .hero {
    position: relative; display: grid; align-items: end; width: 100%;
    min-height: 62svh; border-radius: var(--r-lg); overflow: hidden;
    background: var(--img-plate); isolation: isolate;
  }
  .hero__media { position: absolute; inset: 0; z-index: -2; }
  .hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
  .hero__scrim {
    position: absolute; inset: 0; z-index: -1;
    background:
      linear-gradient(180deg, rgba(6,7,10,0.15) 0%, rgba(6,7,10,0.35) 42%, rgba(6,7,10,0.92) 100%),
      linear-gradient(90deg, rgba(6,7,10,0.85) 0%, rgba(6,7,10,0.15) 62%, transparent 100%);
  }
  .hero__inner {
    position: relative; display: grid; gap: var(--sp-2); padding: var(--sp-5) var(--sp-4) var(--sp-5);
    color: #fff; max-width: 640px;
  }
  .hero__eyebrow { display: flex; align-items: center; gap: var(--sp-2); }
  .hero__title {
    font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; line-height: 1.03;
    font-size: clamp(1.9rem, 7.2vw, 3.4rem); color: #fff; text-wrap: balance;
  }
  .hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: var(--fs-xs); color: rgba(255,255,255,0.82); }
  .hero__meta i { font-style: normal; opacity: 0.45; }
  .hero__synopsis {
    font-size: var(--fs-sm); line-height: 1.62; color: rgba(255,255,255,0.78); max-width: 52ch;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }
  .hero__actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-2); }
  /* 10.2e — a lone hero CTA must look like a button, not a bar: its own width on desktop, full width on phones */
  .hero__actions .btn { flex: 0 0 auto; min-width: 184px; }
  @media (max-width: 560px) { .hero__actions .btn { flex: 1 1 100%; min-width: 0; } }
  .hero .badge, .hero .hero__meta .rating__value { color: #fff; }
  .hero__poster { display: none; }
  .hero--poster-only .hero__media img { object-fit: cover; filter: blur(2px) brightness(0.55); }
  .hero:hover .hero__media img { transform: scale(1.02); }
  .hero__media img { transition: transform 900ms var(--ease); }
  .hero--loading { min-height: 62svh; background: var(--surface-2); }
  @media (max-width: 767px) {
    /* the skeleton must occupy the same box as the real hero or the LCP jumps */
    .hero--loading { aspect-ratio: 4 / 5; min-height: 0; max-height: 84svh; }
  }
  @media (min-width: 768px) {
    .hero { min-height: 46svh; }
    .hero__inner { padding: var(--sp-6) var(--sp-5); }
  }
  /* mobile: 16:9 art is wrong for a phone — 4:5 crop framed on the face box */
  @media (max-width: 767px) {
    .hero { min-height: 0; aspect-ratio: 4 / 5; max-height: 84svh; align-items: end; }
    .hero__media img { object-position: center 18%; }
  }

  /* ---------------------------------------------------------- Bottom sheet --- */
  .bsheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sheet);
    display: flex; flex-direction: column;
    max-height: 85svh; /* PRD §5.1.2 */
    background: var(--surface); color: var(--txt);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-top: 1px solid var(--line-strong);
    box-shadow: 0 -20px 60px rgba(0,0,0,0.45);
    padding-bottom: var(--safe-b);
    transform: translateY(0); transition: transform var(--dur-hover) var(--ease);
  }
  .bsheet[data-open="false"] { transform: translateY(102%); }
  .bsheet__grab { display: grid; place-items: center; height: 22px; flex: none; }
  .bsheet__grab span { width: 38px; height: 4px; border-radius: 2px; background: var(--line-strong); }
  .bsheet__head { flex: none; display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-4) var(--sp-2); }
  .bsheet__title { font-family: var(--font-display); font-size: var(--fs-md); font-weight: var(--fw-bold); }
  .bsheet__body {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    padding: 0 var(--sp-4) var(--sp-4);
  }
  .bsheet__foot {
    flex: none; display: flex; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4);
    border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, var(--bg));
  }
  .bsheet__foot .btn { flex: 1; }
  .scrim {
    position: fixed; inset: 0; z-index: calc(var(--z-sheet) - 1);
    background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
    opacity: 1; transition: opacity var(--dur-hover) var(--ease);
  }
  .scrim[data-open="false"] { opacity: 0; pointer-events: none; }

  /* ---------------------------------------------------------------- Modal --- */
  .modal {
    position: fixed; inset: 0; z-index: var(--z-sheet); display: grid; place-items: center;
    padding: var(--sp-4);
  }
  .modal__panel {
    position: relative; display: flex; flex-direction: column;
    width: min(100%, 560px); max-height: 82svh;
    background: var(--surface); border: 1px solid var(--line-strong);
    border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden;
  }
  .modal__head { flex: none; display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
  .modal__title { font-family: var(--font-display); font-size: var(--fs-md); font-weight: var(--fw-bold); }
  .modal__close { margin-left: auto; }
  .modal__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-4); font-size: var(--fs-sm); color: var(--txt-2); line-height: 1.65; }
  .modal__foot { flex: none; display: flex; gap: var(--sp-2); justify-content: flex-end; padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); }
  /* PRD: never a centred modal on mobile — it becomes a bottom sheet */
  @media (max-width: 767px) {
    .modal { align-items: end; padding: 0; }
    .modal__panel {
      width: 100%; max-height: 85svh; border-radius: var(--r-lg) var(--r-lg) 0 0;
      border-left: 0; border-right: 0; border-bottom: 0; padding-bottom: var(--safe-b);
    }
    .modal__foot { position: sticky; bottom: 0; background: var(--surface); }
  }

  /* ----------------------------------------------------------------- Tabs --- */
  .tabs {
    display: flex; gap: var(--sp-1); overflow-x: auto; scrollbar-width: none;
    min-width: 0; max-width: 100%;
    border-bottom: 1px solid var(--line); position: relative; scroll-behavior: smooth;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 0 var(--sp-3); border: 0; background: none; cursor: pointer;
    color: var(--txt-2); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semibold);
    white-space: nowrap; transition: color var(--dur-hover) var(--ease);
  }
  .tab:hover { color: var(--txt); }
  .tab[aria-selected="true"] { color: var(--txt); }
  .tab[aria-selected="true"]::after {
    content: ''; position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: -1px; height: 3px;
    border-radius: 2px 2px 0 0; background: var(--accent);
  }
  .tab:focus-visible { outline: none; box-shadow: 0 0 0 var(--ring-w) var(--accent-ring); border-radius: var(--r-sm); }
  .tab[disabled] { opacity: 0.4; pointer-events: none; }
  .tab__count { margin-left: 6px; font-size: 11px; opacity: 0.65; font-variant-numeric: tabular-nums; }

  /* ----------------------------------------------------------- Breadcrumbs --- */
  .crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; font-size: var(--fs-xs); color: var(--txt-3); }
  .crumbs ol { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; min-width: 0; overflow: hidden; flex-wrap: nowrap; }
  .crumbs li { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 0 1 auto; }
  /* narrowest phones: keep the root and the leaf, drop the intermediate trail rather than clip it */
  @media (max-width: 359px) {
    .crumbs li:not(:first-child):not(:last-child) { display: none; }
  }
  .crumbs a {
    color: var(--txt-2); text-decoration: none; padding: 0 4px; min-height: 32px;
    display: inline-flex; align-items: center; border-radius: var(--r-xs);
    max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .crumbs a:hover { color: var(--accent); }
  .crumbs a:focus-visible { outline: none; box-shadow: 0 0 0 var(--ring-w) var(--accent-ring); }
  .crumbs__sep { opacity: 0.4; font-size: 11px; }
  @media (max-width: 1023px) {
    .crumbs a, .crumbs [aria-current="page"] { min-height: 44px; min-width: 44px; justify-content: center; }
  }
  .crumbs [aria-current="page"] {
    color: var(--txt); font-weight: var(--fw-medium); padding: 0 4px;
    max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  /* ------------------------------------------------------------- LoadMore --- */
  .loadmore { display: grid; justify-items: center; gap: var(--sp-2); padding: var(--sp-4) 0; }
  .loadmore__note { font-size: var(--fs-xs); color: var(--txt-2); font-variant-numeric: tabular-nums; }
  /* A23 + A24 — the paging control. At rest it is a quiet, premium outline: no deep slab,
     just a hairline in the theme accent and an accent label that already reads as pressable.
     On hover / keyboard focus it fills with the theme accent and flips its ink, so the whole
     affordance becomes the brand colour — lime in dark, signal red in light — with a soft
     glow and a 1px lift. Everything eases over 220ms so the fill sweeps in rather than snaps. */
  .loadmore .btn, .feed-foot .btn {
    min-width: 216px; min-height: 48px;
    --btn-bg: transparent; --btn-bd: color-mix(in oklab, var(--accent-solid) 42%, transparent); --btn-fg: var(--accent-text);
    background: transparent;
    border: 1px solid color-mix(in oklab, var(--accent-solid) 42%, transparent);
    color: var(--accent-text);             /* dark: lime 16.1:1 · light: #D41200 5.4:1 on paper */
    font-weight: var(--fw-semibold);
    letter-spacing: 0.01em;
    box-shadow: 0 0 0 0 transparent;
    transition:
      background-color 220ms var(--ease),
      border-color 220ms var(--ease),
      color 220ms var(--ease),
      box-shadow 260ms var(--ease),
      transform 220ms var(--ease);
  }
  .loadmore .btn:hover, .feed-foot .btn:hover,
  .loadmore .btn:focus-visible, .feed-foot .btn:focus-visible {
    background: var(--accent-solid);
    border-color: var(--accent-solid);
    color: var(--accent-ink);              /* dark: #08130A on lime 15.1:1 · light: white 4.65:1 */
    transform: translateY(-1px);
    box-shadow: 0 8px 22px -10px var(--accent-glow), 0 0 0 1px color-mix(in oklab, var(--accent-solid) 40%, transparent);
  }
  .loadmore .btn:active, .feed-foot .btn:active {
    transform: translateY(0) scale(0.99);
    box-shadow: 0 2px 10px -6px var(--accent-glow);
    transition-duration: 90ms;
  }
  .loadmore .btn:disabled, .loadmore .btn[aria-busy="true"], .feed-foot .btn:disabled { opacity: 0.55; }
  .loadmore[data-exhausted="true"] .btn { display: none; }

  /* --------------------------------------------------------------- Table --- */
  .table-wrap { min-width: 0; max-width: 100%; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
  .table-scroll { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .table { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); }
  .table caption { text-align: left; padding: var(--sp-3) var(--sp-3) 0; font-size: var(--fs-xs); color: var(--txt-3); }
  .table th {
    position: sticky; top: 0; z-index: 1; text-align: left; white-space: nowrap;
    font-weight: var(--fw-semibold); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--txt-3); background: var(--surface-2); padding: var(--sp-2) var(--sp-3);
    border-bottom: 1px solid var(--line);
  }
  .table td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); color: var(--txt-2); }
  .table tbody tr:last-child td { border-bottom: 0; }
  .table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); color: var(--txt); }
  .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
  .table td strong { color: var(--txt); font-weight: var(--fw-semibold); }
  .table__empty td { text-align: center; color: var(--txt-3); padding: var(--sp-5) var(--sp-3); }
  @media (max-width: 1023px) { .table td, .table th { padding: var(--sp-3); height: 44px; } }

  /* ------------------------------------------------------------- StatRow --- */
  .stats { display: grid; gap: var(--sp-2); }
  .stats--grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-3); }
  .stat {
    display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3);
    padding: var(--sp-2) 0; border-bottom: 1px dashed var(--line);
  }
  .stats--grid .stat { flex-direction: column; align-items: flex-start; gap: 4px; padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); border-bottom: 1px solid var(--line); }
  .stat__label { font-size: var(--fs-xs); color: var(--txt-3); }
  .stat__value { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--txt); font-variant-numeric: tabular-nums; }
  .stat__value--empty { color: var(--txt-3); font-weight: var(--fw-regular); }
  .stat__delta { font-size: 11px; font-weight: var(--fw-semibold); }
  .stat__delta--up { color: var(--ok); }
  .stat__delta--down { color: var(--danger); }
  .stat--loading .stat__value { width: 56px; height: 13px; border-radius: 4px; }

  /* ---------------------------------------------------------- ServerList --- */
  .servers { display: grid; gap: var(--sp-2); }
  .server {
    display: flex; align-items: center; gap: var(--sp-2); width: 100%;
    min-height: 48px; padding: var(--sp-2) var(--sp-3); text-align: left;
    background: var(--surface); color: var(--txt); border: 1px solid var(--line);
    border-radius: var(--r-md); font: inherit; font-size: var(--fs-sm); cursor: pointer;
    transition: border-color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
  }
  .server:hover { border-color: var(--line-strong); background: var(--surface-2); }
  .server:focus-visible { outline: none; box-shadow: 0 0 0 var(--ring-w) var(--accent-ring); }
  .server[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
  .server[disabled] { opacity: 0.45; pointer-events: none; }
  .server__name { font-weight: var(--fw-semibold); }
  .server__meta { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); font-size: 11px; color: var(--txt-3); font-variant-numeric: tabular-nums; }
  .server__signal { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
  .server__signal i { width: 3px; border-radius: 1px; background: var(--line-strong); }
  .server__signal i:nth-child(1) { height: 4px; } .server__signal i:nth-child(2) { height: 7px; } .server__signal i:nth-child(3) { height: 10px; }
  .server[data-health="good"] .server__signal i { background: var(--ok); }
  .server[data-health="ok"] .server__signal i:nth-child(3) { background: transparent; }
  .server[data-health="ok"] .server__signal i:nth-child(-n+2) { background: var(--warn); }
  .server[data-health="poor"] .server__signal i:nth-child(n+2) { background: transparent; }
  .server[data-health="poor"] .server__signal i:nth-child(1) { background: var(--danger); }

  /* --------------------------------------------------------- ChannelTile --- */
  .channel {
    position: relative; display: grid; gap: var(--sp-2); padding: var(--sp-3);
    border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
    text-decoration: none; color: inherit; min-height: 96px;
    transition: transform var(--dur-tap) var(--ease), border-color var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease);
  }
  .channel:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
  .channel:focus-visible { outline: none; box-shadow: 0 0 0 var(--ring-w) var(--accent-ring); }
  .channel__head { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
  .channel__logo {
    width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: var(--r-xs);
    background: var(--surface-3); color: var(--txt-2); font-size: 11px; font-weight: var(--fw-bold); overflow: hidden;
  }
  .channel__logo img { width: 100%; height: 100%; object-fit: contain; }
  .channel__name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .channel__foot { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--txt-3); }
  .channel[data-state="offline"] { opacity: 0.6; }
  .channel[data-state="loading"] { min-height: 96px; }

  /* ----------------------------------------------------------- EventCard --- */
  .event {
    display: grid; gap: var(--sp-2); padding: var(--sp-3);
    border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
    text-decoration: none; color: inherit;
    transition: border-color var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease);
  }
  .event:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
  .event:focus-visible { outline: none; box-shadow: 0 0 0 var(--ring-w) var(--accent-ring); }
  .event__top { display: flex; align-items: center; gap: var(--sp-2); }
  .event__league { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--txt-3); }
  .event__teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--sp-2); }
  .event__team { display: flex; align-items: center; gap: 7px; font-size: var(--fs-sm); font-weight: var(--fw-semibold); min-width: 0; }
  .event__team--away { justify-content: flex-end; text-align: right; }
  .event__team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .event__crest { width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--surface-3); }
  .event__vs { font-size: 11px; color: var(--txt-3); font-weight: var(--fw-semibold); }
  .event__foot { display: flex; align-items: center; gap: var(--sp-2); font-size: 11px; color: var(--txt-3); font-variant-numeric: tabular-nums; }
  .event__foot time { color: var(--txt-2); font-weight: var(--fw-semibold); }

  /* -------------------------------------------------------------- AdSlot --- */
  /* Zero chrome of our own. Empty slots are not rendered at all (PRD §7.2), so this
     rule is the belt to the JS braces: if a slot ever reaches the DOM empty, it dies. */
  .adslot { display: contents; }
  .adslot[data-empty="true"], .adslot:empty { display: none !important; }
  .adslot--debug {
    display: grid; place-items: center; min-height: 90px; border: 1px dashed var(--line-strong);
    border-radius: var(--r-sm); color: var(--txt-3); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  }

  /* --------------------------------------------------------- Player shell --- */
  .player {
    position: relative; display: grid; width: 100%; border-radius: var(--r-md); overflow: hidden;
    background: #000; aspect-ratio: 16 / 9; color: #fff; isolation: isolate;
  }
  .player__poster { position: absolute; inset: 0; z-index: -2; }
  .player__poster img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
  .player__center { position: absolute; inset: 0; display: grid; place-items: center; }
  .player__play {
    width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer;
    display: grid; place-items: center; background: var(--accent-solid); color: var(--accent-ink);
    box-shadow: 0 8px 30px rgba(0,0,0,0.45); transition: transform var(--dur-tap) var(--ease);
  }
  .player__play svg { width: 26px; height: 26px; }
  .player__play:hover { transform: scale(1.06); }
  .player__play:focus-visible { outline: none; box-shadow: 0 0 0 var(--ring-w) var(--accent-ring), 0 8px 30px rgba(0,0,0,0.45); }
  .player__bar {
    position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 6px;
    padding: var(--sp-2) var(--sp-3) calc(var(--sp-2) + var(--safe-b));
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.82));
  }
  .player__seek { position: relative; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.25); overflow: hidden; }
  .player__seek span { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 2px; }
  .player__controls { display: flex; align-items: center; gap: var(--sp-2); font-size: 11px; font-variant-numeric: tabular-nums; }
  .player__controls .btn { --btn-bg: transparent; --btn-bd: transparent; color: #fff; }
  .player__controls .btn:hover { background: rgba(255,255,255,0.14); color: #fff; }
  .player__time { color: rgba(255,255,255,0.8); }
  .player__spacer { margin-left: auto; }
  .player--loading .player__center { gap: var(--sp-3); }
  .player__spinner {
    width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.25);
    border-top-color: var(--accent); animation: ms-spin 800ms linear infinite;
  }
  @media (prefers-reduced-motion: reduce) { .player__spinner { animation: none; } }

  /* --------------------------------------------------------------- Footer --- */
  .footer {
    margin-top: var(--sp-7); padding: var(--sp-6) 0 calc(var(--sp-6) + var(--safe-b));
    border-top: 1px solid var(--line); background: var(--bg-2);
  }
  .footer__inner { display: grid; gap: var(--sp-5); max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-4); }
  .footer__mesh { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
  .footer__col h3 {
    font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--txt-3);
    font-weight: var(--fw-semibold); margin-bottom: var(--sp-2);
  }
  .footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .footer__col a {
    display: inline-flex; align-items: center; min-height: 32px; min-width: 32px; padding: 0 4px;
    color: var(--txt-2); text-decoration: none; font-size: var(--fs-xs);
  }
  .footer__col a:hover { color: var(--accent); }
  .footer__col a:focus-visible { outline: none; box-shadow: 0 0 0 var(--ring-w) var(--accent-ring); border-radius: var(--r-xs); }
  .footer__base {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3);
    padding-top: var(--sp-4); border-top: 1px solid var(--line);
    font-size: 11px; color: var(--txt-3);
  }
  .footer__brand { display: inline-flex; align-items: center; gap: 8px; font-weight: var(--fw-bold); color: var(--txt); }
  .footer__brand .minimark { width: 18px; height: 18px; }
  .footer__legal { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-left: auto; }
  .footer__legal a {
    color: var(--txt-3); text-decoration: none; min-height: 32px; min-width: 32px; padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .footer__legal a:hover { color: var(--txt); }
  @media (min-width: 768px) {
    .footer__mesh { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .footer__inner { padding: 0 var(--sp-5); }
  }
  @media (max-width: 1023px) {
    .footer__col a, .footer__legal a { min-height: 44px; min-width: 44px; }
  }

  /* Touch floor (PRD §5.1.2) — declared last on purpose: any component that sets its own
     height earlier still has to honour 44px on a touch canvas. */
  @media (max-width: 1023px) {
    .chip, .pill { min-height: 44px; min-width: 44px; }
    /* micro-type must still clear the 12px mobile floor — a rating you cannot read is not a rating */
    .badge, .card__meta { font-size: 12px; }
    .btn--sm { min-height: 44px; }
  }

  /* A14: any fill that IS the accent must carry ink text — white on lime is invisible (owner). */
  .badge--new, .badge--live, .badge--hdr.is-accent { color: var(--accent-ink); }
  :root[data-theme="light"] .badge--new, :root[data-theme="light"] .badge--live { color: #fff; }
  :root[data-theme="light"] .btn--primary, :root[data-theme="light"] .chip[aria-selected="true"] { color: #fff; }
  .btn--primary, .chip[aria-selected="true"] { color: var(--accent-ink); }

  /* A14: the hero rides on the accent fill, so its badge text must be ink, not white.
     Placed after `.hero .badge { color:#fff }`, with the same specificity, so it wins. */
  .hero .badge--new, .hero .badge--live, .hero .badge--hdr { color: #08130a; }
  :root[data-theme="light"] .hero .badge--new,
  :root[data-theme="light"] .hero .badge--live { color: #fff; }
}
/* Step 4.3 — the one toast the CTA engine needs (popup-blocked fallback) */
.ms-toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: var(--z-sheet);
  transform: translate(-50%, 14px); opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--txt); font-size: var(--fs-sm); font-weight: 650;
  box-shadow: var(--shadow-md); transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.ms-toast[data-open="true"] { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 599px) { .ms-toast { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); } }


/* Phase 11 (9.6) — page-wise banner slot. Full-width, one image, one link, labelled honestly. */
.ad-slot { margin: var(--sp-4) auto; max-width: 1200px; padding: 0 var(--gutter, 16px); }
.ad-slot__link { position: relative; display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.ad-slot__link:hover { border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); }
.ad-slot__img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 200; object-fit: cover; }
.ad-slot__tag { position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--txt-2); background: color-mix(in oklab, var(--bg) 78%, transparent); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 6px; }

/* ---- /assets/pages/shell.css ---- */
/* ==========================================================================
   Site chrome — top bar, mobile tab bar, menu drawer (amendment A9)
   Public chrome carries NO account affordances. Admin lives at /admin/ only.
   Mobile-first: the tab bar and drawer are the primary navigation under 1024px.
   ========================================================================== */
@layer layout {
  .site-header {
    position: sticky; top: 0; z-index: var(--z-header);
    /* A42: the page's own edge wears the brand hue, so the strip directly under the browser
       bar reads as one continuous surface with it (the browser strip itself is browser-owned). */

    /* Solid, not glass. On Android Chrome the translucent header let posters run under the
       brand and made the icons look washed out; the theme's canvas is the right answer. */
    background: var(--chrome-bg);
    border-bottom: 1px solid var(--chrome-line);
    box-shadow: var(--chrome-shadow);
    padding-top: var(--safe-t);
  }
  .site-header::before {
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
    background: var(--accent); pointer-events: none;
  }
  .site-header__inner {
    display: flex; align-items: center; gap: var(--sp-3);
    min-height: var(--header-h); max-width: var(--container);
    margin: 0 auto; padding: 0 var(--gutter);
  }
  .site-brand {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 44px; min-width: 44px; text-decoration: none; color: var(--txt);
    font-family: var(--font-display); font-weight: var(--fw-black);
    font-size: 16px; letter-spacing: var(--tracking-tight);
    transition: color 260ms var(--ease), opacity 200ms var(--ease);
  }
  /* The mark is a glass tile, not a bare icon: a hairline accent ring, an inner light line and a soft
     accent glow under it. Every one of those is painted from tokens, so switching dark → bright animates
     the hue instead of snapping it. */
  .site-brand__tile {
    position: relative; display: grid; place-items: center; flex: none;
    width: 34px; height: 34px; border-radius: 11px; overflow: hidden;
    background-color: color-mix(in oklab, var(--accent) 10%, var(--surface-2));
    box-shadow:
      inset 0 0 0 1px color-mix(in oklab, var(--accent) 32%, transparent),
      inset 0 1px 0 rgba(255, 255, 255, 0.10),
      0 6px 18px color-mix(in oklab, var(--accent) 16%, transparent);
    transition: background-color 280ms var(--ease), box-shadow 280ms var(--ease), transform 200ms var(--ease);
  }
  .site-brand__mark { width: 26px; height: 26px; color: var(--txt); transition: color 280ms var(--ease); }
  .site-brand__shine {
    position: absolute; inset: -45%; pointer-events: none; opacity: 0;
    background: linear-gradient(115deg, transparent 38%, color-mix(in oklab, var(--accent) 60%, white) 50%, transparent 62%);
    transform: translateX(-70%) rotate(10deg);
    transition: opacity 200ms var(--ease), transform 640ms var(--ease);
  }
  .site-brand:hover .site-brand__tile {
    transform: translateY(-1px);
    box-shadow:
      inset 0 0 0 1px color-mix(in oklab, var(--accent) 58%, transparent),
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      0 10px 26px color-mix(in oklab, var(--accent) 30%, transparent);
  }
  .site-brand:hover .site-brand__shine { opacity: 0.85; transform: translateX(70%) rotate(10deg); }
  .site-brand__dot {
    width: 5px; height: 5px; border-radius: 50%; flex: none;
    background-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 20%, transparent);
    transition: background-color 280ms var(--ease), box-shadow 280ms var(--ease);
  }
  .site-brand__word { display: none; }
  .site-brand__word b { color: var(--accent); transition: color 280ms var(--ease); }
  .site-brand:focus-visible { outline: none; box-shadow: 0 0 0 var(--ring-w) var(--accent-ring); border-radius: var(--r-sm); }
  @media (min-width: 400px) { .site-brand__word { display: inline; } }
  @media (prefers-reduced-motion: reduce) {
    .site-brand__shine { display: none; }
    .site-brand__tile, .site-brand__mark, .site-brand__dot, .site-brand__word b { transition: none; }
  }

  /* desktop tabs */
  .site-tabs { display: none; align-items: center; gap: 2px; margin-left: var(--sp-4); }
  .site-tab {
    position: relative; display: inline-flex; align-items: center; gap: 7px;
    min-height: 44px; padding: 0 13px; border-radius: var(--r-sm);
    color: var(--txt-2); font-size: var(--fs-sm); font-weight: var(--fw-medium);
    text-decoration: none; transition: color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
  }
  .site-tab:hover { color: var(--txt); background: var(--surface-2); }
  .site-tab[aria-current="page"] { color: var(--txt); background: var(--accent-soft); }
  .site-tab[aria-current="page"]::after {
    content: ''; position: absolute; left: 13px; right: 13px; bottom: 6px; height: 2px;
    border-radius: 2px; background: var(--accent);
  }
  .site-tab__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }
  @media (min-width: 1024px) { .site-tabs { display: flex; } }

  .site-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
  .icon-btn {
    display: inline-grid; place-items: center; width: 44px; height: 44px;
    border: 1px solid transparent; border-radius: var(--r-sm);
    background: transparent; color: var(--txt); cursor: pointer;
    transition: background var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
  }
  .icon-btn:hover { background: var(--surface-2); border-color: var(--line); }
  .icon-btn:active { transform: scale(0.96); }
  .icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 var(--ring-w) var(--accent-ring); }
  .icon-btn[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent-2-line); color: var(--txt); }
  .site-search {
    display: none; align-items: center; gap: var(--sp-2);
    height: 44px; padding: 0 14px; min-width: 0; width: min(320px, 34vw);
    border: 1px solid var(--line); border-radius: var(--r-sm);
    background: var(--surface); color: var(--txt-2); font-size: var(--fs-sm);
  }
  .site-search:hover { border-color: var(--line-strong); color: var(--txt); }
  @media (min-width: 900px) { .site-search { display: inline-flex; } }

  /* mobile tab bar */
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-tabbar);
    display: grid; grid-template-columns: repeat(5, 1fr);
    padding-bottom: var(--safe-b);
    background: var(--chrome-bg);
    border-top: 1px solid var(--chrome-line);
    box-shadow: 0 -10px 30px -20px rgba(0, 0, 0, 0.9);
  }
  .tabbar__item {
    position: relative; display: grid; justify-items: center; align-content: center; gap: 3px;
    min-height: calc(var(--tabbar-h) + var(--safe-b)); padding: 6px 2px 8px;
    color: var(--txt-2); text-decoration: none; background: none; border: 0;
    font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
    cursor: pointer; transition: color var(--dur-hover) var(--ease);
  }
  .tabbar__item svg { width: 22px; height: 22px; }
  .tabbar__item:hover { color: var(--txt-2); }
  .tabbar__item[aria-current="page"], .tabbar__item[aria-expanded="true"] { color: var(--txt); font-weight: 700; }
  .tabbar__item[aria-current="page"]::before,
  .tabbar__item[aria-expanded="true"]::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 22px; height: 2px; border-radius: 2px; background: var(--accent);
  }
  .tabbar__item[aria-current="page"] svg { color: var(--accent); }
  .tabbar__item:focus-visible { outline: none; box-shadow: inset 0 0 0 var(--ring-w) var(--accent-ring); }
  /* Step 6.5 — the Live TV slot: same 44px target and identical rhythm as its neighbours, but the
     glyph carries the accent and a 5px live dot pulses once every 3s (stopped for reduced motion). */
  .tabbar__ico { position: relative; display: inline-grid; place-items: center; }
  .tabbar__item--live svg { color: var(--accent); }
  .tabbar__item--live[aria-current="page"] svg { filter: drop-shadow(0 0 6px var(--accent-glow, rgba(162,255,0,.35))); }
  .tabbar__live-dot {
    position: absolute; top: -1px; right: -3px; width: 5px; height: 5px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 2px var(--tabbar-bg, #06070A);
    animation: tabLivePulse 3s ease-in-out infinite;
  }
  .tabbar__item--live span:last-child { white-space: nowrap; }
  @keyframes tabLivePulse { 0%, 100% { opacity: .45; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
  @media (prefers-reduced-motion: reduce) { .tabbar__live-dot { animation: none; opacity: 1; } }
  .tabbar__badge {
    position: absolute; top: 5px; right: calc(50% - 20px);
    width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2);
  }
  @media (min-width: 1024px) { .tabbar { display: none; } }

  /* drawer */
  .drawer-backdrop {
    position: fixed; inset: 0; z-index: var(--z-sheet);
    background: var(--backdrop); opacity: 0; pointer-events: none;
    transition: opacity var(--dur-panel) var(--ease);
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  }
  .drawer-backdrop[data-open="true"] { opacity: 1; pointer-events: auto; }
  .drawer {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: calc(var(--z-sheet) + 1);
    width: min(88vw, 342px); display: flex; flex-direction: column;
    /* A real panel clips its own content. Without this the sitemap painted straight over the
       page behind the drawer once it outgrew the viewport (defect found in step 1.1 review). */
    overflow: hidden;
    background: var(--drawer-bg); border-right: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateX(-101%);
    transition: transform var(--dur-panel) var(--ease);
    visibility: hidden;
    padding-top: var(--safe-t); padding-bottom: var(--safe-b);
  }
  .drawer[data-open="true"] { transform: none; visibility: visible; }
  .drawer__head {
    flex: none;
    display: flex; align-items: center; gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line);
  }
  .drawer__title { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-md); }
  .drawer__close { margin-left: auto; }
  /* flex:1 + min-height:0 is what turns this into a real scroll region; without min-height:0 a
     flex child refuses to shrink below its content and the column overflows instead. */
  .drawer__body {
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    padding: var(--sp-3) 0 var(--sp-4);
    scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  }
  .drawer__body::-webkit-scrollbar { width: 6px; }
  .drawer__body::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
  .drawer__group + .drawer__group { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--line); }
  .drawer__label {
    padding: var(--sp-2) var(--sp-4); font-size: 11px; font-weight: var(--fw-semibold);
    letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--txt-3);
  }
  .drawer__link {
    display: flex; align-items: center; gap: var(--sp-3);
    min-height: 46px; padding: 0 var(--sp-4);
    color: var(--txt-2); text-decoration: none; font-size: var(--fs-sm); font-weight: var(--fw-medium);
    border-left: 2px solid transparent;
    transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
  }
  .drawer__link:hover, .drawer__link:focus-visible { background: var(--surface-2); color: var(--txt); outline: none; }
  .drawer__link[aria-current="page"] { color: var(--txt); background: var(--accent-soft); border-left-color: var(--accent); }
  .drawer__link svg { width: 19px; height: 19px; flex: none; color: var(--txt-3); }
  .drawer__link[aria-current="page"] svg { color: var(--accent); }
  .drawer__link .tag {
    margin-left: auto; padding: 2px 7px; border-radius: var(--r-pill);
    background: var(--accent-2-soft); color: var(--accent-2);
    font-size: 10px; font-weight: var(--fw-bold); letter-spacing: 0.04em;
  }
  :root[data-theme="light"] .drawer__link .tag { color: var(--accent-2); }
  .drawer__theme {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    margin: 0; padding: 0 var(--sp-1) 0 0; min-height: 44px;
  }
  .drawer__theme span { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--txt-2); }
  .drawer__foot { flex: none; display: grid; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4) calc(var(--sp-3) + var(--safe-b)); border-top: 1px solid var(--line); }
  .drawer__foot p { font-size: 11px; line-height: 1.5; color: var(--txt-3); }

  /* keep content clear of the tab bar */
  @media (max-width: 1023px) {
    /* --tabbar-h is the inner height; the hairline border and a breathing gap sit on top of it,
       otherwise the last content row clips under the bar by exactly 1px. */
    body { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 1px + var(--sp-3)); }
  }
  @media (min-width: 1024px) {
    body { padding-bottom: 0; }
  }
  body[data-drawer="open"] { overflow: hidden; }

  /* shared contract for any future panel that scrolls internally (bottom sheet, filters) */
  .scroll-region { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

  @media (prefers-reduced-motion: reduce) {
    .drawer, .drawer-backdrop { transition: none; }
  }
}

/* ==========================================================================
   Theme transition — amendment A10 (premium, smooth, respects reduced motion)
   Modern browsers get a circular reveal from the toggle itself (View Transitions);
   everyone else gets a colour crossfade + a soft bloom, so the swap never snaps.
   ========================================================================== */
@layer utilities {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
  ::view-transition-new(root) {
    animation: ms-theme-reveal 560ms var(--ease) both;
  }
  @keyframes ms-theme-reveal {
    from { clip-path: circle(0% at var(--vt-x, 50%) var(--vt-y, 0%)); }
    to { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 50%) var(--vt-y, 0%)); }
  }

  /* fallback path (Safari < 18, Firefox, reduced-motion off but no VT support) */
  html.theme-anim,
  html.theme-anim *,
  html.theme-anim *::before,
  html.theme-anim *::after {
    transition:
      background-color 420ms var(--ease),
      color 420ms var(--ease),
      border-color 420ms var(--ease),
      fill 420ms var(--ease),
      stroke 420ms var(--ease),
      box-shadow 420ms var(--ease) !important;
  }

  .theme-bloom {
    position: fixed; z-index: var(--z-toast); pointer-events: none;
    width: 46vmax; height: 46vmax; margin: -23vmax 0 0 -23vmax;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 68%);
    animation: ms-bloom 620ms var(--ease) forwards;
  }
  @keyframes ms-bloom {
    0% { transform: scale(0.2); opacity: 0.85; }
    100% { transform: scale(1.9); opacity: 0; }
  }
  @media (prefers-reduced-motion: reduce) {
    ::view-transition-new(root) { animation: none; }
    .theme-bloom { display: none; }
  }

  /* ============================================================ A13: shell ===
     YouTube's shape, our skin: full-width slim header, pills under it, a persistent
     desktop rail, and the tab bar as the only mobile menu (no double menu anymore). */

  :root { --hdr: 56px; }

  /* header: hamburger only where a rail exists */

  /* mobile brand lockup: mark + name, tight and confident */
  .site-brand { gap: 9px; }
  .site-brand__tile { width: 32px; height: 32px; border-radius: 10px; }
  .site-brand__mark { width: 24px; height: 24px; }
  .site-brand__word {
    font-family: var(--font-display); font-weight: 700; font-size: 17px;
    letter-spacing: -0.022em; font-feature-settings: 'ss01' on;
  }
  .site-brand__word b { font-weight: 800; color: var(--accent); }
  @media (max-width: 399px) { .site-brand__dot { display: none; } }

  /* ============================================ A20: the rail is a real column again
     Devid's call: the hidden-rail experiment failed on two counts — with one small pill on the edge you
     could not tell a sidebar existed, and an overlay never adjusts the page, so the content stayed
     underneath it. So the rail is back IN the grid: 76px of section icons at rest (every group's glyph
     visible, the active one marked), and it grows to 316px on hover / focus / pin. The page shifts with
     it because it is the same grid — nothing is ever covered, nothing shows through, nothing jumps. */
  .shell { display: grid; grid-template-columns: minmax(0, 1fr); }
  .shell__content { min-width: 0; }

  .railzone { display: none; }
  .siderail { display: none; }
  .railpin { display: none; }

  @media (min-width: 1024px) {
    .shell {
      grid-template-columns: 72px minmax(0, 1fr);
      transition: grid-template-columns 260ms cubic-bezier(0.22, 0.9, 0.25, 1);
    }
    body[data-rail="open"] .shell { grid-template-columns: 264px minmax(0, 1fr); }

    .railzone {
      display: block; position: sticky; top: var(--hdr); align-self: start;
      height: calc(100dvh - var(--hdr)); z-index: 60;
    }

    .siderail {
      display: flex; flex-direction: column; gap: 2px;
      height: 100%; width: 100%;
      overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
      padding: 10px 8px 14px;
      /* opaque in both themes — the page must never read through the rail */
      background: var(--surface);
      border-right: 1px solid var(--line-2);
      scrollbar-width: thin;
    }

    /* ---- resting state: an icon rail, not a mystery pill ---- */
    .railzone[data-open="false"] .siderail__label,
    .railzone[data-open="false"] .navgrp__btn > span:not(.navrow__ico),
    .railzone[data-open="false"] .navgrp__chev,
    .railzone[data-open="false"] .nav-brand__word,
    .railzone[data-open="false"] .nav-brand__tag,
    .railzone[data-open="false"] .railpin__word,
    .railzone[data-open="false"] .siderail__pages { display: none; }
    .railzone[data-open="false"] .navgrp { margin: 0; }
    .railzone[data-open="false"] .navgrp__panel { display: none; }
    /* the icon rail has to look like a deliberate column of controls, not five grey smudges:
       48px tiles, 22px glyphs, a real hover surface and the active section tinted */
    .railzone[data-open="false"] .navgrp { margin: 0; }
    .railzone[data-open="false"] .navgrp__btn {
      width: 48px; height: 48px; margin: 3px auto; padding: 0;
      justify-content: center; border-radius: 13px;
      color: color-mix(in oklab, var(--txt) 74%, transparent);
      transition: color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
    }
    .railzone[data-open="false"] .navgrp__btn:hover { color: var(--txt); background: var(--surface-2); }
    .railzone[data-open="false"] .navgrp__btn[aria-expanded="true"] { color: var(--accent); background: color-mix(in oklab, var(--accent) 12%, transparent); }
    .railzone[data-open="false"] .navgrp__btn svg { width: 22px; height: 22px; }
    .railzone[data-open="false"] .navgrp__btn[aria-expanded="true"] { background: var(--surface-2); }
    .railzone[data-open="false"] .nav-brand { padding: 2px 0 8px; }
    /* the brand is a real control in the icon rail too: 44×44, not a 33×30 sliver */
    .railzone[data-open="false"] .nav-brand__link {
      width: 44px; height: 44px; min-height: 44px; margin: 0 auto;
      justify-content: center; gap: 0; padding: 0;
    }
    .railzone[data-open="false"] .nav-brand__mark { width: 26px; height: 26px; }
    .railzone[data-open="false"] .railpin { width: 44px; margin: 4px auto 0; padding: 0; justify-content: center; }

    /* the width has travelled before the words arrive, so nothing squashes mid-move */
    .siderail__label,
    .navgrp__btn > span,
    .nav-brand__word,
    .nav-brand__tag,
    .railpin__word { transition: opacity 160ms var(--ease) 90ms; }
    .railzone[data-open="true"] .siderail { padding-right: var(--sp-2); }

    .siderail__group + .siderail__group { margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
    .siderail__label {
      font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
      color: var(--txt-3); padding: 0 var(--sp-3) var(--sp-2);
    }
    .siderail__link {
      display: flex; align-items: center; gap: var(--sp-3);
      min-height: 44px; padding: 0 var(--sp-3); border-radius: 10px;
      color: var(--txt-2); text-decoration: none; font-size: var(--fs-sm); font-weight: var(--fw-medium);
      position: relative; transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
    }
    .siderail__link svg { flex: none; opacity: 0.85; }
    .siderail__link:hover { background: var(--surface-2); color: var(--txt); }
    .siderail__link:hover svg { opacity: 1; }
    .siderail__link.is-active { background: var(--surface-2); color: var(--txt); font-weight: 600; }
    .siderail__link.is-active::before {
      content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
      width: 3px; height: 20px; border-radius: 2px; background: var(--accent);
    }
    .siderail__link.is-active svg { color: var(--accent); opacity: 1; }
    .siderail__link .tag { margin-left: auto; }

    /* the pin lives at the foot of the rail, in the thumb-free zone on a desktop but always visible */
    .railpin {
      display: flex; align-items: center; gap: 10px;
      margin-top: auto; min-height: 44px; padding: 0 12px;
      border: 1px solid var(--line-2); border-radius: 10px; background: transparent;
      color: var(--txt-2); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
      transition: color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
    }
    .railpin:hover { color: var(--txt); border-color: color-mix(in oklab, var(--accent) 50%, var(--line-2)); background: var(--surface-2); }
    .railpin:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
    .railpin__glyph { display: grid; place-items: center; flex: none; }
    .railpin__glyph--close { display: none; }
    body[data-rail="open"] .railzone[data-pinned="true"] .railpin__glyph--open { display: none; }
    body[data-rail="open"] .railzone[data-pinned="true"] .railpin__glyph--close { display: grid; }
    /* a pinned rail says so, quietly */
    .railzone[data-pinned="true"] .railpin { color: var(--txt); border-color: color-mix(in oklab, var(--accent) 45%, var(--line-2)); }
  }

  /* ==================================================== A13: drawer, premium ===
     Same groups as the rail, but a full-height sheet with real hierarchy: brand head,
     rounded rows with an accent active bar, an appearance card that sits in the thumb zone. */
  .drawer { width: min(332px, 86vw); }
  .drawer__head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-4) var(--sp-3);
    border-bottom: 1px solid var(--line);
  }
  .drawer__title {
    font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
  }
  .drawer__body { padding: var(--sp-3) var(--sp-2); }
  .drawer__group + .drawer__group { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
  .drawer__label {
    font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--txt-3); padding: 0 var(--sp-3) var(--sp-2);
  }
  .drawer__link {
    display: flex; align-items: center; gap: var(--sp-3);
    min-height: 46px; padding: 0 var(--sp-3); border-radius: 10px;
    color: var(--txt-2); text-decoration: none; font-size: var(--fs-sm); font-weight: var(--fw-medium);
    position: relative;
    transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
  }
  .drawer__link svg { flex: none; opacity: 0.85; }
  .drawer__link:active, .drawer__link:hover { background: var(--surface-2); color: var(--txt); }
  .drawer__link[aria-current="page"] { background: var(--surface-2); color: var(--txt); font-weight: 600; }
  .drawer__link[aria-current="page"]::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; border-radius: 2px; background: var(--accent);
  }
  .drawer__link[aria-current="page"] svg { color: var(--accent); opacity: 1; }
  .drawer__link .tag { margin-left: auto; }

  .drawer__theme {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    min-height: 52px; padding: 0 var(--sp-3);
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  }
  .drawer__theme span { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--txt-2); }
  .drawer__foot { display: grid; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3) calc(var(--sp-3) + var(--safe-b)); border-top: 1px solid var(--line); }
  .drawer__foot p { font-size: 11px; line-height: 1.5; color: var(--txt-3); padding: 0 var(--sp-1); }

  /* ================================================= A14: header controls + search ===
     Every control in the header must look like it belongs to this design: hairline border,
     surface hover, 40px, and an obvious purpose. The old ones were naked icons. */
  .site-actions { gap: var(--sp-2); }
  .icon-btn {
    height: 44px; min-width: 44px; border-radius: 10px;
    border: 1px solid transparent; color: var(--txt-2);
    transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease);
  }
  .icon-btn:hover { background: var(--surface-2); color: var(--txt); border-color: var(--line); }
  .icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 var(--ring-w) var(--accent-ring); }
  /* A14: the sidebar toggle is the last control on the right, matching the rest of the header icons.
     The glyph nudges toward the rail it controls, and the tinted state says which way it will go. */
  .site-search__kbd {
    margin-left: auto; font: 600 11px/1 var(--font-ui); color: var(--txt-3);
    border: 1px solid var(--line); border-radius: 6px; padding: 2px 5px;
  }
  /* the mobile-only search button; the desktop pill takes over from 900px */
  .site-search-btn { display: inline-flex; }
  @media (min-width: 900px) { .site-search-btn { display: none; } }

  /* mobile brand lockup must actually show the name */
  @media (max-width: 899px) {
    .site-brand__word { display: inline-block; font-size: 16.5px; }
  }

  /* ---- search overlay ---- */
  .search-panel {
    position: fixed; inset: 0; z-index: var(--z-sheet);
    display: none; grid-template-rows: auto 1fr;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
  }
  .search-panel[data-open="true"] { display: grid; animation: fadeInDown 220ms var(--ease) both; }
  .search-panel__bar { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
  .search-panel__field {
    display: flex; align-items: center; gap: var(--sp-3);
    height: 52px; padding: 0 var(--sp-2) 0 var(--sp-4);
    border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface);
    box-shadow: var(--shadow-sm);
  }
  .search-panel__field svg { flex: none; color: var(--txt-3); }
  .search-panel__field input {
    flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: none; color: var(--txt);
    font: 500 16px/1 var(--font-ui); outline: none;
  }
  .search-panel__field input::placeholder { color: var(--txt-3); }
  .search-panel__body { padding: var(--sp-4); display: grid; gap: var(--sp-3); align-content: start; }
  .search-panel__label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--txt-3); }
  .search-panel__chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
  .search-panel__hint { font-size: var(--fs-sm); color: var(--txt-3); max-width: 52ch; }
  body[data-overlay="search"] { overflow: hidden; }

  /* ---- footer mesh ---- */
  /* ================================================ A39: the footer, both canvases ================
     Desktop: a brand band on the left, three sitemap columns on the right behind one hairline.
     Phone: the same brand band, then three 52px folding rows so the foot of the page stays a block.
     Nothing hides behind the fixed tab bar — the foot carries its own clearance. */
  .site-footer {
    position: relative; margin-top: var(--sp-7);
    border-top: 1px solid var(--line-2);
    background:
      radial-gradient(120% 90% at 8% -30%, color-mix(in oklab, var(--accent) 9%, transparent) 0%, transparent 62%),
      linear-gradient(180deg, color-mix(in oklab, var(--surface) 94%, var(--accent) 6%) 0%, var(--surface) 58%);
    padding: var(--sp-7) 0 calc(var(--sp-6) + 66px + env(safe-area-inset-bottom, 0px));
  }
  @media (min-width: 1024px) { .site-footer { padding-bottom: var(--sp-6); } }

  .site-footer__band { display: grid; gap: var(--sp-5); }
  @media (min-width: 900px) {
    .site-footer__band { grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.5fr); gap: var(--sp-7); align-items: start; }
    .site-footer__cols { border-left: 1px solid var(--line); padding-left: var(--sp-6); }
  }

  .site-footer__brand { display: grid; gap: 14px; align-content: start; }
  .site-footer .site-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; width: fit-content; }
  .site-footer .site-brand__tile {
    display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
    background: color-mix(in oklab, var(--accent) 12%, var(--surface-2));
    border: 1px solid color-mix(in oklab, var(--accent) 30%, var(--line));
    box-shadow: 0 0 0 6px color-mix(in oklab, var(--accent) 6%, transparent);
  }
  .site-footer .site-brand__mark { width: 26px; height: 26px; color: var(--txt); }
  .site-footer .site-brand__word { font-family: var(--font-display); font-size: 1.32rem; font-weight: 800; letter-spacing: -0.02em; color: var(--txt); }
  .site-footer .site-brand__word b { color: var(--accent-text); }
  .site-footer__note { font-size: var(--fs-sm); line-height: 1.65; color: var(--txt-2); max-width: 46ch; }
  .site-footer__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
  .site-footer__chips li {
    font-size: 11.5px; font-weight: 650; letter-spacing: 0.02em; color: var(--txt-2);
    padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
  }

  .site-footer__cols { display: grid; }
  @media (min-width: 900px) { .site-footer__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); } }
  .site-footer__col { border-bottom: 1px solid var(--line); }
  .site-footer__col:first-of-type { border-top: 1px solid var(--line); }
  @media (min-width: 900px) { .site-footer__col, .site-footer__col:first-of-type { border: 0; } }

  .site-footer__label {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin: 0; min-height: 52px; cursor: pointer; list-style: none;
    font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--txt-2);
  }
  .site-footer__label::-webkit-details-marker { display: none; }
  .site-footer__chev { display: grid; place-items: center; width: 22px; height: 22px; color: var(--txt-3); transition: transform 240ms var(--ease), color 200ms var(--ease); }
  .site-footer__col[open] .site-footer__chev { transform: rotate(180deg); color: var(--accent-text); }
  @media (min-width: 900px) {
    .site-footer__label { min-height: 34px; cursor: default; padding-bottom: 4px; }
    .site-footer__chev { display: none; }
  }

  .site-footer__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; padding-bottom: 8px; }
  @media (min-width: 900px) { .site-footer__links { grid-template-columns: 1fr; padding-bottom: 0; } }
  .site-footer__col a {
    display: flex; align-items: center; min-height: 44px;
    font-size: 13.5px; font-weight: 600; color: var(--txt-2); text-decoration: none;
    transition: color 180ms var(--ease), transform 180ms var(--ease);
  }
  .site-footer__col a:hover, .site-footer__col a:focus-visible { color: var(--accent-text); transform: translateX(2px); }
  @media (min-width: 900px) { .site-footer__col a { min-height: 34px; } }

  .site-footer__base {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 10px var(--sp-4); margin-top: var(--sp-6); padding-top: var(--sp-4);
    border-top: 1px solid var(--line);
  }
  .site-footer__base p { font-size: 12px; line-height: 1.6; color: var(--txt-3); max-width: 52ch; }
  @media (max-width: 899px) {
    /* the sitemap pill needs its 44px, so the base row itself gets tighter */
    .site-footer__base { margin-top: var(--sp-4); padding-top: 10px; gap: 6px; }
    .site-footer__base a { min-height: 44px; padding: 0 16px; }
  }
  .site-footer__base a {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px;
    border-radius: 999px; border: 1px solid var(--line-2); color: var(--txt-2);
    font-weight: 650; text-decoration: none; transition: color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
  }
  .site-footer__base a:hover { color: var(--accent-ink); background: var(--accent); border-color: transparent; }
  .site-footer__base a:hover { color: var(--accent-text); border-color: currentColor; }
  .site-footer__top {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; margin-left: auto;
    border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--txt-2);
    font: inherit; font-size: 12.5px; font-weight: 750; cursor: pointer;
    transition: background 220ms var(--ease), color 220ms var(--ease), border-color 220ms var(--ease), transform 180ms var(--ease);
  }
  .site-footer__top:hover { background: var(--accent); color: var(--accent-ink); border-color: transparent; transform: translateY(-1px); }
  .site-footer__top:focus-visible { outline: var(--ring-w, 2px) solid var(--accent-ring, var(--accent)); outline-offset: 2px; }
  @media (max-width: 599px) { .site-footer__top { margin-left: 0; width: 100%; justify-content: center; } }
}
/* ============================================================================
   A15 — premium accordion navigation (rail + drawer share every rule below)
   One group open at a time; height/opacity motion on a 220ms ease-out curve.
   ========================================================================== */
.navgrp { border-radius: var(--r-md); }
.navgrp__btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 44px; padding: 0 10px; margin: 0;
  background: none; border: 0; border-radius: var(--r-md);
  color: var(--txt-2); font: inherit; font-size: var(--fs-sm); font-weight: 650;
  letter-spacing: 0.01em; text-align: left; cursor: pointer;
  transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.navgrp__btn > svg:first-child { flex: none; opacity: 0.9; }
.navgrp__btn > span { flex: 1 1 auto; }
.navgrp__chev { flex: none; opacity: 0.6; transition: transform 220ms cubic-bezier(0.2, 0.9, 0.24, 1); }
.navgrp__btn:hover { background: var(--surface-2); color: var(--txt); }
.navgrp__btn:focus-visible { outline: none; box-shadow: inset 0 0 0 var(--ring-w) var(--accent-ring); }
.navgrp[data-open="true"] > .navgrp__btn { background: var(--surface-2); color: var(--txt); }
.navgrp[data-open="true"] > .navgrp__btn .navgrp__chev { transform: rotate(180deg); opacity: 1; }
.navgrp[data-open="true"] > .navgrp__btn > svg:first-child { color: var(--accent); opacity: 1; }

.navgrp__panel {
  height: 0; overflow: hidden;
  transition: height 220ms cubic-bezier(0.2, 0.9, 0.24, 1);
}
.navgrp__inner { display: grid; gap: 2px; padding: 4px 0 8px 8px; }
.navgrp__inner .siderail__link { min-height: 44px; font-size: var(--fs-sm); }
.drawer .navgrp__inner .siderail__link, .drawer .siderail__page { min-height: 46px; }

/* the branding block sits mid-rail: below the groups, above the site pages */
.nav-brand {
  margin: var(--sp-4) 0 var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 90% at 12% 0%, color-mix(in oklab, var(--accent) 18%, transparent), transparent 62%),
    var(--surface-2);
  transition: border-color var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease);
}
.nav-brand:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.nav-brand__link { display: grid; gap: 6px; text-decoration: none; color: var(--txt); }
.nav-brand__mark { width: 30px; height: 30px; color: var(--txt); }
.nav-brand__word { font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
.nav-brand__tag { font-size: var(--fs-xs); color: var(--txt-3); line-height: 1.45; }

.siderail__pages { display: grid; gap: 1px; margin-top: var(--sp-2); }
.siderail__page {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px;
  border-radius: var(--r-sm); color: var(--txt-3); text-decoration: none; font-size: var(--fs-sm);
  transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.siderail__page svg { flex: none; opacity: 0.7; }
.siderail__page:hover { background: var(--surface-2); color: var(--txt); }
.siderail__page:hover svg { opacity: 1; }
.siderail__page[aria-current="page"] { color: var(--txt); font-weight: 650; }

/* drawer canvas: same accordion, roomier rows */
.drawer .navgrp--drawer > .navgrp__btn { min-height: 46px; font-size: var(--fs-md); font-weight: 700; }
.drawer .navgrp--drawer .navgrp__inner { padding-left: 6px; }
.drawer .navgrp--drawer + .navgrp--drawer { border-top: 1px solid var(--line); border-radius: 0; }
.drawer .nav-brand { margin: var(--sp-4) 0; }

/* ---------------------------------------------------------- A22: resting rail --- */
/* The closed desktop rail is ONE clean column of six tiles and nothing else:
   the five section glyphs in sidebar order, then the MovieState tile. Site pages,
   the pin and every open panel exist only in the expanded rail, so no clipped
   half-words ("Ab", "Co", "Ed po") can leak out of a 72px strip. */
@media (min-width: 1024px) {
  #railZone[data-open="false"] #siteRail { padding: 10px 12px; gap: 6px; overflow: hidden; }

  #railZone[data-open="false"] #siteRail .siderail__pages,
  #railZone[data-open="false"] #siteRail .railpin,
  #railZone[data-open="false"] #siteRail .navgrp__panel,
  #railZone[data-open="false"] #siteRail .siderail__label,
  #railZone[data-open="false"] #siteRail .navgrp__btn > span:not(.navrow__ico),
  #railZone[data-open="false"] #siteRail .navgrp__chev,
  #railZone[data-open="false"] #siteRail .nav-brand__word,
  #railZone[data-open="false"] #siteRail .nav-brand__tag { display: none !important; }

  #railZone[data-open="false"] #siteRail > .navgrp { width: 48px; margin: 0 auto; flex: 0 0 auto; }
  #railZone[data-open="false"] #siteRail .navgrp__btn {
    width: 48px; height: 48px; margin: 0; padding: 0; border: 0;
    display: grid; place-items: center; border-radius: 13px; background: transparent;
    color: color-mix(in oklab, var(--txt) 72%, transparent);
    transition: color 180ms var(--ease), background 180ms var(--ease);
  }
  #railZone[data-open="false"] #siteRail .navgrp__btn svg { width: 22px; height: 22px; }
  #railZone[data-open="false"] #siteRail .navgrp__btn:hover { color: var(--txt); background: var(--surface-2); }
  #railZone[data-open="false"] #siteRail .navgrp__btn[aria-expanded="true"] {
    color: var(--accent); background: color-mix(in oklab, var(--accent) 14%, transparent);
  }

  #railZone[data-open="false"] #siteRail .nav-brand {
    width: 48px; height: 48px; margin: 6px auto 0; padding: 0; border: 0;
    display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px;
    background: color-mix(in oklab, var(--accent) 12%, transparent);
  }
  #railZone[data-open="false"] #siteRail .nav-brand__link {
    width: 48px; height: 48px; margin: 0; padding: 0; display: grid; place-items: center;
  }
  #railZone[data-open="false"] #siteRail .nav-brand__mark { width: 24px; height: 24px; }

  /* the expanded rail lifts off the page instead of butting against it */
  #railZone[data-open="true"] #siteRail { box-shadow: 14px 0 44px rgba(0, 0, 0, 0.28); }
}


  /* ============================================ A38: the rail opens without a single flicker ===
     Measured defect: on hover the glyph jumped from x=25 to x=18 in one frame before the column
     had travelled, so the rail visibly twitched. The cure is geometric, not cosmetic: every rail
     row carries one fixed 40px icon slot centred on the same optical line in BOTH states, so the
     glyph's x never changes; only the column width and the labels move. */
  @media (min-width: 1024px) {
    .railzone { contain: layout paint; }
    .railzone .navrow__ico {
      display: grid; place-items: center; flex: none;
      width: 40px; height: 40px;
    }
    .railzone .navrow__ico svg { width: 22px; height: 22px; display: block; }
    .railzone .navrow__ico--sm { width: 40px; height: 32px; }
    .railzone .navrow__ico--sm svg { width: 20px; height: 20px; }

    /* open state: same 8px rail inset + same slot => glyph centre stays at x=36 */
    .railzone[data-open="true"] .siderail__link,
    .railzone[data-open="true"] .siderail__page,
    .railzone[data-open="true"] .navgrp__btn { padding-left: 8px; gap: 10px; }
    .railzone[data-open="true"] .nav-brand__link { padding-left: 6px; gap: 10px; }
    .railzone[data-open="true"] .railpin { padding-left: 6px; gap: 10px; }
    .railzone[data-open="true"] .navgrp__chev { margin-left: auto; }

    /* closed tile: the 48px tile now wraps the same 40px slot, so the glyph does not shift */
    .railzone[data-open="false"] .navgrp__btn { padding: 0; }
    .railzone[data-open="false"] .navgrp__btn .navrow__ico { width: 40px; height: 40px; }
    .railzone[data-open="false"] .nav-brand__link { padding: 0; }
    .railzone[data-open="false"] .railpin { padding: 0; }

    /* the surfaces morph instead of snapping: tile -> row is a background fade, not a flash */
    .railzone .navgrp__btn,
    .railzone .siderail__link,
    .railzone .railpin,
    .railzone .nav-brand__link {
      transition: background-color 220ms var(--ease), color 200ms var(--ease),
                  border-color 200ms var(--ease), border-radius 240ms var(--ease);
    }

    /* words arrive after the column has travelled, and they leave first on close */
    .railzone .siderail__label,
    .railzone .navgrp__btn > span:not(.navrow__ico),
    .railzone .nav-brand__word,
    .railzone .nav-brand__tag,
    .railzone .railpin__word,
    .railzone .siderail__page,
    .railzone .siderail__link,
    .railzone .navgrp__chev {
      transition: opacity 170ms var(--ease) 130ms;
    }
    .railzone[data-open="false"] .siderail__label,
    .railzone[data-open="false"] .navgrp__btn > span:not(.navrow__ico),
    .railzone[data-open="false"] .nav-brand__word,
    .railzone[data-open="false"] .nav-brand__tag,
    .railzone[data-open="false"] .railpin__word,
    .railzone[data-open="false"] .siderail__page { transition: opacity 90ms var(--ease) 0ms; }
  }


/* ==========================================================================
   Step 6.4b — navigation feel
   A tap must always be acknowledged in the next frame, and the arriving document
   must never snap into place. No prefetch: a tap costs nothing until it happens.
   ========================================================================== */
.navbar-progress {
  position: fixed;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  z-index: 4000;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  opacity: 0;
  pointer-events: none;
  transition: transform 320ms cubic-bezier(.22,.61,.36,1), opacity 160ms linear;
  box-shadow: 0 0 10px var(--accent);
}
.navbar-progress.is-on { opacity: 1; }
body { animation: ms-doc-in 180ms ease-out both; }
@keyframes ms-doc-in { from { opacity: .55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .navbar-progress { transition: none; }
  body { animation: none; }
}

/* 10.2a — the owner's tagline sits under the footer wordmark, quiet but readable in both themes */
.site-footer__tag { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--txt-2); max-width: 34ch; }

/* 10.2b — the owner's channels in the footer brand band, only when a link is set */
/* 10.2b — the chips and the owner's channels share one row, so the phone footer stays compact */
.site-footer__meta { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.site-footer__social { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.site-footer__socialLink {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--txt-2);
  transition: color .16s ease, border-color .16s ease, transform .16s ease;
}
.site-footer__socialLink:hover, .site-footer__socialLink:focus-visible {
  color: var(--accent-text); border-color: color-mix(in oklab, var(--accent) 55%, var(--line-2)); transform: translateY(-1px);
}
@media (max-width: 560px) { .site-footer__socialLink { width: 44px; height: 44px; } }

@media (max-width: 560px) {
  .site-footer__band { padding-bottom: 10px; }
  .site-footer__meta { gap: 6px 10px; }
  .site-footer__note { line-height: 1.45; }
  .site-footer__base > p:first-child { font-size: 12px; line-height: 1.4; }
  .site-footer__col > summary { min-height: 48px; }
  /* the base row becomes two lines instead of three: copyright + back-to-top, then the note */
  .site-footer__base { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px; }
  .site-footer__base > p:first-child { grid-column: 1; grid-row: 1; margin: 0; }
  .site-footer__base > .site-footer__top { grid-column: 2; grid-row: 1; margin: 0; }
  .site-footer__baseTail { grid-column: 1 / -1; grid-row: 2; margin: 0; }
}

/* Step 13.5 — live suggestions in the search sheet: the answer appears while typing (390 and 1440) */
.sb { border-bottom: 1px solid var(--line); background: var(--surface); max-height: min(58vh, 520px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sb__head { padding: 10px 16px 6px; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--txt-3); font-weight: 700; }
.sb__row { display: flex; align-items: center; gap: 12px; padding: 8px 16px; text-decoration: none; color: var(--txt); border-left: 3px solid transparent; transition: background .16s, border-color .16s, transform .16s; }
.sb__row:hover, .sb__row:focus-visible, .sb__row.is-on { background: var(--surface-2); border-left-color: var(--accent); transform: translateX(2px); }
.sb__row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sb__img { width: 40px; height: 60px; border-radius: 7px; object-fit: cover; flex: none; background: var(--surface-2); box-shadow: 0 3px 10px rgba(0,0,0,.25); }
.sb__img--plate { display: grid; place-items: center; font-size: 17px; font-weight: 800; color: var(--accent-text); background: radial-gradient(120% 90% at 30% 10%, var(--accent-soft), transparent 70%), var(--surface-2); }
.sb__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sb__title { font-size: 14px; font-weight: 650; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb__meta { font-size: 11.5px; color: var(--txt-3); font-variant-numeric: tabular-nums; }
.sb__go { margin-left: auto; color: var(--txt-3); font-size: 18px; }
.sb__all { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px 14px; font-size: 13px; font-weight: 700; color: var(--accent-text); text-decoration: none; border-top: 1px solid var(--line); }
.sb__all:hover, .sb__all:focus-visible { background: var(--surface-2); }
@media (max-width: 559px) { .sb__row { padding: 8px 14px; gap: 10px; } .sb__img { width: 36px; height: 54px; } .sb__title { font-size: 13.5px; } }

/* ---- server network: the sibling movie-server sites, shown only where a page asks for them ---- */
.ms-net[hidden]{display:none!important}
.ms-net{margin:18px 0}
.ms-net__title{font-size:1.05rem;font-weight:700;margin:0 0 6px}
.ms-net__lead{margin:0 0 10px;color:var(--muted,#9aa0a6);font-size:.92rem}
.ms-net__list{list-style:none;display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin:0;padding:0}
.ms-net__card{margin:0}
.ms-net__link{display:flex;flex-direction:column;gap:2px;padding:12px 14px;border:1px solid var(--line,rgba(255,255,255,.14));border-radius:12px;text-decoration:none;color:inherit;transition:border-color .2s ease,transform .2s ease}
.ms-net__link:hover,.ms-net__link:focus-visible{border-color:var(--accent,#8bd450);transform:translateY(-1px)}
.ms-net__name{font-weight:700;font-size:.95rem}
.ms-net__note{font-size:.82rem;color:var(--muted,#9aa0a6)}
.ms-net__theme{align-self:flex-start;margin-top:6px;font-size:.7rem;letter-spacing:.06em;text-transform:uppercase;padding:2px 8px;border-radius:999px;border:1px solid var(--line,rgba(255,255,255,.18))}
.ms-net__line{margin:0;font-size:.82rem;color:var(--muted,#9aa0a6)}
.ms-net__kicker{margin-right:6px;font-size:.7rem;letter-spacing:.08em;text-transform:uppercase;opacity:.75}
.ms-net--maintenance{margin-top:22px}
@media (max-width:520px){.ms-net__list{grid-template-columns:1fr 1fr}}

/* ---- /assets/pages/catalogue.css ---- */
/* Step 3.0 — catalogue landings. Same rhythm as the home feed: pills, head, grid, load more. */
.page-cat { padding-top: var(--sp-3); padding-bottom: var(--sp-6); display: grid; gap: var(--sp-4); }

.cat-head { display: grid; gap: 6px; margin-top: var(--sp-2); }
.cat-title {
  font-family: var(--font-display); font-size: clamp(1.5rem, 5vw, 2.1rem);
  font-weight: 750; letter-spacing: -0.026em; line-height: 1.12;
}
.cat-sub { color: var(--txt-2); font-size: var(--fs-sm); max-width: 60ch; }
.cat-count { color: var(--txt-3); font-size: var(--fs-xs); font-weight: 600; }

.pills--sub { margin-top: calc(var(--sp-2) * -1); }

/* person cards reuse the poster card rhythm but keep a portrait ratio */
.card--person .card__media--person { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: var(--card-radius); overflow: hidden; background: var(--img-plate); }
.card--person .card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card--person .card__img--fallback { display: grid; place-items: center; width: 100%; height: 100%; font-size: 28px; color: var(--txt-3); }

.feed-foot { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); padding: var(--sp-4) 0; }
.feed-foot { padding: var(--sp-5) 0 var(--sp-6); }
/* A23 — the paging control is a real button (components.css), never a ghost word */
.feed-foot .btn { min-width: 216px; min-height: 48px; }
.feed-foot .loadmore__note, .feed-status { font-size: var(--fs-xs); color: var(--txt-2); text-align: center; }

/* ---- trust / legal / search pages (A15 nav destinations) ---- */
.page-doc, .page-search { display: grid; gap: var(--sp-4); padding-top: var(--sp-3); padding-bottom: var(--sp-6); }
.doc-head { display: grid; gap: 8px; }
.doc-title { font-family: var(--font-display); font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 780; letter-spacing: -0.028em; line-height: 1.1; }
.doc-lead { color: var(--txt-2); font-size: var(--fs-md); max-width: 68ch; line-height: 1.6; }
.doc-sec { display: grid; gap: 8px; }
.doc-sec h2 { font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; letter-spacing: -0.01em; }
.doc-sec p { color: var(--txt-2); font-size: var(--fs-sm); line-height: 1.72; max-width: 72ch; }
.doc-sec ul { display: grid; gap: 6px; padding-left: 18px; color: var(--txt-2); font-size: var(--fs-sm); line-height: 1.65; }
.doc-sec li::marker { color: var(--accent); }
.doc-sec a { color: var(--txt); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.doc-sec--note { margin-top: var(--sp-3); padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }

.page-doc > *, .page-search > * { min-width: 0; }
.search-form__field { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.search-form__field input { flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--txt); font: inherit; font-size: var(--fs-md); }
.search-form__field input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 var(--ring-w) var(--accent-ring); }
.search-status { color: var(--txt-3); font-size: var(--fs-sm); min-height: 20px; }

.gift-steps { display: grid; gap: 10px; padding-left: 20px; color: var(--txt-2); font-size: var(--fs-sm); line-height: 1.7; max-width: 72ch; }
.gift-steps li::marker { color: var(--accent); font-weight: 700; }
.gift-note { margin-top: var(--sp-3); padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); display: grid; gap: 8px; }
.gift-note h2 { font-family: var(--font-display); font-size: 1.1rem; }
.gift-note p { color: var(--txt-2); font-size: var(--fs-sm); line-height: 1.7; max-width: 70ch; }

/* ============================== 5.1 — sort row + page strip (one shape on every list) */
.cat-sort { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 var(--sp-3); scrollbar-width: none; -ms-overflow-style: none; }
.cat-sort::-webkit-scrollbar { display: none; }
.cat-sort__opt {
  flex: 0 0 auto; display: inline-flex; align-items: center; height: 34px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface);
  color: var(--txt-2); font-size: 12.5px; font-weight: 650; text-decoration: none; white-space: nowrap;
  transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease);
}
.cat-sort__opt:hover, .cat-sort__opt:focus-visible { color: var(--txt); border-color: var(--accent); }
.cat-sort__opt[aria-current="true"] {
  background: var(--accent-solid); border-color: var(--accent-solid); color: var(--accent-ink); font-weight: 750;
}
.cat-pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding: var(--sp-4) 0 6px; flex-wrap: wrap; }
.cat-pager__nums { display: inline-flex; align-items: center; gap: 6px; }
/* A66 — one paging control, and it is a premium outline at rest (A24): transparent fill, 1px hairline in
   the theme accent, accent label. Hover/focus fills solid with the accent and lifts 1px with a soft glow. */
.cat-pager__step, .cat-pager__num {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 44px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--accent-soft);
  background: transparent; color: var(--accent-text);
  font-size: 13.5px; font-weight: 600; letter-spacing: .01em;
  text-decoration: none; white-space: nowrap;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.cat-pager__num { padding: 0 10px; min-width: 44px; font-variant-numeric: tabular-nums; }
.cat-pager__step:hover, .cat-pager__num:hover,
.cat-pager__step:focus-visible, .cat-pager__num:focus-visible {
  background: var(--accent-solid); color: var(--accent-ink); border-color: var(--accent-solid);
  transform: translateY(-1px); box-shadow: var(--shadow-sm), 0 6px 18px -8px var(--accent-solid); outline: none;
}
.cat-pager__num.is-current {
  background: var(--accent-solid); border-color: var(--accent-solid); color: var(--accent-ink);
  font-weight: 800; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-solid) 22%, transparent);
}
.cat-pager__step.is-off { opacity: .38; border-color: var(--line); color: var(--txt-3); }
@media (max-width: 560px) {
  .cat-pager { gap: 6px; }
  .cat-pager__nums { gap: 4px; }
  .cat-pager__step, .cat-pager__num { padding: 0 10px; min-width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .cat-pager__step, .cat-pager__num { transition: none; }
  .cat-pager__step:hover, .cat-pager__num:hover { transform: none; }
}
.cat-pager__gap { color: var(--txt-3); padding: 0 2px; }
.cat-pager__step.is-off { opacity: 0.42; pointer-events: none; border-color: transparent; }
@media (max-width: 599px) {
  .cat-pager { gap: 6px; }
  .cat-pager__step { padding: 0 10px; font-size: 12.5px; }
}

/* ============================== 5.2 — the list's own intro (never shared between pages) */
.cat-intro {
  max-width: 74ch; margin: 2px 0 var(--sp-4); padding: 15px 18px 16px;
  border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0;
  background: linear-gradient(100deg, var(--accent-soft, rgba(162,255,0,0.06)), transparent 62%);
}
.cat-intro p { margin: 0; font-size: 14.5px; line-height: 1.72; color: var(--txt-2); }
.cat-intro p + p { margin-top: 9px; color: var(--txt-3); }
.cat-intro p:first-child::first-letter { font-weight: 700; color: var(--txt); }
@media (max-width: 599px) { .cat-intro { padding: 13px 14px 14px; } .cat-intro p { font-size: 14px; line-height: 1.7; } }
/* ============================== 5.4 — search (§6.9) + A50 filters */
.sr-head { margin-bottom: var(--sp-3); }
.search-form { display: grid; gap: 12px; }
.sr-recent { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sr-recent[hidden] { display: none; }
.sr-recent__label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--txt-3); }
.sr-recent__chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); color: var(--txt-2); font-size: 13px; text-decoration: none; }
.sr-recent__chip:hover { color: var(--accent-ink); background: var(--accent-soft); }
.sr-recent__clear { min-height: 36px; padding: 0 10px; border: 0; background: none; color: var(--txt-3); font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---- filter bar ---- */
.sr-filters { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface, var(--surface-2)); }
.sr-types { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 1px; }
.sr-types::-webkit-scrollbar { display: none; }
.sr-type { position: relative; flex: none; }
.sr-type input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sr-type span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--txt-2); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: color .16s, border-color .16s, background .16s; }
.sr-type span:hover { border-color: var(--accent); color: var(--txt); }
.sr-type.is-on span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sr-type input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-filter-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
/* Step 13.6 — the filter block is static chrome, so its height is fixed rather than discovered: a late webfont swap
   must never push the results grid down under the reader's thumb (mobile CLS 0.037 → 0). */
@media (max-width: 559px) {
  .sr-types { height: 45px; }
  .sr-filter { height: 64px; }
  .sr-filter-row { height: 208px; }
  .sr-filters { height: 289px; overflow: visible; }
}
.sr-filter { display: grid; gap: 5px; min-width: 0; align-content: start; }
.sr-type, .sr-type span { white-space: nowrap; }
.sr-type { position: relative; display: inline-flex; align-items: center; min-height: 44px; }
.sr-type > input[type="radio"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sr-type > input[type="radio"]:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-filter__label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--txt-3); font-weight: 700;
  /* Step 13.6 — one line, fixed height: when the webfont swaps in, a label must never wrap and push the results down */
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 15px; line-height: 15px; }

/* ---- premium dropdown (upgrades the native select, both themes) ---- */
.sr-select--native { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); border: 0; }
.sr-dd { position: relative; min-width: 0; }
.sr-dd__native { display: none; }            /* step 6.4b: the server draws the premium control; JS-off shows this instead via <noscript> */
.sr-dd--ssr .sr-dd__panel { min-width: 100%; }
.sr-dd__btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--txt); font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; transition: border-color .16s, background .16s, color .16s, box-shadow .16s; }
.sr-dd__btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sr-dd__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-dd__btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sr-dd__btn.is-set { border-color: var(--accent); color: var(--txt); }
.sr-dd__val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-dd__chev { display: inline-flex; color: var(--txt-3); transition: transform .18s ease, color .18s; flex: none; }
.sr-dd__btn[aria-expanded="true"] .sr-dd__chev { transform: rotate(180deg); color: var(--accent-text, var(--accent)); }
.sr-dd__panel { position: absolute; z-index: 70; top: calc(100% + 6px); left: 0; right: 0; min-width: 200px; max-height: 292px; overflow-y: auto; overscroll-behavior: contain; padding: 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 18px 44px rgba(0, 0, 0, .38), 0 2px 8px rgba(0, 0, 0, .18); transform-origin: top center; animation: srDropIn .16s ease both; }
@keyframes srDropIn { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sr-dd__panel { animation: none; } }
.sr-dd__panel.is-up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom center; }
@keyframes srDropUpIn { from { opacity: 0; transform: translateY(4px) scale(.985); } to { opacity: 1; transform: none; } }
.sr-dd__panel.is-up { animation-name: srDropUpIn; }
.sr-dd__opt { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 9px; background: none; color: var(--txt-2); font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; }
.sr-dd__opt:hover { background: var(--surface-2); color: var(--txt); }
.sr-dd__opt:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; color: var(--txt); background: var(--surface-2); }
.sr-dd__opt.is-on { background: var(--accent-soft); color: var(--txt); }
.sr-dd__tick { display: inline-flex; width: 16px; flex: none; color: var(--accent-text, var(--accent)); opacity: 0; }
.sr-dd__opt.is-on .sr-dd__tick { opacity: 1; }
.sr-dd__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- active filter chips ---- */
.sr-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sr-active:empty { display: none; }
.sr-active__label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--txt-3); }
.sr-active__chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--txt); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.sr-active__chip:hover { background: var(--accent); color: var(--accent-ink); }
.sr-active__clear { min-height: 34px; display: inline-flex; align-items: center; padding: 0 6px; color: var(--accent-text, var(--accent)); font-size: 12.5px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---- results ---- */
.sr-results { display: grid; gap: var(--sp-4); margin-top: var(--sp-3); }
.sr-scanned { margin: 0; font-size: 12.5px; color: var(--txt-3); }
.sr-group__h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--txt-3); }
.sr-group__n { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--surface-2); color: var(--txt-2); font-size: 11px; text-align: center; letter-spacing: 0; }
.sr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sr-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 6px 10px; border-radius: 12px; text-decoration: none; color: var(--txt); border: 1px solid transparent; }
.sr-row:hover, .sr-row:focus-visible { background: var(--surface-2); border-color: var(--line); }
.sr-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sr-thumb { width: 46px; height: 69px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); }
.sr-thumb--round { height: 46px; border-radius: 50%; }
.sr-thumb--none { display: grid; place-items: center; font-weight: 800; color: var(--txt-3); font-size: 18px; }
.sr-row__body { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.sr-row__title { font-size: 14.5px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-row__meta { font-size: 12.5px; color: var(--txt-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-row__go { flex: none; color: var(--txt-3); font-size: 20px; line-height: 1; opacity: 0; transition: opacity .16s, transform .16s; }
.sr-row:hover .sr-row__go, .sr-row:focus-visible .sr-row__go { opacity: 1; transform: translateX(2px); color: var(--accent-text, var(--accent)); }

/* ---- zero + empty ---- */
.sr-zero { display: grid; gap: var(--sp-4); margin-top: var(--sp-4); }
.sr-zero__h { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--txt-2); }
.sr-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sr-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--txt-2); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.sr-chip:hover, .sr-chip:focus-visible { border-color: var(--accent); color: var(--txt); background: var(--accent-soft); }
.sr-chip--hub { border-style: dashed; }
.sr-empty__lead { margin: 0 0 6px; font-size: 15px; color: var(--txt); font-weight: 600; }
.sr-empty__hint { margin: 0; font-size: 14px; color: var(--txt-3); }
.sr-empty__act { margin: 12px 0 0; }
.sr-fail { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--txt-2); font-size: 13.5px; }

@media (min-width: 900px) {
  .sr-filters { grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 14px; padding: 14px 16px; }
  .sr-filter-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .sr-results { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: var(--sp-4) var(--sp-5); }
  .sr-results > [data-sr-group="people"] { grid-column: 1 / -1; }
  .sr-results > .sr-scanned, .sr-results > .sr-fail { grid-column: 1 / -1; }
  .sr-zero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-5); }
  .sr-row { min-height: 64px; }
  .sr-thumb { width: 48px; height: 72px; }
}
@media (max-width: 599px) {
  .sr-row { padding: 6px 4px; }
  .sr-row__title { font-size: 14px; }
  .sr-row__go { display: none; }
}

/* ---- Step 6.2 — Live TV hub and channel page ------------------------------------------------ */
.page-live { padding-bottom: 40px; }
.lv-head { margin-bottom: 10px; }
.lv-stat { color: var(--txt-2); font-size: 14px; line-height: 1.7; margin: 6px 0 12px; }
.lv-stat b { color: var(--txt); font-variant-numeric: tabular-nums; }
.lv-mode { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.lv-pills { margin: 6px 0 10px; }
.lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 10px; margin: 14px 0 8px; }
.lv-grid--tight { grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); }
.lv-card {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) 12px; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  text-decoration: none; color: inherit; min-height: 76px; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.lv-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.lv-card__logo { width: 56px; height: 56px; border-radius: 12px; background: var(--surface-2, var(--surface)); display: grid; place-items: center; overflow: hidden; }
.lv-card__logo img { width: 56px; height: 56px; object-fit: contain; }
.lv-card__initial { font-weight: 800; font-size: 20px; color: var(--accent); }
.lv-card__body { min-width: 0; display: block; }
.lv-card__name { display: block; font-weight: 700; font-size: 14.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-card__meta { display: block; color: var(--txt-2); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.lv-dot--up { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.16); }
.lv-dot--down { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.14); }
.lv-dot--unknown { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.14); }
.lv-empty { border: 1px dashed var(--line); border-radius: 16px; padding: 26px; margin: 18px 0; background: var(--surface); }
.lv-empty__text { color: var(--txt-2); font-size: 14.5px; line-height: 1.75; margin: 0; }
.lv-note h2 { font-size: 1.15em; }
.page-live--channel .crumbs { font-size: 12.5px; color: var(--txt-2); margin: 4px 0 10px; }
.page-live--channel .crumbs a { color: var(--txt-2); text-decoration: none; }
.page-live--channel .crumbs a:hover { color: var(--accent); }
.lv-head__state { color: var(--txt-2); font-size: 13px; margin-left: 4px; }
.lv-stage { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 18px; align-items: start; margin: 12px 0 24px; }
.lv-player { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; border: 1px solid var(--line); }
.lv-video { width: 100%; height: 100%; display: block; background: #000; }
.lv-player__veil { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: radial-gradient(circle at 50% 45%, rgba(0,0,0,.45), rgba(0,0,0,.78)); text-align: center; padding: 16px; }
.lv-play { width: 68px; height: 68px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink, #000); font-size: 24px; font-weight: 800; cursor: pointer; display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.lv-play:hover { transform: scale(1.04); }
.lv-player__hint { color: #e7e7e7; font-size: 13px; margin: 0; }
.lv-player__err { position: absolute; left: 12px; right: 12px; bottom: 12px; margin: 0; padding: 10px 14px; border-radius: 10px; background: rgba(239,68,68,.92); color: #fff; font-size: 13px; }
.lv-side { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 16px; }
.lv-side__h { font-size: 14px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--txt-2); margin: 0 0 10px; }
.lv-srcs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lv-src { display: grid; grid-template-columns: auto minmax(0, 1fr) 12px auto; align-items: center; gap: 8px; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.lv-src.is-playing { border-color: var(--accent); background: var(--accent-soft, transparent); }
.lv-src__q { font-weight: 700; }
.lv-src__host { color: var(--txt-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-side__empty, .lv-side__note { color: var(--txt-2); font-size: 12.5px; line-height: 1.65; margin: 10px 0 0; }
.lv-more { margin-top: 8px; }
.lv-more__h { font-size: 1.05em; margin: 18px 0 8px; }
@media (max-width: 900px) {
  .lv-stage { grid-template-columns: minmax(0, 1fr); }
  .lv-grid { grid-template-columns: minmax(0, 1fr); }
  .lv-card { min-height: 72px; padding: 10px 12px; grid-template-columns: 48px minmax(0, 1fr) 12px; gap: 10px; }
  .lv-card__logo, .lv-card__logo img { width: 48px; height: 48px; }
  .lv-play { width: 60px; height: 60px; }
}

/* Step 6.4 — the live hub filter bar: three compact dropdowns + Apply.
   Desktop: one row, caption above each field. Phone: fields stack, Apply is full width at 44px. */
.lv-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin: 14px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2, var(--surface));
}
.lv-filter { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lv-filter .sr-filter__label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--txt-2); font-weight: 700; }
.lv-filter .sr-dd { width: 100%; }
.lv-filter .sr-dd__btn { width: 100%; min-height: 44px; }
.lv-filters__go { display: flex; align-items: center; gap: 10px; }
.lv-apply { min-height: 44px; padding: 0 20px; white-space: nowrap; }
.lv-apply.is-dirty { box-shadow: 0 0 0 3px rgba(162, 255, 0, .18); }
.lv-clear { font-size: 13px; color: var(--txt-2); text-decoration: none; border-bottom: 1px solid transparent; }
.lv-clear:hover { color: var(--accent-text); border-bottom-color: var(--accent-soft); }
.lv-browse { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; margin: 26px 0 4px; font-size: 13px; }
.lv-browse__label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--txt-2); font-weight: 700; }
.lv-browse a { color: var(--txt-2); text-decoration: none; }
.lv-browse a:hover { color: var(--accent-text); }
@media (max-width: 720px) {
  .lv-filters { grid-template-columns: 1fr; gap: 10px; padding: 12px; }
  .lv-filters__go { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
  .lv-apply { width: 100%; }
}

/* A64 — the live hub when its own database is unavailable: a truthful notice, never a fake zero */
.lv-stat--down { color: var(--txt-3); }
.lv-empty--down { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 26px 22px; }
.lv-empty--down .lv-empty__title { margin: 0 0 8px; font-size: 1.15rem; font-weight: 700; color: var(--txt); }
.lv-empty--down .lv-empty__text { margin: 0; color: var(--txt-3); line-height: 1.7; }
.lv-empty--down a { color: var(--accent); font-weight: 600; }

/* A67 — the Live TV upgrade notice: one calm, premium panel in the brand system. */
.page-live--parked { display: grid; place-items: center; min-height: min(78vh, 640px); padding: clamp(28px, 6vw, 72px) 0; }
.lpk-panel {
  width: min(100%, 660px); text-align: center;
  background: radial-gradient(120% 130% at 50% 0%, var(--accent-soft), transparent 60%), var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: clamp(26px, 5vw, 46px) clamp(20px, 4vw, 40px);
  box-shadow: var(--shadow-md);
}
.lpk-glyph { display: inline-grid; place-items: center; width: 62px; height: 62px; border-radius: 18px;
  color: var(--accent-ink); background: var(--accent-solid); box-shadow: 0 10px 28px -10px var(--accent-solid); }
.lpk-glyph svg { width: 30px; height: 30px; }
.lpk-kicker { margin: 18px 0 6px; font: 600 12px/1 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); }
.lpk-title { margin: 0 0 12px; font: 800 clamp(26px, 4.4vw, 36px)/1.12 var(--font-display); color: var(--txt); letter-spacing: -.02em; }
.lpk-copy { margin: 0 auto 20px; max-width: 52ch; font-size: 15.5px; line-height: 1.75; color: var(--txt-2); }
.lpk-chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 22px; padding: 0; }
.lpk-chips li { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--txt-2); font-size: 12.5px; }
.lpk-chips b { color: var(--accent-text); font-weight: 700; }
.lpk-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
@media (max-width: 560px) { .lpk-chips li { font-size: 12px; padding: 7px 10px; } .lpk-actions .btn { flex: 1 1 44%; } }

/* ============================== Phase 8.4 — the trust pages as a designed product
   Devid's verdict: the 8.1 pages were "ekdom normal" — plain text columns with no theme expression.
   This is the rebuild: ambient hero light, a metric strip, an at-a-glance card row, icon-led sections,
   rule lists promoted to scanned card grids, a scroll-spy rail and a reading-progress bar. Same tokens
   as the rest of the site, so dark and bright both come free. */
.docx { display: block; position: relative; padding-top: var(--sp-3); }

/* reading progress: a 2px accent thread pinned under the header, driven by the page's own script */
.docx-progress {
  position: sticky; top: var(--hdr); z-index: 4; height: 2px; margin-bottom: -2px;
  background: var(--line); border-radius: 2px; overflow: hidden;
}
.docx-progress span {
  display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent-solid), var(--accent-text));
  transition: transform 120ms linear;
}

/* ---------- hero ---------- */
.docx-hero {
  position: relative; overflow: hidden; margin-top: var(--sp-2);
  padding: clamp(22px, 3.4vw, 40px) clamp(20px, 3.2vw, 40px) clamp(20px, 2.6vw, 30px);
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background:
    radial-gradient(120% 130% at 88% -20%, var(--accent-soft), transparent 58%),
    linear-gradient(170deg, var(--surface-2), var(--surface));
}
.docx-hero__glow {
  position: absolute; inset: -40% -10% auto auto; width: 62%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-ring), transparent 66%); opacity: .32;
  filter: blur(46px); pointer-events: none;
}
.docx-hero__grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(120% 90% at 20% 0%, #000 12%, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 90% at 20% 0%, #000 12%, transparent 72%);
}
.docx-hero__in { position: relative; display: grid; gap: 14px; }
.docx-kicker {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; width: max-content;
  padding: 6px 12px 6px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2);
  font: 700 11px/1 var(--font-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text);
}
.docx-kicker__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-solid); box-shadow: 0 0 0 3px var(--accent-soft); }
.docx-title {
  margin: 0; font-family: var(--font-display); font-weight: 800; letter-spacing: -.032em; line-height: 1.04;
  font-size: clamp(2rem, 5.6vw, 3rem); color: var(--txt); text-wrap: balance;
}
.docx-lead { margin: 0; max-width: 62ch; color: var(--txt-2); font-size: clamp(15px, 1.5vw, 17px); line-height: 1.68; }
.docx-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 0; padding: 0; }
.docx-chips li {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--txt-2); font-size: 12.5px; font-weight: 550;
}
.docx-chips li::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-solid); }

/* the metric strip answers "how long is this and when was it checked" before reading */
.docx-meta {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 6px 0 0;
  border-top: 1px solid var(--line); padding-top: 14px;
}
.docx-meta > div { display: grid; gap: 3px; padding-right: 14px; }
.docx-meta > div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.docx-meta dt { font: 700 10px/1 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--txt-3); }
.docx-meta dd { margin: 0; color: var(--txt); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- at a glance ---------- */
.docx-glance {
  list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  margin: var(--sp-4) 0 0; padding: 0;
}
.docx-gc {
  display: grid; gap: 6px; padding: 16px 16px 18px; border-radius: var(--r-md);
  border: 1px solid var(--line-2); background: var(--surface-2);
  transition: border-color var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease);
}
.docx-gc:hover { border-color: var(--accent); transform: translateY(-2px); }
.docx-gc__i {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 2px;
}
.docx-gc__t { color: var(--txt); font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.32; }
.docx-gc__d { color: var(--txt-2); font-size: 13px; line-height: 1.6; }

/* ---------- phone jump list / desktop rail ---------- */
.docx-jump { margin: var(--sp-4) 0 0; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--surface-2); overflow: hidden; }
.docx-jump > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 54px; padding: 0 16px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 650; color: var(--txt);
}
.docx-jump > summary::-webkit-details-marker { display: none; }
.docx-jump > summary::after {
  content: ''; width: 8px; height: 8px; border-right: 2px solid var(--txt-2); border-bottom: 2px solid var(--txt-2);
  transform: rotate(45deg); transition: transform var(--dur-hover) var(--ease);
}
.docx-jump[open] > summary::after { transform: rotate(225deg); }
.docx-jump__c { color: var(--txt-3); font-size: 12px; font-weight: 500; margin-left: auto; margin-right: 4px; }
.docx-jump__list { margin: 0; padding: 2px 14px 14px; display: grid; gap: 2px; list-style: none; }
.docx-jump__list a { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--txt-2); font-size: 14px; }
.docx-jump__list a[aria-current="true"] { color: var(--accent-text); font-weight: 650; }

.docx-grid { display: grid; gap: var(--sp-4); padding-top: var(--sp-4); }
.docx-body { display: grid; gap: 0; min-width: 0; }

/* ---------- sections ---------- */
.docx-sec { padding: 24px 0; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--hdr) + 24px); }
.docx-sec:first-child { padding-top: 4px; }
.docx-sec h2 {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px;
  font-family: var(--font-display); font-size: clamp(1.06rem, 1.9vw, 1.26rem); font-weight: 750;
  letter-spacing: -.015em; line-height: 1.32; color: var(--txt);
}
.docx-ico {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--line-2);
}
.docx-num {
  flex: 0 0 auto; font: 700 11px/1 var(--font-ui); letter-spacing: .1em; color: var(--accent-text);
  padding: 4px 0 0; align-self: flex-start;
}
.docx-prose { display: grid; gap: 12px; max-width: 72ch; padding-left: 44px; }
.docx-prose p { margin: 0; color: var(--txt-2); font-size: 15.5px; line-height: 1.78; }
.docx-prose strong { color: var(--txt); font-weight: 700; }
.docx-prose em { color: var(--txt); font-style: normal; font-weight: 600; }
.docx-prose a { color: var(--txt); text-decoration: underline; text-decoration-color: var(--accent-solid); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.docx-prose a:hover { color: var(--accent-text); }
.docx-prose > ul:not(.docx-cards) { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.docx-prose > ul:not(.docx-cards) li { position: relative; padding-left: 22px; color: var(--txt-2); font-size: 15.5px; line-height: 1.7; }
.docx-prose > ul:not(.docx-cards) li::before {
  content: ''; position: absolute; left: 4px; top: .62em; width: 7px; height: 7px; border-radius: 2px;
  background: var(--accent-solid); transform: rotate(45deg);
}

/* rule lists become a grid of cards: scanned, not waded through */
.docx-cards { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; }
.docx-card {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-areas: "i t" "i d"; gap: 2px 10px;
  align-content: start; padding: 14px 14px 15px; border-radius: var(--r-md);
  border: 1px solid var(--line-2); background: var(--surface-2);
  transition: border-color var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease);
}
.docx-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, .22); }
.docx-card__i {
  grid-area: i; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent-text);
}
.docx-card__t { grid-area: t; color: var(--txt); font-size: 13.8px; font-weight: 700; line-height: 1.36; }
.docx-card__d { grid-area: d; color: var(--txt-2); font-size: 13px; line-height: 1.62; }
.docx-card:not(:has(.docx-card__t)) { grid-template-areas: "i d"; }
.docx-card:not(:has(.docx-card__t)) .docx-card__d { color: var(--txt-2); font-size: 13.4px; }

/* ---------- callouts ---------- */
.docx-callout {
  display: grid; gap: 5px; margin: 16px 0 0; padding: 14px 16px; border-radius: var(--r-md);
  border: 1px solid var(--line-2); border-left: 3px solid var(--accent-solid);
  background: linear-gradient(100deg, var(--accent-soft), transparent 62%), var(--surface-2);
  color: var(--txt-2); font-size: 14.5px; line-height: 1.7;
}
.docx-callout--warn { border-left-color: var(--warn, #FF2D46); }
.docx-callout__k {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent-text); font: 700 11px/1 var(--font-ui); letter-spacing: .13em; text-transform: uppercase;
}

/* ---------- closing panels ---------- */
.docx-foot {
  margin-top: var(--sp-4); padding: 18px 20px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--accent-soft), transparent 68%), var(--surface-2);
  border: 1px solid var(--line-2);
}
.docx-foot p { margin: 0; color: var(--txt-2); font-size: 14.5px; line-height: 1.7; }
.docx-foot a { color: var(--txt); text-decoration: underline; text-decoration-color: var(--accent-solid); text-underline-offset: 3px; }

.docx-rel { display: grid; gap: 10px; margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.docx-rel__h { margin: 0; font: 700 11px/1 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--txt-3); }
.docx-rel__list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; }
.docx-rel__list a {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 13px; border-radius: var(--r-md);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--txt-2);
  font-size: 13.5px; font-weight: 600; text-decoration: none;
  transition: color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease);
}
.docx-rel__i { color: var(--accent-text); display: inline-flex; }
.docx-rel__list a:hover, .docx-rel__list a:focus-visible {
  color: var(--txt); border-color: var(--accent); background: var(--surface); transform: translateX(2px);
}

/* ---------- desktop rail ---------- */
@media (min-width: 900px) {
  .docx-grid { grid-template-columns: minmax(0, 1fr) 268px; gap: clamp(32px, 4vw, 52px); }
  .docx-jump { display: none; }
  .docx-toc {
    align-self: start; position: sticky; top: calc(var(--hdr) + 20px);
    display: grid; gap: 12px; padding: 16px 0 16px 18px; border-left: 1px solid var(--line);
  }
  .docx-toc__h { margin: 0; font: 700 11px/1 var(--font-ui); letter-spacing: .15em; text-transform: uppercase; color: var(--txt-3); }
  .docx-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
  .docx-toc a {
    position: relative; display: flex; gap: 9px; padding: 7px 8px 7px 10px; margin-left: -19px;
    border-left: 2px solid transparent; text-decoration: none; color: var(--txt-2);
    font-size: 12.8px; line-height: 1.4;
    transition: color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
  }
  .docx-toc a:hover, .docx-toc a:focus-visible { color: var(--txt); background: var(--surface-2); }
  .docx-toc a[aria-current="true"] {
    color: var(--accent-text); border-left-color: var(--accent-solid); font-weight: 650;
    background: linear-gradient(90deg, var(--accent-soft), transparent 88%);
  }
  .docx-toc__n { color: var(--accent-text); font-weight: 700; font-size: 11px; letter-spacing: .06em; padding-top: 2px; font-variant-numeric: tabular-nums; }
  .docx-toc__foot {
    display: flex; align-items: center; gap: 7px; margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--line);
    color: var(--txt-3); font-size: 11px;
  }
  .docx-toc__foot svg { color: var(--accent-text); flex: 0 0 auto; }
}
@media (max-width: 899px) {
  .docx-toc { display: none; }
  .docx-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .docx-glance { grid-template-columns: 1fr; }
  .docx-gc { grid-template-columns: 38px minmax(0, 1fr); grid-template-areas: "i t" "i d"; align-items: center; padding: 14px; }
  .docx-gc__i { grid-area: i; margin: 0; }
  .docx-gc__t { grid-area: t; }
  .docx-gc__d { grid-area: d; }
  .docx-cards { grid-template-columns: 1fr; }
  .docx-rel__list { grid-template-columns: 1fr; }
  .docx-prose { padding-left: 0; }
  .docx-sec h2 { font-size: 1.04rem; }
  .docx-meta > div { padding-right: 10px; }
  .docx-meta > div + div { padding-left: 10px; }
  .docx-meta dd { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .docx-progress span, .docx-jump > summary::after, .docx-toc a, .docx-gc, .docx-card, .docx-rel__list a { transition: none; }
}

/* 8.5 — content that explains itself: weights, tables, flows, refusals, cards */
.docx-signals { margin: 4px 0 0; }
.docx-signals ul { list-style: none; display: grid; gap: 14px; margin: 0; padding: 0; }
.docx-signals li { display: grid; gap: 6px; }
.docx-sig__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.docx-sig__l { color: var(--txt); font-size: 13.6px; font-weight: 700; letter-spacing: -.005em; }
.docx-sig__w { color: var(--accent-text); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.docx-sig__bar { display: block; height: 7px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-2); overflow: hidden; }
.docx-sig__bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-solid), var(--accent-text)); }
.docx-sig__why { color: var(--txt-3); font-size: 12.4px; line-height: 1.5; }
.docx-signals figcaption { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--txt-3); font-size: 11.5px; line-height: 1.5; }

.docx-table { border: 1px solid var(--line-2); border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.docx-tr { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 14px; padding: 12px 14px; }
.docx-tr + .docx-tr { border-top: 1px solid var(--line); }
.docx-tr--head { background: var(--surface); }
.docx-tr--head span { color: var(--accent-text); font: 700 11px/1.4 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; }
.docx-tr span[role="cell"] { color: var(--txt-2); font-size: 13.4px; line-height: 1.55; }
.docx-td--k { color: var(--txt) !important; font-weight: 650; }

.docx-flow { list-style: none; display: grid; gap: 0; margin: 0; padding: 0; }
.docx-flow li { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; padding: 0 0 16px; }
.docx-flow li:last-child { padding-bottom: 0; }
.docx-flow li::before {
  content: ''; position: absolute; left: 13px; top: 26px; bottom: 2px; width: 1px;
  background: linear-gradient(var(--accent-ring), var(--line));
}
.docx-flow li:last-child::before { display: none; }
.docx-flow__n {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); border: 1px solid var(--accent-ring); color: var(--accent-text);
  font: 700 11.5px/1 var(--font-ui); font-variant-numeric: tabular-nums;
}
.docx-flow__t { color: var(--txt-2); font-size: 14px; line-height: 1.6; padding-top: 3px; }

.docx-checkgrid { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; }
.docx-checkgrid li {
  display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 12px 13px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--txt-2); font-size: 13.2px; line-height: 1.5;
}
.docx-cg__i {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent-text);
}

/* FAQ answers are cards, not loose paragraphs */
.docx-qa {
  padding: 16px 18px 17px; border-radius: var(--r-md); border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent-solid); background: var(--surface-2);
}
.docx-qa p { margin: 0; color: var(--txt-2); font-size: 15px; line-height: 1.75; }
.docx-qa p + p { margin-top: 8px; }

@media (max-width: 720px) {
  .docx-tr { grid-template-columns: 1fr; gap: 4px; }
  .docx-checkgrid { grid-template-columns: 1fr; }
  .docx-qa { padding: 14px 15px; }
}

/* ---------- A71: the gift-card page is a designed page, not a text wall ---------- */
.gift-hero {
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: 20px; border: 1px solid var(--line);
  background: linear-gradient(158deg, var(--surface-2), var(--surface) 64%);
  padding: 26px 22px; margin: var(--sp-3) 0 var(--sp-4);
}
.gift-hero__bloom {
  position: absolute; left: -8%; top: -60%; width: 70%; height: 320px; z-index: -1; pointer-events: none;
  background: radial-gradient(58% 58% at 34% 46%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 72%);
}
.gift-kicker { margin: 0 0 8px; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); }
.gift-title { margin: 0 0 12px; font-size: clamp(26px, 4.4vw, 42px); line-height: 1.08; letter-spacing: -0.025em; max-width: 22ch; }
.gift-lead { margin: 0 0 16px; font-size: 15px; line-height: 1.7; color: var(--txt-2); max-width: 62ch; }
.gift-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.gift-chips li { padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--txt-2); background: var(--surface-2); border: 1px solid var(--line); }
.gift-flow, .gift-rules { margin: 0 0 var(--sp-4); }
.gift-steps { display: grid; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; counter-reset: gs; }
.gift-steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.gift-steps__n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; background: color-mix(in oklab, var(--accent) 16%, var(--surface)); color: var(--accent-text); font-weight: 800; font-size: 14px; border: 1px solid color-mix(in oklab, var(--accent) 34%, var(--line)); }
.gift-steps b { display: block; margin-bottom: 3px; font-size: 14.5px; }
.gift-steps div { font-size: 13.5px; line-height: 1.65; color: var(--txt-2); }
.gift-grid { display: grid; gap: 12px; margin-top: 12px; }
.gift-rule { padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.gift-rule h3 { margin: 0 0 6px; font-size: 15px; }
.gift-rule p { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--txt-2); }
.gift-note { padding: 18px; border-radius: 16px; background: linear-gradient(160deg, color-mix(in oklab, var(--accent) 9%, var(--surface)), var(--surface)); border: 1px solid color-mix(in oklab, var(--accent) 24%, var(--line)); }
.gift-note h2 { margin: 0 0 8px; font-size: 17px; }
.gift-note p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--txt-2); }
@media (min-width: 760px) {
  .gift-hero { padding: 34px 30px; }
  .gift-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gift-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================================
   Step 13.4 — search results as a premium poster grid (390 and 1440)
   A movie site is read with the eyes first: the answer to "Alp" must look like
   the catalogue, not like a settings list. Two columns on a phone, five on a
   desktop, one link per card covering poster + title.
   ========================================================================== */
.sr-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .sr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; } }
@media (min-width: 900px) { .sr-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .sr-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px 18px; } }

.sr-cell { min-width: 0; }
.sr-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--txt); border-radius: 14px; padding: 0; transition: transform .22s cubic-bezier(.2,.7,.2,1), box-shadow .22s; }
.sr-card__media { position: relative; display: block; width: 100%; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.22); }
.sr-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sr-card__img--round, .sr-card__plate--round { aspect-ratio: 1 / 1; border-radius: 50%; }
.sr-card__plate { display: grid; place-items: center; width: 100%; height: 100%; font-size: 2.1em; font-weight: 800; color: var(--accent-text); background: radial-gradient(120% 90% at 30% 10%, var(--accent-soft), transparent 70%), var(--surface-2); letter-spacing: .02em; }
.sr-card__title { font-size: 13.5px; font-weight: 650; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-card__meta { font-size: 11.5px; color: var(--txt-2); font-variant-numeric: tabular-nums; }
.sr-card:hover .sr-card__media, .sr-card:focus-visible .sr-card__media { border-color: var(--accent-line, var(--accent)); }
.sr-card:hover { transform: translateY(-3px); }
.sr-card:hover .sr-card__media { box-shadow: 0 12px 26px rgba(0,0,0,.34), 0 0 0 1px var(--accent-soft); }
.sr-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 14px; }

.sr-count { margin: 0 0 12px; font-size: 12.5px; color: var(--txt-2); font-variant-numeric: tabular-nums; }
.sr-count b { color: var(--txt); font-weight: 700; }
.sr-more { display: flex; justify-content: center; margin: 22px 0 6px; }
.sr-more__btn { font: inherit; font-size: 13.5px; font-weight: 650; color: var(--accent-text); background: transparent; border: 1px solid var(--accent-line, var(--accent)); border-radius: 12px; padding: 11px 22px; min-height: 44px; cursor: pointer; transition: background .2s, color .2s, transform .2s, box-shadow .2s; }
.sr-more__btn:hover, .sr-more__btn:focus-visible { background: var(--accent-solid); color: var(--accent-ink); transform: translateY(-1px); box-shadow: 0 8px 20px var(--accent-soft); }
@media (max-width: 559px) { .sr-grid { gap: 12px 10px; } .sr-card__title { font-size: 13px; } }

/* Step 13.6 — Core Web Vitals: no card ever changes height, so nothing shifts under the reader's thumb */
.sr-card__title { min-height: 2.7em; }
.sr-card__meta { min-height: 1.4em; }
.search-status, .sr-count { min-height: 18px; }
/* the A–Z directory is 2,400 links: let the browser lay out only the years on screen */
.brw-sec { content-visibility: auto; contain-intrinsic-size: auto 1200px; }

/* Step 14.1 — the contact channel is a real form now, so it has to look like the rest of the site: 44px targets, one
   column on a phone, two on a desk, hairline fields that lift on focus, and a status line that never jumps. */
.cx-wrap { margin: 18px 0 6px; }
.cx { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.cx-row { display: grid; gap: 14px; }
@media (min-width: 720px) { .cx-row { grid-template-columns: 1fr 1fr; } }
.cx-field { display: grid; gap: 7px; }
.cx-label { font-size: 12.5px; font-weight: 650; letter-spacing: .02em; text-transform: uppercase; color: var(--txt-2); }
.cx-opt { font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; opacity: .75; }
.cx-input {
  width: 100%; min-height: 46px; padding: 12px 14px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--txt);
  font: inherit; font-size: 15px; line-height: 1.5; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.cx-input::placeholder { color: var(--txt-2); opacity: .8; }
.cx-input:hover { border-color: var(--line-strong, var(--line)); }
.cx-input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.cx-area { min-height: 150px; resize: vertical; }
.cx-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cx-note { margin: 0; font-size: 13px; line-height: 1.6; color: var(--txt-2); }
.cx-act { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cx-status { font-size: 13.5px; font-weight: 600; }
.cx-status--ok { color: var(--txt-2); }
.cx-status--bad { color: var(--danger); }
.cx-done { margin: 0; padding: 16px 18px; border-radius: 12px; background: var(--accent-soft); color: var(--txt); font-size: 14.5px; line-height: 1.65; }
.cx-done strong { color: var(--accent-text); }
@media (prefers-reduced-motion: reduce) { .cx-input { transition: none; } }
