/* ============================================================================================================================
   Grand Total studio dashboard. The layout follows Linear's app (linear.app); the look is Grand Total's receipt paper
   (pipeline/style/tally.css): paper and ink, Space Mono for labels and numbers, marker pink for what needs Sam.
   - shell: a slim sidebar on the app background; the page is one sheet (white, 1px border, 8px radius) that fills the rest
     of the screen, with a 44px header inside it. Full width: lists and boards run edge to edge; detail pages centre their
     content and put properties in a right-hand column. On a phone: the sheet fills the screen, with a bottom tab bar.
   - type: Inter for reading, 13/20 everywhere, 12/16 for meta, 18/26 semibold for the title of a detail page. Space Mono
     (uppercase, tracked) for labels, headers and every number, as on the receipts.
   - lists: group headers (32px, tinted) and rows (36px). Board: 296px columns of small cards. Properties: label / value rows.
   - status is a 14px ring that fills with progress (Linear's status icons): fire (marker pink) = needs you, blue = being made or
     scheduled, green = posted or done, amber = queued, red = stopped, grey = not started. Text is never coloured, except
     the fire count of things that need you.
   - one button height (28px, 24px small): primary (ink), secondary (bordered), ghost. One radius for controls (6px).
   ============================================================================================================================ */
:root {
  --bg: #eae3d6; --sheet: #f5f0e8; --card: #fbf8f3; --tint: #efe9de; --line: #dcd3c3; --line-2: #e6dfd2;
  --ink: #1b1714; --muted: #6e665c; --faint: #a1988a; --hover: rgba(27, 23, 20, .045); --sel: rgba(27, 23, 20, .08);
  --fire: #c8146e; --marker: #ff3d9a; --blue: #3f5bcb; --green: #127a4a; --amber: #b97a0f; --red: #c8332c; --grey: #a1988a;
  --sans: "Inter", ui-sans-serif, system-ui, sans-serif; --mono: "Space Mono", ui-monospace, Menlo, monospace;
  --fs: 13px; --lh: 20px; --fs-s: 12px; --lh-s: 16px; --fs-t: 18px; --lh-t: 26px; --input: 13px;
  --h: 28px; --row: 36px; --hdr: 44px; --tabbar: 56px;
  --on-ink: #f5f0e8; --primary-hover: #3a332d;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;   /* chart series: TikTok, Instagram, YouTube, Facebook (validated) */
  color-scheme: light;
}
/* fire is the marker deepened for text on paper (4.9:1); the marker itself (2.9:1) only ever fills, under ink */
:root[data-theme="dark"] {
  --bg: #0e0c10; --sheet: #17141a; --card: #1e1a21; --tint: #1b181e; --line: #2e2930; --line-2: #241f26;
  --ink: #f5f0e8; --muted: #a39a8d; --faint: #6a6259; --hover: rgba(245, 240, 232, .04); --sel: rgba(245, 240, 232, .08);
  --fire: #ff3d9a; --marker: #ff3d9a; --blue: #7d8ff2; --green: #4cb782; --amber: #e2a33a; --red: #e5584f; --grey: #6a6259;
  --on-ink: #17141a; --primary-hover: #dcd5ca;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  color-scheme: dark;
}
@media (max-width: 899px) { :root { --fs: 15px; --lh: 22px; --fs-s: 13px; --lh-s: 18px; --fs-t: 20px; --lh-t: 28px; --input: 16px; --h: 34px; --row: 48px; --hdr: 52px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--fs)/var(--lh) var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; }
button { cursor: pointer; text-align: inherit; }
textarea { display: block; width: 100%; resize: none; outline: none; font-size: var(--input); line-height: var(--lh); }
input { outline: none; font-size: var(--input); }
::placeholder { color: var(--faint); }
:focus { outline: none; } :focus-visible { outline: 2px solid color-mix(in srgb, var(--marker) 60%, transparent); outline-offset: 1px; border-radius: 4px; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .num { font-variant-numeric: tabular-nums; } .s { font-size: var(--fs-s); line-height: var(--lh-s); }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clamp2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.sp { flex: 1; }
@media (min-width: 900px) { .phone { display: none !important; } }
@media (max-width: 899px) { .desk { display: none !important; } }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.side { display: flex; flex-direction: column; gap: 1px; padding: 12px 8px; overflow: auto; }
.wordmark { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 7px; padding: 6px 8px 18px; font: 700 15px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.wordmark mark { background: var(--marker); color: #1b1714; padding: 2px 4px 1px; margin: 0 -2px; }
.wordmark span { width: 100%; margin-top: 7px; font-weight: 400; font-size: 11px; letter-spacing: .14em; color: var(--muted); }
.side .label { padding: 12px 8px 4px; font-size: var(--fs-s); color: var(--muted); }
.nav { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px; border-radius: 6px; color: var(--ink); }
.nav svg.i { color: var(--muted); }
.nav:hover { background: var(--hover); } .nav.on { background: var(--sel); }
.nav .n { margin-left: auto; font-size: var(--fs-s); color: var(--fire); font-variant-numeric: tabular-nums; }
.side .foot { margin-top: auto; padding: 8px; display: grid; gap: 4px; }
.sheet { margin: 8px 8px 8px 0; background: var(--sheet); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.hdr { flex: none; display: flex; align-items: center; gap: 8px; height: var(--hdr); padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); }
.hdr .crumb { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; font-weight: 500; }
.hdr .crumb a { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; flex: none; }
.hdr .crumb a:hover { color: var(--ink); }
.hdr .crumb .sep { color: var(--faint); }
.hdr .acts { display: flex; align-items: center; gap: 6px; flex: none; }
.body { flex: 1; overflow: auto; min-height: 0; }
.tabbar { display: none; }
@media (max-width: 899px) {
  .app { display: block; height: auto; }
  .side { display: none; }
  .sheet { margin: 0; border: 0; border-radius: 0; min-height: 100dvh; overflow: visible; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .sheet.docked { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .hdr { position: sticky; top: 0; z-index: 20; background: var(--sheet); padding: env(safe-area-inset-top) 8px 0 16px; height: calc(var(--hdr) + env(safe-area-inset-top)); }
  .body { overflow: visible; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tabbar) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: var(--sheet); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; line-height: 13px; color: var(--muted); position: relative; }
  .tabbar a svg.i { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--ink); }
  .tabbar a .n { position: absolute; top: 6px; left: calc(50% + 8px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--fire); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }
}

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--h); padding: 0 10px; border-radius: 6px; white-space: nowrap; font-size: var(--fs); font-weight: 500; line-height: 1; }
.btn.primary { background: var(--ink); color: var(--on-ink); } .btn.primary:hover { background: var(--primary-hover); }
.btn.secondary { background: var(--card); box-shadow: inset 0 0 0 1px var(--line), 0 1px 1px rgba(0, 0, 0, .03); } .btn.secondary:hover { background: var(--tint); }
.btn.ghost { color: var(--muted); } .btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.icon { width: var(--h); padding: 0; }
.btn.sm { height: 24px; padding: 0 8px; font-size: var(--fs-s); }
.btn.sm.icon { width: 24px; padding: 0; }
.btn.on { background: var(--sel); color: var(--ink); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 6px; background: var(--tint); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { height: 22px; padding: 0 8px; border-radius: 4px; font-size: var(--fs-s); font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 1px 1px rgba(0, 0, 0, .04); }
.seg.off { opacity: .45; pointer-events: none; }
.search { display: flex; align-items: center; gap: 6px; height: var(--h); padding: 0 8px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line); background: var(--card); color: var(--muted); width: 220px; }
.search input { flex: 1; min-width: 0; color: var(--ink); }
@media (max-width: 899px) { .search { width: auto; flex: 1; } }
kbd { font: 11px var(--sans); padding: 0 4px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); background: var(--card); }

/* status ring (Linear-style) */
.si { width: 14px; height: 14px; flex: none; display: block; }

/* ---------- list: group headers and rows ---------- */
.group { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; min-height: 32px; padding: 6px 16px; background: var(--tint); border-bottom: 1px solid var(--line-2); font-weight: 500; position: sticky; top: 0; z-index: 2; }
.group .c { color: var(--muted); font-weight: 400; font-size: var(--fs-s); }
.item { display: flex; align-items: center; gap: 10px; min-height: var(--row); padding: 0 16px; border-bottom: 1px solid var(--line-2); }
a.item:hover, .item.click:hover { background: var(--hover); } .item.click { cursor: pointer; }
.item.sel { background: var(--sel); }
.item .title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.item .title .ell:first-child { flex: none; max-width: 60%; }
.item .title .sub { color: var(--muted); font-size: var(--fs-s); }
.item .meta { flex: none; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: var(--fs-s); }
.item .meta .col { width: 64px; text-align: right; }
.item .meta .colw { width: 120px; }
.empty { padding: 16px; color: var(--muted); }
.box > .empty { padding: 10px 12px; }
@media (max-width: 899px) { .item { padding: 10px 16px; } .item:has(.sub) { align-items: flex-start; } .item:has(.sub) .si { margin-top: 4px; } .item .title { flex-direction: column; align-items: stretch; gap: 0; } .item .title .ell:first-child { max-width: none; white-space: normal; } }

/* ---------- board ---------- */
.board { display: flex; gap: 12px; padding: 12px 16px; height: 100%; overflow-x: auto; align-items: flex-start; }
.bcol { flex: 1 1 0; min-width: 0; max-width: 340px; display: flex; flex-direction: column; gap: 6px; }
.bcol .ch { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 4px; font-weight: 500; }
.bcol .ch .c { color: var(--muted); font-weight: 400; font-size: var(--fs-s); }
.card { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--card); border-radius: 6px; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .04); }
.card:hover { box-shadow: 0 0 0 1px var(--faint), 0 1px 2px rgba(0, 0, 0, .05); }
.card .cm { flex: 1; min-width: 0; display: grid; gap: 4px; }
.card .t { line-height: 18px; }
.card .fact { display: flex; align-items: center; gap: 6px; font-size: var(--fs-s); line-height: var(--lh-s); color: var(--muted); min-width: 0; }
.card .fact.you { color: var(--ink); font-weight: 500; }
.pring { flex: none; display: block; }
.pring text { font: 600 9px var(--sans); fill: var(--ink); }
.bcol .none { padding: 4px; font-size: var(--fs-s); color: var(--faint); }
.pbar { height: 3px; border-radius: 2px; background: var(--line-2); overflow: hidden; } .pbar span { display: block; height: 100%; background: var(--blue); }

/* ---------- detail: centred content, properties on the right ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 264px; min-height: 100%; }
.detail > .main { padding: 28px 40px 64px; min-width: 0; }
.detail > .main > .in { max-width: 880px; margin: 0 auto; }
.detail > .props { border-left: 1px solid var(--line); padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 18px; }
@media (max-width: 899px) { .detail { display: block; } .detail > .main { padding: 16px; } .detail > .props { border-left: 0; border-top: 1px solid var(--line); padding: 16px; } }
.pstrip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 8px; font-size: var(--fs-s); color: var(--muted); } .pstrip > span { display: inline-flex; align-items: center; gap: 6px; }
h1.title { margin: 0 0 4px; font: 600 var(--fs-t)/var(--lh-t) var(--sans); letter-spacing: -.01em; }
.lede { color: var(--muted); font-size: 14px; line-height: 22px; margin: 0; }
.lede.ink { color: var(--ink); }
@media (max-width: 899px) { .lede { font-size: 15px; line-height: 23px; } }
.sec { margin-top: 32px; }
.sec > h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font: 600 15px/22px var(--sans); }
@media (max-width: 899px) { .sec > h2 { font-size: 17px; line-height: 24px; } }
.sec > h2 .aside { margin-left: auto; font-weight: 400; font-size: var(--fs-s); color: var(--muted); }
.pgroup { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.prop.hist { align-items: center; min-height: 28px; }
.pgroup > .lab { font-size: var(--fs-s); color: var(--muted); margin-bottom: 4px; }
.prop { display: flex; align-items: flex-start; gap: 8px; }
.prop > .k { width: 84px; flex: none; color: var(--muted); padding: 4px 0; }
.prop > .v { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 0; }
.prop > .v .si { margin: 3px 0; }
.prop a.v:hover { text-decoration: underline; }
.props .btn { justify-self: start; }

/* box: a bordered group of rows (hooks, comments, a table) */
.box { background: var(--card); border-radius: 8px; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .03); overflow: hidden; }
.opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line-2); }
.opt:first-child { border-top: 0; }
.opt.click { cursor: pointer; } .opt.click:hover { background: var(--hover); } .opt.sel { background: var(--tint); }
.opt .lead { flex: none; color: var(--muted); font-size: var(--fs-s); min-width: 20px; display: flex; align-items: center; min-height: var(--lh); }
.opt .main { flex: 1; min-width: 0; }
.opt .trail { flex: none; display: flex; align-items: center; gap: 4px; min-height: var(--lh); color: var(--muted); font-size: var(--fs-s); }
.opt .trail .btn { margin: -2px 0; }
.opt .meta { margin-top: 2px; font-size: var(--fs-s); line-height: var(--lh-s); color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 10px; }
.opt .reply { margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--line); font-size: var(--fs-s); line-height: var(--lh-s); color: var(--muted); }
.radio { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--faint); flex: none; }
.radio.on { box-shadow: inset 0 0 0 5px var(--ink); }

/* composer: a comment box with its send button (Linear's comment field) */
.composer { background: var(--card); border-radius: 8px; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .03); padding: 10px 12px 8px; }
.composer textarea { min-height: 40px; }
.composer .row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.composer .row .hint { flex: 1; color: var(--muted); font-size: var(--fs-s); }
.composer:focus-within { box-shadow: 0 0 0 1px var(--faint), 0 1px 2px rgba(0, 0, 0, .04); }

/* activity: the thread under an item */
.activity { display: grid; gap: 10px; }
.act { display: flex; gap: 10px; }
.act .who { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 600; color: #fff; background: var(--ink); margin-top: 2px; }
.act .who.claude { background: var(--fire); }
.act .bubble { flex: 1; min-width: 0; }
.act .bubble .meta { font-size: var(--fs-s); color: var(--muted); }
.act .bubble .text { white-space: pre-wrap; }

/* editable text shows it: a fill on hover, a ring on focus */
textarea.edit { padding: 2px 6px; margin: -2px -6px; width: calc(100% + 12px); border-radius: 4px; }
textarea.edit:not([readonly]):hover { background: var(--hover); }
textarea.edit:not([readonly]):focus { background: var(--card); box-shadow: inset 0 0 0 1px var(--faint); }
textarea[readonly] { color: var(--ink); }

/* the script: numbered lines, edited in place */
.line { display: flex; gap: 12px; padding: 6px 12px; border-top: 1px solid var(--line-2); }
.line:first-child { border-top: 0; }
.line .no { flex: none; width: 18px; color: var(--faint); font-size: var(--fs-s); line-height: var(--lh); text-align: right; }
.line .main { flex: 1; min-width: 0; }
.line .trail { flex: none; opacity: 0; } .line:hover .trail, .line .trail .on { opacity: 1; }
@media (hover: none) { .line .trail { opacity: 1; } }
.legend { padding: 8px 12px; border-top: 1px solid var(--line-2); font-size: var(--fs-s); color: var(--muted); background: var(--tint); }
.legend b { color: var(--ink); font-weight: 500; }

/* video review */
.review { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px; align-items: start; }
.review .media { position: sticky; top: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (max-width: 899px) { .review { grid-template-columns: minmax(0, 1fr); gap: 20px; } .review .media { position: static; width: min(100%, calc((100dvh - 300px) * 9 / 16)); justify-self: center; } }
.player { aspect-ratio: 9 / 16; width: 100%; background: #000; border-radius: 8px; overflow: hidden; }
.player video { width: 100%; height: 100%; display: block; object-fit: contain; }
.scrub { position: relative; height: 14px; margin: 0 5px; display: flex; align-items: center; touch-action: none; cursor: pointer; }
.scrub .rail { position: absolute; left: 0; right: 0; height: 3px; border-radius: 2px; background: var(--line); }
.scrub .fill { position: absolute; left: 0; height: 3px; border-radius: 2px; background: var(--ink); }
.scrub .pin { position: absolute; top: 2px; width: 2px; height: 4px; margin-left: -1px; background: var(--muted); }
.scrub .pin.draft { background: var(--fire); }
.scrub .knob { position: absolute; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--ink); }
.ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.ctl .time { font-size: var(--fs-s); color: var(--muted); margin: 0 8px; white-space: nowrap; }
.keys { font-size: var(--fs-s); color: var(--faint); }
@media (hover: none) { .keys { display: none; } }
.cover { display: block; width: 84px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); background: var(--tint); }
.cover[data-zoom] { cursor: zoom-in; }
.field { padding: 10px 12px; border-top: 1px solid var(--line-2); } .field:first-child { border-top: 0; }
.field .lab { display: flex; align-items: center; gap: 8px; font-size: var(--fs-s); color: var(--muted); margin-bottom: 4px; }
.field .lab .n { margin-left: auto; } .field .lab .n.over { color: var(--red); }
.progress { display: grid; gap: 6px; padding: 12px; }
.progress .top { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-s); color: var(--muted); }
pre.log { margin: 0; padding: 10px 12px; white-space: pre-wrap; font: var(--fs-s)/1.6 ui-monospace, Menlo, monospace; color: var(--muted); max-height: 320px; overflow: auto; }
details > summary { list-style: none; cursor: pointer; } details > summary::-webkit-details-marker { display: none; }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: 32px; grid-auto-rows: minmax(104px, 1fr); min-height: 100%; }
.cal .dow { height: 32px; padding: 0 10px; display: flex; align-items: center; font-size: var(--fs-s); color: var(--muted); background: var(--tint); border-bottom: 1px solid var(--line-2); }
.cal .day { padding: 6px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day .d { padding: 0 4px; font-size: var(--fs-s); color: var(--muted); }
.cal .day.out { background: var(--tint); } .cal .day.out .d { color: var(--faint); }
.cal .day.today .d { color: var(--on-ink); background: var(--ink); border-radius: 10px; align-self: flex-start; padding: 0 7px; }
.cal .ev { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px; background: var(--card); box-shadow: 0 0 0 1px var(--line); font-size: var(--fs-s); line-height: var(--lh-s); min-width: 0; }
.cal .ev:hover { box-shadow: 0 0 0 1px var(--faint); }

/* ---------- analytics ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.kpi { padding: 14px 16px; border-right: 1px solid var(--line-2); } .kpi:last-child { border-right: 0; }
.kpi .k { font-size: var(--fs-s); color: var(--muted); }
.kpi .v { font-size: 22px; line-height: 30px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: var(--fs-s); color: var(--muted); }
@media (max-width: 899px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi:nth-child(2) { border-right: 0; } .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line-2); } }
.share { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line-2); }
.share span { display: block; height: 100%; }
table.t { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.t th { position: sticky; top: 0; z-index: 2; height: 32px; padding: 0 10px; text-align: right; font-weight: 500; font-size: var(--fs-s); color: var(--muted); background: var(--tint); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.t td { height: var(--row); padding: 0 10px; text-align: right; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.t th:first-child, table.t td:first-child { text-align: left; padding-left: 16px; }
table.t td.l, table.t th.l { text-align: left; }
table.t tr:hover td { background: var(--hover); }
table.t td .muted { font-size: var(--fs-s); }
.tablewrap { overflow-x: auto; }
@media (min-width: 900px) { .tablewrap { overflow: visible; } }
.group.static { position: static; }

/* ---------- dock (phone actions), dialog, toast ---------- */
.dock { display: none; }
@media (max-width: 899px) {
  .dock { display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--sheet); border-top: 1px solid var(--line); }
  .app.has-dock .tabbar { display: none; }
  .btn.sm { height: 32px; padding: 0 12px; } .btn.sm.icon { width: 32px; } .seg button { height: 30px; padding: 0 12px; }
  .scrub { height: 32px; } .scrub .knob { width: 16px; height: 16px; margin-left: -8px; }
  .dock .btn { flex: 1; height: 40px; }
  .hdr .acts .btn.desk-act { display: none; }
}
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .28); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
@media (max-width: 599px) { .scrim { align-items: flex-end; padding-top: 0; } }
.scrim.viewer { align-items: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: rgba(0, 0, 0, .82); cursor: zoom-out; }
.scrim.viewer img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.dialog { width: 100%; max-width: 480px; background: var(--card); border-radius: 10px; box-shadow: 0 16px 48px -12px rgba(0, 0, 0, .35), 0 0 0 1px var(--line); overflow: hidden; }
@media (max-width: 599px) { .dialog { border-radius: 12px 12px 0 0; padding-bottom: env(safe-area-inset-bottom); } }
.dialog .dh { padding: 14px 16px 4px; font-weight: 600; }
.dialog .dp { padding: 0 16px 12px; color: var(--muted); }
.dialog .fields { border-top: 1px solid var(--line-2); }
.dialog .df { display: flex; align-items: flex-start; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.dialog .df > .k { width: 96px; flex: none; color: var(--muted); padding-top: 2px; }
.dialog .df > .v { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.dialog .end { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; background: var(--tint); }
.stepper .num { min-width: 22px; text-align: center; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--on-ink); padding: 8px 12px; border-radius: 6px; font-size: var(--fs-s); opacity: 0; pointer-events: none; transition: opacity 150ms; max-width: calc(100% - 32px); }
@media (max-width: 899px) { #toast { bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); } .app.has-dock ~ #toast, .has-dock #toast { bottom: calc(80px + env(safe-area-inset-bottom)); } }
#toast.show { opacity: 1; }
/* the undo bar: a decision waits 10 seconds before it's sent */
#undo { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 8px); z-index: 55; display: flex; align-items: center; gap: 12px; max-width: calc(100% - 32px);
  padding: 6px 6px 6px 14px; border-radius: 8px; background: var(--ink); color: var(--on-ink); font-size: var(--fs-s); opacity: 0; pointer-events: none; transition: opacity 150ms, transform 150ms; }
#undo.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
#undo .btn { background: color-mix(in srgb, var(--on-ink) 16%, transparent); color: var(--on-ink); }
#undo .btn:hover { background: color-mix(in srgb, var(--on-ink) 26%, transparent); }
body:has(#undo.show) #toast { bottom: 76px; }
@media (max-width: 899px) { #undo { bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); } body:has(.has-dock) #undo { bottom: calc(80px + env(safe-area-inset-bottom)); } }
input[type="time"] { color: var(--ink); background: none; border-radius: 4px; padding: 2px 4px; margin: -2px -4px; } input[type="time"]:hover { background: var(--hover); }

/* ---------- theme switch ---------- */
.side .theme { padding: 4px 8px 8px; }

/* ---------- analytics: filters, stat tiles, charts ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.filters .lab { font-size: var(--fs-s); color: var(--muted); }
@media (max-width: 899px) { .filters { padding: 10px 12px; } .filters .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .filters .seg::-webkit-scrollbar { display: none; } .filters .seg button { flex: none; } }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px; }
.tile { background: var(--card); border-radius: 8px; box-shadow: 0 0 0 1px var(--line); padding: 12px 14px; display: grid; gap: 2px; }
.tile .k { font-size: var(--fs-s); color: var(--muted); }
.tile .v { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tile .d { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-s); color: var(--muted); min-height: 24px; }
.tile .d .up::before { content: "↑ "; } .tile .d .down::before { content: "↓ "; }
@media (max-width: 899px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px; } .tile .v { font-size: 22px; } }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 16px 16px; }
.charts .wide { grid-column: 1 / -1; }
@media (max-width: 899px) { .charts { grid-template-columns: minmax(0, 1fr); padding: 0 12px 12px; } }
.chart { background: var(--card); border-radius: 8px; box-shadow: 0 0 0 1px var(--line); padding: 12px 14px 8px; min-width: 0; }
.chart .ct { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.chart .ct h3 { margin: 0; font: 600 var(--fs)/var(--lh) var(--sans); }
.chart .ct .sub { font-size: var(--fs-s); color: var(--muted); }
.chart .legend2 { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: var(--fs-s); color: var(--muted); }
.chart .legend2 span { display: inline-flex; align-items: center; gap: 6px; }
.chart .legend2 i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.chart .legend2 i.ln { height: 2px; border-radius: 1px; width: 12px; }
.chart .plot { position: relative; margin-top: 8px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis text { font: 11px var(--sans); fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: var(--line-2); }
.chart .base { stroke: var(--line); }
.chart .hair { stroke: var(--faint); stroke-width: 1; }
#tip { position: fixed; z-index: 60; pointer-events: none; background: var(--card); color: var(--ink); border-radius: 6px; box-shadow: 0 0 0 1px var(--line), 0 8px 24px -8px rgba(0, 0, 0, .25);
  padding: 8px 10px; font-size: var(--fs-s); line-height: var(--lh-s); min-width: 140px; max-width: 280px; opacity: 0; transition: opacity 80ms; }
#tip.show { opacity: 1; }
#tip .th { color: var(--muted); margin-bottom: 4px; }
#tip .tr { display: flex; align-items: center; gap: 8px; }
#tip .tr b { font-weight: 600; font-variant-numeric: tabular-nums; }
#tip .tr .k { color: var(--muted); }
#tip .tr i { width: 10px; height: 2px; border-radius: 1px; display: inline-block; flex: none; }
.vlist .item .spark { width: 72px; height: 20px; flex: none; }
.vlist .hdrrow { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 16px; background: var(--tint); border-bottom: 1px solid var(--line-2); font-size: var(--fs-s); color: var(--muted); position: sticky; top: 0; z-index: 2; }
.vlist .hdrrow button { color: var(--muted); font-size: var(--fs-s); font-weight: 500; } .vlist .hdrrow button.on { color: var(--ink); }
.vlist .c-t { flex: 1; min-width: 0; } .vlist .c-n { width: 64px; text-align: right; flex: none; font-variant-numeric: tabular-nums; } .vlist .c-s { width: 72px; flex: none; }
.vlist .item .c-n { font-size: var(--fs); color: var(--ink); }
.vlist .item .c-n.m { color: var(--muted); }
@media (max-width: 899px) { .vlist .c-hide { display: none; } }

/* ---------- thumbnails (Sam, 3 Nov 2026): the film's own frame, 9:16 ---------- */
.thumb { display: block; flex: none; width: 30px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 4px; background: var(--tint); box-shadow: 0 0 0 1px var(--line); }
.thumb.none { background: var(--line-2); box-shadow: none; }
.thumb.sm { width: 22px; border-radius: 3px; } .thumb.xs { width: 14px; border-radius: 2px; } .thumb.lg { width: 100%; border-radius: 6px; }
.card .cmeta { font-size: var(--fs-s); line-height: var(--lh-s); color: var(--faint); }
/* decided, in the 10 s undo window: greyed and not clickable, so it isn't acted on twice */
.pend { opacity: .45; filter: grayscale(1); pointer-events: none; }
/* ---------- calendar: the posting slots in each day; drag a scheduled post to a free one ---------- */
.cal .slot { position: relative; display: flex; align-items: flex-start; gap: 4px; min-height: 28px; border-radius: 6px; min-width: 0; }
.cal .slot .tm { flex: none; width: 36px; padding-left: 4px; font-size: 11px; line-height: 28px; color: var(--faint); }
.cal .slot.booked { padding: 2px 0; }
.cal .slot .ev { flex: 1; align-items: flex-start; gap: 8px; padding: 6px 8px 6px 6px; }
.cal .ev .thumb { width: 30px; border-radius: 3px; }
.cal .ev .m b { font-weight: 600; color: var(--ink); }
.cal .ev .st.green { color: var(--green); } .cal .ev .st.blue { color: var(--blue); } .cal .ev .st.red { color: var(--red); }
.cal .ev .evt { display: grid; gap: 2px; min-width: 0; }
.cal .ev .t { font-weight: 500; line-height: 15px; }
.cal .ev .m { display: flex; align-items: center; gap: 5px; font-size: 11px; line-height: 14px; color: var(--muted); min-width: 0; }
/* posted: done, so it sits back; still to go out: stands forward */
.cal .ev.done { background: var(--tint); box-shadow: 0 0 0 1px var(--line-2); } .cal .ev.done .t, .cal .ev.done .m b { color: var(--muted); }
.cal .ev.todo { background: var(--card); box-shadow: inset 3px 0 0 var(--blue), 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .06); padding-left: 9px; }
.cal .day.past:not(.out) { background: color-mix(in srgb, var(--tint) 55%, transparent); }
.cal .dhd { display: flex; align-items: center; justify-content: space-between; min-height: 22px; }
.cal .add, .cal .rm { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; color: var(--muted); opacity: 0; }
.cal .rm { position: absolute; right: 2px; top: 3px; }
.cal .add:hover, .cal .rm:hover { background: var(--hover); color: var(--ink); }
.cal .day:hover .add, .cal .slot:hover .rm, .cal .add:focus-visible, .cal .rm:focus-visible { opacity: 1; }
@media (hover: none) { .cal .add, .cal .rm { opacity: 1; } }
.cal .ev.drag { cursor: grab; } .cal .ev.drag:active { cursor: grabbing; }
.dragging .cal .slot.free { box-shadow: inset 0 0 0 1px var(--line); }
.cal .slot.over { background: var(--sel); box-shadow: inset 0 0 0 1px var(--faint); }
.cal .slot.booked.over .ev { box-shadow: 0 0 0 2px var(--blue); }   /* dropping here swaps the two */
.item .tm { flex: none; width: 40px; color: var(--muted); font-size: var(--fs-s); }
input[type="date"] { color: var(--ink); background: none; border-radius: 4px; padding: 2px 4px; margin: -2px -4px; } input[type="date"]:hover { background: var(--hover); }
/* ---------- library: every video as its cover ---------- */
.libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 16px 12px; padding: 16px; }
.lib { display: grid; align-content: start; gap: 4px; min-width: 0; }
.lib:hover .thumb { box-shadow: 0 0 0 1px var(--faint); }
.lib .lt { line-height: 18px; margin-top: 2px; }
.lib .lm { font-size: var(--fs-s); line-height: var(--lh-s); color: var(--muted); }
@media (max-width: 599px) { .libgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vlist .tsp { width: 22px; flex: none; }
/* ---------- undo: one line and a bar that runs down (the seconds count wrapped on phones) ---------- */
#undo { overflow: hidden; white-space: nowrap; } #undo .ell { min-width: 0; }
#undo .ubar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
#undo .ubar i { display: block; height: 100%; background: color-mix(in srgb, var(--on-ink) 55%, transparent); transform-origin: left; animation: undo-run linear forwards; }
@keyframes undo-run { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- Grand Total: the receipt (labels and numbers in Space Mono, dashed rules) ---------- */
::selection { background: color-mix(in srgb, var(--marker) 35%, transparent); }
.num, .nav .n, .tabbar a .n, .tile .v, .kpi .v, .vlist .c-n, table.t, .ctl .time, .cal .slot .tm, .item .tm, .line .no, .cal .day .d, .stepper .num, kbd,
  #tip .tr b { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.pring text, .chart .axis text { font-family: var(--mono); }
.tile .v, .kpi .v { font-weight: 700; letter-spacing: -.02em; }
.group, .bcol .ch, .side .label, .pgroup > .lab, .field .lab, .cal .dow, .tile .k, .kpi .k, .vlist .hdrrow, .vlist .hdrrow button, .sec > h2, .dialog .dh, table.t th {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.group, .bcol .ch, .sec > h2, .dialog .dh { font-weight: 700; font-size: 12px; }
.side .label, .pgroup > .lab, .field .lab, .cal .dow, .tile .k, .kpi .k, .vlist .hdrrow, .vlist .hdrrow button, table.t th { font-size: 11px; }
.group .c, .bcol .ch .c, .sec > h2 .aside { font-family: var(--mono); text-transform: none; letter-spacing: 0; font-weight: 400; }
.sec > h2 .aside, .field .lab .n:not(.num) { font-family: var(--sans); text-transform: none; letter-spacing: 0; font-weight: 400; font-size: var(--fs-s); }
.hdr, .group, .vlist .hdrrow { border-bottom-style: dashed; }
.detail > .props { border-left-style: dashed; }
@media (max-width: 899px) {
  .sec > h2 { font-size: 13px; }
  .tabbar a { font: 10px/13px var(--mono); text-transform: uppercase; letter-spacing: .04em; }
  .detail > .props { border-top-style: dashed; }
}

/* The storyboard phone sheet the reviewer passed, beside the cover on a cut (Grand Total) */
.sheet { height: 160px; width: auto; max-width: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); background: var(--tint); cursor: zoom-in; }
