:root, :root.theme-light {
  color-scheme: light;
  --bg: #f4f6fa; --panel: #fff; --panel2: #f8f9fc; --ink: #141a24; --muted: #667085; --line: #e1e6ee;
  --brand: #2b5fd9; --brand-ink: #fff; --link: #2b5fd9; --ok: #0d6b31; --warn: #8a3b0a; --bad: #b3241a; --chip: #eef1f7;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 14px rgba(16,24,40,.06); --r: 10px; --side: 232px; --side-rail: 64px;
}
:root.theme-dark {
  color-scheme: dark;
  --bg: #0d1017; --panel: #151a23; --panel2: #1a2029; --ink: #e8ecf3; --muted: #93a0b4; --line: #262d39;
  --brand: #6b95ff; --brand-ink: #0b1220; --link: #8fb0ff; --ok: #4ade80; --warn: #fbbf24; --bad: #ff7b72; --chip: #212837;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
}
/* PotatoLabs Brand — the DEFAULT theme: orange accent, white text, rgb(40,40,40) base (matches the studio/CG products) */
:root.theme-brand {
  color-scheme: dark;
  --bg: rgb(40,40,40); --panel: #303030; --panel2: #383838; --ink: #ffffff; --muted: #bdbdbd; --line: #4a4a4a;
  --brand: #fb923c; --brand-ink: rgb(40,40,40); --link: #fb923c; --ok: #4ade80; --warn: #fbbf24; --bad: #ff8a80; --chip: #3d3d3d;
  --shadow: 0 1px 2px rgba(0,0,0,.45), 0 8px 22px rgba(0,0,0,.4);
}
/* User theme: tokens + --accent-N / --base-N / --text-N ramps are written inline on <html> by theme-core.js.
   The blocks below use the ramps directly (with color-mix for opacity variants) so each axis can be customised independently. */
:root[data-accent="custom"] .btn.primary:hover { background: var(--accent-400); border-color: var(--accent-400); }
:root[data-accent="custom"] :focus-visible { outline-color: var(--accent-400); }
:root[data-accent] aside a.nav.active { background: color-mix(in srgb, var(--accent-500) 16%, transparent); color: var(--link); }
:root[data-accent] .tabs a.on { color: var(--link); border-color: var(--accent-500); }
:root[data-accent] tr.sel { background: color-mix(in srgb, var(--accent-500) 12%, transparent) !important; }
:root[data-base="custom"] .search, :root[data-base="custom"] input, :root[data-base="custom"] select, :root[data-base="custom"] textarea { background: color-mix(in srgb, var(--panel) 70%, var(--bg)); }
:root[data-text="custom"] .muted, :root[data-text="custom"] th { color: color-mix(in srgb, var(--ink) 62%, var(--bg)); }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14.5px/1.5 Inter, system-ui, -apple-system, "Segoe UI", "Noto Sans", "Noto Sans Devanagari", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--link, var(--brand)); text-decoration: none; } a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; } h2 { font-size: 15px; margin: 0 0 10px; } h3 { font-size: 13px; margin: 0 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.muted { color: var(--muted); } .num { font-variant-numeric: tabular-nums; } .spacer { flex: 1; } .hidden { display: none !important; }

/* layout */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100%; }
aside { background: var(--panel); border-right: 1px solid var(--line); padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 4px 10px 14px; font-size: 15px; }
.logo svg { width: 28px; height: 28px; border-radius: 7px; }
aside h4 { margin: 14px 10px 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
aside a.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
aside a.nav:hover { background: var(--panel2); text-decoration: none; }
aside a.nav.active { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--link, var(--brand)); font-weight: 600; }
aside a.nav .ic { width: 18px; text-align: center; opacity: .85; } aside a.nav .badge { margin-left: auto; }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel2); border-radius: 8px; padding: 7px 12px; color: var(--muted); cursor: pointer; }
.search kbd { margin-left: auto; }
kbd { font: 11px ui-monospace, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--panel); }
main { padding: 22px; max-width: 1360px; width: 100%; margin: 0 auto; }
.pagehead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  aside { position: fixed; z-index: 30; left: 0; width: 260px; transform: translateX(-100%); transition: transform .18s; box-shadow: var(--shadow); }
  aside.open { transform: none; } .menu-btn { display: inline-flex; } main { padding: 14px; } .topbar { padding: 8px 12px; gap: 6px; }
  .topbar > .chip, .topbar > .muted { display: none; } .search { min-width: 0; flex: 1 1 0; overflow: hidden; white-space: nowrap; } .search kbd { display: none; }
  .pagehead h1 { font-size: 19px; } .pagehead .btn, .pagehead input { max-width: 100%; }
}

/* components */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; } .row.tight { gap: 6px; } .stack { display: flex; flex-direction: column; gap: 10px; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .g2, .g3, .g4 { grid-template-columns: 1fr 1fr; } } @media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 7px 13px; border-radius: 8px; cursor: pointer; font: inherit; min-height: 34px; white-space: nowrap; }
.btn:hover { background: var(--panel2); text-decoration: none; } .btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; } .btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); } .btn.sm { padding: 3px 9px; min-height: 28px; font-size: 13px; } .btn.ghost { border-color: transparent; background: transparent; } .btn:disabled { opacity: .45; cursor: not-allowed; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-height: 34px; max-width: 100%; }
textarea { width: 100%; min-height: 84px; resize: vertical; line-height: 1.55; }
input[type=checkbox] { min-height: 0; width: 16px; height: 16px; }
.table-wrap { overflow-x: auto; } table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; background: var(--panel2); white-space: nowrap; }
tbody tr:hover { background: color-mix(in srgb, var(--brand) 4%, transparent); } tr.sel { background: color-mix(in srgb, var(--brand) 10%, transparent) !important; }
tbody tr:last-child td { border-bottom: 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; background: var(--chip); font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip.ok, .chip.approved, .chip.published, .chip.done, .chip.sent, .chip.live, .chip.up { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.chip.warn, .chip.review, .chip.pending, .chip.ready, .chip.degraded, .chip.in_progress, .chip.sensitive { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.chip.bad, .chip.killed, .chip.stale, .chip.dead, .chip.failed, .chip.down, .chip.legal { color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, transparent); }
.banner { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 9%, var(--panel)); color: var(--ink); }
.banner.bad { border-color: color-mix(in srgb, var(--bad) 55%, transparent); background: color-mix(in srgb, var(--bad) 9%, var(--panel)); }
.banner.ok { border-color: color-mix(in srgb, var(--ok) 55%, transparent); background: color-mix(in srgb, var(--ok) 9%, var(--panel)); }
.stat { padding: 14px 16px; } .stat b { display: block; font-size: 26px; letter-spacing: -.02em; } .stat span { color: var(--muted); font-size: 12.5px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; } .tabs a.on { color: var(--brand); border-color: var(--brand); font-weight: 600; text-decoration: none; }
.toasts { position: fixed; right: 14px; bottom: 14px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 28px)); }
.toasts .banner { margin: 0; box-shadow: var(--shadow); }
.overlay { position: fixed; inset: 0; background: rgba(8,12,20,.55); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 14px 14px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: min(560px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.35); max-height: 80vh; display: flex; flex-direction: column; }
.modal header { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; } .modal .body { padding: 16px 18px; overflow: auto; } .modal footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; padding: 14px 18px; font-size: 16px; }
.palette ul { list-style: none; margin: 0; padding: 6px; overflow: auto; } .palette li { padding: 8px 12px; border-radius: 8px; cursor: pointer; display: flex; gap: 10px; } .palette li.on { background: color-mix(in srgb, var(--brand) 14%, transparent); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; } .dot.up { background: var(--ok); } .dot.down { background: var(--bad); }

/* script editor */
.blocks { display: flex; flex-direction: column; gap: 8px; }
.blk { display: grid; grid-template-columns: 112px minmax(150px, 220px) 1fr auto; gap: 8px; align-items: start; border-left: 3px solid var(--brand); padding-left: 8px; }
.blk.note { border-color: var(--muted); } .blk.note textarea { font-style: italic; background: var(--panel2); } .blk.sot, .blk.pkg { border-color: var(--warn); } .blk.vo { border-color: var(--ok); }
.titlein { width: 100%; font-size: 20px; font-weight: 650; border-color: transparent; padding-left: 0; background: transparent; } .titlein:focus { border-color: var(--line); padding-left: 10px; }
@media (max-width: 700px) { .blk { grid-template-columns: 1fr; } }
.diff .add { background: color-mix(in srgb, var(--ok) 15%, transparent); } .diff .del { background: color-mix(in srgb, var(--bad) 13%, transparent); text-decoration: line-through; } .diff div { padding: 3px 8px; border-radius: 4px; }
.suggest { border: 1px dashed var(--brand); border-radius: 8px; padding: 10px 12px; background: color-mix(in srgb, var(--brand) 6%, transparent); white-space: pre-wrap; }

/* rundown */
tr.stale td { background: color-mix(in srgb, var(--bad) 8%, transparent); }
tr.dragging { opacity: .4; } .handle { cursor: grab; color: var(--muted); user-select: none; }
.totals { display: flex; flex-wrap: wrap; gap: 28px; } .totals b { font-size: 20px; display: block; } .over { color: var(--bad); } .under { color: var(--ok); }
.bar { height: 8px; border-radius: 99px; background: var(--chip); overflow: hidden; } .bar i { display: block; height: 100%; background: var(--brand); } .bar.over i { background: var(--bad); }

/* prompter */
.prompter { position: fixed; inset: 0; background: #000; color: #fff; z-index: 80; display: flex; flex-direction: column; }
.prompter .bar2 { display: flex; gap: 10px; align-items: center; padding: 8px 14px; background: #111; color: #ccc; font-size: 13px; }
.prompter .copy { flex: 1; overflow-y: auto; padding: 8vh 12vw 60vh; font-size: var(--ps, 54px); line-height: 1.35; font-weight: 600; scroll-behavior: smooth; }
.prompter .copy p { margin: 0 0 .7em; opacity: .55; } .prompter .copy p.cur { opacity: 1; } .prompter .copy h2 { color: #7aa2ff; font-size: .45em; text-transform: uppercase; letter-spacing: .1em; margin: 1.6em 0 .4em; }
.login { max-width: 380px; margin: 12vh auto; padding: 0 14px; }
.field-app main { max-width: 560px; }
.blk.cflt { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 7%, transparent); }
tr.cue td { background: color-mix(in srgb, var(--brand) 14%, transparent); } tr.cue td:first-child { box-shadow: inset 4px 0 0 var(--brand); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 1fr); gap: 14px; overflow-x: auto; align-items: start; }
.diffrow-only_a td, .diffrow-only_b td { background: color-mix(in srgb, var(--warn) 10%, transparent); } .diffrow-moved td, .diffrow-duration td { background: color-mix(in srgb, var(--brand) 7%, transparent); }

/* ---- appearance picker ---- */
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; background: var(--chip); border-radius: 9px; }
.segbtn { flex: 1; border: 0; background: transparent; color: var(--ink); padding: 6px 10px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 13px; white-space: nowrap; }
.segbtn.on { background: var(--panel); box-shadow: var(--shadow); font-weight: 600; color: var(--link, var(--brand)); }
.axis { padding: 8px 0; border-top: 1px solid var(--line); } .axis:first-child { border-top: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; background-clip: padding-box; }
.sw.on { outline: 2px solid var(--brand); outline-offset: 2px; }
input[type=color].sw { appearance: none; -webkit-appearance: none; min-height: 28px; padding: 0; background: conic-gradient(#f43f5e, #f59e0b, #22c55e, #06b6d4, #6366f1, #f43f5e); overflow: hidden; }
input[type=color].sw::-webkit-color-swatch-wrapper { padding: 0; } input[type=color].sw::-webkit-color-swatch { border: 0; border-radius: 50%; }
.appearance.compact { width: 320px; max-width: calc(100vw - 32px); }
.popover { position: fixed; z-index: 70; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px; max-height: 80vh; overflow: auto; }

/* ---- advanced sidebar ---- */
[hidden] { display: none !important; }
.app { transition: grid-template-columns .16s ease; }
.app.collapsed { grid-template-columns: var(--side-rail) 1fr; }
aside { padding: 0; display: block; overflow: visible; position: sticky; top: 0; height: 100vh; z-index: 30; border-right: 0; background: transparent; }
.sidein { position: absolute; inset: 0 auto 0 0; width: 100%; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden; background: var(--panel); border-right: 1px solid var(--line); transition: width .16s ease, box-shadow .16s; }
aside .logo { padding: 2px 6px 12px; gap: 8px; } aside .logo .sidetoggle { padding: 2px 8px; min-height: 26px; }
aside .nav { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; position: relative; white-space: nowrap; }
aside .nav:hover { background: var(--panel2); text-decoration: none; }
aside .nav .ic { width: 20px; text-align: center; flex: none; opacity: .9; }
aside .nav .badge { margin-left: auto; min-width: 20px; justify-content: center; padding: 0 6px; font-size: 11.5px; font-weight: 700; }
aside .grph { display: flex; align-items: center; width: 100%; margin-top: 10px; padding: 4px 10px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; cursor: pointer; text-align: left; }
aside .grph .caret { margin-left: auto; transition: transform .15s; } aside .grph[aria-expanded=false] .caret { transform: rotate(-90deg); }
aside .grp.closed { display: none; }
.backdrop { display: none; }
/* collapsed = icon rail; hovering or focusing it expands it as an overlay (content does not jump) */
.app.collapsed aside:not(:hover):not(:has(:focus-visible)) .grph .caret { display: none; }
/* labels stay in the accessibility tree (screen readers) while visually hidden in the rail */
.app.collapsed aside:not(:hover):not(:has(:focus-visible)) .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.app.collapsed aside:not(:hover):not(:has(:focus-visible)) .grph { height: 1px; margin: 8px 12px; padding: 0; background: var(--line); font-size: 0; }
.app.collapsed aside:not(:hover):not(:has(:focus-visible)) .sidetoggle { display: none; }
.app.collapsed aside:not(:hover):not(:has(:focus-visible)) .logo { justify-content: center; padding-bottom: 12px; }
.app.collapsed aside:not(:hover):not(:has(:focus-visible)) .nav { justify-content: center; padding: 9px 0; }
.app.collapsed aside:not(:hover):not(:has(:focus-visible)) .nav .badge { position: absolute; top: 2px; right: 6px; margin: 0; min-width: 16px; font-size: 10px; padding: 0 4px; }
.app.collapsed aside:not(:hover):not(:has(:focus-visible)) .grp.closed { display: block; }
.app.collapsed aside:hover .sidein, .app.collapsed aside:has(:focus-visible) .sidein { width: var(--side); box-shadow: var(--shadow); }
.app.collapsed .sidein { width: var(--side-rail); }
@media (max-width: 900px) {
  .app, .app.collapsed { grid-template-columns: 1fr; }
  aside { position: fixed; inset: 0 auto 0 0; width: 272px; transform: translateX(-102%); transition: transform .18s; height: 100%; }
  aside.open { transform: none; }
  .sidein, .app.collapsed .sidein { width: 272px; box-shadow: var(--shadow); }
  .app.collapsed aside .lbl { position: static !important; width: auto !important; height: auto !important; overflow: visible !important; clip: auto !important; clip-path: none !important; } .app.collapsed aside .grph .caret { display: revert !important; } .app.collapsed aside .grph { height: auto !important; margin: 10px 0 0 !important; padding: 4px 10px !important; background: none !important; font-size: 11px !important; }
  .app.collapsed aside .nav { justify-content: flex-start !important; padding: 8px 10px !important; } .app.collapsed aside .nav .badge { position: static !important; margin-left: auto !important; }
  .app.collapsed aside .logo { justify-content: flex-start !important; } .sidetoggle { display: none !important; }
  aside.open + .backdrop { display: block; position: fixed; inset: 0; background: rgba(8,12,20,.5); z-index: 25; }
}

/* ---- live console (playout-style) ---- */
.console { font-variant-numeric: tabular-nums; }
.chead { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 14px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); position: sticky; top: 56px; z-index: 8; }
.crow .ctime { white-space: nowrap; }
.cclock { font-size: 34px; font-weight: 700; letter-spacing: .02em; line-height: 1; }
.cgrid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
.clist { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; max-height: calc(100vh - 190px); overflow-y: auto; }
.crow { display: grid; grid-template-columns: 34px 112px 1fr 64px 64px 84px; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: default; font-size: 16px; }
.crow[tabindex="0"] { cursor: pointer; } .crow[tabindex="0"]:hover { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.crow.on { background: color-mix(in srgb, var(--brand) 18%, transparent); box-shadow: inset 5px 0 0 var(--brand); }
.crow.past, .crow.skipped { color: var(--muted); } .crow.past b { font-weight: 500; } .crow.skipped { text-decoration: line-through; }
.crow.past .muted, .crow.past .ctime, .crow.skipped .muted { color: color-mix(in srgb, var(--muted) 85%, var(--ink)); } .crow.stale { background: color-mix(in srgb, var(--bad) 8%, transparent); }
.cidx, .ctime { color: var(--muted); } .cdur { text-align: right; } .cmark { font-weight: 800; color: var(--ink); font-size: 12px; letter-spacing: .08em; }
.cright { display: flex; flex-direction: column; gap: 12px; }
.ccard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.ccard.now { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.clabel { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--muted); margin-bottom: 4px; }
.ctitle { font-size: 26px; font-weight: 700; line-height: 1.2; } .ctitle.small { font-size: 19px; }
.ctimer { font-size: clamp(54px, 9vw, 92px); font-weight: 800; line-height: 1.05; letter-spacing: .01em; } .ctimer.warn { color: var(--warn); } .ctimer.over { color: var(--bad); }
.cstat { font-size: 14px; color: var(--muted); } .cstat.over { color: var(--bad); font-weight: 700; } .cstat.under { color: var(--ok); font-weight: 700; }
.cscript { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; line-height: 1.45; max-height: 38vh; overflow: auto; } .cscript p { margin: .4em 0; }
.cright.noscript .cscript { display: none; }
@media (max-width: 1000px) { .cgrid { grid-template-columns: 1fr; } .cright { order: -1; } .clist { max-height: none; } .chead { position: static; } }
@media (max-width: 640px) { .crow { grid-template-columns: 26px 1fr 54px; font-size: 15px; } .crow .ctime, .crow .cready, .crow .cmark { display: none; } .cclock { font-size: 26px; } }

/* ================= professional rundown surface ================= */
.rdbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 2px 0 8px; position: sticky; top: 56px; z-index: 9; background: var(--bg); }
.rdbar h1 { font-size: 19px; line-height: 1.2; }
.rdsum { display: flex; flex-wrap: wrap; gap: 6px 24px; align-items: center; padding: 8px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; }
.rm span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); line-height: 1.2; } .rm b { font-size: 17px; line-height: 1.25; }
.rbar { flex: 1 1 160px; min-width: 120px; height: 6px; margin-left: 6px; }
.banner.slim { padding: 6px 12px; margin-bottom: 8px; font-size: 13px; }
.rdctl { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.rdctl .seg { padding: 2px; } .rdctl .segbtn { padding: 3px 10px; font-size: 12.5px; }
.rdhint { font-size: 12px; }
.rdwrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; max-height: calc(100vh - 262px); min-height: 160px; position: relative; }
table.rdt { table-layout: fixed; width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px; }
.rdt col.cn { width: 52px; } .rdt col.ct { width: 80px; } .rdt col.cf { width: 118px; } .rdt col.cd { width: 78px; } .rdt col.ce { width: 80px; } .rdt col.cs { width: 78px; } .rdt col.ca { width: 236px; }
.rdt th { position: sticky; top: 0; z-index: 2; padding: 6px 8px; font-size: 10.5px; background: var(--panel2); border-bottom: 1px solid var(--line); }
.rdt th.r, .rdt td.c-d, .rdt td.c-e { text-align: right; }
.rdt td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow: hidden; }
.rdt td.c-t, .rdt td.c-e, .rdt td.c-n, .rdt td.c-d { white-space: nowrap; }
.rdt tbody tr:hover td { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.rdt tr.sel td { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.rdt tr.cue td { background: color-mix(in srgb, var(--brand) 20%, transparent); }
.rdt tr.stale td { background: color-mix(in srgb, var(--bad) 9%, transparent); }
.rdt tr.skipped td { color: var(--muted); } .rdt tr.skipped .rtitle b, .rdt tr.skipped .rtitle a { text-decoration: line-through; font-weight: 500; }
.rdt td:first-child { box-shadow: inset 3px 0 0 var(--line); }
.rdt tr.k-story td:first-child { box-shadow: inset 3px 0 0 var(--brand); } .rdt tr.k-live td:first-child { box-shadow: inset 3px 0 0 var(--bad); } .rdt tr.k-package td:first-child { box-shadow: inset 3px 0 0 var(--ok); } .rdt tr.k-headlines td:first-child { box-shadow: inset 3px 0 0 var(--warn); } .rdt tr.k-break td:first-child { box-shadow: inset 3px 0 0 var(--muted); }
.rdt tr.cue td:first-child { box-shadow: inset 6px 0 0 var(--brand); }
.rtitle { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.rtitle b, .rtitle a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; min-width: 0; }
.kic { color: var(--muted); width: 1.2em; text-align: center; flex: none; }
.rsub { display: flex; gap: 8px; align-items: center; font-size: 12px; margin-left: 1.55em; min-height: 1.3em; overflow: hidden; white-space: nowrap; }
.rrefs { display: inline-flex; gap: 4px; } .rrefs .chip { font-size: 11px; padding: 0 7px; }
.chipx { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 5px; font: inherit; opacity: .8; } .chipx:hover { opacity: 1; }
.rdur { width: 66px; text-align: right; border: 1px solid transparent; background: transparent; padding: 2px 5px; min-height: 24px; font: inherit; font-variant-numeric: tabular-nums; border-radius: 6px; }
.rdur:hover { border-color: var(--line); } .rdur:focus { background: var(--bg); border-color: var(--brand); outline: none; }
.c-n .handle { cursor: grab; color: var(--muted); margin-right: 4px; user-select: none; } .c-n .num { color: var(--muted); }
.ract { display: flex; gap: 2px; justify-content: flex-end; opacity: 0; transition: opacity .08s; }
.rdt tr:hover .ract, .rdt tr.sel .ract, .rdt tr.cue .ract, .rdt tr:focus-within .ract { opacity: 1; }
.ract .btn.sm { padding: 1px 7px; min-height: 24px; font-size: 12.5px; }
.rdadd { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 7px 10px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--panel2); z-index: 2; }
.rdadd select { max-width: 280px; min-height: 28px; padding: 3px 8px; } .rdadd input { min-height: 28px; padding: 3px 8px; }
.rtl { display: flex; gap: 2px; height: 30px; margin-bottom: 8px; }
.rtlseg { min-width: 3px; border: 0; border-radius: 5px; color: var(--bg); overflow: hidden; cursor: pointer; font-size: 11px; padding: 0 5px; text-align: left; white-space: nowrap; font-weight: 600; }
.rtlseg.cue { outline: 2px solid var(--ink); outline-offset: 1px; } .rtlseg.stale { box-shadow: 0 0 0 2px var(--bad) inset; } .rtlseg.sel { filter: brightness(1.15); }
.menu { position: relative; } .menu summary { list-style: none; cursor: pointer; } .menu summary::-webkit-details-marker { display: none; }
.menupanel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 10px; display: flex; flex-direction: column; gap: 6px; min-width: 250px; }
.menupanel .btn { justify-content: flex-start; }
/* layouts */
.lay-comfortable .rdt td { padding: 8px 8px; }
.lay-compact .rdt td { padding: 3px 8px; }
.lay-compact .c-i { white-space: nowrap; } .lay-compact .rtitle, .lay-compact .rsub { display: inline-flex; vertical-align: baseline; } .lay-compact .rsub { margin-left: 10px; max-width: 55%; }
.lay-compact .rdt col.ca { width: 236px; }
.lay-list .rdt td { padding: 1px 8px; font-size: 13px; line-height: 1.25; } .lay-list .rdt th { padding: 3px 8px; }
.lay-list .rdt col.ct { width: 74px; } .lay-list .rdt col.cn { width: 44px; } .lay-list .rdt col.cs { width: 66px; } .lay-list .rdt col.ca { width: 232px; } .lay-list .rdt col.cf { width: 90px; }
.lay-list .rdt .chip { font-size: 11px; padding: 0 6px; } .lay-list .ract .btn.sm { min-height: 20px; padding: 0 6px; } .lay-list .rdur { min-height: 20px; padding: 0 5px; }
.lay-list .rdt td:first-child { box-shadow: inset 2px 0 0 var(--line); }
@media (hover: none) { .ract { opacity: 1; } }
@media (max-width: 900px) { .rdt col.cf, .rdt col.ce, .rdt col.cs { width: 0; } .rdt .c-f, .rdt .c-e, .rdt .c-s, .rdt th:nth-child(4), .rdt th:nth-child(6), .rdt th:nth-child(7) { display: none; } .rdt col.ca { width: 150px; } table.rdt { min-width: 520px; } .rdbar { position: static; } }

/* ================= global density ================= */
:root[data-density="compact"] { --r: 8px; }
:root[data-density="compact"] main { padding: 14px 16px; }
:root[data-density="compact"] th, :root[data-density="compact"] td { padding-top: 4px; padding-bottom: 4px; }
:root[data-density="compact"] .card { padding: 11px 13px; margin-bottom: 11px; }
:root[data-density="compact"] .btn { min-height: 28px; padding: 3px 10px; } :root[data-density="compact"] input, :root[data-density="compact"] select { min-height: 28px; padding: 3px 8px; }
:root[data-density="compact"] .pagehead { margin-bottom: 10px; } :root[data-density="compact"] .topbar { padding-top: 6px; padding-bottom: 6px; }
:root[data-density="compact"] aside .nav { padding-top: 5px; padding-bottom: 5px; }

.blkmeta { display: grid; gap: 4px; } .blkmeta input { width: 100%; font-size: 12px; padding: 4px 6px; }
@media (max-width: 700px) { .blk { grid-template-columns: 1fr; } }

.notif { padding: 10px 14px; gap: 10px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); } .notif.unread { font-weight: 600; background: color-mix(in srgb, var(--brand) 8%, transparent); } .notif .dotmark { width: 12px; color: var(--brand); }

/* rundown: story pool beside the list */
.rdsplit { display: flex; gap: 12px; align-items: flex-start; } .rdmain { flex: 1; min-width: 0; }
.rdpool { width: 300px; flex: none; position: sticky; top: 8px; max-height: calc(100vh - 130px); display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.poolist { overflow: auto; border-top: 1px solid var(--line); } .prow { display: flex; gap: 6px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); cursor: grab; } .prow.used { opacity: .55; cursor: default; } .prow .ptitle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .rdsplit { flex-direction: column; align-items: stretch; } .rdmain { width: 100%; } .rdpool { width: auto; position: static; max-height: 340px; } }
/* with the story panel open (see `slim` in rundowns.js) the list has ~770px */
@media (min-width: 901px) { .rdsplit.withpool table.rdt { min-width: 0; } .rdsplit.withpool .rdt col.ca { width: 150px; } .rdsplit.withpool .ract { flex-wrap: wrap; justify-content: flex-end; row-gap: 2px; } }

.rdadd { flex-direction: column; align-items: stretch; gap: 6px; } .rdaddmain { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rdmore > summary { cursor: pointer; font-size: 12px; color: var(--muted); } .rdmoregrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-top: 6px; }
.poolfoot { display: flex; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--panel2); } .prow input[type=checkbox] { flex: none; }
.rdadd:has(.rdmore[open]) { position: static; }

.pron { font-size: .6em; opacity: .75; font-style: italic; margin: 0 0 .4em; }

/* assignment board + drag targets */
.aboard { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.acol, .dz { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 8px 10px; min-height: 120px; } .acol h2 { font-size: 13px; margin: 0 0 8px; }
.acard { border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); padding: 8px; cursor: default; } .acard[draggable=true] { cursor: grab; }
.dropping { outline: 2px dashed var(--brand); outline-offset: -3px; background: color-mix(in srgb, var(--brand) 8%, var(--panel)); }

/* reference preview */
.chip.clickable { cursor: pointer; } .pvbox { background: #000; border-radius: 8px; min-height: 160px; display: grid; place-items: center; overflow: hidden; } .pvbox video, .pvbox img { max-width: 100%; max-height: 52vh; } .pvbox audio { width: 100%; } .pvbox .muted { color: #bbb; padding: 20px; }
.gfx { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1b2b3a, #2f4a63 55%, #1b2b3a); border-radius: 8px; overflow: hidden; color: #fff; font-family: system-ui, sans-serif; }
.gfx-lt { position: absolute; left: 6%; bottom: 12%; background: var(--brand, #fb923c); color: #111; padding: .5em 1em; border-left: .5em solid #fff; display: grid; max-width: 70%; } .gfx-lt b { font-size: clamp(14px, 3vw, 28px); } .gfx-lt span { font-size: clamp(11px, 2vw, 18px); opacity: .85; }
.gfx-tk { position: absolute; left: 0; right: 0; bottom: 0; background: #b91c1c; padding: .6em 1em; font-size: clamp(12px, 2.2vw, 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gfx-hc { position: absolute; inset: 18% 10%; display: grid; align-content: center; gap: .5em; text-align: center; } .gfx-hc b { font-size: clamp(18px, 4vw, 38px); } .gfx-hc span { font-size: clamp(12px, 2vw, 20px); opacity: .85; }

/* script markup */
.annbtn.has { color: var(--brand); font-weight: 700; } .inkpad { position: relative; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); min-height: 150px; cursor: crosshair; user-select: none; } .inktext { padding: 12px; white-space: pre-wrap; opacity: .55; font-size: 15px; pointer-events: none; }
.inklive { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--brand); pointer-events: none; } .inkthumb { width: 110px; height: 44px; color: var(--brand); border: 1px solid var(--line); border-radius: 4px; background: var(--panel2); flex: none; } .annrow.done { opacity: .5; text-decoration: line-through; }

/* workflow designer */
.wfd { display: grid; gap: 10px; } .wfrow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; } .wfrow.side { align-items: center; margin-top: 4px; } .wfarrow { align-self: center; color: var(--muted); }
.wfnode { display: grid; gap: 2px; text-align: left; min-width: 112px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); color: var(--ink); cursor: pointer; } .wfnode b { font-size: 13px; } .wfnode .muted { font-size: 11px; }
.wfnode.manual { border-style: dashed; border-color: var(--brand); } .wfnode.side { background: color-mix(in srgb, var(--warn) 10%, var(--panel2)); } .wfnode.on { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ======================================================================================================
   APPLICATION CANVAS — the window is the workspace: no page margins, panes scroll on their own,
   dense controls. Ordinary pages keep a slim padding; workspace screens (main.canvas) use all of it.
   ====================================================================================================== */
html, body { height: 100%; }
body { font-size: 13.5px; line-height: 1.4; }
.app { height: 100vh; min-height: 0; }
.content { height: 100vh; overflow: hidden; min-height: 0; }
.topbar { padding: 3px 10px; gap: 8px; min-height: 34px; backdrop-filter: none; }
.topbar .btn.sm { min-height: 24px; padding: 1px 8px; } .topbar .chip { font-size: 11px; padding: 0 6px; }
.search { padding: 3px 10px; font-size: 12.5px; max-width: 360px; border-radius: 6px; }
main { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 8px 10px; max-width: none; margin: 0; width: 100%; }
main.canvas { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
aside .logo { padding: 0 4px 6px; } .sidein { padding: 8px 6px; } aside .nav { padding: 6px 8px; }
h1 { font-size: 17px; margin: 0; } h2 { font-size: 14px; margin: 0 0 6px; }
.pagehead { margin-bottom: 8px; gap: 8px; } .pagehead h1 { font-size: 17px; }
.card { padding: 8px 10px; margin-bottom: 8px; box-shadow: none; border-radius: 6px; }
.grid { gap: 8px; } .stack { gap: 6px; } .row { gap: 8px; }
.btn { padding: 3px 10px; min-height: 28px; } .btn.sm { padding: 1px 8px; min-height: 24px; }
input, select, textarea { padding: 3px 8px; min-height: 28px; }
.banner { padding: 6px 10px; margin-bottom: 8px; }
.tabs { margin-bottom: 8px; } th, td { padding-top: 5px; padding-bottom: 5px; }

/* the rundown workspace */
.ws { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; height: 100%; }
.ws .rdhead { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; padding: 3px 8px; border-bottom: 1px solid var(--line); background: var(--panel); }
.ws .rdbar { flex: 1 1 auto; padding: 0; margin: 0; gap: 6px; min-width: 0; } .ws .rdbar h1 { font-size: 14px; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rdswitch { max-width: 15ch; min-height: 24px; padding: 0 4px; font-size: 12px; }
.ws .rdsum { padding: 0; margin: 0; border: 0; background: transparent; gap: 12px; flex: 0 1 auto; } .ws .rdsum .rm span { font-size: 9.5px; } .ws .rdsum .rm b { font-size: 13px; }
.ws .rdsum .rbar { width: 90px; min-width: 60px; }
.ws .banner.slim { margin: 0; border-radius: 0; border-width: 0 0 1px; padding: 3px 10px; font-size: 12.5px; }
.ws .rdctl { margin: 0; padding: 2px 8px; gap: 8px; border-bottom: 1px solid var(--line); background: var(--panel2); } .ws .rdhint { display: none; }
.ws .rtl { margin: 0; border-radius: 0; }
.wsbody { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
.wsbody .rdpool { width: 240px; position: static; max-height: none; height: 100%; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: var(--panel); }
.wsbody .rdmain { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.wsbody .rdwrap { flex: 1 1 auto; min-height: 0; overflow: auto; border: 0; border-radius: 0; background: transparent; }
.wsbody .rdadd { position: static; flex: none; border-top: 1px solid var(--line); padding: 4px 8px; }
.insp { width: clamp(380px, 38vw, 660px); display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--panel); }
.insphead { display: flex; align-items: center; gap: 6px; padding: 3px 8px; border-bottom: 1px solid var(--line); flex: none; } .insptitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.inspbody { flex: 1 1 auto; min-height: 0; overflow: auto; }
.ed-embed { padding: 6px 8px; } .ed-embed .edbar { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; font-size: 12px; } .ed-embed .g2 { grid-template-columns: 1fr; gap: 6px; }
.insp[data-tab="script"] .ed-embed .g2 > :last-child, .insp[data-tab="details"] .ed-embed .g2 > :first-child { display: none; }
.ed-embed .card { padding: 6px 8px; margin-bottom: 6px; } .ed-embed .blk { gap: 6px; } .ed-embed textarea { min-height: 44px; }
.wsbody .rdpool .poolist { overflow: auto; }
}
.wsbody { grid-template-rows: minmax(0, 1fr); } .wsbody > * { min-height: 0; min-width: 0; }
.wsbody .rdt col.cn { width: 42px; } .wsbody .rdt col.ct { width: 64px; } .wsbody .rdt col.cf { width: 98px; } .wsbody .rdt col.cd { width: 66px; } .wsbody .rdt col.ca { width: 118px; }
.wsbody .rdt .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* script blocks inside the narrow inspector: type | text | actions on one line, per-block extras (video, pronunciation, cut line) wrap below */
.ed-embed .blk { grid-template-columns: 92px minmax(0, 1fr) auto; align-items: start; padding-left: 6px; margin-bottom: 4px; }
.ed-embed .blk > :nth-child(1) { grid-column: 1; grid-row: 1; } .ed-embed .blk > textarea { grid-column: 2; grid-row: 1; width: 100%; } .ed-embed .blk > :nth-child(4) { grid-column: 3; grid-row: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; max-width: 96px; }
.ed-embed .blk > .blkmeta { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 4px; } .ed-embed .blkmeta input { flex: 1 1 120px; min-height: 24px; font-size: 12px; }
.ed-embed .blk select { width: 100%; }
.ed-embed h2 { font-size: 13px; } .ed-embed .row { gap: 6px; }

.ed-embed .plan { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; } .ed-embed .plan > button { grid-column: 1 / -1; } .ed-embed .plan label.f { gap: 1px; }
/* workspace table fits its pane: # | start | item (flags, status, refs and inline actions live in its second line) | duration; the selected row's other actions sit in one toolbar */
.wsbody table.rdt { min-width: 0; width: 100%; }
.wsbody .rdt .rsub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; } .wsbody .rdt .rsub .btn.sm { padding: 0 6px; min-height: 20px; font-size: 11.5px; }
.seltools { display: flex; align-items: center; gap: 4px; padding: 2px 8px; border-bottom: 1px solid var(--line); background: var(--panel2); font-size: 12.5px; flex: none; } .seltools .seltitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 32ch; } .seltools .btn.sm { min-height: 22px; padding: 0 8px; }
/* board columns scroll inside themselves so every column header is always a reachable drop target */
.aboard { align-items: start; } .acol { max-height: calc(100vh - 150px); overflow-y: auto; } .acol > h2 { position: sticky; top: -8px; background: var(--panel); margin: -8px -10px 8px; padding: 8px 10px 4px; z-index: 1; }

/* ---- responsive workspace: classes mode-xl / mode-l / mode-m / mode-s are set from the window width ---- */
@supports (height: 100dvh) { .app, .content { height: 100dvh; } }
.wsbody { position: relative; }
.wsbody .splitter { width: 6px; cursor: col-resize; background: var(--line); touch-action: none; } .wsbody .splitter:hover, .wsbody .splitter:focus-visible { background: var(--brand); outline: 0; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .38); z-index: 38; }
.ws.mode-l .rdpool, .ws.mode-m .rdpool, .ws.mode-m .insp { position: absolute; top: 0; bottom: 0; height: auto; max-height: none; z-index: 40; box-shadow: 0 0 28px rgba(0, 0, 0, .5); }
.ws.mode-l .rdpool, .ws.mode-m .rdpool { left: 0; width: min(320px, 92vw); border-right: 1px solid var(--line); }
.ws.mode-m .insp { right: 0; width: min(580px, 94vw); }
.ws.mode-m .wsbody { grid-template-columns: minmax(0, 1fr); }
.ws.mode-s .wsbody { display: block; overflow: auto; }
.ws.mode-s .rdpool, .ws.mode-s .insp { position: static; width: auto; height: auto; max-height: none; box-shadow: none; border: 0; min-height: 100%; }
.ws.mode-s .rdctl, .ws.mode-s .rdsum .rbar, .ws.mode-s .rtl, .ws.mode-s .rdsum .rm:nth-child(n+4) { display: none; }
.ws.mode-s .rdhead { gap: 2px 8px; } .ws.mode-s .rdbar h1 { max-width: 16ch; } .ws.mode-s .rdswitch { max-width: 11ch; }
.ws.mode-s .rdt th, .ws.mode-s .rdt td { padding-left: 4px; padding-right: 4px; } .ws.mode-s .seltools { overflow-x: auto; }
.ws.mode-s .rdadd { position: static; }
.phonetabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-top: 1px solid var(--line); background: var(--panel); flex: none; padding-bottom: env(safe-area-inset-bottom); }
.ptab { padding: 10px 4px; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; min-height: 44px; } .ptab.on { color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand); }
/* touch targets: coarse pointers get larger hit areas everywhere */
@media (pointer: coarse) { .btn, .btn.sm, input, select { min-height: 36px; } .segbtn { min-height: 34px; } aside .nav { padding: 10px 10px; } }
/* other pages: below 1100px two-column layouts stack, wide tables scroll inside their card */
@media (max-width: 1100px) { .g2, .g3, .g4 { grid-template-columns: 1fr 1fr; } .card.flush { overflow-x: auto; } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } main { padding: 6px 8px; } .pagehead { gap: 6px; } .topbar .muted, .topbar .chip { display: none; } }
.ws.mode-xl .rdpool, .ws.mode-xl .insp, .ws.mode-l .insp { width: auto; }
.ws > * { flex-shrink: 0; } .ws > .wsbody { flex: 1 1 0; min-height: 0; }
@media (max-width: 700px) { main td, main th { overflow-wrap: anywhere; } main kbd { white-space: normal; } main pre, main code { white-space: pre-wrap; overflow-wrap: anywhere; } }
.banner a, p a, .muted a { text-decoration: underline; text-underline-offset: 2px; }

/* ---- codicons (VS Code icon set): 16px, follow the text colour ---- */
.codicon { width: 16px; height: 16px; flex: none; vertical-align: -3px; fill: currentColor; }
.btn .codicon { vertical-align: -3px; } .btn.sm .codicon { width: 14px; height: 14px; vertical-align: -2px; }
aside .nav .ic { display: inline-flex; align-items: center; justify-content: center; } aside .nav .ic .codicon { width: 18px; height: 18px; }
aside .grph .caret { display: inline-flex; } aside .grph .caret .codicon { width: 12px; height: 12px; vertical-align: 0; }
.search .codicon { color: var(--muted); }

/* ---- layering: the workspace never paints over the navigation sidebar ---- */
.content { position: relative; z-index: 0; isolation: isolate; }

/* ---- compact workspace panels ---- */
.ws .rdhead { padding: 2px 6px; gap: 0 10px; }
.ws .rdctl, .seltools { padding: 1px 6px; gap: 4px; font-size: 12px; }
.ws .btn.sm, .insp .btn.sm, .rdpool .btn.sm { min-height: 22px; padding: 0 6px; font-size: 12px; }
.ws .btn.sm.ghost { padding: 0 4px; }
.ws .segbtn { min-height: 22px; padding: 0 8px; font-size: 12px; }
.wsbody .rdpool { width: 210px; font-size: 12.5px; }
.wsbody .rdpool .row { gap: 4px; }
.wsbody .rdpool .poolist > * { padding-top: 3px; padding-bottom: 3px; }
.insp { width: clamp(340px, 32vw, 560px); }
.insphead { padding: 1px 6px; gap: 4px; }
.ws input, .ws select, .ws textarea { min-height: 24px; padding: 1px 6px; font-size: 12.5px; }
.ws .rdt th, .ws .rdt td { padding-top: 2px; padding-bottom: 2px; font-size: 12.5px; }
.ws .rdt .chip { font-size: 10.5px; padding: 0 5px; }
.wsbody .rdadd { padding: 2px 6px; }
.ed-embed { padding: 4px 6px; } .ed-embed .card { padding: 4px 6px; margin-bottom: 4px; }
.ws .btn, .ws summary.btn { min-height: 22px; padding: 0 8px; font-size: 12px; } .ws .rdbar { gap: 4px; }
.ws .rdsum .rm span { font-size: 9px; line-height: 1.1; } .ws .rdsum .rm b { font-size: 12px; line-height: 1.1; }
.ws .rdswitch { min-height: 22px; }

/* ---- sidebar: larger monochrome icons (white on dark themes, black on light), neutral active state ---- */
:root { --side-rail: 56px; }
aside .nav .ic { width: 20px; } aside .nav .ic .codicon { width: 18px; height: 18px; }
aside .nav { gap: 12px; padding: 8px 10px; color: var(--ink); } aside .nav .ic { opacity: 1; color: var(--ink); }
aside a.nav.active, :root[data-accent] aside a.nav.active { background: var(--panel2); color: var(--ink); box-shadow: inset 3px 0 0 var(--ink); }
aside a.nav.active .ic { color: var(--ink); }
aside .logo .sidetoggle .codicon { width: 16px; height: 16px; }

/* ---- forms: label right-aligned beside its field (saves a line per field); stacks again in narrow panes ---- */
label.f { display: grid; grid-template-columns: minmax(80px, 9rem) minmax(0, 1fr); align-items: center; column-gap: 8px; row-gap: 2px; }
label.f > .lt { text-align: right; line-height: 1.2; }
label.f > .lt::after { content: ""; }
label.f > :not(.lt) { text-align: left; min-width: 0; }
label.f:has(> textarea, > .stack, > div) { align-items: start; } label.f:has(> textarea) > .lt { padding-top: 5px; }
label.f > :nth-child(n+3) { grid-column: 2; }
.ed-embed label.f, .insp label.f, .popover label.f, .ws .rdpool label.f { grid-template-columns: 1fr; } .ed-embed label.f > .lt, .insp label.f > .lt, .popover label.f > .lt, .ws .rdpool label.f > .lt { text-align: left; }
@media (max-width: 700px) { label.f { grid-template-columns: 1fr; } label.f > .lt { text-align: left; } }

/* ======================================================================================================
   COMPACT BY DEFAULT — denser sidebar, bars, tables, cards and controls everywhere (more workspace)
   ====================================================================================================== */
:root { --side: 196px; --side-rail: 46px; }
body { font-size: 13px; line-height: 1.35; }
.sidein { padding: 6px 4px; gap: 0; } aside .logo { padding: 0 4px 4px; font-size: 13px; gap: 6px; } aside .logo img { width: 22px; height: 22px; }
aside .nav { padding: 4px 8px; gap: 8px; font-size: 12.5px; border-radius: 5px; min-height: 26px; } aside .nav .ic { width: 20px; } aside .nav .ic .codicon { width: 18px; height: 18px; }
aside .grph { margin-top: 6px; padding: 2px 8px; font-size: 10px; } aside .nav .badge { font-size: 10.5px; min-width: 16px; padding: 0 4px; }
.app.collapsed aside:not(:hover):not(:has(:focus-visible)) .nav { padding: 5px 0; } .app.collapsed aside:not(:hover):not(:has(:focus-visible)) .grph { margin: 4px 10px; }
.topbar { min-height: 30px; padding: 2px 8px; gap: 6px; } .search { padding: 2px 8px; font-size: 12px; max-width: 320px; }
main { padding: 6px 8px; } h1 { font-size: 15px; } .pagehead { margin-bottom: 6px; } .pagehead h1 { font-size: 15px; } h2 { font-size: 13px; margin-bottom: 4px; } h3 { font-size: 11px; margin-bottom: 3px; }
.card { padding: 6px 8px; margin-bottom: 6px; border-radius: 5px; } .grid { gap: 6px; } .stack { gap: 4px; } .row { gap: 6px; }
th, td { padding: 3px 8px; } th { font-size: 10.5px; } .tabs { margin-bottom: 6px; } .tabs a { padding: 4px 10px; }
.btn { min-height: 24px; padding: 1px 8px; font-size: 12.5px; } .btn.sm { min-height: 20px; padding: 0 6px; font-size: 12px; }
input, select, textarea { min-height: 24px; padding: 1px 6px; font-size: 12.5px; } textarea { min-height: 40px; }
label.f { font-size: 12px; row-gap: 1px; } .stack > label.f, .card.stack label.f { margin: 0; }
.chip { font-size: 10.5px; padding: 0 6px; } .banner { padding: 4px 8px; margin-bottom: 6px; font-size: 12.5px; }
.modal header { padding: 8px 12px; } .modal .body { padding: 10px 12px; } .modal footer { padding: 8px 12px; }
.muted { font-size: inherit; }

/* ---- rundown workspace: list panel · tab groups ---- */
.rdws { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 220px 5px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.rdws > * { min-width: 0; min-height: 0; }
.rdws .splitter { width: 5px; cursor: col-resize; background: var(--line); } .rdws .splitter:hover, .rdws .splitter:focus-visible { background: var(--brand); outline: 0; }
.rdlist { display: flex; flex-direction: column; background: var(--panel); border: 0; position: static; height: auto; overflow: hidden; font-size: 12px; }
.rdlisthead { display: flex; align-items: center; gap: 2px; padding: 2px 4px 2px 8px; font-size: 10.5px; letter-spacing: .08em; color: var(--muted); } .rdlisthead .btn { color: var(--muted); }
.rdlistsearch { padding: 2px 6px 4px; } .rdlistsearch input { width: 100%; min-height: 22px; font-size: 12px; }
.rdlayouts { display: flex; gap: 2px; padding: 0 6px 4px; border-bottom: 1px solid var(--line); } .rdlayouts .lay { padding: 0 6px; color: var(--muted); } .rdlayouts .lay.on { background: var(--panel2); color: var(--ink); box-shadow: inset 0 -2px 0 var(--brand); }
.rllist { flex: 1 1 auto; overflow: auto; padding-bottom: 8px; }
.rlhead { display: flex; align-items: center; gap: 4px; width: 100%; padding: 4px 8px 2px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; cursor: default; text-align: left; } .rlhead .muted { margin-left: auto; }
.rlhead[aria-expanded] { cursor: pointer; }
.rlrow { display: flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; min-height: 24px; cursor: pointer; border-left: 2px solid transparent; }
.rlrow:hover { background: var(--panel2); } .rlrow.open { border-left-color: var(--line); } .rlrow.on { background: color-mix(in srgb, var(--brand) 14%, transparent); border-left-color: var(--brand); }
.rlname { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .rlwhen { font-size: 10.5px; white-space: nowrap; } .rlside { display: none; padding: 0 3px; } .rlrow:hover .rlside, .rlrow:focus-within .rlside { display: inline-flex; } .rlrow:hover .rlwhen { display: none; }
.sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); } .sdot.live { background: var(--bad); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 30%, transparent); } .sdot.ready { background: var(--ok); } .sdot.open { background: var(--warn); } .sdot.closed { background: var(--line); }
.rdgroups { display: grid; gap: 1px; background: var(--line); min-height: 0; grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.rdgroups[data-dir=cols] { grid-template: minmax(0, 1fr) / repeat(2, minmax(0, 1fr)); } .rdgroups[data-dir=cols3] { grid-template: minmax(0, 1fr) / repeat(3, minmax(0, 1fr)); }
.rdgroups[data-dir=rows] { grid-template: repeat(2, minmax(0, 1fr)) / minmax(0, 1fr); } .rdgroups[data-dir=grid] { grid-template: repeat(2, minmax(0, 1fr)) / repeat(2, minmax(0, 1fr)); }
.wsgroup { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); position: relative; } .wsgroup.drop { outline: 2px dashed var(--brand); outline-offset: -3px; }
.wstabs { display: flex; align-items: stretch; flex: none; background: var(--panel2); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; min-height: 26px; } .wstabs::-webkit-scrollbar { display: none; }
.wstab { display: flex; align-items: center; gap: 6px; padding: 0 4px 0 10px; max-width: 220px; min-width: 90px; border-right: 1px solid var(--line); color: var(--muted); cursor: pointer; font-size: 12px; white-space: nowrap; }
.wstab:hover { color: var(--ink); } .wstab.on { background: var(--bg); color: var(--ink); box-shadow: inset 0 -2px 0 var(--line); } .wsgroup.focus .wstab.on { box-shadow: inset 0 -2px 0 var(--brand); }
.wsname { overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; } .wsx { display: inline-flex; border: 0; background: none; color: inherit; padding: 2px; border-radius: 4px; opacity: .6; cursor: pointer; } .wsx:hover { opacity: 1; background: var(--chip); }
.wshost { flex: 1 1 auto; min-height: 0; position: relative; display: flex; flex-direction: column; } .wsinst { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; } .wsinst[hidden] { display: none; }
.wsempty { margin: auto; text-align: center; color: var(--muted); display: grid; gap: 4px; justify-items: center; } .wsempty .codicon { width: 32px; height: 32px; opacity: .4; }
/* a rundown inside a group: the list panel and the header switcher are redundant there */
.ws.embedded .rdswitch, .ws.embedded .rdbar > a[href="#/rundowns"], .ws.embedded .rdbar > button[aria-label="New rundown"] { display: none; }
.ws.embedded { height: 100%; }
@media (max-width: 820px) { .rdws { grid-template-columns: minmax(0, 1fr) !important; } .rdws .splitter, .rdlist { display: none; } .rdgroups { grid-template: minmax(0, 1fr) / minmax(0, 1fr) !important; } .wsgroup:nth-child(n+2) { display: none; } }
.rdt tr.multi td { background: color-mix(in srgb, var(--brand) 20%, transparent); } .rdt tr.cutd { opacity: .45; }

/* ---- context menu (VS Code look) ---- */
.ctxmenu { position: fixed; z-index: 90; min-width: 200px; max-width: 320px; max-height: calc(100vh - 8px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); padding: 3px; font-size: 12.5px; }
.ctxitem { display: flex; align-items: center; gap: 8px; width: 100%; padding: 3px 8px 3px 4px; min-height: 24px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; border-radius: 4px; cursor: pointer; }
.ctxitem:hover:not(:disabled), .ctxitem:focus-visible:not(:disabled), .ctxitem:focus:not(:disabled) { background: color-mix(in srgb, var(--brand) 22%, transparent); outline: 0; } .ctxitem:disabled { opacity: .4; cursor: default; } .ctxitem.danger { color: var(--bad); }
.ctxic { width: 16px; display: inline-flex; justify-content: center; flex: none; } .ctxlbl { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ctxkbd { color: var(--muted); font-size: 11px; margin-left: 16px; } .ctxsub { display: inline-flex; margin-left: 8px; }
.ctxsep { height: 1px; background: var(--line); margin: 3px 4px; }

/* ---- rundown board: expandable story peek ---- */
.bpeek td { padding: 0 !important; background: var(--panel2); } .bpeekbody { padding: 4px 10px 6px 34px; font-size: 12px; max-height: 220px; overflow: auto; } .bpeekbody p { margin: 2px 0; display: flex; gap: 6px; } .bpeekbody .bt { flex: none; min-width: 54px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.bxp { display: inline-flex; border: 0; background: none; color: var(--muted); padding: 0 2px; cursor: pointer; vertical-align: middle; } .bxp:hover { color: var(--ink); }

/* embedded rundowns (inside a group): the header gives space back to the running order */
.wshost { container-type: size; }
.ws.embedded .rdsum { gap: 8px; } .ws.embedded .rdsum .rm span, .ws.embedded .rdsum .rbar { display: none; }
@container (max-height: 440px) { .ws.embedded .rdctl, .ws.embedded .banner.slim, .ws.embedded .rtl { display: none; } }

/* sidebar icons a little smaller */
aside .nav .ic { width: 18px; } aside .nav .ic .codicon { width: 16px; height: 16px; } aside .nav { gap: 8px; }
/* drop targets while dragging a story between rundowns */
.rdt tr.dropat td, .board tr.dropat td { box-shadow: inset 0 2px 0 var(--brand); } .board .card.dropat { outline: 2px dashed var(--brand); outline-offset: -2px; }
.board tr[draggable=true] { cursor: grab; }
.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 12px; }

/* resizable editor groups */
.rdgroups { position: relative; }
.gsplit { position: absolute; z-index: 5; background: transparent; } .gsplit:hover, .gsplit:focus-visible, body.gdrag .gsplit { background: color-mix(in srgb, var(--brand) 70%, transparent); outline: 0; }
.gsplit.x { top: 0; bottom: 0; width: 6px; cursor: col-resize; } .gsplit.y { left: 0; right: 0; height: 6px; cursor: row-resize; }
body.gdrag { user-select: none; cursor: grabbing; } body.gdrag .wshost { pointer-events: none; }
@media (max-width: 820px) { .gsplit { display: none; } }
