/* The clip desk, drawn in Distill's design system.

   The clip desk is the engine's own page (web/index.html) and is not edited. It paints everything from a
   small set of variables, so this file re-points those variables at the tokens in system.css, sets the
   typeface, and corrects the handful of places where a colour was written out instead of taken from a
   variable. It is added to the page as it is served (studio/distill/brand.py), after the page's own styles,
   which is why plain selectors here win.

   Keep this short. Anything that needs more than a re-pointed variable or a one-line correction is a sign
   the page should grow a proper seam, not a bigger override. After an upstream sync, open /app and look:
   a new orange is the usual thing to find. */
:root {
  --brand: var(--accent);
  --brand-press: var(--accent-deep);
  --brand-ink: var(--fg);            /* upstream uses this both for headings and for text on a brand fill; */
  --brand-soft: var(--accent-soft);     /* headings win here and the fills are corrected below               */
  --brand-line: var(--accent-line);
  --brand-deep: var(--accent-deep);
  --frame: var(--side);
  --frame-2: var(--side-on);
  --frame-line: var(--rule-soft);
  --frame-text: var(--side-fg);
  --frame-dim: var(--side-dim);
  --bg: var(--page);
  --muted: var(--raised);
  --line: var(--rule-soft);
  --line-2: var(--rule);
  --text: var(--fg);
  --dim: var(--fg-soft);
  --faint: var(--fg-faint);
  --good: var(--ok);
  --good-soft: var(--ok-soft);
  --bad: var(--danger);
  --bad-soft: var(--danger-soft);
  --r-lg: var(--ds-r-lg);
  --r: var(--ds-r-lg);
  --r-sm: var(--ds-r);
}

body { font-family: var(--sans); font-size: 14.5px; }
::-webkit-scrollbar-thumb { background: var(--thumb); border-color: var(--page); }
::selection { background: var(--accent-line); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- text on an indigo fill is white (it was dark on orange) */
.btn.primary, .btn.primary svg, .pill.brand { color: var(--on-fill); }
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.dark { background: var(--fg); border-color: var(--fg); }

/* ---- the frame: the same rail as the studio's */
/* Only where the desk shows its sidebar as a column. Under 901px the desk turns it into a drawer and its
   own rule makes the grid one column; this rule, coming later at the same weight, used to win there too and
   kept a 244px column for a sidebar that was no longer in it -- the page filled two thirds of a phone. */
@media (min-width: 901px) { .app { grid-template-columns: var(--rail) minmax(0, 1fr); } }
/* One scroll for the whole sidebar, under our five places; the footer (AI, Settings) stays put. */
.side { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.side .nav { flex: none; overflow: visible; min-height: auto; }
.side-foot { position: sticky; bottom: -12px; margin-top: auto; padding-bottom: 12px; background: var(--frame); z-index: 1; }
.side { padding: 16px 12px 12px; }
.side-head { padding: 2px 6px 14px 8px; }
.side-head .logo { height: 30px; }
.side-head .ds-home { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.side-head .ds-home img { width: 26px; height: 26px; border-radius: 7px; display: block; }
.side-head:has(.ds-home) .mark { display: none; }
.side-head .collapse { display: none; }      /* the rail never folds on the studio, so not here either (shell.js) */
.app.mini .side-head .ds-home .ds-word { display: none; }
/* Inside the sticky footer (shell.js puts it back after each redraw), so a long sidebar cannot scroll it away. */
.side-foot .ds-theme { display: flex; width: max-content; margin: 4px 0 8px 6px; }
.app.mini .side-foot .ds-theme { display: none; }
.nav { gap: 1px; }
.nav h4 { font: 500 12.5px/1.3 var(--sans); color: var(--side-dim); padding: 14px 10px 4px; }
.nav-item { min-height: 34px; border-radius: 7px; font: 500 14.5px/1.2 var(--sans); color: var(--side-fg); }
.nav-item svg { width: 17px; height: 17px; color: var(--side-dim); }
.nav-item:hover { background: var(--side-hover); color: var(--fg); }
.nav-item.on, .nav-item.on:hover { background: var(--side-on); color: var(--fg); font-weight: 600; }
.nav-item.on svg { color: var(--fg); }
.nav-item.on .count, .nav-item.on .working { background: var(--rule-soft); color: var(--fg); }
.nav-item.on .avatar { background: var(--fg); color: var(--page); }
/* The clip desk's first page ("Home" in its own list) is the place our rail calls Clips, which sits just
   above, so the desk's own row would be the same place twice. */
#nav [data-v="overview"] { display: none; }
/* the old tab that put the studio inside this page: the studio is the frame now */
#nav [data-v="distill"] { display: none; }
.sb-soft, .nav-item.sug .sug-add { background: var(--rule-soft); }
.ds-desk { flex: none; }
.ds-heading { display: block; }
.app.mini .ds-desk .ds-item span, .app.mini .ds-desk h4, .app.mini .ds-heading { display: none; }
.app.mini .ds-desk .ds-item { justify-content: center; padding: 0; }
.side-foot { border-top-color: var(--rule-soft); }
.side-card, .ai-card { font-family: var(--sans); }

/* ---- the board, and what is raised off it */
main { background: var(--page); }
.topbar { background: var(--page); }
.topbar h1 { font: 650 18px/1.2 var(--sans); letter-spacing: -.01em; }
.topbar p { font-size: 13.5px; }
.card, .tile, .kpi, .clip, .lp, .chan, dialog, .pop { background-color: var(--raised); }
input, select, textarea { background-color: var(--raised); }
.hero h2 { font: 650 clamp(22px, 2.6vw, 30px)/1.15 var(--sans); letter-spacing: -.015em; }
.empty b, .card > h2, .card-head h2, .set-sec h2 { font-family: var(--sans); font-weight: 600; }

/* The video list: a picture you can actually see, and for a video the studio made, the way to it. */
.job-head .jthumb { width: 176px; border: 1.5px solid var(--rule); }
.job-head .jt { align-items: center; gap: 16px; }
.ds-open { display: inline-block; margin-left: 10px; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.ds-open:first-child { margin-left: 0; }
.ds-open:hover { color: var(--accent-deep); }
@media (max-width: 560px) { .job-head .jthumb { width: 104px; } }

/* The recording red with white text on it was 4.3:1; a shade deeper reads in both modes. */
.pill.live, .sb-tag.rec, .sbadge.rec, .nav-item.on .sb-tag, .sinfo .lv, .lp .ok.live, .bell .dotn, .btn .rdot.on { background: #D92E3B; }

/* ---- the desk's hand-written colours. It writes white and pale tints out by hand in about a hundred places
   (cards, buttons, the setup box, notices, hover colours). Each is put on our tokens here, in both themes:
   the tokens resolve light or dark themselves (system.css), so this works whichever the person chose. The
   list was made from every literal colour in web/index.html's styles; after an upstream sync, run the same
   search and add what is new. A white dot on red (the "live" marks) stays white. */

.btn, label.ck, .card, .composer, .composer.compact .chip, .composer.compact .lp, .composer.compact .ob,
.nstep, .composer.compact .nstep .ctl button, .tile-o, .seg, .range label, .tile, .step .n, .clip, .badge,
.livecard, .plan, dialog, .ntoast, .pop, .ai-home, .tr-card, .tr-chip, .tr-x, .fg-tile, .fg-sh, .fg-pill,
.fg-job, .ttabs .tabbtn.on .n { background-color: var(--raised); }
.appsetup .copyrow code, input:focus, select:focus, textarea:focus { background-color: var(--sunk); color: var(--fg); }

.utabs .tabbtn:hover, .ttabs .tabbtn:hover, .fg-tabs .tabbtn:hover, .chip:hover, .chip:focus-visible,
.tile-o:enabled:hover, .tile-o:focus-visible, .seg button:hover, .seg button:focus-visible, .tr-back:hover,
.step:hover, tr:hover > td, .ntoast:hover, .chip.on:hover, .pick.open .chip:hover { background: var(--rule-soft); }
.btn:hover, label.ck:hover, input:hover, select:hover, textarea:hover { border-color: var(--accent-line); }

.chprev img, .chprev .ph, .chan .pic { background: var(--rule-soft); }
.lp.wait .th, .sk { background: linear-gradient(90deg, var(--raised) 0%, var(--side-hover) 50%, var(--raised) 100%); }
.making { background: linear-gradient(110deg, var(--raised) 30%, var(--sunk) 50%, var(--raised) 70%); }
label.sw input { background: var(--rule); }
.btn.primary:disabled { background: var(--accent-soft); color: var(--fg-faint); }
.btn.danger:hover { background: var(--danger-soft); }
.danger-card, .livecard { border-color: color-mix(in srgb, var(--danger) 40%, var(--raised)); }

/* notices: the pale fill becomes the token's dark fill, and the text on it the token itself */
.chprev.bad, .sbadge.live, .lp.bad, .lp .rm:hover, .lp .rm:focus-visible, .ntoast.k-post i, .ntoast.k-live i,
.nt.k-post i, .nt.k-fail i, .nt.k-live i { background: var(--danger-soft); color: var(--danger); }
.lp.bad b, .lp .tx em, .pop.menu .danger, .pop.menu .danger svg { color: var(--danger); }
.lp .ok, .ntoast.k-clips i, .nt.k-clips i { background: var(--ok-soft); color: var(--ok); }
.vb, .badge.s-mid, .ntoast.k-expiry i, .nt.k-expiry i { background: color-mix(in srgb, var(--warn) 16%, var(--raised)); color: var(--warn); }
.vb b { color: var(--fg); }
.seg button[aria-pressed=true] small { color: var(--fg-soft); }

/* ---- added by the 2026-11-28 sync (PeakCut's templates, schedule, campaigns, what's-new, GTA pill).
   Made with scripts' search: every rule new since 39c32a8 whose background or border is a light literal.
   Left white on purpose: the heading previews (.pv-hook, .cp9-hook, .tp9-hook, .wa-hook) because they show
   what the clip's own white box will look like, knobs and dots on a coloured fill, and marks drawn on video. */
.updbox, .appcard, .dz-search input, .upd-card, .fp-row, .lc, .fc, .cp, .cchip,
.campbar .pick-btn, .campbar .tpc-btn, .campbar .pick-btn:hover, .campbar .tpc-btn:hover, .campbar .cb-opt,
.cb-panel .ob, .cmp-row, .segs button.on, .rbox, .cmp-styles button, .cmp-foot, .noclips .nc-ic, .cf-n,
.cmp-prog > span:not(.grow), .cmp-setup li, .lang-sel,
.sch-filters select, .sch-post, .sch-cell, .sch-cell.today, .sch-plus:hover, .sch-tb, .sch-tech code, .sch-tg,
.sch-tgh, .sch-card, .sch-card.sch-card, .sch-card.ok, .sch-card.bad, .sch-card.warn, .sch-card.run, .sch-cal,
.sch-addb, .sch-mc, .sch-side2, .sch-wc.sch-day:not(.today):not(.past), .sch-md.sch-day:not(.today):not(.past):not(.out),
.ce-days button, .ce-f input:focus, .ce-f textarea:focus, .ce-chips button, .ce-step button, .ce2-r,
.ce3-f input, .ce3-f textarea, .mc-row, .mc-chip, .cp-search input, .cp-sort,
.cpg-step, .cpg-chip, .cpg-in, .cpg-adv, .cpg-bar, .cpg-vids, .dz-tools select, .dz-tools .chip, #dz_kinds button,
.wn-k, .wn-tile, .wn-big, .wa-langs span, .tpe-opt, .tpe-pre .tpe-opt, .tpe-pre .tpe-opt.on, .rs, .tpc-pop,
.fg-sh.on i { background: var(--raised); }
/* the off-white "sunk" patches (a past day, a form's field, a side column) sit on the board itself */
.sch-wrap, .sch-side, .sch-col.past, .sch-wc.past, .sch-md.past, .sch-md.out, .ce-f input, .ce-f textarea,
.ce-step, .mcp.off, .cpg-brief, .cpg-sum { background: var(--sunk); }
/* PeakCut's orange tints: hover is a plain wash, "today" and "now" are the indigo the rest of Distill uses */
.sch-post:hover, .mc-table tr[data-act]:hover, a.cw-r:hover, .sch-ev:hover, .fg-tabs .tabbtn:hover,
.lc .btn.on:hover, .fc .btn.on:hover, .sch-slot.can:hover, .sch-md.can:hover, .spark i.e { background: var(--rule-soft); }
.sch-slot.nowh, .sch-wc.today, .sch-md.today { background: var(--accent-soft); }
.sch-day.over, .sch-slot.over, .sch-wc.sch-day.over, .sch-md.sch-day.over { background: color-mix(in srgb, var(--warn) 18%, var(--raised)); }
.sch-slot { border-top-color: var(--rule-soft); }
/* status tints */
.upd-card.warn, .upd-ba .was, .sch-box.bad, .sch-ev.bad, .sch-card.bad, .cw-r.bad, .cw-why, .ao-ck:has(input:checked) { background: var(--danger-soft); }
.upd-ba .now, .sch-box.ok, .sch-ev.ok, .cw-r.ok, .sch-acc.done, .cpg-sum.on { background: var(--ok-soft); }
.sch-box.warn, .sch-ev.warn, .cw-r.warn, .cw-why.warn { background: color-mix(in srgb, var(--warn) 16%, var(--raised)); }
.sch-mc.ok, .sch-acc.done { border-color: color-mix(in srgb, var(--ok) 40%, var(--raised)); }
.sch-mc.bad, .upd-card.warn { border-color: color-mix(in srgb, var(--danger) 40%, var(--raised)); }
.vb.ok, .vb.ok b, .vb.ok svg { color: var(--ok); }
/* white rings round avatars and dots are cut out of the surface they sit on */
.ab-logo, .fp-bar .fp-av, .fc-av, .cpb::after, .sch-pb .sch-dot { border-color: var(--raised); }
/* the what's-new box: a peach sunrise on a white card becomes an indigo one on paper */
.wn-hero { background: radial-gradient(120% 140% at 0% 0%, var(--accent-soft) 0%, color-mix(in srgb, var(--accent-soft) 45%, var(--raised)) 45%, var(--raised) 100%); }
.wn-art.styles, .wn-art.cam, .wn-art.lang { background: linear-gradient(135deg, var(--accent-soft), var(--raised)); }
.wn-k, .wa-langs span { border-color: var(--accent-line); color: var(--accent); }
.wa-langs span { color: var(--fg); }
.wa-cam i { background: var(--accent-line); }
/* the style editor's three coloured panels and the campaign colours keep their hue, on a dark ground */
.tpe-presets { --pc: color-mix(in srgb, #3B82F6 16%, var(--raised)); --pi: #9DBBFF; }
.tpe-presets.heading { --pc: color-mix(in srgb, #EC4899 16%, var(--raised)); --pi: #F9A8D4; }
.tpe-presets.layout { --pc: color-mix(in srgb, #22C55E 16%, var(--raised)); --pi: #86EFAC; }
.cc0, .cc1, .cc2, .cc3, .cc4, .cc5 { --cc-bg: color-mix(in srgb, var(--cc) 14%, var(--raised)); --cc-line: color-mix(in srgb, var(--cc) 40%, var(--raised)); }
/* In both modes: the one orange PeakCut drew by hand on the what's-new art is the indigo accent. */
.wa-ph.play { border-color: var(--accent); }

/* ---- "Draw the layout" (cliplook.js): a row in the clip editor and its dialog */
.ds-draw-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: -4px 0 4px; }
.ds-draw-row .sub a { color: var(--accent); }
#ds-draw { width: min(1100px, 96vw); max-height: 94vh; padding: 0; border: 0; border-radius: 16px; background: var(--raised); color: var(--fg); }
#ds-draw::backdrop { background: rgba(20, 16, 14, .55); }
.ds-dw { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; }
.ds-dw-head { display: flex; align-items: center; justify-content: space-between; }
.ds-dw-head h2 { margin: 0; font: 700 22px/1.2 var(--sans); }
.ds-dw-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.ds-dw-kinds button, .ds-dw-which button { min-height: 40px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 999px; background: var(--raised); color: var(--fg); cursor: pointer; font: 500 15px var(--sans); }
.ds-dw-kinds button[aria-checked="true"], .ds-dw-which button[aria-pressed="true"] { background: var(--press); color: var(--on-press); border-color: var(--press-line); font-weight: 700; }
.ds-dw-body { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 16px; align-items: start; }
.ds-dw-stage { position: relative; user-select: none; touch-action: none; cursor: crosshair; border-radius: 10px; overflow: hidden; background: #000; }
.ds-dw-stage img { display: block; width: 100%; height: auto; pointer-events: none; }
.ds-dw-boxes { position: absolute; inset: 0; }
.ds-dw-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .25), 0 0 0 1px #000; cursor: move; }
.ds-dw-box.on { border-color: #FFE34D; }
.ds-dw-box span { position: absolute; left: 0; top: 0; background: #000c; color: #fff; font: 600 12px var(--sans); padding: 2px 6px; }
.ds-dw-box i { position: absolute; right: -8px; bottom: -8px; width: 18px; height: 18px; border-radius: 50%; background: #FFE34D; border: 2px solid #000; cursor: nwse-resize; }
.ds-dw-side { display: grid; gap: 12px; justify-items: start; }
.ds-dw-side canvas { width: 216px; height: 384px; border-radius: 12px; background: #111; }
.ds-dw-which .seg { display: flex; gap: 6px; flex-wrap: wrap; }
.ds-dw-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.ds-dw-foot .sub { margin-right: auto; }
@media (max-width: 760px) { .ds-dw-body { grid-template-columns: 1fr; } .ds-dw-side { justify-items: center; } }

/* ---- the sign-in pages (web/auth.html, web/reset.html; marked data-ds-page="auth" by brand.py). They have a few
   variables of their own and paint their panel white outright, which left a white panel round a dark card. */
body[data-ds-page="auth"] { --ink: var(--fg); --deep: var(--accent-deep); --brand-hi: var(--accent-deep);
  --soft: var(--accent-soft); --line-b: var(--accent-line); }
body[data-ds-page="auth"] .main { background: var(--page); }
body[data-ds-page="auth"] .card { background: transparent; }
/* One centred card with the mark above it, at every width: the engine's left panel sold the clip desk alone
   ("free and open source"), which is not this product, and the owner's standard is no taglines. */
body[data-ds-page="auth"] { grid-template-columns: 1fr; background: var(--page); }
body[data-ds-page="auth"] .side { display: none; }
body[data-ds-page="auth"] .main { margin: 0; border-radius: 0; min-height: 100vh; align-content: center; }
body[data-ds-page="auth"] .mobile-logo { display: block; height: 34px; margin-bottom: 28px; }

/* ---- nothing points at the engine's maker (brand.unlink_upstream empties the links and stops its updater) */
.set-link[data-k="updates"], .toast .rep { display: none !important; }
