/* editor.css — "Ember Studio" magic editor surfaces. Semantic tokens come from
   tokens.css (the shared Ember Studio layer, linked before this file); base
   brand tokens from gipity-theme.css. This file NEVER redefines a shared token
   and NEVER hardcodes a brand color — it only composes the stage scale, ember
   accent, hairlines and soft-round shapes into the editor's panes.

   Functional surfaces are sacred: the screen-router display rules, every id/
   data-testid the JS queries, the transcript virtualization geometry
   (.tp-scroller / .tp-sizer / .tp-block absolute positioning), the preview tile
   math (positions are set inline by preview.js — CSS never touches them) and the
   proc-stage[data-status] hooks are all preserved. */

/* ── Editor page ground ────────────────────────────────────────────────────── */
body.editor { background: var(--stage-0); color: var(--ink); }

/* Button tiers, scoped to the editor page so they never fight the studio's
   global .primary-btn / button.ghost. PRIMARY = ember gradient (one hero per
   view); GHOST = hairline-ringed utility. */
body.editor .primary-btn {
  background: var(--grad-ember); color: #fff; border: none;
  border-radius: var(--r-btn); box-shadow: var(--shadow-accent);
  font-weight: 700; transition: filter var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
body.editor .primary-btn:hover:not(:disabled) { filter: brightness(1.06); }
body.editor .primary-btn:active:not(:disabled) { transform: scale(.98); }
body.editor .primary-btn:disabled { opacity: .55; box-shadow: none; }
body.editor button.ghost {
  background: transparent; color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: var(--r-btn);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
body.editor button.ghost:hover { background: var(--stage-2); color: var(--ink); }
body.editor :focus-visible { outline: none; box-shadow: var(--focus-ring); }
body.editor input, body.editor select, body.editor textarea {
  background: var(--stage-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-input);
}
body.editor input:focus, body.editor select:focus, body.editor textarea:focus {
  outline: none; box-shadow: var(--focus-ring); border-color: var(--accent-line);
}

/* ── Screen router (UNCHANGED behavior) ────────────────────────────────────── */
.ed-screen { display: none; }
body[data-screen="picker"] #picker-screen { display: block; }
body[data-screen="load"] #load-screen { display: block; }
body[data-screen="editor"] #editor-screen { display: block; }
body[data-screen="process"] #process-screen { display: block; }

/* ── Header ─────────────────────────────────────────────────────────────────── */
.ed-header { display: none; }
body[data-screen="editor"] .ed-header {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--stage-1); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  /* Wrap the control cluster to a 2nd row when it can't fit (narrow windows,
     phones) instead of running the buttons off the right edge where they become
     unreachable — that hid "Section boxes" / "Highlights" entirely. On a wide
     screen everything still sits on one line. */
  flex-wrap: wrap; row-gap: var(--s-2);
}
/* Header controls never shrink; only the title flexes + truncates. When the row
   overflows, buttons wrap to the next line (all reachable) rather than clipping. */
body[data-screen="editor"] .ed-header > button { flex: none; }
.ed-title {
  font-weight: 700; color: var(--ink); font-size: var(--text-lg); letter-spacing: -0.01em;
  flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.header-spacer { flex: 1 1 auto; }
.dirty-dot {
  width: 9px; height: 9px; border-radius: var(--r-chip);
  background: var(--accent); box-shadow: 0 0 0 3px var(--stage-1), 0 0 10px var(--accent-line);
}
.ed-pad { padding: var(--s-6) var(--s-5); max-width: 900px; margin: 0 auto; }
.tagline { color: var(--ink-dim); font-size: var(--text-lg); max-width: 60ch; margin-bottom: var(--s-5); }

/* ── Session picker ─────────────────────────────────────────────────────────── */
#picker-screen .ed-pad { max-width: 820px; }
#picker-screen h1 {
  font-size: var(--text-xl); letter-spacing: -0.02em; margin-bottom: var(--s-2);
}
/* ember kicker above the picker title */
#picker-screen h1::before {
  content: "MAGIC EDITOR"; display: block;
  font-size: var(--text-xs); font-weight: 800; letter-spacing: 0.16em;
  margin-bottom: var(--s-2);
  background: var(--grad-ember); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--accent);
}
.session-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.sess-row { margin: 0; position: relative; }
.sess-empty { color: var(--ink-dim); }
.sess-empty-msg { margin: 0; }
.sess-empty-actions { display: flex; gap: .6rem; margin-top: .75rem; flex-wrap: wrap; }
.sess-empty-start { display: inline-flex; align-items: center; text-decoration: none; }
.sess-btn {
  width: 100%; text-align: left; display: flex; flex-direction: column; gap: 3px;
  background: var(--stage-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-card);
  padding: var(--s-4); padding-right: 92px; box-shadow: var(--shadow-card);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease);
}
.sess-btn:hover {
  border-color: var(--accent-line); background: var(--stage-2);
  transform: translateY(-2px); box-shadow: var(--shadow-pop);
}
.sess-title { font-weight: 700; color: var(--ink); font-size: var(--text-base); }
.sess-meta { color: var(--ink-faint); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }

/* Per-card action cluster (Rename / Delete) — floated top-right, revealed on hover
   or keyboard focus so the resting card stays clean. Sits above the card button. */
.sess-actions {
  position: absolute; top: var(--s-3); right: var(--s-3); z-index: 2;
  display: flex; gap: var(--s-1);
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.sess-row:hover .sess-actions,
.sess-row:focus-within .sess-actions { opacity: 1; }
.sess-act { padding: 3px 9px; margin: 0; font-size: var(--text-base); line-height: 1; background: var(--stage-1); }
.sess-act:hover { background: var(--stage-3); }
.sess-act-danger:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, transparent); }

/* Inline rename editor (replaces the card in place). */
.sess-edit {
  display: flex; align-items: center; gap: var(--s-2);
  background: var(--stage-2); border: 1px solid var(--accent-line);
  border-radius: var(--r-card); padding: var(--s-3) var(--s-4); box-shadow: var(--shadow-card);
}
.sess-edit-input { flex: 1 1 auto; margin: 0; }
.sess-edit-save, .sess-edit-cancel { flex: none; margin: 0; padding: 5px 14px; }

/* Type-the-title delete dialog. */
.sess-dialog-scrim {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: var(--s-4);
}
.sess-dialog {
  width: min(440px, 96vw);
  background: var(--stage-1); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow-pop);
  padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3);
}
.sess-dialog-h { margin: 0; color: var(--ink); letter-spacing: -0.01em; }
.sess-dialog-conf { margin: 0; color: var(--ink-dim); font-size: var(--text-sm); }
.sess-dialog-conf strong { color: var(--ink); }
.sess-dialog-input { width: 100%; margin: 0; }
.sess-dialog-actions { display: flex; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-1); }
.sess-dialog-actions button { margin: 0; }
.sess-dialog-danger { background: var(--danger, var(--grad-ember)); }
.sess-dialog-danger:disabled { opacity: .5; box-shadow: none; }

/* ── Load / instruction cards ──────────────────────────────────────────────── */
.load-card {
  background: var(--stage-2); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--s-5);
  box-shadow: var(--shadow-card); max-width: 720px; margin-top: var(--s-4);
}
.load-card h2 { margin-top: 0; color: var(--ink); letter-spacing: -0.01em; }
.load-card .hint, .hint { color: var(--ink-dim); font-size: var(--text-sm); }
.load-actions { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; margin-top: var(--s-4); }
.analysis-cmds { margin: var(--s-4) 0; }
.cmd-row { display: flex; align-items: stretch; gap: var(--s-2); margin: var(--s-2) 0; }
.cmd {
  flex: 1 1 auto; margin: 0; overflow-x: auto;
  background: var(--stage-1); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: var(--s-2) var(--s-3);
  color: var(--code); font-size: var(--text-sm);
}

/* ── Advanced (collapsed) command blocks — demote raw node commands ────────── */
.adv-cmds { margin: var(--s-4) 0 0; }
.adv-cmds > summary {
  cursor: pointer; color: var(--ink-faint); font-size: var(--text-sm);
  user-select: none; padding: var(--s-1) 0;
}
.adv-cmds > summary:hover { color: var(--ink-dim); }
.adv-cmds[open] > summary { margin-bottom: var(--s-2); }
.adv-cmds .cmd { white-space: pre; }
.render-folder { color: var(--ink); font-weight: 600; }

/* ── Boot-error guard card (editor.js showBootError) ───────────────────────────
   A full-viewport, top-most overlay so a boot crash is NEVER an empty screen. It sits
   above every editor screen/drawer (z-index above .sess-dialog-scrim/.ed-scrim). */
.boot-error-scrim {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.62); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: var(--s-4);
}
.boot-error-card {
  width: min(560px, 96vw);
  background: var(--stage-1); border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--r-card); box-shadow: var(--shadow-pop);
  padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3);
}
.boot-error-icon {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 22px; color: #fff;
  background: var(--grad-ember);
}
.boot-error-h { margin: 0; color: var(--ink); letter-spacing: -0.01em; }
.boot-error-msg { margin: 0; color: var(--ink-dim); font-size: var(--text-sm); }
.boot-error-details { margin: 0; }
.boot-error-sum { cursor: pointer; color: var(--ink-dim); font-size: var(--text-xs); user-select: none; }
.boot-error-stack {
  margin: var(--s-2) 0 0; padding: var(--s-2) var(--s-3);
  background: var(--stage-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: var(--text-xs); color: var(--ink-dim);
}
.boot-error-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-1); }
.boot-error-actions button { margin: 0; }

/* ── Tabs ──────────────────────────────────────────────────────────────────── */
.ed-tabbar {
  display: flex; gap: var(--s-4);
  padding: var(--s-2) var(--s-4) 0;
  background: var(--stage-1); border-bottom: 1px solid var(--line);
}
.ed-tab {
  background: transparent; color: var(--ink-faint);
  border: none; margin: 0; border-radius: 0;
  padding: var(--s-3) 2px calc(var(--s-3) - 2px);
  font-weight: 700; position: relative;
  transition: color var(--dur) var(--ease);
}
.ed-tab:hover { color: var(--ink); }
/* active tab = 2px ember-gradient underline (replaces the notched border) */
.ed-tab.is-active { color: var(--ink); top: 0; background: transparent; }
.ed-tab.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--grad-ember); border-radius: var(--r-chip);
}

/* ════════════════════════════════════════════════════════════════════════════
   NLE WORKSPACE  (owned by the SHELL agent: layout regions, monitor, transport,
   rails, dock, drawers). The panels agent appends its own sections (toolbar tool
   groups, inspector/cuts refinements) AFTER this block under its own comment.
   Ember tokens unchanged — pure DOM/CSS restructure.
   ════════════════════════════════════════════════════════════════════════════ */
body.editor {
  --ed-header-h: 56px;
  --toolbar-h: 48px;
  --dock-h: 210px;
  --rail-l: 300px;
  --rail-r: 300px;
}

/* The editor screen is FULL-BLEED: defeat Water.css's `body { max-width:800px;
   margin:auto }` cap (it was squeezing the workspace and leaving dead margins on
   both sides). The picker/load/process screens keep their own .ed-pad centering,
   so this only affects how far the shell can stretch. */
body[data-screen="editor"] { max-width: none; margin: 0; padding: 0; }

/* …and it fits EXACTLY in the viewport: header + toolbar + workspace = 100vh, the
   page itself never scrolls, and each inner region scrolls on its own. Locked at
   ≥900px only; the <900 stacked layout below deliberately lets the page flow. */
@media (min-width: 900px) {
  body[data-screen="editor"] {
    height: 100vh; overflow: hidden;
    display: flex; flex-direction: column;
  }
  body[data-screen="editor"] #editor-screen {
    flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column;
  }
  body[data-screen="editor"] #edit-view { flex: 1 1 auto; min-height: 0; display: flex; }
  body[data-screen="editor"] .ed-workspace { flex: 1 1 auto; min-height: 0; }
  /* Monitor sizes to the available stage box, letterboxed both ways:
     width = min(stageWidth, stageHeight × 16/9). The `.pv-monitor .pv-stage`
     descendant selector outranks the base `.pv-stage { width:100% }` (defined
     later in the file) so this wins regardless of source order. */
  .pv-monitor { container-type: size; }
  .pv-monitor .pv-stage { width: min(100cqw, calc(100cqh * 16 / 9)); height: auto; }
}
/* Header drawer-toggle buttons (Edit / Notes / Render) reuse .ghost; the active
   one gets an ember-tinted ring so the current view reads at a glance. */
body.editor .ed-header button.ghost.is-active {
  color: var(--ink); border-color: var(--accent-line);
  background: var(--accent-soft);
}

/* Undo / Redo — header pair (near Save). Ember-tinted hover when live; clearly
   greyed + non-interactive when the stack is empty (ghost has no default disabled
   look). The dock pair inherits .dock-tool's disabled treatment. */
body.editor .ed-header .ed-undo,
body.editor .ed-header .ed-redo { font-variant-numeric: tabular-nums; }
body.editor .ed-header .ed-undo:hover:not(:disabled),
body.editor .ed-header .ed-redo:hover:not(:disabled) {
  border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft);
}
body.editor .ed-header .ed-undo:disabled,
body.editor .ed-header .ed-redo:disabled {
  opacity: .4; cursor: default; background: transparent; color: var(--ink-faint);
}

/* Second toolbar row — sticky under the header, holds the editing tools. */
.ed-toolbar {
  display: none;
  align-items: center; gap: var(--s-2);
  min-height: var(--toolbar-h); box-sizing: border-box;
  padding: var(--s-1) var(--s-4);
  background: var(--stage-1); border-bottom: 1px solid var(--line);
  position: sticky; top: var(--ed-header-h); z-index: 15;
  overflow-x: auto; white-space: nowrap;
}
body[data-screen="editor"] .ed-toolbar { display: flex; }
.ed-tool-sep { width: 1px; align-self: stretch; margin: 6px 2px; background: var(--line); flex: none; }
.ed-toolbar .ed-tool { flex: none; }

/* The workspace grid: transcript | stage | inspector, with a full-width dock. */
.ed-view { min-width: 0; }
.ed-workspace {
  display: grid;
  grid-template-columns: var(--rail-l) minmax(0, 1fr) var(--rail-r);
  grid-template-rows: minmax(0, 1fr) var(--dock-h);
  grid-template-areas:
    "transcript stage inspector"
    "timeline   timeline timeline";
  gap: 1px;
  background: var(--line);          /* hairline seams show through the gap */
  overflow: hidden;
}
.ed-rail-l { grid-area: transcript; }
.ed-stage  { grid-area: stage; }
.ed-rail-r { grid-area: inspector; }
.ed-dock   { grid-area: timeline; }

/* Rail collapse: shrink to a 36px spine. Both collapsed → the monitor goes
   maximal ("focus mode"). Driven by body[data-left]/[data-right]. */
body[data-left="collapsed"] .ed-workspace  { grid-template-columns: 36px minmax(0, 1fr) var(--rail-r); }
body[data-right="collapsed"] .ed-workspace { grid-template-columns: var(--rail-l) minmax(0, 1fr) 36px; }
body[data-left="collapsed"][data-right="collapsed"] .ed-workspace { grid-template-columns: 36px minmax(0, 1fr) 36px; }

/* ── Rails (wrappers around the existing panels) ───────────────────────────── */
.ed-rail {
  position: relative; min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  background: var(--stage-0); overflow: hidden;
}
.rail-head {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--line); background: var(--stage-1);
  flex: none;
}
.ed-rail-r .rail-head { flex-direction: row; }
.rail-head-title { font-weight: 800; font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); flex: 1 1 auto; }
.rail-collapse { padding: 2px 9px; margin: 0; font-size: var(--text-base); line-height: 1; flex: none; }

/* The collapsed spine (rotated label + expand chevron). Hidden when open. */
.rail-expand {
  display: none;
  align-items: center; gap: var(--s-3);
  width: 100%; height: 100%;
  background: var(--stage-1); border: none; color: var(--ink-dim);
  cursor: pointer; writing-mode: vertical-rl;
  padding: var(--s-3) 0; font-weight: 700; letter-spacing: 0.08em;
}
.rail-expand:hover { color: var(--ink); background: var(--stage-2); }
.rail-expand-chev { writing-mode: horizontal-tb; font-size: var(--text-lg); }
.rail-spine-label { text-transform: uppercase; font-size: var(--text-xs); }

/* Collapsed state: hide the panel + head, show the spine. */
body[data-left="collapsed"] .ed-rail-l > .rail-head,
body[data-left="collapsed"] .ed-rail-l > #transcript-panel { display: none; }
body[data-left="collapsed"] .ed-rail-l > .rail-expand { display: flex; }
body[data-right="collapsed"] .ed-rail-r > .rail-head,
body[data-right="collapsed"] .ed-rail-r > .ed-rail-scroll { display: none; }
body[data-right="collapsed"] .ed-rail-r > .rail-expand { display: flex; }

/* Left rail holds the transcript panel; it fills the rail below the head. */
.ed-rail-l > #transcript-panel { flex: 1 1 auto; min-height: 0; border-radius: 0; border: none; box-shadow: none; }
/* Right rail: inspector + cuts scroll together inside the rail. */
.ed-rail-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--s-3); display: flex; flex-direction: column; gap: var(--s-3); }

/* ── Center stage: big letterboxed monitor + transport ─────────────────────── */
.ed-stage { min-width: 0; min-height: 0; background: var(--stage-0); overflow: hidden; }
.ed-preview { display: flex; flex-direction: column; height: 100%; min-height: 0; gap: 0; }
.pv-monitor { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; background: #000; padding: var(--s-3); }

/* ── Bottom dock ───────────────────────────────────────────────────────────── */
.ed-dock { display: flex; flex-direction: column; min-height: 0; background: var(--stage-0); overflow: hidden; }
/* The canvas sets its own content height (ruler + lanes + scene strip) inline;
   the wrap fills the dock row and scrolls if the lanes are taller than the dock. */
.ed-dock .ed-timeline-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; padding: var(--s-2) var(--s-3) 0; }
.dock-toolbar { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-1) var(--s-3) var(--s-2); flex: none; flex-wrap: wrap; }
.dock-toolbar .ed-help { margin: 0; flex: 1 1 auto; }
.dock-toolbar button { padding: 2px 11px; margin: 0; }

/* ── Drawers (Notes / Render) — slide in from the right over the workspace ──── */
/* The scrim is a full-viewport click-catcher (a click on it closes the drawer).
   It is deliberately NOT blurred and only whisper-dark: when a drawer is open the
   user is very often editing the Render/Section-boxes controls while WATCHING the
   live preview monitor change — a blurred/frosted stage defeated the whole
   WYSIWYG point. The drawer's own solid surface + shadow-pop convey modality; the
   scrim just needs to be clickable, so the monitor behind it stays crisp. */
.ed-scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,0.12);
}
.ed-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41;
  width: min(460px, 92vw);
  background: var(--stage-1); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; overflow: hidden;
}
.ed-drawer-head {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line);
  flex: none;
}
.ed-drawer-head h2 { margin: 0; flex: 1 1 auto; font-size: var(--text-lg); letter-spacing: -0.01em; }
.ed-drawer-close { padding: 3px 11px; margin: 0; font-size: var(--text-base); line-height: 1; }
.ed-drawer > .notes-panel { overflow-y: auto; flex: 1 1 auto; min-height: 0; max-width: none; }
/* The Highlights drawer body scrolls as a whole (its clip list can be long). */
.ed-drawer > .intro-panel { overflow-y: auto; flex: 1 1 auto; min-height: 0; padding: 0 var(--s-4) var(--s-4); }
/* The Render drawer is now a SINGLE scroll container — bg + rail + render sections
   stack inside .ed-drawer-scroll and the whole thing scrolls, so nothing is stranded
   below the fold (the old layout only scrolled .render-panel). */
.ed-drawer-scroll { overflow-y: auto; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ed-drawer-scroll > .render-panel { margin: 0; border: none; border-radius: 0; box-shadow: none; max-width: none; overflow: visible; }
/* Section boxes drawer — its OWN slide-in (mirrors Highlights). The rail card gets
   side/bottom breathing room and the whole body scrolls on overflow (the style
   controls are long). The card carries its own border/shadow, so no extra chrome. */
.ed-drawer-sections .ed-drawer-scroll { padding: 0 var(--s-4) var(--s-4); }
.ed-drawer-sections .ed-drawer-scroll > .rail-panel { flex: none; min-width: 0; }
.ed-drawer-sections .rail-section { margin-top: var(--s-3); }

/* ── Theme drawer — presets + component swaps + layout transform (its OWN drawer) ── */
.ed-drawer-theme .ed-drawer-scroll { padding: 0 var(--s-4) var(--s-4); }
.ed-drawer-theme .ed-drawer-scroll > .theme-panel { flex: none; min-width: 0; }
.tp { display: flex; flex-direction: column; gap: var(--s-4); padding-top: var(--s-3); }
.tp.is-disabled { opacity: .5; pointer-events: none; }
.tp-sec { display: flex; flex-direction: column; gap: var(--s-2); }
.tp-sec-head { display: flex; align-items: center; gap: var(--s-2); }
.tp-sec-head .tp-h { flex: 1 1 auto; }
.tp-h { margin: 0; color: var(--ink); font-size: var(--text-base); font-weight: 700; letter-spacing: -0.01em; }
.tp-sub { margin: 0; }
.tp-reset { padding: 2px 11px; margin: 0; font-size: var(--text-xs); }
.tp-reset:disabled { opacity: .5; }
/* Preset cards — the headline choice. Big, tappable, ember-accented when active. */
.tp-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.tp-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: var(--s-3); margin: 0; border: 1px solid var(--line); border-radius: var(--r-tile);
  background: var(--stage-0); color: var(--ink); cursor: pointer; position: relative;
  transition: border-color .12s, background .12s;
}
.tp-card:hover { border-color: var(--accent-line); }
.tp-card.is-active { border-color: var(--accent); background: var(--accent-soft); }
.tp-card-title { font-weight: 700; font-size: var(--text-sm); }
.tp-card-blurb { font-size: var(--text-xs); color: var(--ink-dim); line-height: 1.3; }
.tp-card-chip {
  position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 700;
  color: var(--accent); text-transform: uppercase; letter-spacing: .04em; display: none;
}
.tp-card.is-active .tp-card-chip { display: block; }
/* When no theme is applied yet (old EDL), dim the preset chips (nothing selected). */
.tp.tp-no-theme .tp-card { opacity: .96; }
/* Component + slider rows */
.tp-rows { display: flex; flex-direction: column; gap: var(--s-2); }
.tp-row { display: grid; grid-template-columns: 7em 1fr auto; align-items: center; gap: var(--s-2); }
.tp-row-lab { color: var(--ink-dim); font-size: var(--text-sm); }
.tp-select { width: 100%; margin: 0; padding: 3px 8px; font-size: var(--text-sm); }
.tp-mark { font-size: 10px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .03em; min-width: 3.2em; text-align: right; }
.tp-mark.is-on { color: var(--accent); font-weight: 700; }
.tp-slider-row .tp-slider { width: 100%; accent-color: var(--accent); margin: 0; }
.tp-readout { font-variant-numeric: tabular-nums; font-size: var(--text-xs); color: var(--ink); min-width: 3.4em; text-align: right; }
/* Legacy backgrounds — collapsed, quiet; the theme is the default surface now. */
.tp-legacy { margin-top: var(--s-3); border-top: 1px solid var(--line); padding-top: var(--s-2); }
.tp-legacy > summary { cursor: pointer; color: var(--ink-dim); font-size: var(--text-sm); padding: var(--s-1) 0; }
.tp-legacy[open] > summary { color: var(--ink); }
.ed-drawer-theme .tp-legacy > .bg-panel { padding: var(--s-2) 0 0; }

/* ── Responsive: narrow two-rail (900–1200) and stacked (<900) ─────────────── */
/* 900–1200px: keep the three regions in-grid but narrow the rails so the monitor
   stays usable. The transcript can still be collapsed to its 36px spine via the
   chevron or the toolbar's #rail-l-toggle (both flip body[data-left]). This keeps
   the collapse mechanism identical to ≥1200 — no separate overlay state. */
@media (min-width: 900px) and (max-width: 1200px) {
  body.editor { --rail-l: 280px; --rail-r: 270px; }
  .ed-rail-toggle { display: inline-flex; }
}
@media (min-width: 1200px) {
  /* the transcript toolbar toggle is redundant with the chevron at full width */
  .ed-rail-toggle { display: none; }
}

/* <900px: stacked. Monitor first, then transcript + inspector as collapsibles,
   timeline last. The grid becomes a simple flow column. */
@media (max-width: 899px) {
  .ed-workspace {
    display: flex; flex-direction: column;
    height: auto; overflow: visible; gap: var(--s-3);
    background: transparent; padding: var(--s-3);
  }
  .ed-stage { order: 1; }
  .ed-rail-l { order: 2; }
  .ed-rail-r { order: 3; }
  .ed-dock { order: 4; }
  .pv-monitor { padding: 0; }
  .pv-stage { max-height: 42vh; }
  .ed-rail, .ed-dock, .ed-stage { border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
  .ed-rail-l > #transcript-panel { border: none; }
  .tp-scroller { min-height: 240px; max-height: 50vh; }
  .ed-dock { min-height: 260px; }
  .ed-dock .ed-timeline-wrap { overflow-x: auto; }
  /* collapsed rails don't apply the spine treatment when stacked */
  body[data-left="collapsed"] .ed-rail-l > .rail-head,
  body[data-left="collapsed"] .ed-rail-l > #transcript-panel,
  body[data-right="collapsed"] .ed-rail-r > .rail-head,
  body[data-right="collapsed"] .ed-rail-r > .ed-rail-scroll { display: revert; }
  body[data-left="collapsed"] .ed-rail-l > .rail-expand,
  body[data-right="collapsed"] .ed-rail-r > .rail-expand { display: none; }
  .ed-rail-toggle { display: none; }
  .ed-drawer { width: 100vw; }
}

/* ── Transcript panel ──────────────────────────────────────────────────────── */
.ed-transcript {
  background: var(--stage-2); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; overflow: hidden;
}
.ed-transcript:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent-line); }
.tp-bar {
  display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line); background: var(--stage-1);
}
.tp-search { flex: 1 1 140px; margin: 0; min-width: 120px; }
.tp-search-info { color: var(--ink-faint); font-size: var(--text-xs); }
.tp-hint { color: var(--ink-faint); font-size: var(--text-xs); flex-basis: 100%; }
/* '✂ Cut selection' affordance in the transcript header — Ember-styled, appears only
   when words are selected. Cuts the selection via the same path as Delete. */
.tp-cut {
  display: inline-flex; align-items: center; gap: var(--s-1); flex: none;
  margin: 0; padding: 4px 11px;
  background: var(--grad-ember); color: #fff; border: none;
  border-radius: var(--r-sm); font-weight: 700; font-size: var(--text-xs);
  line-height: 1.2; cursor: pointer; box-shadow: var(--shadow-card);
}
.tp-cut:hover { filter: brightness(1.08); }
.tp-cut:active { filter: brightness(0.96); }
.tp-cut-ico { font-size: var(--text-sm); line-height: 1; }
/* Scroller fills the rail below the search bar (was a fixed 62vh; the rail now
   owns the height). clientHeight-driven virtualization is unaffected. */
.tp-scroller { position: relative; flex: 1 1 auto; min-height: 200px; overflow-y: auto; overflow-x: hidden; }
.tp-sizer { position: relative; width: 100%; }
.tp-block { position: absolute; left: 0; right: 0; padding: 0 var(--s-4) var(--s-3); box-sizing: border-box; }
.tp-turn-head {
  display: flex; align-items: center; gap: var(--s-2); padding: 6px var(--s-2);
  margin: 4px 0 var(--s-2); border-radius: var(--r-sm);
  background: var(--stage-1); border: 1px solid var(--line);
}
.tp-chip { width: 11px; height: 11px; border-radius: var(--r-chip); flex: none; box-shadow: 0 0 0 2px var(--stage-1); }
.tp-speaker { font-weight: 800; color: var(--ink); font-size: var(--text-sm); letter-spacing: -0.01em; }
.tp-ts { color: var(--ink-faint); font-size: var(--text-xs); font-variant-numeric: tabular-nums; margin-left: auto; }
.tp-para { line-height: 1.6; color: var(--ink); font-size: var(--text-base); }
.tw { cursor: pointer; border-radius: 4px; padding: 0 1px; transition: background var(--dur-fast) var(--ease); }
.tw:hover { background: var(--accent-soft); }
.tw-filler { text-decoration: underline dotted var(--accent-line); text-underline-offset: 3px; }
.tw-cut { text-decoration: line-through; color: var(--ink-faint); opacity: 0.75; }
.tw-cut:hover { color: var(--ink); background: var(--accent-soft); }
.tw-sel { background: var(--accent-soft); }
.tw-now { background: var(--grad-ember); color: #fff; }
.tw-match { outline: 2px solid var(--accent); outline-offset: 1px; }
.tp-empty { padding: var(--s-5); color: var(--ink-dim); }
.tp-empty h3 { margin: 0 0 var(--s-2); color: var(--ink); }

/* ── Cuts drawer ───────────────────────────────────────────────────────────── */
.cuts-drawer {
  background: var(--stage-2); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--s-4); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: var(--s-3);
}
.cuts-head { display: flex; align-items: baseline; gap: var(--s-2); }
.cuts-head h3 { margin: 0; color: var(--ink); }
.cuts-summary { color: var(--ink-dim); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.cuts-tools { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.cuts-toggle { display: flex; align-items: center; gap: var(--s-1); color: var(--ink-dim); font-size: var(--text-sm); margin: 0; }
.cuts-toggle input { margin: 0; accent-color: var(--accent); }
.cut-list { display: flex; flex-direction: column; gap: var(--s-1); max-height: 40vh; overflow-y: auto; }
.cut-empty { color: var(--ink-faint); font-size: var(--text-sm); margin: 0; }
.cut-chip {
  display: flex; align-items: center; gap: var(--s-2);
  background: var(--stage-1); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: var(--s-1) var(--s-2);
  transition: border-color var(--dur) var(--ease);
}
.cut-chip:hover { border-color: var(--line-strong); }
.cut-src {
  font-size: var(--text-xs); padding: 2px 8px; border-radius: var(--r-chip); flex: none;
  border: 1px solid var(--line); color: var(--ink-dim); font-weight: 700;
}
.cut-src.src-user, .cut-src.src-transcript { color: #fff; background: var(--grad-ember); border-color: transparent; }
.cut-mid { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-width: 0; }
.cut-label { color: var(--ink); font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cut-dur { color: var(--ink-faint); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.cut-jump { padding: 3px 9px; margin: 0; font-size: var(--text-xs); }
.cut-del { padding: 2px 9px; margin: 0; font-size: var(--text-base); line-height: 1; }
.cuts-foot { display: flex; }

/* ── Notes tab ─────────────────────────────────────────────────────────────── */
.notes-panel { padding: var(--s-5); max-width: 820px; margin: 0 auto; }
.notes-savebar { display: flex; justify-content: flex-end; margin-bottom: var(--s-4); }
.notes-body { display: flex; flex-direction: column; gap: var(--s-4); }
.notes-sec {
  background: var(--stage-2); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--s-4); box-shadow: var(--shadow-card);
}
.notes-sec-head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-3); }
.notes-sec-head h3 { margin: 0; color: var(--ink); flex: 1 1 auto; letter-spacing: -0.01em; }
.notes-sec-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: none; border-radius: var(--r-sm);
  background: var(--accent-soft); color: var(--accent);
  font-size: var(--text-base); line-height: 1;
}
.copy-btn { padding: 3px 11px; margin: 0; font-size: var(--text-xs); }
.copy-btn.is-copied { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.notes-ta { width: 100%; margin: 0; resize: vertical; font-family: inherit; }
.notes-chapters { display: flex; flex-direction: column; gap: var(--s-2); }
.notes-chapter { display: flex; align-items: center; gap: var(--s-2); }
.ch-time {
  padding: 3px 9px; margin: 0; font-size: var(--text-xs); font-variant-numeric: tabular-nums;
  flex: none; background: var(--stage-3); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-chip);
}
.ch-time:hover { border-color: var(--accent-line); color: var(--accent); }
.ch-title { flex: 1 1 auto; margin: 0; }

/* ── Timeline ──────────────────────────────────────────────────────────────── */
.ed-timeline-wrap { padding: var(--s-4); }
.ed-timeline {
  display: block; width: 100%;
  background: var(--stage-1);
  border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  cursor: crosshair; outline: none;
  touch-action: none;            /* we own pan/zoom/select via Pointer Events; block native gestures */
}
.ed-timeline:focus { border-color: var(--accent-line); box-shadow: var(--shadow-card), 0 0 0 1px var(--accent-line); }
.ed-help { color: var(--ink-faint); font-size: var(--text-xs); margin: var(--s-2) 0 0; }

/* ── Dock edit-control cluster (relocated beside the scrubber) ──────────────────
   Split / Merge / Cut / Restore + a Layout quick-switch, mounted in the bottom dock
   toolbar by editor.js. Compact + Ember-styled; wraps rather than overflowing. The
   `.dock-toolbar <selector>` specificity beats the generic `.dock-toolbar button`
   padding rule above so these read tighter. */
.dock-tools { display: inline-flex; align-items: center; gap: var(--s-1); flex-wrap: wrap; }
.dock-toolbar .dock-tool {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; margin: 0; font-size: var(--text-xs); line-height: 1;
}
.dock-toolbar .dock-tool:disabled { opacity: .4; cursor: default; }
.dock-tool-glyph { font-size: var(--text-sm); line-height: 1; }
.dock-tool-label { font-weight: 700; }
.dock-sep { width: 1px; align-self: stretch; min-height: 20px; background: var(--line); margin: 0 var(--s-1); flex: none; }
.dock-layouts { display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.dock-toolbar .dock-ly {
  min-width: 26px; padding: 3px 8px; margin: 0;
  font-size: var(--text-xs); font-weight: 700; font-variant-numeric: tabular-nums;
}
.dock-toolbar .dock-ly:disabled { opacity: .4; cursor: default; }
.dock-toolbar .dock-ly.is-active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
/* Cut button reflects a live timeline range selection (ember tint). */
.dock-toolbar .dock-tool.has-selection { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
/* Cut-to-start / cut-to-end: glyph-only (⇤✂ / ✂⇥), kept compact + tight. */
.dock-toolbar .dock-edgecut .dock-tool-glyph { letter-spacing: -1px; }

/* People-count stepper in the dock: [−] [count] [+]. Mirrors the .dock-ly chips. */
.dock-people { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.dock-toolbar .dock-people-btn {
  min-width: 24px; padding: 3px 8px; margin: 0;
  font-size: var(--text-sm); font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dock-toolbar .dock-people-btn:disabled { opacity: .4; cursor: default; }
.dock-people-count {
  min-width: 20px; padding: 0 4px; text-align: center;
  font-size: var(--text-xs); font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.dock-people.is-empty .dock-people-count { color: var(--ink-dim); }

/* ── Timeline right-click menu (Cut selection / Clear / Split here) ─────────────
   A small floating menu the orchestrator opens on canvas right-click. position:fixed
   at the pointer, closed on outside-click / blur / after a choice. */
.tl-menu {
  position: fixed; z-index: 60; min-width: 178px;
  background: var(--stage-2); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow-card); padding: 4px; display: flex; flex-direction: column;
}
.tl-menu-item {
  display: block; width: 100%; text-align: left; margin: 0;
  background: none; border: 0; padding: 6px 10px; border-radius: 6px;
  color: var(--ink); font-size: var(--text-xs); line-height: 1.2; cursor: pointer;
}
.tl-menu-item:hover, .tl-menu-item:focus { background: var(--accent-soft); outline: none; }
.tl-menu-danger { color: var(--accent); font-weight: 700; }
.tl-menu-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.dock-ly-auto { font-variant-numeric: normal; font-weight: 800; letter-spacing: 0.02em; }

/* Row legend — always breaks to its own line under the controls (flex-basis:100%),
   so the segmented speaking bars / scene strip / cold-open band are self-explanatory. */
.dock-legend { flex-basis: 100%; display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-1); }
.dock-legend-item { display: inline-flex; align-items: center; gap: var(--s-1); color: var(--ink-dim); font-size: var(--text-xs); }
.dl-swatch { width: 14px; height: 10px; border-radius: 2px; flex: none; border: 1px solid var(--line); }
.dl-speaking { background: hsl(32 70% 50%); }         /* seat-0 speaking-bar hue (matches the lanes) */
.dl-scenes { background: var(--stage-2); }
.dl-comingup { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: var(--accent-line); }

/* ── Editor columns (legacy 2-col — kept for any consumer) ──────────────────── */
.ed-cols {
  display: grid; grid-template-columns: 1fr 340px; gap: var(--s-4);
  padding: 0 var(--s-4) var(--s-5);
  align-items: start;
}
@media (max-width: 900px) { .ed-cols { grid-template-columns: 1fr; } }

/* ── Preview MONITOR + TRANSPORT ────────────────────────────────────────────── */
/* NOTE: tile geometry (position/left/top/width/height/display) is set inline by
   preview.js — CSS here only dresses the chrome, never the tile math. The stage
   letterboxes on the short axis inside the .pv-monitor grid (place-items:center):
   it keeps a true 16:9 and grows to the available height, black bars fill the rest. */
.pv-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%; height: auto;
  max-height: 100%; max-width: 100%;
  margin: auto;
  background: #000;
  border: 1px solid var(--line); border-radius: var(--r-tile); overflow: hidden;
  box-shadow: var(--shadow-tile);
}
.pv-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* THEME composite overlays — drawn slot frames (canvas) over the tiles, and the VP9
   header loop at the top. Both are pointer-transparent so the tile-transform chrome
   still receives pointerdown on the tiles beneath. DOM order (frames → header →
   intro → rail/chrome) gives the correct paint stacking without z-index juggling. */
.pv-frames { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pv-header { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; object-fit: fill; }

/* Transport bar — sits directly under the monitor. Icon-first, grouped with
   hairline dividers; drives preview.js's transport engine. */
/* ONE horizontal, non-wrapping row: scene ⏮ · frame ⟨ · PLAY/PAUSE (largest,
   center) · frame ⟩ · scene ⏭ · loop … time (pushed right). J/K/L shuttle is
   keyboard-only, so those buttons no longer exist. */
.pv-transport {
  display: flex; align-items: center; gap: var(--s-1); flex-wrap: nowrap;
  padding: var(--s-2) var(--s-3);
  background: var(--stage-1); border-top: 1px solid var(--line);
  flex: none;
}
.pv-tbtn {
  padding: 4px 10px; margin: 0; min-width: 34px; flex: none;
  font-size: var(--text-sm); line-height: 1.1;
}
/* PLAY/PAUSE — the largest, central transport control. */
.pv-play { min-width: 48px; padding: 6px 14px; font-size: var(--text-lg); }
.pv-tbtn.is-playing, .pv-tbtn.is-on {
  background: var(--grad-ember); color: #fff; border-color: transparent;
}
.pv-time {
  margin-left: auto; flex: none;
  font-variant-numeric: tabular-nums; color: var(--ink);
  font-size: var(--text-sm); font-weight: 600; padding: 0 var(--s-2);
}
.pv-transport[data-rate]:not([data-rate=""]) .pv-time::after {
  content: " ·×" attr(data-rate); color: var(--accent); font-weight: 700;
}
/* Preview AUDIO controls — mute toggle + a compact volume slider, grouped with the
   transport. The mute button reuses .pv-tbtn; updateMuteBtn() flips its glyph to a
   struck speaker (🔇) when muted/silent and adds .is-blocked (ember) when the browser's
   autoplay policy refuses un-muted sound (press Play again to grant). */
.pv-mute.is-blocked {
  background: var(--grad-ember); color: #fff; border-color: transparent;
}
.pv-mute.is-muted { opacity: 0.72; }
.pv-vol {
  flex: none; width: 76px; margin: 0 0 0 2px; padding: 0;
  accent-color: var(--accent); cursor: pointer; vertical-align: middle;
}
/* Folder line — ONE compact single row at the very bottom of the stage:
   "📁 <folder> · mapped N/M tracks · [Change]". Small text; the status truncates,
   the Change button is a small ghost that never shrinks. */
.pv-bar {
  display: flex; align-items: center; gap: var(--s-2); flex-wrap: nowrap;
  padding: var(--s-1) var(--s-3); flex: none; border-top: 1px solid var(--line);
}
.pv-status {
  flex: 1 1 auto; min-width: 0; color: var(--ink-dim); font-size: var(--text-xs);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pv-change { flex: none; padding: 2px 10px; margin: 0; font-size: var(--text-xs); }
.pv-tiles { position: absolute; inset: 0; }
.pv-tile {
  position: absolute; overflow: hidden; background: #000;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.5);
}
/* The inner <video> is absolutely positioned so preview.js can offset/scale it from
   the crop rect (cropBox). Defaults (no crop) = full tile + object-fit:cover. */
.pv-tile video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.pv-name {
  position: absolute; left: 8px; bottom: 8px;
  color: #fff; font-size: var(--text-sm); font-weight: 600;
  padding: 3px 10px; border-radius: var(--r-chip);
  background: rgba(0,0,0,0.5); backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Render panel ──────────────────────────────────────────────────────────── */
.render-panel {
  margin-top: var(--s-4);
  background: var(--stage-2); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--s-4); box-shadow: var(--shadow-card);
}
.render-panel h3 { margin-top: 0; color: var(--ink); }

/* ── Inspector ─────────────────────────────────────────────────────────────── */
/* The inspector is a plain flex column. VERTICAL SCROLL is owned by the RIGHT RAIL's
   `.ed-rail-scroll` (overflow-y:auto + min-height:0, bounded by the workspace grid
   row) — the inspector + cuts scroll together there, so every section stays reachable
   however tall the content gets. We deliberately do NOT put overflow on the inspector
   itself (that would nest a second scrollbar inside the rail's). min-width:0 + the
   wrap guards below keep the column INSIDE the rail so number grids / long labels no
   longer run off the right edge and get clipped by the rail's overflow:hidden. */
.ed-inspector {
  display: flex; flex-direction: column; gap: var(--s-3);
  min-width: 0; max-width: 100%;
}
.ed-inspector, .ed-inspector * { min-width: 0; }
/* Long, unbreakable strings (folder names, refs) wrap instead of forcing width. */
.ed-inspector .insp-title, .ed-inspector .insp-bg-val,
.ed-inspector .people-name, .ed-inspector .slot-who,
.ed-inspector select, .ed-inspector option { overflow-wrap: anywhere; }

/* Collapsible inspector sections (<details>): the long single tab is now a stack of
   expand/collapse groups (Layout, People, Tile layout, Trim, Auto-edit params) whose
   open/closed state is remembered for the session. Ember-styled, hairline-ringed. */
.insp-group {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--stage-1); overflow: hidden;
}
.insp-group-sum {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  font-weight: 700; color: var(--ink); font-size: var(--text-sm);
}
.insp-group-sum::-webkit-details-marker { display: none; }
.insp-group-sum::before {
  content: "\25B8"; flex: none; color: var(--ink-faint); font-size: var(--text-xs);
  transition: transform var(--dur) var(--ease);
}
.insp-group[open] > .insp-group-sum::before { transform: rotate(90deg); color: var(--accent); }
.insp-group-sum:hover { background: var(--stage-2); }
.insp-group-sum:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.insp-group-title { flex: 1 1 auto; letter-spacing: -0.01em; }
.insp-group-count { flex: none; color: var(--ink-faint); font-size: var(--text-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.insp-group-body {
  display: flex; flex-direction: column; gap: var(--s-2);
  padding: var(--s-3); border-top: 1px solid var(--line);
}

/* Scene container is now a plain column (its sub-sections carry their own chrome). */
.insp-scene {
  display: flex; flex-direction: column; gap: var(--s-3);
}
/* Sub-blocks (People / Tile layout) drop their own top separator inside a group. */
.insp-group-body > .insp-people,
.insp-group-body > .insp-tile { border-top: none; margin-top: 0; padding-top: 0; }
/* The scene header + Split/Merge actions stay outside the collapsibles as context. */
.insp-scene-head { display: flex; flex-direction: column; gap: var(--s-2); }
.insp-empty { color: var(--ink-dim); }
.insp-head { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.insp-title { font-weight: 700; color: var(--ink); }
.insp-range { color: var(--ink-dim); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.insp-src {
  font-size: var(--text-xs); padding: 2px 9px; border-radius: var(--r-chip);
  border: 1px solid var(--line); color: var(--ink-dim); font-weight: 700; margin-left: auto;
}
.insp-src.src-user { color: #fff; background: var(--grad-ember); border-color: transparent; }
.insp-field { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.insp-field > span { color: var(--ink-dim); font-size: var(--text-sm); }
.insp-field select, .insp-field input { margin: 0; }
.insp-sublabel { color: var(--ink-dim); font-size: var(--text-sm); }
.insp-slots { display: flex; flex-direction: column; gap: var(--s-1); }
.slot-row { display: flex; align-items: center; gap: var(--s-1); }
.slot-idx {
  width: 22px; height: 22px; flex: none; text-align: center; line-height: 22px;
  color: var(--ink-dim); font-size: var(--text-sm); font-weight: 700;
  background: var(--stage-3); border-radius: var(--r-sm);
}
.slot-who { flex: 1 1 auto; margin: 0; }
.slot-btn { padding: 2px 9px; margin: 0; }
.insp-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.insp-block {
  border-top: 1px solid var(--line); padding-top: var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-2);
}
.insp-block h3 { margin: 0; color: var(--ink); font-size: var(--text-base); }
.trim-in { width: 100%; margin: 0; }
.p-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--s-1) var(--s-2); }
.p-label { color: var(--ink-dim); font-size: var(--text-sm); }
.p-range { grid-column: 1 / -1; width: 100%; margin: 0; accent-color: var(--accent); }
.p-val { color: var(--ink); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }

/* ── Process episode (in-browser pipeline) ─────────────────────────────────── */
.proc-topbar { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-2); }
.proc-topbar h1 { margin: 0; flex: 1 1 auto; letter-spacing: -0.02em; }
.proc-panel {
  background: var(--stage-1); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--s-5); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: var(--s-4); max-width: 760px;
}
.proc-intro { color: var(--ink-dim); margin: 0; }
.proc-folder { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.proc-status { color: var(--ink-dim); font-size: var(--text-sm); }
/* detected-participant chip row (populated by process.js afterFolder) */
.proc-cast { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.proc-cast:empty { display: none; }
.proc-cast-chip {
  display: inline-flex; align-items: center; gap: var(--s-2);
  background: var(--stage-2); border: 1px solid var(--line);
  border-radius: var(--r-chip); padding: 3px 11px 3px 8px;
  font-size: var(--text-xs); color: var(--ink); font-weight: 600;
}
.proc-cast-dot { width: 9px; height: 9px; border-radius: var(--r-chip); flex: none; }
.proc-ready { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.proc-reproc { display: flex; align-items: center; gap: var(--s-1); color: var(--ink-dim); font-size: var(--text-sm); margin: 0; }
.proc-reproc input { margin: 0; accent-color: var(--accent); }
.proc-counts { color: var(--ink-dim); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.proc-warn { color: var(--warn, var(--ink-dim)); font-size: var(--text-sm); padding: var(--s-2); border-left: 3px solid var(--warn, var(--accent)); background: var(--surface-2, transparent); border-radius: var(--radius-sm, 4px); }

.proc-stages { display: flex; flex-direction: column; gap: var(--s-2); }
.proc-stage {
  border: 1px solid var(--line); border-radius: var(--r-card);
  padding: var(--s-3) var(--s-4); background: var(--stage-2);
  display: flex; flex-direction: column; gap: var(--s-2);
  transition: border-color var(--dur) var(--ease);
}
.proc-stage[data-status="running"] { border-color: var(--accent-line); }
.proc-stage[data-status="done"] { border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.proc-stage[data-status="error"] { border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.proc-stage-head { display: flex; align-items: center; gap: var(--s-2); }
/* per-row status LED, driven entirely by [data-status] (no JS needed) */
.proc-stage-head::before {
  content: ""; width: 10px; height: 10px; flex: none; border-radius: var(--r-chip);
  background: transparent; box-shadow: inset 0 0 0 2px var(--ink-faint);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.proc-stage[data-status="running"] .proc-stage-head::before {
  background: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 28%, transparent);
  animation: proc-led-pulse 1s var(--ease) infinite;
}
.proc-stage[data-status="done"] .proc-stage-head::before { background: var(--ok); box-shadow: none; }
.proc-stage[data-status="skipped"] .proc-stage-head::before { background: var(--ink-faint); box-shadow: none; }
.proc-stage[data-status="error"] .proc-stage-head::before { background: var(--danger); box-shadow: none; }
@keyframes proc-led-pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .proc-stage-head::before { animation: none !important; } }

.proc-stage-name { font-weight: 700; color: var(--ink); flex: none; min-width: 12ch; }
.proc-stage-status { color: var(--ink-dim); font-size: var(--text-sm); flex: 1 1 auto; min-width: 0; }
.proc-retry { padding: 3px 11px; margin: 0; font-size: var(--text-xs); flex: none; }
.proc-bar {
  height: 8px; border-radius: var(--r-chip); overflow: hidden;
  background: color-mix(in srgb, #ffffff 6%, transparent);
}
.proc-fill { height: 100%; width: 0; background: var(--grad-ember); transition: width var(--dur) var(--ease); }
.proc-stage[data-status="done"] .proc-fill,
.proc-stage[data-status="skipped"] .proc-fill { background: var(--ok); }
.proc-stage[data-status="skipped"] .proc-fill { opacity: 0.5; }
.proc-stage[data-status="error"] .proc-fill { background: var(--danger); }
.proc-stage[data-status="error"] .proc-stage-status { color: var(--danger); }
.proc-stage[data-status="running"] .proc-stage-name::after { content: " …"; color: var(--ink-faint); }

/* ── "Run it on your computer" — generate run-episode.cmd ────────────────────── */
.proc-runscript {
  display: flex; flex-direction: column; gap: var(--s-3);
  border: 1px solid var(--line); border-radius: var(--r-card);
  padding: var(--s-4); background: var(--stage-2);
}
.proc-runscript-h { margin: 0; color: var(--ink); letter-spacing: -0.01em; font-size: var(--text-base); }
.proc-runscript .cmd-row { margin: 0; }
.proc-runscript-btns { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.proc-runscript .hint { margin: 0; }
/* callout steering big recordings to the run script above */
.proc-bignote {
  color: var(--ink); font-size: var(--text-sm); margin: 0;
  padding: var(--s-2) var(--s-3);
  border-left: 3px solid var(--accent, var(--primary));
  background: color-mix(in srgb, var(--accent, var(--primary)) 8%, transparent);
  border-radius: var(--r-sm);
}

/* — toolbar/timeline/rails — ─────────────────────────────────────────────────
   The editing-TOOL GROUPS that mount INSIDE the shell's `.ed-toolbar` (edit /
   layout / generate), plus the per-scene hover affordance overlay. The shell
   owns `.ed-toolbar` itself, the `.ed-workspace` grid, the rails/spines, the
   dock strip and the drawers — this block never restyles those; it only adds the
   tool-group internals + the hover HUD. Ember tokens only; no hardcoded color. */

/* Tool groups sit as flex items in the shell's single-row scrolling toolbar. */
.tb-group { display: inline-flex; align-items: center; gap: var(--s-1); flex: none; }
.tb-div { width: 1px; align-self: stretch; min-height: 22px; background: var(--line); margin: 0 var(--s-2); flex: none; }
.tb-btn {
  display: inline-flex; align-items: center; gap: var(--s-1);
  min-width: 34px; height: 32px; padding: 0 var(--s-2); margin: 0;
  background: transparent; color: var(--ink-dim);
  border: 1px solid transparent; border-radius: var(--r-btn);
  cursor: pointer; line-height: 1;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.tb-btn:hover:not(:disabled) { background: var(--stage-2); color: var(--ink); border-color: var(--line); }
.tb-btn:active:not(:disabled) { transform: scale(.96); }
.tb-btn:disabled { opacity: .38; cursor: default; }
.tb-glyph { font-size: var(--text-base); }
.tb-label { font-size: var(--text-sm); font-weight: 700; }
.tb-auto .tb-glyph { color: var(--accent); }
/* layout quick-switch tiles (SVG diagram from the shared geometry) */
.tb-ly { padding: 0 8px; }
.tb-ly-ico { width: 26px; height: 15px; display: block; color: var(--ink-faint); }
.tb-ly-ico rect { fill: currentColor; }
.tb-ly:hover:not(:disabled) .tb-ly-ico { color: var(--ink); }
.tb-ly.is-active { border-color: var(--accent-line); background: var(--accent-soft); }
.tb-ly.is-active .tb-ly-ico { color: var(--accent); }

/* Auto-edit params popover (mirrors the inspector params block). Fixed-position
   + body-mounted so it escapes the toolbar's overflow-x clip. */
.tb-pop {
  position: fixed; z-index: 60; min-width: 240px;
  display: flex; flex-direction: column; gap: var(--s-2);
  background: var(--stage-2); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow-pop); padding: var(--s-3);
}
.tb-pop-h { font-weight: 700; color: var(--ink); font-size: var(--text-sm); }
.tb-pop-row { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--s-2); align-items: center; }
.tb-pop-lab { color: var(--ink-dim); font-size: var(--text-sm); }
.tb-pop-val { color: var(--ink); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.tb-pop-range { grid-column: 1 / -1; width: 100%; margin: 0; accent-color: var(--accent); }
.tb-pop-regen { margin-top: var(--s-1); }

/* Per-scene hover affordance overlay (floated above the scene strip inside the
   shell's `.ed-timeline-wrap`, which the JS makes position:relative). */
.scene-hud {
  position: absolute; z-index: 12;
  transform: translate(-50%, -100%); margin-top: -5px;
  display: flex; align-items: center; gap: 2px; padding: 3px;
  background: var(--stage-3); border: 1px solid var(--line);
  border-radius: var(--r-sm); box-shadow: var(--shadow-pop);
}
.scene-hud[hidden] { display: none; }
.hud-btn, .hud-ly {
  min-width: 26px; height: 24px; padding: 0 7px; margin: 0;
  font-size: var(--text-sm); line-height: 1;
  background: transparent; color: var(--ink-dim);
  border: 1px solid transparent; border-radius: var(--r-sm); cursor: pointer;
}
.hud-btn:hover:not(:disabled), .hud-ly:hover { background: var(--stage-1); color: var(--ink); }
.hud-btn:disabled { opacity: .4; cursor: default; }
.hud-ly { font-weight: 700; font-variant-numeric: tabular-nums; }
.hud-ly.is-active { color: var(--accent); background: var(--accent-soft); }

/* ── Touch targets: ≥44px hit area on coarse pointers (phones/tablets) ─────────
   Desktop (fine pointer) keeps the compact sizes above; these only apply to touch. */
@media (pointer: coarse) {
  /* Dock edit cluster: Split / Merge / Cut / Restore / Undo / Redo (.dock-tool) and
     the Layout quick-switch (.dock-ly) — bump from ~22px to 44px. */
  .dock-toolbar .dock-tool,
  .dock-toolbar .dock-ly { min-height: 44px; padding: 8px 12px; }
  .dock-toolbar .dock-ly { min-width: 44px; }
  /* Zoom strip + Fit (they use bare .ghost in the dock-toolbar). */
  .dock-toolbar #zoom-in,
  .dock-toolbar #zoom-out,
  .dock-toolbar #fit-btn { min-height: 44px; min-width: 44px; }
  /* Transport bar under the monitor. */
  .pv-tbtn { min-height: 44px; min-width: 44px; }
  .pv-play { min-height: 48px; min-width: 56px; }
  .pv-vol { width: 96px; min-height: 44px; }
  /* Scene HUD affordances (split / merge / layout) floated over the scene strip. */
  .hud-btn, .hud-ly { min-height: 44px; min-width: 44px; padding: 0 12px; }
  .scene-hud { gap: 4px; padding: 5px; flex-wrap: wrap; max-width: calc(100vw - 24px); justify-content: center; }
  /* Timeline right-click / long-press menu items. */
  .tl-menu-item { padding: 12px 14px; min-height: 44px; }
  .tl-menu { min-width: 200px; }
}

/* ── Background panel (top of the Render drawer) ───────────────────────────────
   Export-facing: a master On/Off toggle + one dropdown per speaker-count view. */
.ed-drawer > .bg-panel, .ed-drawer-scroll > .bg-panel { flex: none; padding: var(--s-4) var(--s-4) 0; }
.bg-section {
  background: var(--stage-2); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--s-4); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: var(--s-2);
}
.bg-h { margin: 0; color: var(--ink); }
.bg-section .hint { margin: 0; }
.bg-master {
  display: flex; align-items: center; gap: var(--s-2);
  margin-top: var(--s-1); font-weight: 600; color: var(--ink); cursor: pointer;
}
.bg-master-cb { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.bg-master-txt { font-size: var(--text-sm); }
.bg-rows { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-1); }
.bg-row { display: grid; grid-template-columns: 5.5em 1fr; align-items: center; gap: var(--s-3); }
.bg-row-lab { color: var(--ink-dim); font-size: var(--text-sm); }
.bg-select {
  width: 100%; margin: 0; padding: 5px 8px;
  background: var(--stage-1); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--text-sm);
}
.bg-select:disabled { opacity: .5; }
.bg-section.is-off .bg-rows { opacity: .55; }
.bg-refresh { align-self: flex-start; margin: var(--s-1) 0 0; padding: 4px 12px; font-size: var(--text-sm); }
.bg-refresh:disabled { opacity: .5; cursor: default; }
.bg-foot { color: var(--ink-faint); font-size: var(--text-xs); }

/* ── Topic rail panel (Render drawer) — mirrors the background section chrome ── */
.rail-section {
  background: var(--stage-2); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--s-4); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-3);
}
.rail-h { margin: 0; color: var(--ink); }
.rail-section .hint { margin: 0; }
.rail-master {
  display: flex; align-items: center; gap: var(--s-2);
  margin-top: var(--s-1); font-weight: 600; color: var(--ink); cursor: pointer;
}
.rail-master-cb { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.rail-master-txt { font-size: var(--text-sm); }
.rail-opts { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-1); }
.rail-opt { display: flex; align-items: center; gap: var(--s-2); cursor: pointer; }
.rail-opt-lab { color: var(--ink-dim); font-size: var(--text-sm); }
.rail-opt-sync .rail-sync-cb { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }
.rail-mv {
  width: 4em; margin: 0; padding: 4px 6px; background: var(--stage-1); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--text-sm);
}
.rail-list { display: flex; flex-direction: column; gap: var(--s-1); margin-top: var(--s-1); }
.rail-list.is-disabled { opacity: .5; pointer-events: none; }
.rail-box-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center;
  gap: var(--s-2); padding: 4px 6px; border-radius: var(--r-sm);
  background: var(--stage-1); border: 1px solid var(--line); cursor: pointer;
}
.rail-box-row.is-user { border-left: 3px solid var(--accent); }
.rail-box-label {
  min-width: 0; margin: 0; padding: 4px 6px; background: var(--stage-0); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--text-sm);
}
.rail-box-time { display: flex; align-items: center; gap: 2px; }
.rail-box-secs {
  width: 4.5em; margin: 0; padding: 4px 6px; background: var(--stage-0); color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--text-xs); text-align: right;
}
.rail-box-ctl { display: flex; align-items: center; gap: 1px; }
.rail-ico {
  padding: 2px 6px; font-size: var(--text-xs); line-height: 1;
  min-width: 22px; text-align: center;
}
.rail-ico:disabled { opacity: .35; cursor: default; }
.rail-box-del:hover { color: var(--danger, #e5484d); }
.rail-empty { color: var(--ink-faint); font-size: var(--text-xs); }
.rail-foot { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-1); }
.rail-add, .rail-resync { padding: 4px 12px; font-size: var(--text-sm); }
.rail-add:disabled, .rail-resync:disabled { opacity: .5; cursor: default; }
.rail-section.is-off .rail-list, .rail-section.is-off .rail-foot { opacity: .55; }

/* ── Topic-rail STYLE controls (size / spacing / colours / vertical / solo) ──── */
.rail-style {
  display: flex; flex-direction: column; gap: var(--s-2);
  margin-top: var(--s-2); padding-top: var(--s-2);
  border-top: 1px solid var(--line);
}
.rail-style-h {
  margin: 0; font-size: var(--text-xs); font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-dim);
}
.rail-ctl { display: grid; grid-template-columns: 6.5em 1fr 4em; align-items: center; gap: var(--s-2); }
.rail-ctl-lab { color: var(--ink-dim); font-size: var(--text-sm); }
.rail-ctl-val { color: var(--ink-faint); font-size: var(--text-xs); text-align: right; font-variant-numeric: tabular-nums; }
.rail-slider { width: 100%; margin: 0; accent-color: var(--accent); cursor: pointer; }
.rail-colors { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.rail-color { display: flex; align-items: center; gap: var(--s-2); cursor: pointer; }
.rail-color-sw {
  width: 28px; height: 22px; margin: 0; padding: 0; flex: none;
  background: var(--stage-0); border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer;
}
.rail-color-lab { color: var(--ink-dim); font-size: var(--text-xs); min-width: 0; }
.rail-bg-row { display: flex; flex-direction: column; gap: var(--s-1); }
.rail-inactive-bg-row[hidden] { display: none; }
.rail-solo-row { grid-template-columns: 6.5em 1fr; }
.rail-solo {
  margin: 0; padding: 4px 6px; background: var(--stage-1); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--text-sm);
}
.rail-reset { align-self: flex-start; padding: 4px 12px; font-size: var(--text-sm); }

/* ── Chapters panel (its own drawer) ────────────────────────────────────────── */
.ed-drawer > .chapter-panel { overflow-y: auto; flex: 1 1 auto; min-height: 0; padding: var(--s-4); }
.chapter-section .rail-box-row { grid-template-columns: 1fr auto auto; }
.chapter-time { width: 5.5em; text-align: right; }
.chapter-warn {
  display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap;
  padding: 6px 10px; border-radius: var(--r-sm);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.chapter-warn-txt { color: var(--ink-dim); font-size: var(--text-xs); flex: 1 1 12em; }
.chapter-pin { padding: 3px 10px; font-size: var(--text-xs); flex: none; }
.ch-title-ro { display: inline-block; padding: 2px 0; color: var(--ink); }
.notes-manage-chapters { padding: 3px 10px; font-size: var(--text-xs); }

/* ── Cold-open intro panel (Render drawer) ──────────────────────────────────── */
.intro-section {
  background: var(--stage-2); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--s-4); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-3);
}
.intro-h { margin: 0; color: var(--ink); }
.intro-section .hint { margin: 0; }
.intro-master {
  display: flex; align-items: center; gap: var(--s-2);
  margin-top: var(--s-1); font-weight: 600; color: var(--ink); cursor: pointer;
}
.intro-master-cb { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.intro-master-txt { font-size: var(--text-sm); }
.intro-list { display: flex; flex-direction: column; gap: var(--s-1); margin-top: var(--s-1); }
.intro-list.is-disabled, .intro-settings.is-disabled { opacity: .5; pointer-events: none; }
.intro-clip-row {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label ctl" "who who" "times times" "trans trans";
  gap: 4px 6px; padding: 6px; border-radius: var(--r-sm);
  background: var(--stage-1); border: 1px solid var(--line); border-left: 3px solid var(--accent); cursor: pointer;
}
.intro-clip-row.is-selected { background: var(--accent-soft, rgba(255,106,61,0.12)); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.intro-clip-label { grid-area: label; min-width: 0; margin: 0; padding: 4px 6px;
  background: var(--stage-0); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--text-sm); }
.intro-clip-who { grid-area: who; margin: 0; padding: 4px 6px;
  background: var(--stage-0); color: var(--ink-dim); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--text-xs); }
.intro-clip-times { grid-area: times; display: flex; align-items: center; gap: 4px; }
.intro-clip-secs { width: 4.5em; margin: 0; padding: 4px 6px;
  background: var(--stage-0); color: var(--ink-dim); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--text-xs); text-align: right; }
.intro-dash { color: var(--ink-faint); }
.intro-clip-ctl { grid-area: ctl; display: flex; align-items: center; gap: 1px; }
.intro-ico { padding: 2px 6px; font-size: var(--text-xs); line-height: 1; min-width: 22px; text-align: center; }
.intro-ico:disabled { opacity: .35; cursor: default; }
.intro-clip-del:hover { color: var(--danger, #e5484d); }
.intro-empty { color: var(--ink-faint); font-size: var(--text-xs); }
.intro-add { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-1); }
.intro-add button { padding: 4px 12px; font-size: var(--text-sm); }
.intro-add button:disabled { opacity: .5; cursor: default; }
.intro-settings { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-2); }
.intro-opt { display: grid; grid-template-columns: 10em 1fr; align-items: center; gap: var(--s-2); }
.intro-opt-lab { color: var(--ink-dim); font-size: var(--text-sm); }
.intro-text, .intro-num, .intro-select {
  width: 100%; margin: 0; padding: 5px 8px; background: var(--stage-1); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--text-sm);
}
.intro-num { width: 6em; }
.intro-dur { color: var(--ink-faint); font-size: var(--text-xs); margin-top: var(--s-1); }
.intro-suggest { margin-top: var(--s-1); }
.intro-suggest summary { cursor: pointer; color: var(--ink-dim); font-size: var(--text-sm); }
.intro-section.is-off .intro-list, .intro-section.is-off .intro-add, .intro-section.is-off .intro-settings { opacity: .55; }

/* Per-clip transition row (cut/crossfade/dip/slide + duration) + regenerate. */
.intro-clip-trans { grid-area: trans; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.intro-clip-trans .intro-trans-lab { color: var(--ink-faint); font-size: var(--text-xs); }
.intro-trans-type { margin: 0; padding: 3px 6px; background: var(--stage-0); color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--text-xs); }
.intro-trans-dur { width: 4em; margin: 0; padding: 3px 6px; background: var(--stage-0); color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--text-xs); text-align: right; }
.intro-regen { color: var(--accent); }

/* Primary action bar: Generate · Preview · Include (the "save into the video"). */
.intro-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2);
  padding-top: var(--s-2); border-top: 1px solid var(--line); }
.intro-actions button { padding: 5px 12px; font-size: var(--text-sm); }
.intro-actions .intro-generate { border-color: var(--accent); color: var(--accent); }
.intro-actions .intro-preview.is-playing { background: var(--accent); color: #1a0f0a; }
.intro-actions button:disabled { opacity: .5; cursor: default; }

/* Candidate pick-list (suggestHighlights results). */
.intro-cands { display: flex; flex-direction: column; gap: var(--s-1); margin-top: var(--s-2); }
.intro-cands-head { display: flex; align-items: center; justify-content: space-between; }
.intro-cands-title { color: var(--ink-dim); font-size: var(--text-sm); font-weight: 600; }
.intro-cand {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-2);
  padding: 6px 8px; border-radius: var(--r-sm); background: var(--stage-1); border: 1px solid var(--line);
}
.intro-cand.is-used { opacity: .5; }
.intro-cand-star { padding: 2px 8px; font-size: var(--text-base); line-height: 1; color: var(--accent); min-width: 30px; }
.intro-cand-star:disabled { color: var(--ink-faint); }
.intro-cand-main { min-width: 0; }
.intro-cand-text { color: var(--ink); font-size: var(--text-sm); display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intro-cand-meta { color: var(--ink-faint); font-size: var(--text-xs); }
.intro-cand-score { color: var(--accent); font-variant-numeric: tabular-nums; font-size: var(--text-xs); font-weight: 700; }
.intro-cands-empty { color: var(--ink-faint); font-size: var(--text-xs); }

/* Intro-playback canvas overlay on the monitor stage (WYSIWYG cold-open preview). */
.pv-intro-canvas { position: absolute; inset: 0; width: 100%; height: 100%;
  display: none; z-index: 20; background: #000; }
.pv-intro-canvas.is-active { display: block; }
.pv-intro-badge { position: absolute; left: 10px; top: 8px; z-index: 21; display: none;
  padding: 2px 10px; border-radius: 999px; font-size: var(--text-xs); font-weight: 700; letter-spacing: .08em;
  background: var(--accent); color: #1a0f0a; pointer-events: none; }
.pv-intro-badge.is-active { display: block; }

/* Toolbar quick On/Off — accent tint when the background is ON. */
.tb-bg.is-on { border-color: var(--accent-line); background: var(--accent-soft); }
.tb-bg.is-on .tb-glyph, .tb-bg.is-on .tb-label { color: var(--accent); }

/* Inspector: which background the selected scene resolves to. */
.insp-bg {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
  margin-top: var(--s-1); font-size: var(--text-xs);
}
.insp-bg-lab { color: var(--ink-faint); }
.insp-bg-val { color: var(--ink-dim); font-weight: 600; text-align: right; }

/* ── Render drawer: the outputs list (what render.cmd writes into out/) ───────── */
.render-outputs {
  list-style: none; margin: var(--s-3) 0 0; padding: 0;
  display: flex; flex-direction: column; gap: var(--s-2);
}
.render-outputs li {
  display: flex; gap: var(--s-2); align-items: baseline;
  color: var(--ink-dim); font-size: var(--text-sm);
  padding-left: var(--s-3); position: relative;
}
.render-outputs li::before {
  content: ""; position: absolute; left: 0; top: 0.55em;
  width: 6px; height: 6px; border-radius: var(--r-chip); background: var(--accent);
}
.render-outputs code { color: var(--code); }

/* ── Toolbar '?' help button — pushed to the far right of the tool row ────────── */
.tb-help-btn {
  margin-left: auto; flex: none;
  min-width: 30px; padding: 4px 10px; font-weight: 800; line-height: 1;
}

/* ── Keyboard-shortcuts overlay (centered modal, '?' toggles, Esc closes) ─────── */
.shortcuts-scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: var(--s-4);
}
.shortcuts-card {
  width: min(460px, 96vw); max-height: 86vh; overflow-y: auto;
  background: var(--stage-1); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow-pop);
  padding: var(--s-5);
}
.shortcuts-head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-4); }
.shortcuts-h { margin: 0; flex: 1 1 auto; color: var(--ink); letter-spacing: -0.01em; font-size: var(--text-lg); }
.shortcuts-close { padding: 3px 11px; margin: 0; font-size: var(--text-base); line-height: 1; }
.shortcuts-list {
  display: grid; grid-template-columns: auto 1fr;
  gap: var(--s-3) var(--s-4); margin: 0; align-items: center;
}
.shortcuts-keys { display: flex; gap: var(--s-1); flex-wrap: wrap; margin: 0; }
.shortcuts-kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; padding: 2px 7px;
  background: var(--stage-3); color: var(--ink);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--r-sm);
  font-family: inherit; font-size: var(--text-xs); font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.shortcuts-desc { margin: 0; color: var(--ink-dim); font-size: var(--text-sm); }

/* ── Notes: YouTube-chapters export block ─────────────────────────────────────── */
.notes-sec .yt-chapters {
  margin: var(--s-2) 0 0; white-space: pre-wrap; word-break: break-word;
  max-height: 40vh; overflow-y: auto;
}

/* ════════════════════════════════════════════════════════════════════════════
   TILE TRANSFORM (Wave 3) — the direct-manipulation chrome over the monitor + the
   inspector's Tile-layout block. The chrome (transform.js) mounts INSIDE .pv-stage
   and is positioned in % by the JS; CSS only dresses it. Ember tokens only. */

/* Selection chrome: accent outline over the selected tile, 8 resize handles + a
   crop-mode button. In crop mode it goes dashed and shows a CROP label. */
.tf-chrome {
  position: absolute; z-index: 6; box-sizing: border-box;
  outline: 2px solid var(--accent); outline-offset: -1px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.55), 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent);
  cursor: move; touch-action: none; user-select: none;
}
.tf-chrome[hidden] { display: none; }
.tf-chrome.is-crop { outline-style: dashed; cursor: grab; }
.tf-chrome.is-crop:active { cursor: grabbing; }

.tf-handle {
  position: absolute; width: 12px; height: 12px; box-sizing: border-box;
  background: var(--accent); border: 1px solid #fff; border-radius: 2px;
  z-index: 7; touch-action: none;
}
.tf-h-nw { left: -6px; top: -6px; cursor: nwse-resize; }
.tf-h-n  { left: 50%; top: -6px; margin-left: -6px; cursor: ns-resize; }
.tf-h-ne { right: -6px; top: -6px; cursor: nesw-resize; }
.tf-h-e  { right: -6px; top: 50%; margin-top: -6px; cursor: ew-resize; }
.tf-h-se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.tf-h-s  { left: 50%; bottom: -6px; margin-left: -6px; cursor: ns-resize; }
.tf-h-sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.tf-h-w  { left: -6px; top: 50%; margin-top: -6px; cursor: ew-resize; }

/* The handles all sit OUTSIDE the chrome box, so the interior corners are free —
   keep the crop button + mode label INSIDE so the stage's overflow:hidden never
   clips them (top-row tiles: solo, grids). */
.tf-crop-btn {
  position: absolute; top: 5px; right: 5px; margin: 0; z-index: 8;
  padding: 2px 9px; font-size: var(--text-xs); font-weight: 700; line-height: 1.4;
  background: rgba(0,0,0,0.55); color: #fff; cursor: pointer;
  border: 1px solid var(--accent-line); border-radius: var(--r-chip);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.tf-crop-btn:hover { background: rgba(0,0,0,0.72); }
.tf-crop-btn.is-on { background: var(--grad-ember); color: #fff; border-color: transparent; }
.tf-mode-label {
  position: absolute; top: 6px; left: 6px; z-index: 8;
  padding: 1px 6px; border-radius: var(--r-chip);
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  font-size: var(--text-xs); font-weight: 800; letter-spacing: 0.12em;
  color: var(--accent); text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.tf-mode-label[hidden] { display: none; }

/* Inspector Tile-layout block. */
.insp-tile {
  display: flex; flex-direction: column; gap: var(--s-2);
  border-top: 1px solid var(--line); margin-top: var(--s-2); padding-top: var(--s-3);
}
.insp-tile-h { margin: 0; color: var(--ink); font-size: var(--text-sm); letter-spacing: 0.02em; }
.insp-hint { margin: 0; color: var(--ink-faint); font-size: var(--text-xs); line-height: 1.5; }
.tile-scope { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); }
.tile-scope-opt {
  display: inline-flex; align-items: center; gap: var(--s-1);
  color: var(--ink-dim); font-size: var(--text-sm); margin: 0; cursor: pointer;
}
.tile-scope-opt input { margin: 0; accent-color: var(--accent); }
.tile-nums {
  display: grid; grid-template-columns: auto repeat(4, 1fr);
  align-items: center; gap: var(--s-1) var(--s-2);
}
.tile-nums-lab { color: var(--ink-dim); font-size: var(--text-xs); font-weight: 700; }
.tile-num-cell { display: flex; flex-direction: column; gap: 1px; margin: 0; min-width: 0; }
.tile-num-ax { color: var(--ink-faint); font-size: 10px; font-weight: 700; text-align: center; }
.tile-num {
  width: 100%; margin: 0; padding: 3px 4px; text-align: right;
  font-variant-numeric: tabular-nums; font-size: var(--text-xs);
}
.tile-num:disabled { opacity: .5; }
.tile-crop-en {
  display: inline-flex; align-items: center; gap: var(--s-1);
  color: var(--ink-dim); font-size: var(--text-sm); margin: 0; cursor: pointer;
}
.tile-crop-en input { margin: 0; accent-color: var(--accent); }
.tile-resets { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.tile-resets button { padding: 3px 10px; margin: 0; font-size: var(--text-xs); }

/* ════════════════════════════════════════════════════════════════════════════
   WAVE 4 — snap-to-slot overlay, drop-to-swap highlight, People section, Auto chip.
   Ember tokens only; the JS positions everything in %. */

/* Designed-slot overlay: shown while dragging a tile. Faint dashed frames mark the
   background's manifest slots; the active magnetic-snap target glows accent. */
.tf-slots { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.tf-slots[hidden] { display: none; }
.tf-slot {
  position: absolute; box-sizing: border-box;
  border: 1px dashed color-mix(in srgb, var(--ink) 28%, transparent);
  border-radius: var(--r-sm);
}
.tf-slot.is-active {
  border: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 0 14px color-mix(in srgb, var(--accent) 55%, transparent);
}
/* Drop-to-swap: the tile the dragged one will swap with lights up before release. */
.pv-tile.tf-swap-target {
  outline: 2px solid var(--accent); outline-offset: -2px;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent),
              0 0 16px color-mix(in srgb, var(--accent) 45%, transparent);
}

/* Toolbar 'Auto' layout chip — text pill beside the variant glyphs. */
.tb-ly-auto {
  padding: 0 10px; font-size: var(--text-xs); font-weight: 800; letter-spacing: 0.02em;
  color: var(--ink-dim);
}
.tb-ly-auto:hover:not(:disabled) { color: var(--ink); }
.tb-ly-auto.is-active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }

/* Inspector — 'People in this scene' (+ Add / − Remove person). */
.insp-people {
  display: flex; flex-direction: column; gap: var(--s-2);
  border-top: 1px solid var(--line); margin-top: var(--s-2); padding-top: var(--s-3);
}
.people-list { display: flex; flex-direction: column; gap: var(--s-1); }
.people-row { display: flex; align-items: center; gap: var(--s-2); }
.people-idx {
  width: 22px; height: 22px; flex: none; text-align: center; line-height: 22px;
  color: var(--ink-dim); font-size: var(--text-sm); font-weight: 700;
  background: var(--stage-3); border-radius: var(--r-sm);
}
.people-name { flex: 1 1 auto; color: var(--ink); font-size: var(--text-sm);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-x { flex: none; padding: 2px 9px; margin: 0; font-size: var(--text-xs); line-height: 1.4; }
.people-x:disabled { opacity: .4; cursor: default; }
.people-add-sel { width: 100%; margin: 0; }
.people-hint { margin: 0; }

/* Panel jump-highlight — when the header "Section boxes" / "Highlights" buttons
   open the Render drawer, briefly ring the target panel so the eye lands on the
   right controls (they share the drawer with Background + render outputs). */
.panel-flash {
  border-radius: 12px;
  animation: panelFlash 1.4s ease-out 1;
}
@keyframes panelFlash {
  0%   { box-shadow: 0 0 0 2px var(--accent-line), 0 0 22px var(--accent-soft); background: var(--accent-soft); }
  100% { box-shadow: 0 0 0 0 transparent; background: transparent; }
}

/* ── Import a recording — picker CTA + modal flow ─────────────────────────────
   The entry point sits above the session list; the flow itself runs in a centered
   modal. Ember tokens only; the modal mirrors the delete-dialog scrim conventions. */
.import-cta {
  display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap;
  margin: 0 0 var(--s-5); padding: var(--s-4);
  background: var(--stage-2); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow-card);
}
.import-cta-btn { flex: none; margin: 0; display: inline-flex; align-items: center; gap: var(--s-2); }
.import-cta-ico { font-size: var(--text-lg); line-height: 1; }
.import-cta-help { margin: 0; color: var(--ink-dim); font-size: var(--text-sm); flex: 1 1 220px; min-width: 200px; }

.imp-scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: var(--s-4);
}
.imp-card {
  width: min(560px, 96vw); max-height: 90vh; overflow-y: auto;
  background: var(--stage-1); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
}
.imp-head {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line);
}
.imp-h { margin: 0; flex: 1 1 auto; font-size: var(--text-lg); letter-spacing: -0.01em; color: var(--ink); }
.imp-x { flex: none; padding: 3px 9px; margin: 0; line-height: 1; }
.imp-body { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }
.imp-lede { margin: 0; color: var(--ink); font-size: var(--text-base); }
.imp-fine { margin: 0; color: var(--ink-faint); font-size: var(--text-sm); }
.imp-fine a { color: var(--accent); }
.imp-steps { margin: 0; padding-left: 1.3em; color: var(--ink-dim); font-size: var(--text-sm); display: flex; flex-direction: column; gap: var(--s-1); }
.imp-steps code, .imp-note code { color: var(--code); }
.imp-actions { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; margin-top: var(--s-1); }
.imp-actions button { margin: 0; }

.imp-note {
  background: var(--stage-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-3); color: var(--ink-dim); font-size: var(--text-sm);
}
.imp-note p { margin: 0; }

.imp-warn {
  color: var(--ink); font-size: var(--text-sm);
  padding: var(--s-3); border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: var(--r-sm);
}

.imp-field { display: flex; flex-direction: column; gap: var(--s-1); }
.imp-field-label { color: var(--ink-dim); font-size: var(--text-sm); font-weight: 700; }
.imp-input { width: 100%; margin: 0; }

.imp-people { display: flex; flex-direction: column; gap: var(--s-2); }
.imp-person {
  display: flex; align-items: flex-start; gap: var(--s-3);
  background: var(--stage-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: var(--s-3);
}
.imp-seat {
  flex: none; align-self: center; min-width: 4.5em;
  font-size: var(--text-xs); font-weight: 800; letter-spacing: 0.04em;
  color: var(--accent); text-transform: uppercase;
}
.imp-person-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.imp-name { margin: 0; }
.imp-person-meta { color: var(--ink-faint); font-size: var(--text-xs); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.imp-tag { color: var(--ink-dim); font-size: var(--text-xs); }
.imp-tag-warn { color: var(--accent); }
.imp-person-ctrls { flex: none; display: flex; gap: 2px; align-self: center; }
.imp-move { padding: 2px 8px; margin: 0; line-height: 1; font-size: var(--text-sm); }
.imp-move:disabled { opacity: .35; cursor: default; }
.imp-move-danger:hover:not(:disabled) { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, transparent); }

.imp-working { display: flex; align-items: center; gap: var(--s-3); color: var(--ink); font-size: var(--text-base); }
.imp-work-status { min-width: 0; }
.imp-spinner {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--line-strong); border-top-color: var(--accent);
  animation: imp-spin 0.8s linear infinite;
}
@keyframes imp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .imp-spinner { animation: none; } }

/* ── Featured callouts ─────────────────────────────────────────────────────── */
/* Card overlay on the monitor stage: transparent (the live backdrop + header show
   through), pointer-transparent, fades in/out with the shared enter/exit animation. */
.pv-callout-canvas { position: absolute; inset: 0; width: 100%; height: 100%;
  display: none; z-index: 22; background: transparent; pointer-events: none;
  opacity: 0; transition: opacity 120ms ease; }
.pv-callout-canvas.is-active { display: block; opacity: 1; }

/* Callouts drawer body */
.callout-panel { display: block; }
.callout-section .rail-h { margin-bottom: var(--s-1); }
.callout-list { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-2); }
.callout-row { border: 1px solid var(--stage-3); border-left: 3px solid var(--accent);
  border-radius: var(--radius-s, 8px); background: var(--stage-1); padding: var(--s-2);
  display: flex; flex-direction: column; gap: var(--s-2); }
.callout-row-head { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.callout-type { min-width: 7rem; }
.callout-time-wrap { display: inline-flex; align-items: center; gap: 4px; }
.callout-time { width: 5.5rem; text-align: center; }
.callout-ctl { display: inline-flex; gap: 2px; margin-left: auto; }
.callout-del { color: var(--danger, #e5484d); }
.callout-kicker-hint { font-size: var(--text-xs); letter-spacing: .12em; font-weight: 700;
  color: var(--accent); opacity: .85; }
.callout-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-1); }
.callout-field { display: flex; flex-direction: column; gap: 2px; }
.callout-field-label { font-size: var(--text-xs); color: var(--ink-dim); }
.callout-field input, .callout-field select { width: 100%; }
.callout-duration { width: 6rem; }
.callout-cover-row { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.callout-cover-thumb { width: 48px; height: 66px; border-radius: 4px; border: 1px solid var(--stage-3);
  background: var(--stage-2) center/cover no-repeat; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 9px; line-height: 1.1; color: var(--ink-faint); padding: 2px; flex: 0 0 auto; }
.callout-cover-thumb.has-img { color: transparent; }
.callout-cover-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.callout-cover-btn, .callout-fetch-cover { font-size: var(--text-xs); }

/* Per-type media section: link chips + visual controls + screenshot hint */
.callout-media { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-1); }
.callout-thumbs { display: flex; gap: 6px; flex: 0 0 auto; }
.callout-app-thumb { width: 66px; height: 42px; }   /* landscape app-shot inset thumb */
.callout-chip-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.callout-chip-label { font-size: var(--text-xs); color: var(--ink-faint); }
.callout-chip { font-size: var(--text-xs); font-weight: 600; }
.callout-chip-hint { font-size: var(--text-xs); color: var(--ink-faint); }
.callout-shot-hint { border-top: 1px dashed var(--stage-3); padding-top: var(--s-1); }
.callout-shot-hint .hint { margin: 0 0 4px; }
.callout-shot-cmd { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.callout-shot-cmd code { font-size: 11px; background: var(--stage-2); border: 1px solid var(--stage-3);
  border-radius: 4px; padding: 2px 6px; overflow-x: auto; white-space: nowrap; max-width: 100%; }
.callout-shot-copy { font-size: var(--text-xs); flex: 0 0 auto; }
.callout-detect-row { margin-top: var(--s-2); }
.callout-detect { font-weight: 600; }

/* Candidate pick-list (from Detect mentions) */
.callout-candidates { margin-top: var(--s-2); border: 1px solid var(--stage-3);
  border-radius: var(--radius-s, 8px); background: var(--stage-0); padding: var(--s-2); }
.callout-cand-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.callout-cand-title { font-weight: 700; font-size: var(--text-s); }
.callout-cand-list { display: flex; flex-direction: column; gap: 4px; margin-top: var(--s-1); }
.callout-cand-row { display: flex; align-items: flex-start; gap: var(--s-2);
  padding: 4px 6px; border-radius: 6px; }
.callout-cand-row:hover { background: var(--stage-1); }
.callout-cand-star { font-size: 1.1rem; line-height: 1; padding: 0 4px; color: var(--accent); }
.callout-cand-body { flex: 1 1 auto; min-width: 0; cursor: pointer; }
.callout-cand-l1 { display: flex; align-items: baseline; gap: 6px; }
.callout-cand-glyph { flex: 0 0 auto; }
.callout-cand-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.callout-cand-time { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-dim); font-size: var(--text-xs); }
.callout-cand-author { font-size: var(--text-xs); color: var(--ink-dim); }
.callout-cand-quote { font-size: var(--text-xs); color: var(--ink-faint); font-style: italic; }
.callout-cand-err { color: var(--danger, #e5484d); }
