/* Studio rework mockups: shared theme. Static design stills only (CoS, 2026-10-03).
   Concept: the screening room. The picture is the only true black; chrome is graphite (dark)
   or daylight grey (light). One accent: tungsten, the colour of Sarah's spotlight pool.
   Spoken words (anything Sarah says) are set in serif; everything else is UI sans. */

:root, [data-theme="dark"] {
  --bg: #1a1b1f;
  --bg-2: #202227;
  --panel: #24262c;
  --raised: #2d3037;
  --hover: #33363e;
  --line: #363941;
  --line-soft: #2c2f35;
  --text: #ecebe7;
  --text-2: #b9bbc1;
  --muted: #8b8f98;
  --faint: #5d616a;
  --accent: #f2a94b;
  --accent-ink: #f5b866;
  --accent-soft: rgba(242, 169, 75, 0.14);
  --accent-line: rgba(242, 169, 75, 0.55);
  --on-accent: #1d1306;
  --done: #6cc08b;   --done-soft: rgba(108, 192, 139, 0.14);
  --need: #ff7a66;   --need-soft: rgba(255, 122, 102, 0.14);
  --run:  #84a9ff;   --run-soft: rgba(132, 169, 255, 0.14);
  --well: #000;
  --wave: #6f737c;
  --wave-hi: #f2a94b;
  --overlay: rgba(10, 11, 13, 0.55);
  --shadow-pop: 0 24px 60px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.4);
  --rail: #141518;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #e8eaee;
  --bg-2: #eef0f3;
  --panel: #ffffff;
  --raised: #f3f4f7;
  --hover: #eceef2;
  --line: #d5d8de;
  --line-soft: #e4e6ea;
  --text: #16171a;
  --text-2: #3d4047;
  --muted: #646872;
  --faint: #9a9ea7;
  --accent: #f0a23f;
  --accent-ink: #a95f05;
  --accent-soft: rgba(240, 162, 63, 0.16);
  --accent-line: rgba(200, 120, 20, 0.6);
  --on-accent: #1d1306;
  --done: #2e8a55;   --done-soft: rgba(46, 138, 85, 0.12);
  --need: #c8402c;   --need-soft: rgba(200, 64, 44, 0.11);
  --run:  #3d6bd6;   --run-soft: rgba(61, 107, 214, 0.11);
  --well: #000;
  --wave: #a3a7b0;
  --wave-hi: #d98a1c;
  --overlay: rgba(30, 32, 38, 0.28);
  --shadow-pop: 0 24px 60px rgba(25, 30, 45, 0.22), 0 2px 8px rgba(25, 30, 45, 0.12);
  --rail: #f8f9fb;
  color-scheme: light;
}

:root {
  --ui: "Avenir Next", "Avenir", -apple-system, system-ui, sans-serif;
  --cond: "Avenir Next Condensed", "Avenir Next", sans-serif;
  --read: "Iowan Old Style", "Charter", Georgia, serif;
  --r-screen: 6px;
  --r-panel: 14px;
  --r-btn: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100vw; height: 100vh; overflow: hidden; }
body {
  font-family: var(--ui);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern";
}
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.read { font-family: var(--read); }
svg.i { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s14 { width: 14px; height: 14px; }
svg.i.s18 { width: 18px; height: 18px; }
svg.i.s20 { width: 20px; height: 20px; }

/* ---------- frame ---------- */
.app { display: grid; grid-template-columns: 64px 1fr; height: 100vh; }
.main { display: grid; grid-template-rows: 56px 34px 52px 1fr 96px; min-width: 0; min-height: 0; position: relative; }
.main.no-slate { grid-template-rows: 56px 34px 1fr 96px; }
.main.no-film { grid-template-rows: 56px 34px 52px 1fr; }
.main.bare { grid-template-rows: 56px 34px 1fr; }

/* Mission Control rail (collapsed) */
.rail { background: var(--rail); border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 4px; }
.rail .mc { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(140deg, #4aa3ff, #2c6bd8); color: #fff; font-weight: 700; display: grid; place-items: center; margin-bottom: 14px; font-size: 15px; }
.rail a { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.rail a.on { background: var(--raised); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.rail .sep { width: 24px; height: 1px; background: var(--line); margin: 6px 0; }
.rail .grow { flex: 1; }

/* ---------- stage bar ---------- */
.stagebar { display: flex; align-items: center; gap: 14px; padding: 0 16px 0 14px; background: var(--bg-2); border-bottom: 1px solid var(--line-soft); position: relative; z-index: 30; }
.prod { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 10px; min-width: 196px; }
.prod img { width: 40px; height: 40px; border-radius: 7px; object-fit: cover; background: #000; }
.prod b { font-size: 15px; font-weight: 600; display: block; line-height: 1.2; }
.prod small { color: var(--muted); font-size: 12px; }
.prod .chev { color: var(--muted); margin-left: 4px; }
.stages { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.stg { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 11px 0 9px; border-radius: 9px; color: var(--text-2); position: relative; white-space: nowrap; font-size: 14px; }
.stg .n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.stg.cur { background: var(--raised); color: var(--text); font-weight: 600; }
.stg.cur::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -9px; height: 2px; border-radius: 2px; background: var(--accent); }
.stg.hov { background: var(--hover); color: var(--text); }
.stg .arrow { color: var(--faint); }
.stg-sep { width: 10px; height: 1px; background: var(--line); flex: none; }

/* state glyphs: shape + word carry the state, never colour alone */
.st { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: 11px; font-weight: 700; line-height: 1; }
.st svg { width: 11px; height: 11px; stroke-width: 2.4; }
.st.done { background: var(--done-soft); color: var(--done); }
.st.need { background: var(--need-soft); color: var(--need); }
.st.run  { color: var(--run); }
.st.run svg { width: 18px; height: 18px; stroke-width: 2; }
.st.cur  { background: var(--accent); color: var(--on-accent); }
.st.cur::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--on-accent); }
.st.idle { border: 1.5px dashed var(--faint); }

.bar-right { display: flex; align-items: center; gap: 8px; }
.spend { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; color: var(--text-2); }
.spend .engn { display: flex; align-items: center; gap: 6px; color: var(--text); font-weight: 500; }
.spend .div { width: 1px; height: 18px; background: var(--line); }
.spend .meter { width: 54px; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.spend .meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: var(--r-btn); font: 500 14px var(--ui); color: var(--text); background: transparent; border: 1px solid var(--line); white-space: nowrap; }
.btn.ghost { border-color: transparent; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary .price { font-weight: 500; opacity: .8; }
.btn.on { background: var(--raised); border-color: var(--line); }
.btn.hov { background: var(--hover); }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--raised); color: var(--text); font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.btn.assist { border-color: var(--accent-line); color: var(--accent-ink); font-weight: 600; }
.btn.assist.on { background: var(--accent-soft); }

/* ---------- master voice spine ---------- */
.spine { display: flex; align-items: center; gap: 12px; padding: 0 16px 0 18px; background: var(--bg); border-bottom: 1px solid var(--line-soft); position: relative; z-index: 2; }
.spine .lbl { font-size: 12px; color: var(--muted); white-space: nowrap; display: flex; gap: 6px; align-items: center; width: 170px; }
.spine .lbl b { color: var(--text-2); font-weight: 600; }
.spine .wave { flex: 1; height: 26px; position: relative; }
.spine .tc { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; width: 92px; text-align: right; }
.spine.empty .wave { border-top: 1.5px dashed var(--line); height: 0; }
.wave svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* ---------- slate row ---------- */
.slate { display: flex; align-items: center; gap: 18px; padding: 0 16px 0 20px; border-bottom: 1px solid var(--line-soft); background: var(--bg); }
.slate h1 { font: 600 24px/1 var(--cond); letter-spacing: 0.005em; white-space: nowrap; display: flex; align-items: baseline; gap: 10px; }
.slate h1 .dot { color: var(--faint); font-weight: 400; }
.slate h1 small { font: 500 14px var(--ui); color: var(--muted); letter-spacing: 0; }
.stepper { display: flex; gap: 2px; }
.stepper .btn { width: 32px; padding: 0; height: 32px; }
.cells { display: flex; gap: 4px; }
.cell { width: 122px; padding: 5px 9px 5px; border-radius: 7px; background: var(--panel); border: 1px solid var(--line-soft); font-size: 11.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; }
.cell b, .cell span { display: block; }
.cell .bar { height: 3px; border-radius: 2px; margin-bottom: 4px; background: var(--line); }
.cell b { font-weight: 600; font-size: 12px; display: flex; align-items: center; gap: 5px; }
.cell span { color: var(--muted); }
.cell.done .bar { background: var(--done); } .cell.done b { color: var(--text); }
.cell.need .bar { background: repeating-linear-gradient(-45deg, var(--need) 0 4px, transparent 4px 7px); }
.cell.need span { color: var(--need); }
.cell.run .bar { background: linear-gradient(90deg, var(--run) 55%, var(--line) 55%); }
.cell.run span { color: var(--run); }
.tabs { display: flex; gap: 2px; padding: 3px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 10px; }
.tabs a { height: 32px; padding: 0 16px; display: flex; align-items: center; justify-content: center; white-space: nowrap; border-radius: 7px; font-weight: 500; color: var(--text-2); font-size: 14px; }
.tabs a.on { background: var(--raised); color: var(--text); font-weight: 600; box-shadow: 0 1px 0 var(--line); }
.grow { flex: 1; }

/* ---------- work area ---------- */
.work { display: grid; grid-template-columns: minmax(0, 60fr) minmax(0, 40fr); gap: 16px; padding: 16px; min-height: 0; }
.col { display: flex; flex-direction: column; gap: 12px; min-height: 0; min-width: 0; }
.viewer { position: relative; flex: 1; min-height: 0; background: var(--well); border-radius: var(--r-screen); overflow: hidden; display: grid; place-items: center; }
.viewer img.pic { width: 100%; height: 100%; object-fit: contain; display: block; }
.viewer .tag { position: absolute; left: 14px; top: 12px; display: flex; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12.5px; font-weight: 500; background: var(--raised); color: var(--text-2); border: 1px solid var(--line-soft); white-space: nowrap; }
.chip.dim { background: rgba(0,0,0,.55); border-color: rgba(255,255,255,.12); color: #e9e7e2; backdrop-filter: blur(6px); }
.chip.acc { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.chip.done { background: var(--done-soft); border-color: transparent; color: var(--done); }
.chip.need { background: var(--need-soft); border-color: transparent; color: var(--need); }
.chip.run { background: var(--run-soft); border-color: transparent; color: var(--run); }

.panel { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-panel); min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; }
.panel > .sec { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.panel > .sec:last-child { border-bottom: 0; }
.panel .foot { position: sticky; bottom: 0; margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; background: var(--panel); }
.panel .foot .note { font-size: 12px; color: var(--muted); line-height: 1.35; }
.h { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.h .muted { font-weight: 400; }
.lab { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.row { display: flex; align-items: center; gap: 8px; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.field { border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; background: var(--bg-2); color: var(--text); font-size: 13.5px; line-height: 1.5; }
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line); gap: 2px; }
.seg a { height: 28px; padding: 0 12px; display: grid; place-items: center; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.seg a.on { background: var(--raised); color: var(--text); box-shadow: 0 0 0 1px var(--line); font-weight: 600; }

/* eyes card: the route is hard-wired: Sonnet eyes at 4 fps, Opus reviewer, Gemini ears */
.eyes { border-radius: 10px; border: 1px solid var(--line-soft); background: var(--bg-2); padding: 10px 12px; font-size: 12.5px; }
.eyes .route { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.eyes .route span { font-size: 11.5px; padding: 2px 8px; border-radius: 10px; background: var(--raised); color: var(--text-2); }
.eyes ul { list-style: none; display: grid; gap: 5px; }
.eyes li { display: flex; gap: 8px; align-items: flex-start; }
.eyes li .st { width: 16px; height: 16px; margin-top: 1px; }

/* ---------- filmstrip ---------- */
.film { border-top: 1px solid var(--line-soft); background: var(--bg-2); display: flex; align-items: stretch; gap: 0; padding: 8px 16px 8px 20px; overflow: hidden; }
.film .grp { display: flex; flex-direction: column; gap: 4px; padding-right: 14px; margin-right: 14px; border-right: 1px solid var(--line-soft); }
.film .grp:last-child { border-right: 0; }
.film .gl { font-size: 11.5px; color: var(--muted); white-space: nowrap; display: flex; gap: 6px; }
.film .gl b { color: var(--text-2); font-weight: 600; }
.film .shots { display: flex; gap: 6px; }
.th { position: relative; width: 100px; height: 56px; border-radius: 5px; overflow: hidden; background: #000; flex: none; outline: 1px solid var(--line-soft); }
.th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.th .num { position: absolute; left: 4px; bottom: 3px; font: 600 11px var(--cond); color: #fff; background: rgba(0,0,0,.6); padding: 0 5px; border-radius: 4px; }
.th .st { position: absolute; right: 4px; top: 4px; width: 16px; height: 16px; background: rgba(0,0,0,.65); }
.th .st.done { color: #7fd29c; } .th .st.need { color: #ff8b78; } .th .st.run { color: #9dbbff; } .th .st.idle { border-color: rgba(255,255,255,.4); background: rgba(0,0,0,.5); }
.th .eye { position: absolute; right: 4px; bottom: 3px; font-size: 10px; color: #fff; background: rgba(0,0,0,.6); padding: 0 4px; border-radius: 4px; display: flex; gap: 3px; align-items: center; }
.th.cur { outline: 2px solid var(--accent); outline-offset: 1px; }
.th.hov { outline: 2px solid var(--text-2); }
.th.small { width: 64px; height: 36px; }
.deck { display: flex; align-items: center; gap: 8px; }
.deck .stack { position: relative; width: 74px; height: 42px; }
.deck .stack img { position: absolute; width: 64px; height: 36px; object-fit: cover; border-radius: 4px; outline: 1px solid var(--line); }
.deck .stack img:nth-child(1) { left: 10px; top: 0; opacity: .5; }
.deck .stack img:nth-child(2) { left: 5px; top: 3px; opacity: .75; }
.deck .stack img:nth-child(3) { left: 0; top: 6px; }
.deck small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.deck small b { color: var(--text-2); font-weight: 600; display: block; }

/* ---------- overlays ---------- */
.scrim { position: absolute; inset: 56px 0 0 0; background: var(--overlay); z-index: 20; }
.pop { position: absolute; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-pop); z-index: 40; }
.cursor { position: absolute; width: 22px; height: 22px; z-index: 100; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); }

/* transport */
.transport { display: flex; align-items: center; gap: 10px; }
.iconbtn { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); border: 1px solid var(--line); background: var(--panel); }
.iconbtn.big { width: 42px; height: 42px; border-radius: 21px; background: var(--text); color: var(--bg); border: 0; }
.iconbtn.ghost { border-color: transparent; background: transparent; }

/* slider */
.slider { position: relative; height: 22px; flex: 1; }
.slider .track { position: absolute; left: 0; right: 0; top: 10px; height: 3px; border-radius: 2px; background: var(--line); }
.slider .fill { position: absolute; left: 0; top: 10px; height: 3px; border-radius: 2px; background: var(--accent); }
.slider .knob { position: absolute; top: 3px; width: 17px; height: 17px; margin-left: -8px; border-radius: 50%; background: var(--panel); border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.slider .ticks { position: absolute; left: 0; right: 0; top: 18px; display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint); }

/* pair: fps and hold side by side, one control */
.pair { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--bg-2); }
.pair > div { padding: 4px 12px; display: flex; flex-direction: column; justify-content: center; line-height: 1.15; }
.pair > div + div { border-left: 1px solid var(--line); }
.pair small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.pair b { white-space: nowrap; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; }
.pair .stepx { color: var(--faint); font-weight: 400; font-size: 13px; }
.pair .on { background: var(--accent-soft); }
.pair .on small { color: var(--accent-ink); }

/* tracks under a player */
.tracks { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: 64px 1fr; gap: 6px 10px; align-items: center; font-size: 12px; position: relative; }
.tracks .tl { color: var(--muted); }
.tracks .lane { height: 34px; border-radius: 6px; position: relative; overflow: hidden; background: var(--bg-2); }
.tracks .ruler { grid-column: 2; height: 14px; position: relative; font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.tracks .ruler span { position: absolute; top: 0; transform: translateX(-50%); }
.clip { position: absolute; top: 0; bottom: 0; border-radius: 6px; overflow: hidden; display: flex; }
.clip img { height: 100%; width: auto; flex: none; opacity: .92; }
.clip .cap { position: absolute; left: 6px; top: 4px; font-size: 11px; font-weight: 600; color: #fff; background: rgba(0,0,0,.55); padding: 0 6px; border-radius: 4px; }
.seamline { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--accent); z-index: 3; }
.seamline::before { content: ""; position: absolute; top: -6px; left: -5px; border: 6px solid transparent; border-top-color: var(--accent); }

/* ---------- 1440 x 900: same frame, tighter. The viewer shrinks; the controls panel scrolls on its own. ---------- */
@media (max-width: 1600px) {
  .stagebar { gap: 8px; padding: 0 10px; }
  .prod { min-width: 0; padding-right: 4px; }
  .prod small, .prod .chev { display: none; }
  .prod img { width: 32px; height: 32px; }
  .stages { gap: 0; }
  .stg { padding: 0 7px 0 6px; gap: 5px; font-size: 13px; }
  .stg .n { display: none; }
  .stg.cur .n { display: inline; }
  .spend { padding: 0 9px; gap: 7px; }
  .spend .engn, .spend .meter, .spend .div { display: none; }
  .btn .lbl { display: none; }
  .btn.ghost { padding: 0 9px; }
  .slate { gap: 12px; padding: 0 12px 0 16px; }
  .slate h1 { font-size: 21px; }
  .slate h1 small { display: none; }
  .cell { width: 84px; padding: 5px 7px; }
  .cell span { font-size: 11px; }
  .tabs a { padding: 0 11px; }
  .work { gap: 12px; padding: 12px; grid-template-columns: minmax(0, 58fr) minmax(0, 42fr); }
  .panel > .sec { padding: 12px 14px; }
  .th { width: 84px; height: 47px; }
  .film .grp { padding-right: 10px; margin-right: 10px; }
  .film .gl span, .film .gl { font-size: 11px; }
}
