/* Edit Studio — Linear's "midnight precision instrument": a near-black canvas, carbon cards with hairline borders, white and
   grey ink, weights 400–590 (never bold), and one acid-lime colour kept for the single main action on each screen. Status
   colours (open notes orange, with Claude violet, fixed green, errors red) are small marks, never text or buttons. */
:root {
  /* design tokens (DESIGN.md) */
  --color-void: #08090a;
  --color-carbon: #0f1011;
  --color-obsidian: #161718;
  --color-graphite: #23252a;
  --color-smoke: #383b3f;
  --color-ash: #62666d;
  --color-fog: #8a8f98;
  --color-mist: #d0d6e0;
  --color-bone: #e5e5e6;
  --color-paper: #ffffff;
  --color-acid-lime: #e4f222;
  --color-pulse-green: #27a644;
  --color-coral-red: #eb5757;
  --color-iris-violet: #6366f1;
  --color-lavender: #8b5cf6;
  --color-orange: #f2994a;          /* open notes: a status mark distinct from the lime action */
  --color-stone: #62666d;
  --color-ink-black: #000000;
  --radius-small: 4px;
  --radius-buttons: 6px;
  --radius-cards: 12px;
  --radius-pills: 9999px;
  --ease: 160ms ease;
  --shadow-sm: rgba(0, 0, 0, .4) 0 2px 4px 0;
  --shadow-float: rgba(8, 9, 10, .6) 0 4px 32px 0, 0 0 0 1px var(--color-graphite);

  /* roles used across the app */
  --bg: var(--color-void);
  --panel: var(--color-carbon);
  --panel-2: var(--color-obsidian);
  --panel-3: rgba(255, 255, 255, .05);
  --raised: rgba(255, 255, 255, .09);
  --line: var(--color-graphite);
  --line-2: #2c2e33;
  --line-3: var(--color-smoke);
  --heading: var(--color-paper);
  --text: #f7f8f8;
  --body: var(--color-mist);
  --muted: var(--color-fog);
  --faint: var(--color-ash);
  --ink: var(--color-bone);         /* strong marks: playhead, play button, toasts */
  --on-ink: var(--color-void);
  --input: rgba(255, 255, 255, .02);
  /* the one main action per screen */
  --action: var(--color-acid-lime);
  --action-hover: #eef66a;
  --on-action: var(--color-void);
  /* selection and focus are neutral: the border brightens to mist */
  --accent: var(--color-mist);
  --accent-text: var(--color-paper);
  --accent-tint: rgba(255, 255, 255, .06);
  --accent-tint-2: rgba(255, 255, 255, .1);
  /* status: open notes = orange, with Claude = violet, final/fixed = green, teammates = lavender, errors = red */
  --amber: var(--color-orange);
  --amber-text: #f7b77c;
  --amber-tint: rgba(242, 153, 74, .14);
  --violet: var(--color-iris-violet);
  --violet-text: #a5a7fb;
  --violet-tint: rgba(99, 102, 241, .18);
  --team: var(--color-lavender);
  --team-text: #c0a6fb;
  --team-tint: rgba(139, 92, 246, .16);
  --green: var(--color-pulse-green);
  --green-text: #5fcf7a;
  --green-tint: rgba(39, 166, 68, .16);
  --red: var(--color-coral-red);
  --red-text: #ff8f8f;
  --red-tint: rgba(235, 87, 87, .16);
  --claude: #e08a6c;

  --font: "Inter Variable", "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "Berkeley Mono", "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --top-h: 52px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--body); font: 14px/1.5 var(--font); font-feature-settings: "cv01", "ss03", "lnum"; letter-spacing: -.006em; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--heading); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); }
::placeholder { color: var(--faint); }
kbd { font: 11px var(--mono); padding: 1px 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: var(--radius-small); color: var(--muted); background: var(--panel); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar ---------- */
.top { height: var(--top-h); display: flex; align-items: center; gap: 20px; padding: 0 16px; background: rgba(8, 9, 10, .88); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 9px; white-space: nowrap; font-weight: 510; font-size: 15px; letter-spacing: -.012em; color: var(--heading); }
.logo { width: 22px; height: 22px; border-radius: 6px; background: url(/favicon.svg) center / cover no-repeat; flex: none; }   /* the clapper (same as the Slack app) */
.nav { display: flex; gap: 2px; align-items: center; }
.nav a { white-space: nowrap; display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: var(--radius-buttons); color: var(--muted); font-size: 13px; font-weight: 400; transition: color var(--ease), background var(--ease); }
.nav a:hover { color: var(--text); background: var(--panel-3); }
.nav a.on { color: var(--heading); background: var(--raised); font-weight: 510; }
.nav a .n { margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: var(--radius-small); background: var(--panel-3); color: var(--muted); font: 510 11px var(--font); font-variant-numeric: tabular-nums; }
.nav a.on .n { background: var(--action); color: var(--on-action); }
.gear { width: 30px; height: 30px; border-radius: var(--radius-buttons); display: grid; place-items: center; color: var(--muted); transition: color var(--ease), background var(--ease); }
.gear:hover, .gear.on { color: var(--text); background: var(--panel-3); }
.gear svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.claude-pill { white-space: nowrap; display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: var(--radius-pills); border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 13px; font-weight: 400; transition: border-color var(--ease), color var(--ease); }
.claude-pill:hover { border-color: var(--line-3); color: var(--text); }
.claude-pill .short { display: none; }
.claude-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.claude-pill.on { color: var(--body); }
.claude-pill.on .dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-tint); }
.claude-pill.busy .dot { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-tint); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- shared ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--radius-pills); border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 13px; font-weight: 400; white-space: nowrap; transition: color var(--ease), border-color var(--ease), background var(--ease); }
.chip:hover { color: var(--text); border-color: var(--line-3); }
.chip.on { background: var(--raised); color: var(--heading); border-color: var(--line-3); }
.chip .n { opacity: .6; font-variant-numeric: tabular-nums; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.btn { height: 32px; padding: 0 14px; border-radius: var(--radius-buttons); border: 1px solid var(--line); background: var(--panel-3); color: var(--body); font-size: 13px; font-weight: 510; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: background var(--ease), border-color var(--ease), color var(--ease); }
.btn:hover { border-color: var(--line-3); background: var(--raised); color: var(--text); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--action); border-color: var(--action); color: var(--on-action); box-shadow: rgba(0, 0, 0, .07) 0 1px 1px, rgba(0, 0, 0, .04) 0 3px 2px; }
.btn.primary:hover:not(:disabled) { background: var(--action-hover); border-color: var(--action-hover); color: var(--on-action); }
.btn.approve { background: var(--panel-3); }
.btn.approved { background: var(--green-tint); border-color: transparent; color: var(--green-text); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel-3); }
.btn.sm { height: 26px; padding: 0 10px; font-size: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: -.013em; }
.empty { padding: 56px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.empty a { color: var(--heading); font-weight: 510; text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 6px; border-radius: var(--radius-small); font-size: 12px; font-weight: 510; background: var(--panel-3); color: var(--muted); }
.badge.amber { background: var(--amber-tint); color: var(--amber-text); }
.badge.blue { background: var(--violet-tint); color: var(--violet-text); }
.badge.green { background: var(--green-tint); color: var(--green-text); }
.badge.violet { background: var(--team-tint); color: var(--team-text); }
.hl { color: inherit; }

/* ---------- home ---------- */
.home { max-width: 1440px; margin: 0 auto; padding: 32px 32px 80px; }
.home-head { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }
.home-head h1 { font-size: 32px; line-height: 1.13; font-weight: 510; margin: 0 20px 0 0; letter-spacing: -.022em; }
.home-head .search { margin-left: auto; height: 32px; width: 240px; padding: 0 12px; border-radius: var(--radius-buttons); border: 1px solid var(--line); background: var(--input); color: var(--text); outline: none; transition: border-color var(--ease); }
.home-head .sort { height: 32px; padding: 0 10px; border-radius: var(--radius-buttons); border: 1px solid var(--line); background: var(--panel); color: var(--body); font-size: 13px; outline: none; cursor: pointer; }
.home-head .sort:focus { border-color: var(--accent); }
.home-head .search:focus { border-color: var(--accent); }
.group { margin-bottom: 48px; }
.group-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.group-head h2 { font-size: 17px; line-height: 1.3; font-weight: 510; margin: 0; display: flex; align-items: center; gap: 10px; letter-spacing: -.012em; }
.group-head h2 .sw { width: 9px; height: 9px; border-radius: 50%; }
.group-head .sub { color: var(--faint); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-cards); overflow: hidden; transition: border-color var(--ease), background var(--ease); display: block; }
.card:hover { border-color: var(--line-3); background: var(--panel-2); }
.thumb { aspect-ratio: 9 / 16; background: #000 center / cover no-repeat; position: relative; border-bottom: 1px solid var(--line); }
.thumb .badges { position: absolute; left: 8px; top: 8px; right: 8px; display: flex; gap: 5px; flex-wrap: wrap; }
/* on top of video, tags are solid fills */
.thumb .badges .badge { background: rgba(8, 9, 10, .82); color: var(--text); backdrop-filter: blur(6px); }
.thumb .badges .badge.amber { background: var(--amber); color: var(--color-void); }
.thumb .badges .badge.green { background: var(--green); color: #fff; }
.thumb .badges .badge.blue { background: var(--violet); color: #fff; }
.thumb .badges .badge.violet { background: var(--team); color: #fff; }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 12px; }
.card-meta { padding: 10px 12px 12px; }
.card-meta .t { font-weight: 510; color: var(--heading); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.card-meta .s { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job { border-style: dashed; border-color: var(--line-3); background: transparent; }
.job .thumb { display: grid; place-items: center; background: var(--bg); }
.job .spinner { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--color-mist); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.job .log { position: absolute; left: 12px; right: 12px; bottom: 12px; font-size: 12px; color: var(--muted); }
.job.skipped { border-color: var(--amber); }
/* a skipped card reads top-down: the badge, then why */
.job.skipped .thumb { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 10px; padding: 12px; }
.job.skipped .log { position: static; color: var(--amber-text); line-height: 1.5; overflow: hidden; }

/* ---------- settings ---------- */
.new { max-width: 820px; margin: 0 auto; padding: 44px 32px 80px; }
.new h1 { font-size: 40px; line-height: 1.05; font-weight: 510; letter-spacing: -.022em; margin: 0 0 12px; }
.new .lead { font-size: 16px; line-height: 1.5; color: var(--muted); margin: 0 0 32px; max-width: 620px; }
.new .lead b { color: var(--body); font-weight: 510; }
.step-label { font-size: 13px; color: var(--heading); font-weight: 510; margin: 32px 0 10px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 510; font-size: 13px; color: var(--body); }
.field .hint { color: var(--faint); font-size: 12px; }
.field input, .field textarea, .field select { background: var(--input); border: 1px solid var(--line-2); border-radius: var(--radius-buttons); padding: 9px 12px; color: var(--text); outline: none; transition: border-color var(--ease); }
.field textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 12px; margin-top: 12px; padding-top: 20px; border-top: 1px solid var(--line); align-items: center; }
.form-actions .btn.primary { height: 36px; padding: 0 18px; }

/* ---------- review ---------- */
.review { display: grid; grid-template-columns: 248px minmax(0, 1fr) 380px; height: calc(100vh - var(--top-h)); }
.queue { border-right: 1px solid var(--line); overflow: auto; background: var(--panel); }
.queue-head { padding: 14px 12px 10px; display: flex; gap: 6px; flex-wrap: wrap; position: sticky; top: 0; background: var(--panel); z-index: 1; }
.queue-head .chip { height: 24px; padding: 0 10px; font-size: 12px; }
.q-item { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; margin: 1px 8px; padding: 6px 8px; border-radius: var(--radius-buttons); transition: background var(--ease); }
.q-item:hover { background: var(--panel-3); }
.q-item.on { background: var(--accent-tint); }
.q-item .mini { width: 40px; height: 56px; border-radius: var(--radius-small); background: #000 center / cover; position: relative; box-shadow: 0 0 0 1px var(--line); }
.q-item .mini .st { position: absolute; right: -3px; top: -3px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--panel); }
.q-item .t { font-weight: 510; font-size: 13px; color: var(--heading); }
.q-item .s { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stage-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.stage-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.stage-head .title { font-weight: 510; font-size: 15px; color: var(--heading); letter-spacing: -.011em; margin-right: 4px; white-space: nowrap; }
.stage-head .grp { display: flex; align-items: center; gap: 4px; }
.stage-head .grp .chip { height: 26px; padding: 0 10px; }
.stage-head .lbl { color: var(--faint); font-size: 12px; margin: 0 4px 0 6px; }
.stage-head .spacer { flex: 1; }
.chip.ver.new::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--action); margin-left: 2px; }
.stage { flex: 1; min-height: 0; display: grid; place-items: center; position: relative; padding: 16px; background: var(--bg); }
.frame { position: relative; background: #000; border-radius: var(--radius-cards); overflow: hidden; box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.frame hyperframes-player, .frame video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.frame video { object-fit: contain; background: #000; }
.overlay { position: absolute; inset: 0; z-index: 5; cursor: crosshair; }
.overlay.playing { cursor: pointer; }
.overlay.element { cursor: cell; }
/* markers on the video: open = orange, with Claude = violet, fixed = green, draft = white */
.pin { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--amber); color: var(--color-void); display: grid; place-items: center; font-weight: 590; font-size: 11px; box-shadow: 0 0 0 2px #fff, 0 4px 12px rgba(0, 0, 0, .3); pointer-events: auto; cursor: pointer; }
.pin > span { transform: rotate(45deg); }
.pin.draft { background: #fff; box-shadow: 0 0 0 2px var(--color-void), 0 4px 12px rgba(0, 0, 0, .3); }
.pin.done { background: var(--green); color: #fff; }
.pin.sent { background: var(--violet); color: #fff; }
.box { position: absolute; border: 2px solid var(--amber); border-radius: 6px; background: var(--amber-tint); pointer-events: none; }
.box.draft { border-color: #fff; background: rgba(255, 255, 255, .1); border-style: dashed; }
.box.done { border-color: var(--green); background: var(--green-tint); }
.box.sent { border-color: var(--violet); background: var(--violet-tint); }
.box .tag { position: absolute; left: -2px; top: -24px; height: 22px; padding: 0 8px; border-radius: 6px 6px 6px 0; font: 510 11.5px var(--font); color: var(--color-void); background: var(--amber); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; line-height: 22px; }
.box.draft .tag { background: #fff; color: var(--color-void); }
.box.done .tag { background: var(--green); color: #fff; }
.box.sent .tag { background: var(--violet); color: #fff; }
.box.hover { border-color: var(--color-mist); background: rgba(208, 214, 224, .1); }
.box.hover .tag { background: var(--color-mist); color: var(--color-void); }
.box.prev { border-color: var(--green); background: var(--green-tint); border-style: dashed; }
.box.prev .tag { background: var(--green); color: #fff; }
.pin.prev { background: var(--green); color: #fff; }
.stage-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); z-index: 6; pointer-events: none; }
.updated { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 8; }

.transport { display: flex; align-items: center; gap: 8px; padding: 8px 16px 6px; }
.transport .tbtn { width: 32px; height: 32px; border-radius: var(--radius-buttons); border: 1px solid var(--line); background: var(--panel-3); color: var(--body); display: grid; place-items: center; transition: border-color var(--ease), background var(--ease); }
.transport .tbtn:hover { border-color: var(--line-3); background: var(--raised); }
.transport .tbtn[data-act=play] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.transport .tbtn[data-act=play]:hover { background: #fff; }
.transport .tbtn svg { width: 15px; height: 15px; fill: currentColor; }
.transport .time { font: 12px var(--mono); letter-spacing: -.013em; color: var(--text); min-width: 150px; margin-left: 6px; }
.transport .time .faint { color: var(--faint); }
.transport .spacer { flex: 1; }
.transport select { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-buttons); color: var(--body); height: 32px; padding: 0 8px; }
.timeline { position: relative; margin: 0 16px; height: 54px; cursor: pointer; user-select: none; }
.tl-track { position: absolute; left: 0; right: 0; top: 18px; height: 26px; border-radius: var(--radius-buttons); background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.tl-scene { position: absolute; top: 0; bottom: 0; border-right: 1px solid var(--line); background: var(--panel); font: 10px var(--mono); color: var(--faint); overflow: hidden; white-space: nowrap; container-type: inline-size; }
.tl-scene span { display: block; padding: 6px 0 0 5px; }
/* a scene too short for its name shows only its edge, so names never run together */
@container (max-width: 30px) { .tl-scene span { visibility: hidden; } }
.tl-scene:nth-child(2n) { background: var(--panel-2); }
.tl-scene.cur { background: var(--raised); color: var(--heading); }
.tl-played { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0, 0, 0, .04); pointer-events: none; }
.tl-head { position: absolute; top: 12px; bottom: 6px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 2px; pointer-events: none; z-index: 3; }
.tl-head::before { content: ""; position: absolute; left: -5px; top: -4px; width: 12px; height: 8px; border-radius: 3px; background: var(--ink); }
.tl-note { position: absolute; top: 0; width: 17px; height: 17px; margin-left: -8.5px; border-radius: 50%; background: var(--amber); color: var(--color-void); font: 590 9px var(--font); display: grid; place-items: center; z-index: 2; box-shadow: 0 0 0 2px var(--bg); }
.tl-note.done { background: var(--green); color: #fff; }
.tl-note.sent { background: var(--violet); color: #fff; }
.tl-note.prev { background: var(--panel); color: var(--green-text); box-shadow: inset 0 0 0 1.5px var(--green), 0 0 0 2px var(--bg); cursor: pointer; }
.tl-hover { position: absolute; top: -8px; transform: translateX(-50%); font: 11px var(--mono); background: var(--ink); color: var(--on-ink); padding: 2px 7px; border-radius: 6px; pointer-events: none; z-index: 4; }
.words { margin: 2px 16px 14px; height: 28px; overflow: hidden; white-space: nowrap; font-size: 14px; line-height: 28px; color: var(--faint); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); text-align: center; }
.words span { padding: 2px 3px; cursor: pointer; border-radius: var(--radius-pills); transition: color var(--ease), background var(--ease); }
.words span:hover { color: var(--text); }
.words span.cur { color: var(--on-ink); background: var(--ink); padding: 2px 8px; }

/* notes panel */
.side { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.composer { padding: 16px; border-bottom: 1px solid var(--line); }
.composer-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.composer-head .at { font-weight: 510; font-size: 14px; color: var(--heading); letter-spacing: -.011em; }
.tools { margin-left: auto; display: flex; padding: 2px; background: var(--panel-3); border: 1px solid var(--line); border-radius: var(--radius-buttons); }
.tools button { border: 0; background: transparent; color: var(--muted); padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 510; transition: color var(--ease), background var(--ease); }
.tools button:hover:not(:disabled) { color: var(--text); }
.tools button.on { background: var(--raised); color: var(--heading); box-shadow: var(--shadow-sm); }
.tools button:disabled { opacity: .45; cursor: default; }
.anchor-line { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; min-height: 18px; display: flex; gap: 6px; align-items: center; }
.anchor-line .x { margin-left: auto; color: var(--faint); background: none; border: 0; }
.anchor-line .x:hover { color: var(--text); }
.composer textarea { width: 100%; min-height: 80px; resize: vertical; background: var(--input); border: 1px solid var(--line-2); border-radius: var(--radius-buttons); padding: 10px 12px; color: var(--text); outline: none; line-height: 1.5; transition: border-color var(--ease); }
.composer textarea:focus { border-color: var(--accent); }
.composer .hints { margin-top: 8px; color: var(--faint); font-size: 12px; line-height: 1.9; }
.composer .row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--color-mist); }
.activity { padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; display: flex; gap: 10px; align-items: flex-start; background: var(--bg); }
/* avatars: dark circle, 2px coloured ring — Claude coral, teammates lavender, you grey */
.activity .av, .note-reply .av { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--panel); border: 2px solid var(--claude); display: grid; place-items: center; color: var(--claude); font-weight: 590; font-size: 10.5px; }
.activity .av.you { border-color: var(--color-stone); color: var(--color-stone); }
.activity .av.team { border-color: var(--team); color: var(--team-text); }
.activity .tx { color: var(--muted); padding-top: 2px; }
.activity .tx b { color: var(--heading); font-weight: 510; }
.list-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px 10px; color: var(--muted); font-size: 12.5px; }
.list-head .spacer { flex: 1; }
.notes { flex: 1; overflow: auto; padding: 0 12px 12px; }
.note { border: 1px solid var(--line); background: var(--panel-2); border-radius: var(--radius-cards); padding: 12px 14px; margin-bottom: 8px; transition: border-color var(--ease), box-shadow var(--ease); cursor: default; }
.note:hover { border-color: var(--line-3); }
.note.focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.note.done { opacity: .7; }
/* comments fixed on the previous version, listed on the new one to check */
.prev-notes { margin-bottom: 12px; padding-bottom: 4px; border-bottom: 1px dashed var(--line-2); }
.prev-notes.closed { margin-bottom: 8px; }
.prev-head { display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px 2px 8px; background: none; border: 0; color: var(--heading); font: 510 12.5px var(--font); text-align: left; cursor: pointer; }
.prev-head .faint { font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prev-head .chev { width: 12px; color: var(--muted); flex: none; }
.note.prev { cursor: pointer; }
.note.prev .note-n { background: var(--green); color: #fff; }
.note-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.note-n { width: 20px; height: 20px; border-radius: 50%; background: var(--amber); color: var(--color-void); font-weight: 590; font-size: 11px; display: grid; place-items: center; flex: none; }
.note.done .note-n { background: var(--green); color: #fff; }
.note.sent .note-n { background: var(--violet); color: #fff; }
.note-time { font: 12px var(--mono); letter-spacing: -.013em; color: var(--body); background: var(--panel-3); border: 1px solid var(--line); padding: 1px 7px; border-radius: var(--radius-small); }
.note-time:hover { background: var(--raised); color: var(--heading); }
.note-anchor { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.note-top .spacer { flex: 1; }
.note-body { white-space: pre-wrap; word-break: break-word; line-height: 1.5; color: var(--text); }
.note-reply { margin-top: 10px; padding: 8px 10px; border-radius: var(--radius-buttons); background: var(--bg); border: 1px solid var(--line); font-size: 12.5px; color: var(--body); display: flex; gap: 8px; }
.note-reply .av { width: 18px; height: 18px; font-size: 9px; margin-top: 1px; }
.note-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.learn { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 7px; border-radius: var(--radius-pills); border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 12px; font-weight: 510; transition: color var(--ease), border-color var(--ease), background var(--ease); }
.learn .box2 { width: 14px; height: 14px; border-radius: var(--radius-small); border: 1.5px solid var(--faint); display: grid; place-items: center; }
.learn:hover { color: var(--text); border-color: var(--line-3); }
.learn.queued { color: var(--amber-text); border-color: transparent; background: var(--amber-tint); }
.learn.queued .box2 { border-color: var(--amber); background: var(--amber); }
.learn.learned { color: var(--green-text); border-color: transparent; background: var(--green-tint); }
.learn.learned .box2 { border-color: var(--green); background: var(--green); }
.learn .box2 svg { width: 10px; height: 10px; fill: none; stroke: #fff; stroke-width: 3; }
.learn.queued .box2 svg { stroke: var(--color-void); }
.note-foot .spacer { flex: 1; }
.icon-btn { width: 26px; height: 26px; border-radius: 6px; border: 0; background: transparent; color: var(--faint); display: grid; place-items: center; transition: color var(--ease), background var(--ease); }
.icon-btn:hover { background: var(--panel-3); color: var(--text); }
.icon-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.rule { margin-top: 8px; font-size: 12px; color: var(--green-text); }
.send-bar { border-top: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--panel); }
.send-bar .btn { justify-content: center; height: 36px; font-size: 13.5px; }
.edit-area { width: 100%; min-height: 60px; background: var(--input); border: 1px solid var(--accent); border-radius: var(--radius-buttons); padding: 8px 10px; color: var(--text); outline: none; resize: vertical; }

/* drawer + toasts */
.drawer { position: fixed; right: 16px; top: calc(var(--top-h) + 8px); width: 460px; max-width: calc(100vw - 32px); max-height: calc(100vh - var(--top-h) - 28px); overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-cards); box-shadow: var(--shadow-float); z-index: 40; padding: 20px; }
.drawer h3 { margin: 0 0 4px; font-size: 20px; line-height: 1.33; font-weight: 510; letter-spacing: -.012em; }
.drawer .sess { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-buttons); margin-top: 8px; }
.drawer .sess.on { border-color: var(--green); background: var(--green-tint); }
.drawer pre { white-space: pre-wrap; font: 11px/1.5 var(--mono); color: var(--muted); background: var(--bg); padding: 10px; border-radius: var(--radius-buttons); max-height: 160px; overflow: auto; margin: 6px 0 0; }
.drawer .msg { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; align-items: center; }
.toast { background: var(--ink); color: var(--on-ink); padding: 9px 14px; border-radius: var(--radius-buttons); box-shadow: var(--shadow-float); font-size: 13px; font-weight: 510; animation: rise .2s ease-out; }
.toast.err { background: var(--red); color: #fff; }
@keyframes rise { from { transform: translateY(10px) scale(.96); opacity: 0; } }

@media (max-width: 1100px) {
  /* video and comments stay side by side down to a phone: the Studio often sits in Claude's browser pane next to the chat */
  .review { grid-template-columns: minmax(0, 1fr) clamp(230px, 42vw, 340px); }
  .queue { display: none; }
}
/* the top bar keeps all six tabs visible at every width: the name, then the long Claude label, then the counts give way */
@media (max-width: 1180px) {
  .top { gap: 14px; }
  .brand { font-size: 0; gap: 0; }
}
@media (max-width: 960px) {
  .top { gap: 10px; padding: 0 12px; }
  .nav a { padding: 0 8px; }
  .claude-pill { padding: 0 10px; }
  .claude-pill .label { display: none; }
  .claude-pill .short { display: inline; }
  .top .scope { max-width: 112px; }
}
@media (max-width: 760px) {
  .nav a { padding: 0 6px; }
  .nav a .n { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .group-head { flex-wrap: wrap; gap: 4px 12px; }
  .form { grid-template-columns: 1fr; }
  .home, .new { padding-left: 16px; padding-right: 16px; }
  .home-head h1 { font-size: 32px; }
  .new h1 { font-size: 36px; }
  /* the title on its own line, then search, sort and actions share one row */
  .home .home-head .titles { flex: 1 0 100%; }
  .home .home-head .search { flex: 1 1 140px; width: auto; min-width: 0; margin-left: 0; }
  .home .home-head .sort, .home .home-head .head-actions, .home .home-head [data-start] { flex: none; }
}

/* narrow panes (Claude's browser next to the chat): smaller paddings so the video, timeline and comments all fit */
@media (max-width: 760px) {
  .stage-head { padding: 8px 10px; gap: 6px; }
  .stage-head .lbl { display: none; }
  .stage-head .grp .chip { height: 26px; padding: 0 8px; font-size: 12.5px; }
  .stage { padding: 8px; }
  .transport { padding: 6px 10px 4px; gap: 6px; }
  .transport .tbtn { width: 30px; height: 30px; }
  .transport .time { min-width: 0; font-size: 11.5px; margin-left: 2px; }
  .transport select { height: 30px; }
  .timeline { margin: 0 10px; height: 46px; }
  .tl-track { top: 14px; }
  .words { margin: 0 10px 8px; font-size: 13px; }
  .composer { padding: 12px; }
  .composer-head { flex-wrap: wrap; row-gap: 6px; }
  .composer-head .at { font-size: 14px; white-space: nowrap; }
  .composer textarea { min-height: 52px; }
  .activity { padding: 8px 12px; }
  .list-head { padding: 8px 12px 6px; }
  /* the comments column scrolls as one, with Apply revisions / Approve pinned at the bottom */
  .side { overflow-y: auto; }
  .notes { flex: 1 0 auto; overflow: visible; min-height: 64px; }
  .send-bar { position: sticky; bottom: 0; z-index: 2; }
  .actions-row { flex-wrap: wrap; }
  .actions-row .btn { min-width: 0; flex: 1 1 110px; height: 32px; white-space: normal; line-height: 1.2; }
  .top { gap: 6px; padding: 0 10px; }
  .top .scope { max-width: 118px; padding-left: 8px; }
  .nav a { font-size: 13px; padding: 0 5px; }
  .claude-pill { padding: 0 9px; gap: 6px; }
  .top-right { gap: 4px; }
  .send-bar { padding: 10px 12px; gap: 8px; }
  .send-bar .btn, .send-bar .btn.lg { height: 34px; font-size: 13px; }
  .send-bar .help { font-size: 11.5px; }
}
/* very narrow: the tabs get their own row (with their counts back) rather than scroll out of sight */
@media (max-width: 670px) {
  :root { --top-h: 86px; }
  .top { flex-wrap: wrap; align-content: center; row-gap: 6px; }
  .top-right { margin-left: auto; }
  .top .scope { max-width: 180px; }
  .nav { order: 3; flex: 1 0 100%; justify-content: space-between; }
  .nav a .n { display: inline-grid; }
}
@media (max-width: 480px) { .nav a .n { display: none; } }
/* phones: comments go below the video (side by side is still usable down to here) */
@media (max-width: 460px) {
  .review { grid-template-columns: 1fr; height: auto; }
  .stage { flex: none; height: 70vh; }
  .side { border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- team sharing ---------- */
.note-from { font-size: 11.5px; font-weight: 510; color: var(--team-text); background: var(--team-tint); padding: 1px 8px; border-radius: var(--radius-pills); white-space: nowrap; }
.btn.shared { background: var(--accent-tint); border-color: transparent; color: var(--accent-text); }
.btn .spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin 1s linear infinite; }
.update-pill { height: 30px; padding: 0 14px; border-radius: var(--radius-pills); border: 0; background: var(--color-paper); color: var(--color-void); font-size: 13px; font-weight: 510; white-space: nowrap; transition: background var(--ease); }
.update-pill:hover { background: var(--color-bone); }
.notice { margin: 0 0 20px; padding: 12px 16px; border-radius: var(--radius-cards); background: var(--amber-tint); color: var(--amber-text); }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.suggest .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.suggest .chip.team { background: var(--team-tint); border-color: transparent; color: var(--team-text); }

/* ---------- stages + review actions ---------- */
.btn.lg { height: 36px; padding: 0 16px; font-size: 13.5px; }
.home-head .titles { flex: 1 1 420px; min-width: 0; }
.home-head .titles h1 { margin: 0; }
.home-head .titles .sub { margin: 6px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; letter-spacing: -.011em; max-width: 620px; }
.home-head .search { margin-left: 0; }
.card-meta .ver, .q-item .ver { font: 12px var(--mono); color: var(--faint); }
.card-meta .st { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.card-meta .st .sw { width: 8px; height: 8px; border-radius: 50%; }
.jobs .grid { margin-bottom: 8px; }
.queue-head { align-items: baseline; justify-content: space-between; padding: 16px 16px 10px; }
.queue-title { font-weight: 510; font-size: 14px; color: var(--heading); }
.queue-title:hover { color: var(--body); }
.q-item .mini .st { background: var(--amber); }
.composer .row .spacer { flex: 1; }
.send-bar .btn.lg { height: 42px; }
.actions-row { display: flex; gap: 8px; }
.actions-row .btn { flex: 1; justify-content: center; height: 36px; }
.send-bar .help { font-size: 12.5px; text-align: center; }
.state-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-buttons); background: var(--violet-tint); color: var(--muted); font-size: 13px; line-height: 1.5; }
.state-card b { color: var(--heading); font-weight: 510; }
.state-card .spin { flex: none; margin-top: 3px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--violet-text); animation: spin 1s linear infinite; }
.state-card.ok { background: var(--green-tint); }
.state-card.ok b { color: var(--green-text); }
.learn.on { color: var(--accent-text); border-color: transparent; background: var(--accent-tint); }
.learn.on .box2 { border-color: var(--accent); background: var(--accent); }
.empty.small { padding: 28px 12px; font-size: 13px; }
.more { display: flex; justify-content: center; margin: 24px 0 0; }

/* ---------- delivery: select, upload dialog, folder picker ---------- */
.head-actions { display: flex; gap: 8px; align-items: center; }
.pick { position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .85); background: rgba(0, 0, 0, .35); display: grid; place-items: center; padding: 0; color: transparent; transition: background var(--ease), border-color var(--ease); }
.pick svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.pick:hover { background: rgba(0, 0, 0, .55); }
.pick.on { background: var(--color-bone); border-color: var(--color-bone); color: var(--color-void); }
.card:has(.pick.on) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(8, 9, 10, .7); display: grid; place-items: center; padding: 16px; }
.modal-card { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-cards); box-shadow: var(--shadow-float); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-card h3 { margin: 0; font-size: 20px; line-height: 1.33; font-weight: 510; letter-spacing: -.012em; }
.modal-card p { margin: 0; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
/* opening headline editor: a scaled preview of the top of the frame, drawn at the ad's real size */
.hl-edit textarea { width: 100%; resize: vertical; min-height: 76px; font-size: 15px; line-height: 1.45; background: var(--input); border: 1px solid var(--line-2); border-radius: var(--radius-buttons); padding: 10px 12px; color: var(--text); outline: none; }
.hl-edit textarea:focus { border-color: var(--line-3); }
.hl-preview { position: relative; overflow: hidden; border-radius: var(--radius-buttons); background: #000; }
.hl-frame { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: linear-gradient(#1b1d20, #0c0d0e); }
.hl-box { position: absolute; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; font-family: 'Studio Headline', 'Roboto Condensed', 'Arial Narrow', sans-serif; font-weight: 400; letter-spacing: -.03em; line-height: 1; color: #000; }
.hl-row { display: flex; align-items: center; white-space: pre; background: #fff; box-sizing: content-box; }
.hl-row:first-child { padding-top: var(--pad-y) !important; border-radius: var(--r) var(--r) 0 0; }
.hl-row:last-child { padding-bottom: var(--pad-y) !important; border-radius: 0 0 var(--r) var(--r); }
.hl-row:only-child { border-radius: var(--r); }
.hl-status { font-size: 13px; min-height: 18px; }
.hl-status.err { color: var(--red-text); }
.where { display: grid; gap: 8px; }
.where > * { min-width: 0; }
.radio .btn { flex: none; }
.radio { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-buttons); cursor: pointer; transition: border-color var(--ease), background var(--ease); }
.radio > div { flex: 1; min-width: 0; }
.radio .mono { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio input { accent-color: var(--color-mist); }
.radio.on { border-color: var(--accent); background: var(--accent-tint); }
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.clients .field input { background: var(--input); border: 1px solid var(--line-2); border-radius: var(--radius-buttons); padding: 8px 12px; color: var(--text); outline: none; }
.clients .field input:focus { border-color: var(--accent); }
.plan { border: 1px solid var(--line); border-radius: var(--radius-buttons); max-height: 260px; overflow: auto; }
.plan-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.plan-row:last-child { border-bottom: 0; }
.plan-row .pa { font-weight: 590; white-space: nowrap; }
.plan-row .pd { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.crumb { border: 0; background: transparent; color: var(--muted); padding: 2px 6px; border-radius: var(--radius-small); font-weight: 510; }
.crumb:hover { background: var(--accent-tint); }
.crumb:last-of-type { color: var(--heading); }
.folders { border: 1px solid var(--line); border-radius: var(--radius-buttons); max-height: 320px; overflow: auto; padding: 4px; }
.folder { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 6px; transition: background var(--ease); }
.folder:hover { background: var(--panel-3); }
.folder svg { width: 18px; height: 18px; flex: none; fill: var(--color-fog); opacity: .85; }
.folder span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.newfolder { display: flex; gap: 8px; }
.newfolder input { flex: 1; background: var(--input); border: 1px solid var(--line-2); border-radius: var(--radius-buttons); padding: 7px 12px; color: var(--text); outline: none; }
.newfolder input:focus { border-color: var(--accent); }
.styles-sync p { margin: 0 0 12px; line-height: 1.5; }
.sync-list { border: 1px solid var(--line); border-radius: var(--radius-cards); background: var(--panel); }
.sync-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sync-row:last-child { border-bottom: 0; }
.sync-row .faint { font-size: 12.5px; margin-top: 2px; }
.sync-row .badge { white-space: nowrap; flex: none; }

/* ---------- clients ---------- */
.scope { height: 30px; max-width: 180px; padding: 0 26px 0 10px; border-radius: var(--radius-buttons); border: 1px solid var(--line); background: var(--panel); color: var(--body); font: 400 13px var(--font); outline: none; cursor: pointer; text-overflow: ellipsis; }
.scope:hover { border-color: var(--line-3); }
.scope:focus-visible { border-color: var(--accent); }
.step-label.full { grid-column: 1 / -1; margin: 20px 0 0; }
.form > .step-label.full:first-child { margin-top: 36px; }
/* the tab row scrolls on its own when the window is narrow, so the page never does */
.nav { min-width: 0; flex: 0 1 auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.top-right, .brand, .scope { flex: none; }
