/* ui/public/style.css — Moorfold: the local production panel and the public demo share this sheet.
   Fonts are the project's own OFL files (assets/fonts, served from fonts/), with system fonts behind them; no CDN, no remote file.
   Light and dark follow the OS setting. Colours: ground #EEF0EC, ink #1B2430, blue #2B4BE0, warning #9A4514 on #F3E4D8. */
@font-face { font-family: "Instrument Sans"; src: url("../fonts/InstrumentSans-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/InstrumentSans-Bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Spectral"; src: url("../fonts/Spectral-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Spectral"; src: url("../fonts/Spectral-SemiBold.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/IBMPlexMono-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --bg: #EEF0EC; --bg-raised: #F7F8F5; --bg-sunk: #E4E8E1; --ink: #1B2430; --ink-2: #4A5563; --ink-3: #5C6470;
  --line: #D3D8D0; --line-strong: #1B2430;
  --blue: #2B4BE0; --blue-hover: #2340C4; --blue-soft: #E1E6FA; --on-blue: #FFFFFF;
  --warn: #9A4514; --warn-bg: #F3E4D8; --hatch: rgba(154, 69, 20, 0.14); --on-warn: #FFFFFF;
  --ok: #2B4BE0;
  /* the dark stage: the film's own ground, the same in both themes */
  --stage: #11161C; --stage-2: #1A2129; --stage-line: #2A333D; --on-stage: #E9ECE6; --on-stage-2: #A9B2BC; --amber: #F2A93B;
  /* the scene strip sits on the stage: its marks are the dark-surface set (validated against #0F1419) */
  --m-cleared: #8FA3FF; --m-pending: #5B6672; --m-uncertain: #D2783F; --m-unknown: #E7EAE4; --m-blocked: #E7EAE4;
  --shadow: 0 1px 2px rgba(17, 22, 28, 0.06), 0 8px 24px rgba(17, 22, 28, 0.08);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 12px; --radius-sm: 8px;
  --font-head: "Instrument Sans", "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Spectral", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, Cambria, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  --header-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1419; --bg-raised: #161C23; --bg-sunk: #0B0F13; --ink: #E7EAE4; --ink-2: #A9B2BC; --ink-3: #8E98A3;
    --line: #27313B; --line-strong: #E7EAE4;
    --blue: #8FA3FF; --blue-hover: #A9B8FF; --blue-soft: #1C2547; --on-blue: #0F1419;
    --warn: #F2A272; --warn-bg: #3A2416; --hatch: rgba(242, 162, 114, 0.12); --on-warn: #12171D;
    --stage: #0A0E12; --stage-2: #141A21; --stage-line: #252E38;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 18px/1.6 var(--font-body); font-variant-numeric: lining-nums; -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; }
a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { color: var(--blue-hover); }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--ring, var(--blue)); outline-offset: 2px; border-radius: 4px; }
/* on the dark stage surfaces the light theme's blue ring is too faint (under 3:1): a light ring there */
.hero, .player, .board, .film, .site-footer { --ring: #8FA3FF; }
#main h1:focus { outline: none; }   /* focus lands on the heading after a screen change; the heading itself is the cue */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -64px; z-index: 50; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-sm); font: 600 15px/1.2 var(--font-head); text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 760px) { .wrap { padding: 0 32px; } }
code, .mono { font-family: var(--font-mono); font-size: 0.82em; }
.icon { width: 1em; height: 1em; flex: none; vertical-align: -0.14em; }

/* ---- site header ------------------------------------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 86%, transparent); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); }
@supports not (background: color-mix(in srgb, red, blue)) { .site-header { background: var(--bg); } }
.header-in { display: flex; align-items: center; gap: 28px; min-height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.logo:hover { color: var(--ink); }
.logo-mark { width: 30px; height: 30px; }
.lm-bg { fill: var(--ink); }
.lm-m { fill: none; stroke: var(--bg); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.lm-dot { fill: #5B7CFF; }
.logo-word { font: 700 19px/1 var(--font-head); letter-spacing: -0.01em; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.nav a { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; font: 600 15px/1 var(--font-head); color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--bg-sunk); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line); }
.header-side { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; font: 600 13px/1 var(--font-head); color: var(--ink-2); background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 25%, transparent); }
@media (max-width: 860px) {
  .header-in { flex-wrap: wrap; gap: 6px 16px; padding-top: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  :root { --header-h: 108px; }
}
@media (max-width: 560px) {
  /* a phone: the header scrolls away with the page instead of covering a third of the screen */
  .site-header { position: relative; }
  html { scroll-padding-top: 16px; }
  .header-in { min-height: 0; padding-top: 12px; gap: 8px 16px; }
  .nav { padding-bottom: 10px; }
  .nav ul { gap: 0; }
  .nav a { height: 34px; padding: 0 10px; font-size: 14.5px; }
  .nav-home { margin-left: auto; }
}
.nav-home a { color: var(--ink-3); }

/* ---- buttons -------------------------------------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px; border: 0;
  font: 600 16px/1 var(--font-head); text-decoration: none; cursor: pointer; transition: background-color .15s ease, color .15s ease, transform .15s ease; }
.btn-primary { background: var(--blue); color: var(--on-blue); }
.btn-primary:hover { background: var(--blue-hover); color: var(--on-blue); }
.btn-ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn-ghost:hover { background: rgba(127, 127, 127, 0.12); color: inherit; }
.btn:active { transform: translateY(1px); }
.btn-small { height: 34px; padding: 0 14px; font-size: 14px; }
.btn .icon { width: 18px; height: 18px; }

/* ---- hero: the dark stage --------------------------------------------------------------------------------------------- */
.hero { background: radial-gradient(1200px 500px at 85% 0%, #1D2A44 0%, transparent 60%), var(--stage); color: var(--on-stage); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 72px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 700 13px/1.2 var(--font-head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); }
.hero .eyebrow { color: var(--amber); }
.hero h1 { margin: 0 0 20px; font: 700 clamp(38px, 4.6vw, 60px)/1.04 var(--font-head); letter-spacing: -0.025em; color: #FFFFFF; }
.hero .lead { margin: 0 0 30px; font-size: 20px; line-height: 1.6; color: var(--on-stage-2); max-width: 38em; }
.hero .btn-ghost { color: var(--on-stage); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.hero-meta { margin: 0; font: 500 14px/1.5 var(--font-head); color: var(--on-stage-2); }
.hero-meta .sep { opacity: .5; margin: 0 8px; }
.hero-note { margin: 0 0 26px; padding: 12px 16px; border-left: 3px solid var(--amber); background: rgba(255, 255, 255, 0.04); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 16.5px; color: var(--on-stage-2); }
.hero-note b { font: 700 12px/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--on-stage); margin-right: 8px; }
@media (max-width: 960px) { .hero-in { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; padding-bottom: 56px; } }

/* the player: a framed screen, a rail of the six excerpts below it */
.player { background: var(--stage-2); border-radius: 16px; padding: 10px; box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--stage-line); }
.player video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 10px; background: #000; }
.player video:focus-within, .lb-in video:focus-within { outline: 3px solid var(--ring, var(--blue)); outline-offset: 2px; }   /* the browser's own controls take the focus inside the video */
.player-bar { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 12px 6px 4px; }
.player-title { margin: 0; font: 700 15px/1.3 var(--font-head); color: var(--on-stage); }
.player-sub { margin: 0; font: 500 13px/1.4 var(--font-head); color: var(--on-stage-2); text-align: right; }
.rail { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding: 10px 2px 2px; }
.rail-item { position: relative; display: block; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: #000; cursor: pointer; box-shadow: inset 0 0 0 1px var(--stage-line); }
.rail-item img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; opacity: .62; transition: opacity .15s ease; }
.rail-item:hover img, .rail-item[aria-pressed="true"] img { opacity: 1; }
.rail-item[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--amber); }
.rail-label { position: absolute; left: 6px; bottom: 4px; font: 700 11px/1 var(--font-head); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.8); letter-spacing: .04em; }
@media (max-width: 560px) { .rail { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.player-clip { margin: 2px 6px 0; font: 500 14px/1.45 var(--font-head); color: var(--on-stage-2); min-height: 1.45em; }
.player-foot { margin: 12px 6px 4px; font: 500 12.5px/1.5 var(--font-head); color: var(--on-stage-2); opacity: .85; }
/* the panel's hero board (no clips there): the scene strip and the gate in numbers */
.board { background: var(--stage-2); border-radius: 16px; padding: 22px; box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--stage-line); }
.board h2 { margin: 0 0 14px; font: 700 13px/1.2 var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--on-stage-2); }
.board .legend { margin-top: 18px; gap: 10px 20px; }
.board .legend li { color: var(--on-stage); font-size: 14px; }
.board .legend .n { color: var(--on-stage-2); }
.board-sig { margin: 16px 0 0; font: 700 14px/1.4 var(--font-head); color: var(--amber); }

/* ---- metrics band ----------------------------------------------------------------------------------------------------- */
.metrics { background: var(--bg-raised); border-bottom: 1px solid var(--line); }
.metrics-in { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metrics-head { padding-top: 34px; }
.metrics-head .eyebrow { margin-bottom: 8px; }
.metrics-head h2 { margin: 0 0 10px; font: 700 clamp(22px, 2.4vw, 28px)/1.2 var(--font-head); letter-spacing: -0.01em; }
.metrics-head .ep-note { margin: 0; max-width: 860px; font-size: 17px; color: var(--ink-2); font-style: italic; }
.metrics-head .ep-note b { font: 700 12px/1 var(--font-head); font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-right: 6px; }
.metric { padding: 30px 22px 28px; border-left: 1px solid var(--line); }
.metric:first-child { border-left: 0; padding-left: 0; }
.metric-value { display: block; font: 700 clamp(30px, 3.4vw, 44px)/1 var(--font-head); letter-spacing: -0.02em; font-variant-numeric: tabular-nums lining-nums; color: var(--ink); }
.metric-label { display: block; margin-top: 10px; font: 600 15px/1.35 var(--font-head); color: var(--ink); }
.metric-note { display: block; margin-top: 4px; font-size: 14.5px; line-height: 1.45; color: var(--ink-3); }
.metric.is-warn .metric-value { color: var(--warn); }
@media (max-width: 960px) {
  .metrics-in { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric, .metric:first-child { border-left: 0; padding: 22px 0; border-top: 1px solid var(--line); }
  .metric:nth-child(-n+2) { border-top: 0; }
  .metric:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line); }
}

/* ---- sections ----------------------------------------------------------------------------------------------------------- */
.band { padding: 80px 0; }
.band + .band { border-top: 1px solid var(--line); }
.band-raised { background: var(--bg-raised); }
.sec-head { max-width: 760px; margin-bottom: 36px; }
.sec-head h2 { margin: 0 0 12px; font: 700 clamp(26px, 3vw, 36px)/1.12 var(--font-head); letter-spacing: -0.02em; }
.sec-head p { margin: 0; font-size: 18.5px; color: var(--ink-2); }
@media (max-width: 560px) { .band { padding: 56px 0; } body { font-size: 17px; } }

/* the engine, step by step */
.pipeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; counter-reset: step; }
.step { position: relative; padding: 0 22px 0 0; }
.step::before { content: ""; position: absolute; top: 22px; left: 44px; right: 0; height: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step-num { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 2px var(--ink); font: 700 16px/1 var(--font-head); }
.step h3 { margin: 18px 0 8px; font: 700 18px/1.25 var(--font-head); }
.step p { margin: 0 0 14px; font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.state { display: inline-flex; align-items: flex-start; gap: 8px; font: 600 14px/1.4 var(--font-head); color: var(--ink); }
.state .sdot { width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; flex: none; background: var(--ink-3); }
.state.is-open .sdot { background: var(--warn); }
.state.is-done .sdot { background: var(--blue); }
.state.is-blocked .sdot { background: transparent; box-shadow: inset 0 0 0 2px var(--warn); }
@media (max-width: 960px) {
  .pipeline { grid-template-columns: 1fr; gap: 26px; }
  .step { padding: 0 0 0 64px; }
  .step-num { position: absolute; left: 0; top: 0; }
  .step::before { top: 44px; bottom: -26px; left: 21px; right: auto; width: 2px; height: auto; }
  .step h3 { margin-top: 8px; }
}

/* the scene strip: a length of film, one frame per scene */
.film { position: relative; background: var(--stage); border-radius: 14px; padding: 22px 18px; box-shadow: inset 0 0 0 1px var(--stage-line); }
.film::before, .film::after { content: ""; position: absolute; left: 18px; right: 18px; height: 6px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 8px, transparent 8px 18px); border-radius: 2px; }
.film::before { top: 8px; } .film::after { bottom: 8px; }
.frames { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; height: 64px; }   /* always one row: one frame per scene */
@media (max-width: 560px) { .frames { gap: 1px; } }
.board .frames { height: 44px; gap: 2px; }
.frame { border-radius: 3px; background: var(--m-pending); cursor: default; }
.frame.lv-CLEARED { background: var(--m-cleared); }
.frame.lv-UNCERTAIN { background: var(--m-uncertain); }
.frame.lv-UNKNOWN { background: repeating-linear-gradient(135deg, var(--m-unknown) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1.5px var(--m-unknown); }
.frame.lv-BLOCKED { background: var(--m-blocked); }
.frame:hover { outline: 2px solid #fff; outline-offset: 1px; }
.film-scale { display: flex; justify-content: space-between; margin-top: 10px; font: 600 12px/1 var(--font-mono); color: var(--on-stage-2); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 22px 0 0; padding: 0; }
.legend li { display: flex; align-items: center; gap: 10px; font: 600 15px/1.3 var(--font-head); }
.legend .sw { width: 22px; height: 22px; border-radius: 4px; background: var(--m-pending); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.legend .sw.lv-CLEARED { background: var(--m-cleared); } .legend .sw.lv-UNCERTAIN { background: var(--m-uncertain); }
.legend .sw.lv-UNKNOWN { background: repeating-linear-gradient(135deg, var(--stage) 0 2px, var(--m-unknown) 2px 5px); }
.legend .sw.lv-BLOCKED { background: var(--stage); box-shadow: inset 0 0 0 2px var(--m-blocked); }
.legend .n { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 500; }
.callout { display: flex; gap: 16px; align-items: flex-start; max-width: 860px; margin: 28px 0 0; padding: 18px 20px; border-radius: var(--radius); background: var(--warn-bg); color: var(--ink); }
.callout .icon { width: 24px; height: 24px; color: var(--warn); margin-top: 2px; }
.callout p { margin: 0; font-size: 17px; }
.callout strong { font-family: var(--font-head); color: var(--warn); }

/* chapters: one bar per chapter, its estimated time */
.bars { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content max-content; gap: 14px 18px; align-items: center; max-width: 980px; }
.bars .bh { font: 700 12px/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.bars .bh.num { text-align: right; }
.bar-name { font: 700 16px/1.2 var(--font-head); }
.bar-track { height: 14px; border-radius: 0 4px 4px 0; background: var(--bg-sunk); overflow: hidden; }
.bar { display: block; height: 100%; width: 0; border-radius: 0 4px 4px 0; background: var(--blue); }
.bar-val { font: 600 15px/1 var(--font-head); font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); min-width: 3.4em; }
.bar-flag { font: 600 14px/1 var(--font-head); color: var(--ink-3); text-align: right; white-space: nowrap; }
.bar-flag.has { color: var(--warn); }

/* checks */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-width: 980px; }
.checks li { display: grid; grid-template-columns: 28px 13em minmax(0, 1fr) 13em; gap: 14px; align-items: baseline; padding: 16px 0; border-top: 1px solid var(--line); }
.checks li > code { text-align: right; }
.checks li:last-child { border-bottom: 1px solid var(--line); }
.checks .icon { width: 20px; height: 20px; color: var(--ink-3); align-self: center; }
.checks .is-open .icon { color: var(--warn); } .checks .is-done .icon { color: var(--blue); }
.checks b { font: 700 16px/1.3 var(--font-head); }
.checks span { font-size: 16.5px; color: var(--ink-2); }
.checks code { color: var(--ink-3); }
@media (max-width: 760px) { .checks li { grid-template-columns: 28px 1fr; } .checks li > span, .checks li > code { grid-column: 2; text-align: left; } }

/* ---- page header (scenes, rights, approvals) --------------------------------------------------------------------- */
.page-head { padding: 56px 0 36px; background: var(--bg-raised); border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 0 0 12px; font: 700 clamp(32px, 4vw, 48px)/1.08 var(--font-head); letter-spacing: -0.025em; }
.page-head .lead { margin: 0; max-width: 760px; font-size: 19px; color: var(--ink-2); }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; }
.stats li { display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); font: 600 14.5px/1.2 var(--font-head); color: var(--ink-2); }
.stats b { font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stats li.is-warn { background: var(--warn-bg); box-shadow: none; } .stats li.is-warn b { color: var(--warn); }
.page-body { padding-top: 36px; padding-bottom: 80px; }

/* toolbar: segmented control, chapter, search */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 18px; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bg-sunk); border: 0; margin: 0; }
.seg legend { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.seg label { position: relative; display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px; font: 600 14.5px/1 var(--font-head); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label.is-on, .seg label:has(input:checked) { background: var(--bg-raised); color: var(--ink); box-shadow: var(--shadow); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 1px; }
.field { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 999px; background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line); }
.field .icon { width: 18px; height: 18px; color: var(--ink-3); }
.field select, .field input { border: 0; background: transparent; color: var(--ink); font: 500 15px/1 var(--font-head); height: 40px; min-width: 0; }
.field select:focus-visible, .field input:focus-visible { outline: none; }
.field:focus-within { box-shadow: inset 0 0 0 2px var(--blue); }
.field-search { flex: 1 1 260px; max-width: 420px; }
.field-search input { width: 100%; }
.count { margin: 0 0 12px; font: 500 14.5px/1.4 var(--font-head); color: var(--ink-3); }

/* ---- tables ---------------------------------------------------------------------------------------------------------- */
.table-card { background: var(--bg-raised); border-radius: var(--radius); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); margin: 0 0 28px; }
.table-wrap { position: relative; overflow-x: auto; border-radius: var(--radius); }   /* relative: a visually hidden label inside stays in the scroll box */
.table-wrap:focus-visible { outline-offset: 3px; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 16px; line-height: 1.45; font-variant-numeric: tabular-nums lining-nums; }
caption { caption-side: top; text-align: left; padding: 18px 20px 6px; font: 600 14px/1.4 var(--font-head); color: var(--ink-3); }
th, td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--line); }
tbody tr:last-child > * { border-bottom: 0; }
thead th { font: 700 12px/1.3 var(--font-head); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); background: var(--bg-raised); white-space: nowrap; padding-top: 12px; padding-bottom: 12px; }
tbody th { font-weight: 600; }
td.num, th.num { text-align: right; }
tbody tr { transition: background-color .12s ease; }
tbody tr:hover { background: color-mix(in srgb, var(--bg-sunk) 55%, transparent); }
.what { display: block; font-family: var(--font-body); }
.sub { display: block; margin-top: 3px; font: 500 13.5px/1.45 var(--font-head); color: var(--ink-3); }
.sub code { font-size: 12.5px; }
tbody th code { color: var(--ink); font-weight: 600; font-size: 14px; }
table.scenes { min-width: 1040px; }
table.queue { min-width: 980px; }
table.scenes td:nth-child(3) { min-width: 260px; }
table.scenes .notes { min-width: 210px; }
/* desktop: no sideways scroll needed, so the header row can stay in view while the page scrolls */
@media (min-width: 1180px) {
  .table-wrap.can-stick { overflow: visible; }
  .table-wrap.can-stick thead th { position: sticky; top: var(--header-h); z-index: 2; box-shadow: 0 1px 0 var(--line); }
  .table-wrap.can-stick thead th:first-child { border-top-left-radius: var(--radius); }
  .table-wrap.can-stick thead th:last-child { border-top-right-radius: var(--radius); }
}
/* narrow: the scene id stays in view while the table scrolls sideways */
@media (max-width: 1179px) {
  table.scenes tbody th, table.scenes thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg-raised); }
  table.scenes tbody tr.flag th { background: var(--warn-bg); }
}
.scroll-hint { display: none; margin: 0 0 8px; font: 600 13px/1.3 var(--font-head); color: var(--ink-3); }
@media (max-width: 1179px) { .scroll-hint { display: block; } }

/* flagged rows: missing or not known — a warm ground and a rule on the left; unknown also hatched (not colour alone) */
tr.flag { background-color: var(--warn-bg); }
tr.flag:hover { background-color: var(--warn-bg); }
tr.flag > :first-child { box-shadow: inset 4px 0 0 var(--warn); }
tr.flag.lv-row-UNKNOWN, tr.flag.lv-row-BLOCKED { background-image: repeating-linear-gradient(135deg, transparent 0 9px, var(--hatch) 9px 18px); }
.sig { display: block; font: 700 14px/1.35 var(--font-head); color: var(--warn); margin-bottom: 2px; }

/* chips, tags */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font: 700 12px/1 var(--font-head); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink-2); background: var(--bg-sunk); }
.chip .icon { width: 13px; height: 13px; }
.chip.lv-CLEARED, .chip.st-done { color: var(--blue); background: var(--blue-soft); }
.chip.lv-UNCERTAIN, .chip.st-open { color: var(--warn); background: var(--warn-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 35%, transparent); }
.chip.lv-UNKNOWN, .chip.lv-BLOCKED, .chip.st-unknown, .chip.st-blocked { color: var(--on-warn); background: var(--warn); }
.chip.tr-done { color: var(--blue); background: var(--blue-soft); }
.chip.tr-missing { color: var(--ink-2); background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
table.scenes td.trail { min-width: 150px; }
.downloads { margin: 0 0 14px; font: 500 14.5px/1.5 var(--font-head); color: var(--ink-2); }
.fmt-line { margin: 18px 0 0; font: 500 14.5px/1.5 var(--font-head); color: var(--ink-2); }
.fmt-line .sep { margin: 0 8px; opacity: .5; }
.fmt-tag { display: block; margin-bottom: 4px; font: 600 12.5px/1.4 var(--font-head); color: var(--warn); }
table.suggestions { min-width: 900px; }
table.suggestions td.sg-text { min-width: 340px; }
.sub-head { margin: 28px 0 12px; font: 700 20px/1.3 var(--font-head); }
.empty-note { color: var(--ink-2); }
.warn-text { color: var(--warn); }
.tag { display: inline-flex; align-items: center; margin-left: 8px; height: 20px; padding: 0 7px; border-radius: 999px; font: 700 11px/1 var(--font-head); letter-spacing: .05em; color: var(--blue); background: var(--blue-soft); vertical-align: 2px; }
.play { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; height: 28px; padding: 0 11px 0 9px; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font: 600 12.5px/1 var(--font-head); cursor: pointer; }
.play:hover { background: var(--blue); color: var(--on-blue); }
.play .icon { width: 12px; height: 12px; }

/* rights queue: one table per state */
.group-head { display: flex; align-items: center; gap: 12px; margin: 40px 0 14px; }
.group-head:first-child { margin-top: 0; }
.group-head h2 { margin: 0; font: 700 22px/1.2 var(--font-head); letter-spacing: -0.01em; }
.group-head p { margin: 0; color: var(--ink-3); font: 500 15px/1.4 var(--font-head); }

/* approvals: one step per decision */
.steps { list-style: none; margin: 0; padding: 0; max-width: 920px; }
.astep { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 0 20px; padding-bottom: 34px; }
.astep::before { content: ""; position: absolute; left: 25px; top: 52px; bottom: 6px; width: 2px; background: var(--line); }
.astep:last-child::before { display: none; }
.astep-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--bg-raised); box-shadow: inset 0 0 0 2px var(--line); color: var(--ink-3); }
.astep-icon .icon { width: 22px; height: 22px; }
.astep.is-open .astep-icon { color: var(--warn); box-shadow: inset 0 0 0 2px var(--warn); background: var(--warn-bg); }
.astep.is-blocked .astep-icon { color: var(--on-warn); background: var(--warn); box-shadow: none; }
.astep.is-done .astep-icon { color: var(--blue); box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); }
.astep.is-unknown .astep-icon { color: var(--on-warn); background: var(--warn); box-shadow: none; }
.astep-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; min-height: 52px; }
.astep h2 { margin: 0; font: 700 22px/1.2 var(--font-head); }
.astep-body { grid-column: 2; }
.astep-body p { margin: 6px 0 0; font-size: 17px; color: var(--ink-2); }
.astep-body .waits { display: flex; gap: 8px; align-items: baseline; margin-top: 10px; font: 600 15px/1.4 var(--font-head); color: var(--ink); }
.astep-body .waits span { color: var(--ink-3); font-weight: 500; }
.note-band { display: flex; gap: 14px; align-items: flex-start; max-width: 920px; margin-top: 10px; padding: 18px 20px; border-radius: var(--radius); background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line); }
.note-band .icon { width: 22px; height: 22px; color: var(--blue); margin-top: 3px; }
.note-band p { margin: 0; font-size: 17px; }

/* ---- tooltip, lightbox --------------------------------------------------------------------------------------------------- */
.tip { position: fixed; z-index: 60; max-width: 300px; padding: 8px 11px; border-radius: 8px; background: var(--ink); color: var(--bg); font: 500 13.5px/1.4 var(--font-head); pointer-events: none; box-shadow: var(--shadow); }
.lightbox { width: min(1100px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 16px; background: var(--stage-2); color: var(--on-stage); box-shadow: var(--shadow-lg); }
.lightbox::backdrop { background: rgba(8, 11, 15, 0.78); }
.lb-in { position: relative; padding: 14px; }
.lb-in video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 10px; background: #000; }
.lb-cap { margin: 12px 4px 2px; font: 500 15px/1.45 var(--font-head); color: var(--on-stage-2); }
.lb-cap b { color: var(--on-stage); }
.lb-close { position: absolute; top: 22px; right: 22px; z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.lb-close .icon { width: 18px; height: 18px; }

/* ---- footer ------------------------------------------------------------------------------------------------------------------ */
.site-footer { background: var(--stage); color: var(--on-stage-2); }
.foot-in { display: grid; grid-template-columns: 1.2fr repeat(3, minmax(0, 1fr)); gap: 32px; padding-top: 56px; padding-bottom: 40px; }
.site-footer .logo { color: var(--on-stage); }
.site-footer .lm-bg { fill: var(--on-stage); } .site-footer .lm-m { stroke: var(--stage); }
.foot-in h2 { margin: 0 0 10px; font: 700 13px/1.2 var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--on-stage); }
.foot-in p { margin: 0; font-size: 15.5px; line-height: 1.6; }
.foot-tag { margin-top: 14px !important; }
.foot-bottom { border-top: 1px solid var(--stage-line); }
.foot-bottom p { margin: 0; padding: 18px 0 26px; font: 500 13.5px/1.5 var(--font-head); color: var(--on-stage-2); }
@media (max-width: 960px) { .foot-in { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot-in { grid-template-columns: 1fr; } }

.loading, .error { padding: 60px 0; font-size: 18px; }
.error { color: var(--warn); font-weight: 600; }

/* ---- the demo's band and its copy for readers without JavaScript (written by the build; boot.js hides the copy while app.js draws) */
.example-band { background: var(--warn-bg); border-bottom: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.example-in { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; padding-top: 14px; padding-bottom: 14px; }
.example-tag { display: inline-flex; align-items: center; gap: 8px; margin: 0; font: 700 13px/1.3 var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--warn); white-space: nowrap; }
.example-tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.example-text { flex: 1 1 520px; margin: 0; font-size: 16.5px; line-height: 1.55; color: var(--ink); max-width: 72em; }
.js .static-copy { display: none; }
.noscript-line { flex-basis: 100%; color: var(--ink-2); }
.noscript-note p { margin: 20px 0 0; padding: 14px 18px; border-radius: var(--radius-sm); background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line); font-size: 16.5px; }
.static-note { max-width: 860px; margin: 0 0 18px; font-size: 17px; color: var(--ink-2); font-style: italic; }
.static-note b { font: 700 12px/1 var(--font-head); font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-right: 6px; }
.static-copy .callout { margin: 0 0 28px; }
.static-end { max-width: 860px; margin: 8px 0 0; font-size: 16px; color: var(--ink-2); }
table.chapters { min-width: 520px; }
a.play { text-decoration: none; }
.foot-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15.5px; }
.site-footer a { color: var(--on-stage); }
.site-footer a:hover { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  tr.flag > :first-child { border-left: 4px solid CanvasText; }
  .frame, .legend .sw { forced-color-adjust: none; }
  .chip, .pill, .tag { border: 1px solid CanvasText; }
}
