/* Content Ops, by The Content Operators. The site's system, tamed for daily work: its type and its
   palette, without its editorial scale. Ink, paper and grey carry the interface. Marker red is kept for
   annotation (notes on a cut, drawings) and for alerts (overdue, stuck). Categories (formats, pillars)
   take a muted eight-colour set. The one colour a customer brings is their accent: it marks what you
   DO (the primary button, the active place), and nothing else changes per brand. */

@font-face { font-family: 'Inter'; src: url(/fonts/inter.woff2) format('woff2'); font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'Inter Tight'; src: url(/fonts/inter-tight.woff2) format('woff2'); font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url(/fonts/jetbrains-mono.woff2) format('woff2'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url(/fonts/caveat.woff2) format('woff2'); font-weight: 500 600; font-display: swap; }

:root {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --paper-warm: #fafaf8;
  --grey: #6b6b6b;
  --rule: #e4e4e1;
  --marker: #e11313;

  --bg: #f7f7f5;            /* the canvas behind boards */
  --panel: #ffffff;
  --sunken: #f2f2ef;
  --hover: #f0f0ed;
  --border: #e6e6e2;
  --border-strong: #d2d2cd;
  --text: #111110;
  --text-2: #5c5c57;
  --text-3: #8d8d86;
  --accent: #0a0a0a;        /* the customer's colour; ink by default */
  --on-accent: #ffffff;
  --alert: var(--marker);
  --alert-bg: #fdeceb;
  --ok: #2f7350;
  --ok-bg: #e3f0e8;
  --warn: #9a6a1f;
  --warn-bg: #f6eedd;

  --font-ui: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-head: 'Inter Tight', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --radius: 4px;
  --float: 0 10px 28px rgba(10, 10, 10, .12), 0 1px 3px rgba(10, 10, 10, .08);
  --side: 236px;
  --top: 52px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 13.5px/1.45 var(--font-ui); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--ink); color: var(--paper); }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-head); font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: 22px; line-height: 1.2; }
h2 { font-size: 17px; line-height: 1.3; }
h3 { font-size: 14px; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.label { font: 500 10.5px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12px; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.alert-text { color: var(--alert); }
.hand { font: 600 20px/1.1 'Caveat', cursive; color: var(--marker); }

/* ---- icons ---- */
.ico, .logo, .mark { display: inline-flex; flex: none; align-items: center; justify-content: center; line-height: 0; }
.ico svg { width: 16px; height: 16px; }
.logo svg, .mark svg { width: 16px; height: 16px; }
.logo.sm svg, .ico.sm svg, .mark.sm svg { width: 13px; height: 13px; }
.logo.lg svg, .ico.lg svg, .mark.lg svg { width: 20px; height: 20px; }
.logo.xl svg, .mark.xl svg { width: 28px; height: 28px; }

/* ---- buttons and inputs ---- */
button, .btn {
  font: 500 13px/1 var(--font-ui); color: var(--text); background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 7px 11px; min-height: 30px; cursor: pointer; white-space: nowrap; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px; text-decoration: none; transition: background 120ms, border-color 120ms, color 120ms;
}
button:hover, .btn:hover { background: var(--hover); }
button:disabled, .btn.disabled { opacity: .45; cursor: default; pointer-events: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover, .btn.primary:hover { filter: brightness(1.15); }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
button.ghost:hover, .btn.ghost:hover { background: var(--hover); color: var(--text); }
button.danger { color: var(--alert); }
button.danger.solid { background: var(--alert); border-color: var(--alert); color: #fff; }
button.small, .btn.small { padding: 4px 8px; min-height: 24px; font-size: 12px; }
button.icon, .btn.icon { padding: 5px; min-height: 28px; min-width: 28px; }
button.icon.small { padding: 3px; min-height: 22px; min-width: 22px; }
button.on { background: var(--sunken); border-color: var(--border-strong); color: var(--text); }
input, select, textarea {
  font: 13.5px/1.4 var(--font-ui); color: var(--text); background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 7px 10px; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 15px; height: 15px; padding: 0; }
input[type=color] { padding: 2px; width: 36px; height: 30px; }
textarea { resize: vertical; }
input.bare, textarea.bare { border-color: transparent; background: transparent; padding: 4px 6px; }
input.bare:hover, textarea.bare:hover { background: var(--hover); }
label.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.field-row { display: flex; flex-direction: column; gap: 6px; }
.field-row > span { font-size: 12px; color: var(--text-2); font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; color: var(--text-2); min-height: 28px; padding: 5px 10px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--sunken); color: var(--text); }
kbd { font: 500 11px var(--font-mono); padding: 2px 6px; border-radius: 3px; border: 1px solid var(--border-strong); background: var(--panel); color: var(--text-2); }

/* ---- chips, tags, avatars, badges ---- */
.chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; font-size: 12px; line-height: 1; padding: 3px 7px 3px 5px; border-radius: 3px;
  color: var(--chip-fg, var(--text-2)); background: var(--chip-bg, var(--sunken)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .ico svg { width: 13px; height: 13px; }
.chip.plain { padding-left: 7px; }
.chip.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.chip.alert { --chip-fg: var(--alert); --chip-bg: var(--alert-bg); }
.chip.ok { --chip-fg: var(--ok); --chip-bg: var(--ok-bg); }
.chip.warn { --chip-fg: var(--warn); --chip-bg: var(--warn-bg); }
.chip.ink { --chip-fg: #fff; --chip-bg: var(--ink); }
.logos { display: inline-flex; align-items: center; gap: 3px; }
.avatar { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font: 600 9.5px/1 var(--font-ui);
  color: #fff; background: var(--av, #5c5c57); overflow: hidden; letter-spacing: .02em; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 18px; height: 18px; font-size: 8px; }
.avatar.lg { width: 32px; height: 32px; font-size: 12px; }
.avatar.none { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--text-3); }
.count { font: 500 11px/1 var(--font-mono); color: var(--text-3); }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font: 600 10.5px/1 var(--font-ui);
  background: var(--accent); color: var(--on-accent); }
.badge.alert { background: var(--alert); color: #fff; }
.due { font: 500 11.5px/1 var(--font-mono); color: var(--text-2); white-space: nowrap; }
.due.over { color: var(--alert); }
.due.soon { color: var(--warn); }
.stuck { display: inline-flex; align-items: center; gap: 4px; font: 500 11px/1 var(--font-mono); color: var(--alert); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); display: inline-block; flex: none; }
.dot.alert { background: var(--alert); }
.dot.ok { background: var(--ok); }

/* ---- the shell ---- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); height: 100vh; }
.side { background: var(--paper-warm); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.wsbtn { margin: 10px 10px 6px; padding: 7px 8px; display: flex; align-items: center; gap: 9px; border: 1px solid transparent; background: transparent;
  justify-content: flex-start; min-height: 40px; }
.wsbtn:hover { background: var(--hover); }
.wslogo { width: 26px; height: 26px; border-radius: 5px; flex: none; display: grid; place-items: center; background: var(--accent); color: var(--on-accent);
  font: 600 12px/1 var(--font-head); overflow: hidden; }
.wslogo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.wsname { flex: 1; min-width: 0; text-align: left; font: 600 13.5px/1.2 var(--font-head); overflow: hidden; text-overflow: ellipsis; }
.wsplan { display: block; font: 500 10px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.nav { flex: 1; overflow-y: auto; padding: 4px 8px 12px; display: flex; flex-direction: column; gap: 1px; }
.nav a, .nav button.navlink, .sidefoot a, .sidefoot button.navlink { display: flex; align-items: center; gap: 9px; padding: 0 9px; height: 30px; border-radius: var(--radius); color: var(--text-2);
  text-decoration: none; font-weight: 500; border: 0; background: none; justify-content: flex-start; min-height: 30px; width: 100%; }
.nav a:hover, .nav button.navlink:hover, .sidefoot a:hover, .sidefoot button.navlink:hover { background: var(--hover); color: var(--text); }
.sidefoot a.on, .nav a.on { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--border), inset 2px 0 0 var(--accent); }
.nav a .ico, .sidefoot a .ico { color: var(--text-3); }
.nav a.on .ico, .sidefoot a.on .ico { color: var(--text); }
.nav a .badge { margin-left: auto; }
.nav .sub { padding-left: 34px; height: 27px; font-weight: 400; font-size: 13px; }
.navhd { margin: 14px 9px 4px; display: flex; align-items: center; gap: 6px; }
.navhd .label { flex: 1; }
.sidefoot { border-top: 1px solid var(--border); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.powered { padding: 6px 9px 2px; font: 500 9.5px/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { height: var(--top); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--border); background: var(--panel); }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; font-family: var(--font-head); font-size: 15px; }
.crumbs .ico { color: var(--text-3); }
.crumbs a { text-decoration: none; color: var(--text-2); font-weight: 500; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--text-3); font-weight: 400; }
.searchbox { position: relative; width: min(340px, 34vw); }
.searchbox input { width: 100%; padding-left: 30px; background: var(--sunken); border-color: transparent; }
.searchbox .ico { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.view { flex: 1; min-height: 0; overflow: auto; }
.menubtn { display: none; }

/* ---- pages ---- */
.page { max-width: 1180px; margin: 0 auto; padding: 24px 28px 64px; display: flex; flex-direction: column; gap: 18px; }
.page.wide { max-width: none; }
.page.narrow { max-width: 760px; }
.pagehd { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.pagehd .titles { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.pagehd p { color: var(--text-2); max-width: 70ch; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 18px; background: var(--panel); flex: none; overflow-x: auto; }
.tabs a, .tabs button { height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; color: var(--text-2); text-decoration: none; font-weight: 500;
  border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; margin-bottom: -1px; min-height: 0; }
.tabs a:hover, .tabs button:hover { color: var(--text); background: none; }
.tabs a.on, .tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--border); flex: none; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; }
.panel > .hd { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.panel > .bd { padding: 14px; }
.section { display: flex; flex-direction: column; gap: 10px; }
.section > h3 { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.stat { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.stat .v { font: 600 24px/1 var(--font-head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--text-2); }
.empty { padding: 36px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; color: var(--text-2); }
.empty .ico svg { width: 26px; height: 26px; color: var(--text-3); }
.empty h3 { color: var(--text); font-size: 15px; }
.empty p { max-width: 46ch; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius); background: var(--sunken); font-size: 13px; color: var(--text-2); }
.notice.alert { background: var(--alert-bg); color: #7d1212; }
.notice.ok { background: var(--ok-bg); color: #1f4f37; }
.notice .ico { margin-top: 1px; }
table.list { width: 100%; border-collapse: collapse; background: var(--panel); }
table.list th { text-align: left; font: 500 11px/1 var(--font-ui); color: var(--text-3); padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--panel); z-index: 1; }
table.list td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--paper-warm); }
table.list td.title { font-weight: 500; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- rows: My work, Inbox, Numbers ---- */
/* ---- switches (settings, the format registry) ---- */
input.switch { -webkit-appearance: none; appearance: none; flex: none; width: 32px; height: 18px; padding: 0; margin: 0; border: 0; border-radius: 9px;
  background: var(--border-strong); position: relative; cursor: pointer; transition: background 120ms; }
input.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(10, 10, 10, .25); transition: transform 120ms; }
input.switch:checked { background: var(--ink); }
input.switch:checked::after { transform: translateX(14px); }
input.switch:disabled { opacity: .5; cursor: default; }
input.switch:focus { outline: none; }
input.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* ---- the system, on the home screen ---- */
.system .ladder { list-style: none; margin: 0; padding: 12px 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; border-bottom: 1px solid var(--border); }
.system .ladder li { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; color: var(--text-3); }
.system .ladder li .n { font: 500 10.5px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.system .ladder li b { font-size: 13px; font-weight: 600; }
.system .ladder li.past { color: var(--text-2); }
.system .ladder li.on { color: var(--text); border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.system .ladder li .note { font-size: 12px; color: var(--text-2); }
.system .next { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 500; }
.system .next .ico:last-child { margin-left: auto; color: var(--text-3); }
.system .next.go { cursor: pointer; }
.system .next.go:hover { background: var(--hover); }
.system .loop { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 1px; background: var(--border); border-radius: 0 0 4px 4px; overflow: hidden; }
.system .tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; border: 0; border-radius: 0; background: var(--panel); text-align: left; min-height: 0; cursor: pointer; white-space: normal; }
.system .tile:hover { background: var(--hover); }
.system .tile .step { display: flex; align-items: center; gap: 6px; font: 500 10.5px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.system .tile .v { font: 600 22px/1 var(--font-head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.system .tile .l { font-size: 12px; color: var(--text-2); }
.workrow { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--border); cursor: pointer; min-height: 40px; }
.workrow:last-child { border-bottom: 0; }
.workrow:hover { background: var(--paper-warm); }
.workrow .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.workrow .title .muted { font-weight: 400; }
.workrow.unread { background: #fffdf4; }
.workrow.unread .title::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: middle; }

/* ---- boards ---- */
.boardwrap { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.board { flex: 1; min-height: 0; display: flex; gap: 10px; padding: 14px 18px 18px; overflow-x: auto; align-items: flex-start; }
.colm { flex: none; width: 272px; max-height: 100%; display: flex; flex-direction: column; background: var(--sunken); border-radius: 6px; }
.colm.side { width: 220px; background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.colm.gate .colhd .gatemark { display: inline-flex; }
.colhd { padding: 9px 10px 6px; display: flex; align-items: center; gap: 6px; }
.colhd h3 { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.colhd .gatemark { display: none; color: var(--text-3); }
.colnote { padding: 0 10px 8px; font-size: 11.5px; color: var(--text-3); line-height: 1.35; }
.limit { font: 500 10.5px/1 var(--font-mono); color: var(--text-3); padding: 3px 5px; border-radius: 3px; background: var(--panel); }
.colbody { flex: 1; min-height: 40px; overflow-y: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 6px; }
.colbody.over { background: rgba(10, 10, 10, .04); border-radius: 4px; }
.addcard { margin: 0 8px 8px; justify-content: flex-start; color: var(--text-3); border-color: transparent; background: transparent; }
.addcard:hover { color: var(--text); background: var(--hover); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 5px; padding: 9px 10px 8px; display: flex; flex-direction: column; gap: 7px;
  cursor: pointer; position: relative; transition: border-color 120ms, box-shadow 120ms; }
.card:hover { border-color: var(--border-strong); }
.card.dragging { opacity: .4; }
.card.done { opacity: .6; }
.card.sel { box-shadow: 0 0 0 2px var(--accent); }
.card.stuckc { box-shadow: inset 2px 0 0 var(--alert); }
.card .top1 { display: flex; align-items: center; gap: 6px; font: 500 11px/1 var(--font-mono); color: var(--text-3); }
.card .top1 .ico svg { width: 13px; height: 13px; }
.card .ttl { display: flex; align-items: flex-start; gap: 6px; font-weight: 500; font-size: 13.5px; line-height: 1.35; }
.card .ttext { min-width: 0; overflow-wrap: anywhere; }
.card .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 18px; }
.card .meta .spacer { min-width: 4px; }
.card .meta .opennotes { font: 500 11px/1 var(--font-mono); color: var(--marker); white-space: nowrap; }
.card .brandflag { font: 500 10.5px/1 var(--font-mono); color: var(--ok); }
/* The format band, bled to the card's top edge (the margins are the card's padding, the radius its own
   less the border). --band is the format's tag colour, set on the element. The colour is mixed DOWN into
   --panel, never painted, so --text on it stays above 11:1 for all eight tag colours on a light panel and
   on a dark one (tests/boards.test.js recomputes it from this rule). The full colour is only the 3px edge,
   where no text sits; that edge is what a column of cards is scanned by. */
.card .band { margin: -9px -10px 0; padding: 2px 6px 2px 8px; min-height: 26px; border-radius: 4px 4px 0 0; display: flex; align-items: center; gap: 6px; color: var(--text);
  background: linear-gradient(100deg, color-mix(in srgb, var(--band) 30%, var(--panel)) 0%, color-mix(in srgb, var(--band) 8%, var(--panel)) 85%);
  box-shadow: inset 3px 0 0 var(--band); }
.card .band.neutral { --band: var(--text-3); }
.card .band .bbtn { display: inline-flex; align-items: center; justify-content: flex-start; gap: 5px; min-width: 0; min-height: 22px; padding: 2px 5px; margin-left: -3px;
  border: 1px solid transparent; border-radius: 3px; background: none; color: var(--text); font: 600 12px/1.2 var(--font-ui); }
.card .band .bname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .band .stage { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 0; padding: 3px 5px; border: 1px solid transparent; border-radius: 3px;
  background: color-mix(in srgb, var(--panel) 55%, transparent); color: var(--text); font: 500 10px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.card .band .stage .ico svg { width: 12px; height: 12px; }
.card .band button.bbtn:hover, .card .band button.stage:hover { background: color-mix(in srgb, var(--panel) 70%, transparent); border-color: color-mix(in srgb, var(--text) 25%, transparent); }
.card .band .unset { color: var(--text-2); font-weight: 500; }
.card .band .stage.unset { background: none; border-style: dashed; border-color: color-mix(in srgb, var(--text) 25%, transparent); }
/* The fields a card changes in place: the priority leading the title, the platforms, the assignee. Each is
   the value at rest and grows an edge on hover; unset is dashed, the same language as an empty avatar. */
.card .pri { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; min-height: 0; padding: 0; border: 1px solid transparent; border-radius: 3px; background: none; }
.card button.pri:hover { background: none; border-color: var(--border-strong); }
.card .pri0 { width: 11px; height: 11px; border-radius: 50%; border: 1.5px dashed var(--border-strong); }
.card button.pri:hover .pri0 { border-color: var(--text-3); }
.card .plats { display: inline-flex; align-items: center; gap: 3px; min-height: 22px; padding: 2px 4px; margin-left: -5px; border: 1px solid transparent; border-radius: 3px; background: none;
  font: 500 11.5px/1 var(--font-ui); color: var(--text-3); }
.card .plats.unset { margin-left: 0; border-style: dashed; border-color: var(--border-strong); }
.card button.plats:hover { background: none; border-color: var(--border-strong); color: var(--text-2); }
.card .assign { min-height: 0; min-width: 0; padding: 1px; border: 0; border-radius: 50%; background: none; }
.card .assign:hover { background: none; box-shadow: 0 0 0 2px var(--border-strong); }
/* The cut as a square on the card's left, playing muted while the pointer is on the card. The video is out
   of flow, so the file's own size never reaches the layout. */
.card .crow { display: flex; align-items: flex-start; gap: 10px; }
.card .cbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.vtile { position: relative; flex: none; width: 76px; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: #111; }
.vtile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.vtile .vplay { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .92); filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .7)); pointer-events: none; transition: opacity 120ms; }
.card:hover .vtile:not(.ph) .vplay { opacity: 0; }
.vtile .vver { position: absolute; left: 4px; bottom: 4px; font: 500 9.5px/1 var(--font-mono); padding: 2px 4px; border-radius: 3px; background: rgba(10, 10, 10, .75); color: #fff; }
.vtile.ph { background: var(--sunken); box-shadow: inset 0 0 0 1px var(--border); }
.vtile.ph .vplay { color: var(--text-3); filter: none; }
/* Group by person: a heading per person inside each column */
.colbody .grouphd { display: flex; align-items: center; gap: 6px; padding: 8px 2px 2px; font-size: 12px; color: var(--text-2); }
.colbody .grouphd:first-child { padding-top: 0; }
.colbody .grouphd b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text); }
.colbody .grouphd .you { font: 500 9.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; padding: 2px 4px; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--border-strong); }
.colbody .grouphd .count { margin-left: auto; }
.harvested { font: 500 11px/1 var(--font-mono); color: var(--ok); display: inline-flex; gap: 4px; align-items: center; }

/* ---- drawer: a piece ---- */
.drawer-back { position: fixed; inset: 0; background: rgba(10, 10, 10, .18); z-index: 60; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--panel); z-index: 61; display: flex; flex-direction: column;
  box-shadow: -12px 0 40px rgba(10,10,10,.12); border-left: 1px solid var(--border); animation: slidein 160ms ease-out; }
@keyframes slidein { from { transform: translateX(24px); opacity: .6; } }
.drawer .dhd { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex: none; }
.drawer .dbody { flex: 1; overflow-y: auto; padding: 16px 20px 28px; display: flex; flex-direction: column; gap: 16px; }
.drawer .dbody > *, .col > *, .page > * { flex-shrink: 0; }
.drawer .dtitle { font: 600 20px/1.25 var(--font-head); letter-spacing: -.015em; width: 100%; border: 1px solid transparent; padding: 4px 6px; margin: -4px -6px; resize: none; overflow: hidden; background: none; }
.drawer .dtitle:hover { background: var(--hover); }
.drawer:focus { outline: none; }
/* A piece with a cut: the cut in the dark (versions, player, the gate's verdicts), the notes on paper beside
   it, the ticket on the right. Each column scrolls on its own; the player never moves. */
.drawer.rich { width: min(1280px, calc(100vw - 40px)); }
.drawer .drich { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(280px, 1fr) minmax(260px, 330px) minmax(300px, 350px); grid-template-rows: minmax(0, 1fr); }
.drawer .dstage { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; padding: 12px; background: #0b0b0b; }
.drawer .dstagebar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.drawer .dstagebar .count { color: inherit; opacity: .75; }
.drawer .dstage .rvplayer { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.drawer .dstagefoot { display: flex; flex-direction: column; gap: 6px; }
.drawer .dstagefoot:empty { display: none; }
.drawer .dnotes { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--paper); border-right: 1px solid var(--border); }
/* the note box's controls wrap in the narrower column rather than squeezing the visibility choice */
.drawer .dnotes .cmcrow { flex-wrap: wrap; }
.drawer .dnotes .cmvis { flex: none; }
.drawer .dnotes .cmsend { margin-left: auto; }
.drawer.rich .dbody { min-width: 0; min-height: 0; }
.places { display: flex; flex-wrap: wrap; gap: 6px; }
.place { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: var(--radius); background: var(--sunken); font-size: 12.5px; }
.place b { font-weight: 600; white-space: nowrap; }
.place select { border: 0; background: transparent; padding: 0 2px; font-weight: 500; font-size: 12.5px; }
.fields { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 2px 10px; align-items: center; }
.fields > .fk { font-size: 12.5px; color: var(--text-2); padding: 6px 0; display: flex; align-items: center; gap: 6px; }
.fields > .fv { min-height: 32px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 2px 0; }
.fv .val { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: var(--radius); cursor: pointer; min-height: 28px; max-width: 100%; }
.fv .val:hover { background: var(--hover); }
.fv .val.empty { color: var(--text-3); }
.fv input.bare { width: 100%; }
.gatebar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 6px; background: var(--sunken); }
.gatebar .label { margin-right: auto; }
.dtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.dtabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--text-2); padding: 8px 10px; min-height: 0; margin-bottom: -1px; }
.dtabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.desc { min-height: 70px; width: 100%; font: 13.5px/1.55 var(--font-ui); }
.check-list { display: flex; flex-direction: column; gap: 2px; }
.check-item { display: flex; align-items: center; gap: 8px; padding: 3px 4px; border-radius: 3px; }
.check-item:hover { background: var(--hover); }
.check-item.done span { color: var(--text-3); text-decoration: line-through; }
.thread { display: flex; flex-direction: column; gap: 12px; }
.cmt { display: flex; gap: 10px; }
.cmt .cb { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cmt .ch { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.cmt .ch b { font-weight: 600; }
.cmt .ct { white-space: pre-wrap; overflow-wrap: anywhere; }
.act { display: flex; gap: 8px; font-size: 12.5px; color: var(--text-2); align-items: baseline; }
.act time { color: var(--text-3); font: 11px var(--font-mono); white-space: nowrap; margin-left: auto; }
.composer { display: flex; gap: 8px; align-items: flex-start; }
.composer textarea { flex: 1; min-height: 38px; }
.cuts { display: flex; flex-direction: column; gap: 8px; }
.cutrow { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.cutrow:hover { border-color: var(--border-strong); }
.cutrow .cthumb { width: 96px; aspect-ratio: 16/9; border-radius: 3px; background: #111 center / cover no-repeat; flex: none; }
.selects { width: 100%; border-collapse: collapse; }
.selects td, .selects th { padding: 4px 4px; border-bottom: 1px solid var(--border); text-align: left; font-size: 12.5px; }
.selects th { color: var(--text-3); font-weight: 500; }
.selects input, .selects select { width: 100%; padding: 4px 6px; font-size: 12.5px; }
.selects input.tc { width: 72px; font-family: var(--font-mono); }

/* ---- floating: menus, pickers, modals, toasts ---- */
.pop { position: fixed; z-index: 90; min-width: 200px; max-width: 320px; max-height: 60vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--border);
  border-radius: 6px; box-shadow: var(--float); padding: 5px; display: flex; flex-direction: column; gap: 1px; }
.pop .pophd { padding: 4px 4px 6px; }
.pop .pophd input { width: 100%; }
.pop .item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 3px; cursor: pointer; border: 0; background: none; justify-content: flex-start;
  width: 100%; min-height: 30px; font-weight: 400; text-align: left; }
.pop .item:hover, .pop .item.hl { background: var(--hover); }
.pop .item .tick { margin-left: auto; color: var(--text); }
.pop .item.danger { color: var(--alert); }
.pop .item .sub { margin-left: auto; color: var(--text-3); font-size: 12px; }
.pop .sep { height: 1px; background: var(--border); margin: 4px 2px; }
.pop .grouphd { padding: 6px 8px 2px; }
.modal-back { position: fixed; inset: 0; background: rgba(10, 10, 10, .36); z-index: 80; display: grid; place-items: center; padding: 20px; animation: fade 120ms; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--panel); border-radius: 8px; box-shadow: var(--float); }
.modal.wide { width: min(820px, 100%); }
.modal .mhd { display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; }
.modal .mhd h2 { flex: 1; }
.modal .mbd { padding: 4px 18px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal .mft { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
#toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; border-radius: 6px; padding: 9px 14px; font-size: 13px; box-shadow: var(--float); pointer-events: auto; display: flex; gap: 10px; align-items: center; max-width: min(560px, calc(100vw - 32px)); }
.toast.bad { background: var(--panel); color: var(--alert); box-shadow: var(--float), inset 0 0 0 1px var(--alert); }
.toast button { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; min-height: 24px; padding: 3px 8px; }

/* ---- auth and onboarding ---- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--panel); }
.auth .pitch { background: var(--ink); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.auth .pitch h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.05; letter-spacing: -.03em; font-weight: 500; max-width: 15ch; }
.auth .pitch p { color: #a9a9a3; font-size: 15px; max-width: 46ch; }
.auth .pitch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.auth .pitch li { display: flex; gap: 10px; align-items: center; color: #d8d8d3; font-size: 14px; }
.auth .pitch li .ico { color: #fff; }
.auth .formside { display: grid; place-items: center; padding: 40px 24px; }
.authcard { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.authcard h2 { font-size: 22px; }
.authcard input { width: 100%; padding: 9px 11px; }
.authcard button.primary { width: 100%; min-height: 38px; }
.authcard .or { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; }
.authcard .or::before, .authcard .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.brandline { display: flex; align-items: baseline; gap: 10px; }
.brandline .wm { font: 600 18px/1 var(--font-head); letter-spacing: -.01em; }
.brandline .by { font: 500 9.5px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.auth .pitch .brandline .by { color: #8d8d86; }
.marked { position: relative; white-space: nowrap; }
.marked svg { position: absolute; left: -2%; bottom: -.14em; width: 104%; height: .3em; overflow: visible; pointer-events: none; }
.marked path { fill: none; stroke: var(--marker); stroke-linecap: round; stroke-width: 6; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 520ms cubic-bezier(.22, 1, .36, 1) 400ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .marked path { animation: none; stroke-dashoffset: 0; } }
.onboard { max-width: 920px; margin: 0 auto; padding: 48px 24px 80px; display: flex; flex-direction: column; gap: 24px; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.pickcard { text-align: left; white-space: normal; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px; min-height: 0; border-radius: 8px; background: var(--panel); }
.pickcard b { font: 600 15px/1.2 var(--font-head); }
.pickcard span { color: var(--text-2); font-weight: 400; font-size: 13px; line-height: 1.45; }
button.pickcard.on { background: var(--panel); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
button.pickcard:not(.on) { color: var(--text-2); }
.pickcard > .row { width: 100%; }
.pickcard .ico svg { width: 20px; height: 20px; }

/* ---- review room: the cut in a dark panel, notes on paper (Signoff's, retuned) ---- */
.review { position: fixed; inset: 0; z-index: 70; display: grid; grid-template-columns: minmax(0, 1fr) 400px; background: #0b0b0b; }
.review .rvmain { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; padding: 12px 18px 14px; }
/* the dark panel a cut plays in: the review room, and the stage of a piece drawer */
.review .rvmain, .drawer .dstage { color: #f2f2f0;
  --text: #f2f2f0; --text-2: #b4b4ae; --text-3: #8a8a84; --border: #262626; --border-strong: #3a3a3a; --panel: #141414; --hover: #1d1d1d; --sunken: #1a1a1a; --accent-r: #fff; }
.review .rvmain button, .drawer .dstage button, .drawer .dstage .btn { background: #141414; color: #f2f2f0; border-color: #333; }
.review .rvmain button:hover, .drawer .dstage button:hover, .drawer .dstage .btn:hover { background: #222; }
.review .rvmain select { background: #141414; color: #f2f2f0; border-color: #333; }
.drawer .dstage button.on, .drawer .dstage button.primary { background: #fff; color: #0a0a0a; border-color: #fff; }
.drawer .dstage button.danger { color: #ff6b6b; }
.review .rvtop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review .rvtitle { display: flex; flex-direction: column; gap: 3px; min-width: 0; margin-right: auto; }
.review .rvtitle h1 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.review .rvtitle .label { color: #8a8a84; }
.review .rvplayer { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.review .rvfoot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: #8a8a84; }
.review .rvfoot .mark svg { width: 14px; height: 13px; }
.review .rvside { background: var(--paper); display: flex; flex-direction: column; min-height: 0; color: var(--text); }
.pl { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.plstage { position: relative; flex: 1; min-height: 220px; background: #000; overflow: hidden; cursor: pointer; border-radius: 4px; }
.plstage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.placv { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.placv.drawing { pointer-events: auto; cursor: crosshair; }
.plwait { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 2px solid #262626; border-top-color: #fff; animation: spin .8s linear infinite; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.plerr { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; padding: 32px; color: #b4b4ae; background: #141414; cursor: default; }
.plerr a { color: #fff; }
.rvplayer > .plerr { position: static; flex: 1; border-radius: 4px; }
.pltrack { position: relative; height: 30px; flex: none; cursor: pointer; touch-action: none; }
.pltrack::before { content: ''; position: absolute; left: 0; right: 0; top: 14px; height: 2px; background: #2a2a2a; border-radius: 1px; }
.plbuf { position: absolute; left: 0; top: 14px; height: 2px; width: 0; background: #4a4a4a; }
.plfill { position: absolute; left: 0; top: 14px; height: 2px; width: 0; background: #fff; }
.plsel { position: absolute; top: 9px; height: 12px; border: 1px solid #fff; pointer-events: none; }
.plhead { position: absolute; top: 8px; width: 13px; height: 13px; margin-left: -6.5px; border-radius: 3px; background: #fff; pointer-events: none; }
.plranges { position: absolute; left: 0; right: 0; top: 23px; height: 2px; pointer-events: none; }
.plrange { position: absolute; height: 2px; background: var(--marker); }
.plrange.done { background: #4a4a4a; }
.plpins { position: absolute; inset: 0; pointer-events: none; }
.plpin { position: absolute; top: -10px; margin-left: -9px; width: 18px; height: 18px; min-height: 0; min-width: 0; padding: 0; border-radius: 50%; background: var(--marker) !important;
  color: #fff !important; border: 0 !important; font: 600 8px/1 var(--font-mono); pointer-events: auto; }
.plpin.internal { background: #fff !important; color: #0a0a0a !important; }
.plpin.done { background: #2a2a2a !important; color: #8a8a84 !important; }
.plpin:hover { outline: 2px solid #fff; outline-offset: 1px; }
.pltip { position: absolute; bottom: 30px; transform: translateX(-50%); font: 500 11px var(--font-mono); padding: 3px 7px; border-radius: 3px; background: #fff; color: #0a0a0a; pointer-events: none; white-space: nowrap; }
.plctl { display: flex; align-items: center; gap: 6px; flex: none; flex-wrap: wrap; }
.plbtn { padding: 5px 8px; line-height: 1; }
.plplay { width: 38px; background: #fff !important; color: #0a0a0a !important; border-color: #fff !important; }
.plbtn.on { background: #fff !important; color: #0a0a0a !important; }
.pltime { font: 500 12.5px var(--font-mono); font-variant-numeric: tabular-nums; border-color: transparent !important; background: transparent !important; padding: 5px 6px; }
.plinout { font: 500 11px var(--font-mono); padding: 4px 8px; background: #fff !important; color: #0a0a0a !important; }
.plspacer { flex: 1; }
.plspeed { font: 500 12px var(--font-mono); padding: 4px 6px; }
.plvolpop { position: fixed; z-index: 95; padding: 10px 12px; border-radius: 6px; background: var(--paper); box-shadow: var(--float); }
.plvolpop input { width: 110px; padding: 0; border: none; background: none; }
.cmprow { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cmpcell { position: relative; background: #000; overflow: hidden; min-height: 200px; border-radius: 4px; }
.cmpcell video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cmplabel { position: absolute; top: 8px; left: 8px; font: 500 10.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; padding: 5px 7px; border-radius: 3px; background: #fff; color: #0a0a0a; }
.cm { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.cmhead { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; }
.cmseg { margin-left: auto; display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.cmseg button { border: 0; border-radius: 0; color: var(--text-2); font-size: 11.5px; padding: 4px 8px; min-height: 24px; background: transparent; }
.cmseg button + button { border-left: 1px solid var(--border); }
.cmseg button.on { background: var(--sunken); color: var(--text); }
.cmbar { display: flex; gap: 6px; padding: 2px 16px 12px; border-bottom: 1px solid var(--border); }
.cmsearch { flex: 1; min-width: 0; font-size: 12.5px; }
.cmsort { font-size: 12px; }
.cmlist { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px; display: flex; flex-direction: column; }
.cmempty { color: var(--text-2); font-size: 13px; padding: 26px 0; }
.cmc { padding: 12px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; cursor: pointer; flex: none; }
.cmc:hover { background: var(--paper-warm); }
.cmc.internal { border-left: 2px solid var(--border-strong); padding-left: 10px; }
.cmc.reply { margin-left: 30px; padding: 8px 0 0; border-bottom: 0; cursor: default; }
.cmc.reply:hover { background: none; }
.cmc.resolved, .cmc.pending { opacity: .5; }
.cmc.focus { background: var(--paper-warm); box-shadow: inset 2px 0 0 var(--marker); padding-left: 10px; }
.cmhd { display: flex; align-items: center; gap: 8px; font-size: 12px; min-width: 0; }
.cmhd .avatar { background: var(--ink); }
.cmhd .avatar.client { background: var(--marker); }
.cmname { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmkind { font: 500 10px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.cmwhen { color: var(--text-3); font: 11px var(--font-mono); white-space: nowrap; }
.cmts { font: 500 11px/1 var(--font-mono); font-variant-numeric: tabular-nums; padding: 4px 6px; min-height: 0; color: var(--marker); background: transparent; border-color: var(--marker); }
.cmts:hover { color: #fff; background: var(--marker); }
.cmmark { font-size: 11px; padding: 3px 6px; min-height: 0; color: var(--text-3); }
.cmmark.on { color: #fff; background: var(--marker); border-color: var(--marker); }
.cmflag { font: 500 10px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.cmbody { font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmacts { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; margin-left: -6px; }
.cmacts:empty { display: none; }
.cmlink { border-color: transparent; background: transparent; color: var(--text-2); font-size: 12px; padding: 3px 7px; min-height: 0; }
.cmlink:hover { color: var(--text); background: var(--hover); }
.cmlink.ok { color: var(--text); }
.cmlink.bad { color: var(--alert); }
.cmconfirm { font-size: 12px; color: var(--text-2); padding: 0 6px; }
.cmres { font: 500 10px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-left: auto; }
.cmreply { display: flex; flex-direction: column; gap: 6px; margin-left: 30px; }
.cmcomp { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--border); }
.cmaddname { justify-content: center; padding: 12px; }
.cmtext { font-size: 13.5px; resize: none; line-height: 1.45; width: 100%; }
.cmcrow { display: flex; align-items: center; gap: 6px; }
.cmclock { font: 500 11.5px var(--font-mono); padding: 6px 8px; font-variant-numeric: tabular-nums; }
.cmclock.on { color: var(--marker); border-color: var(--marker); }
.cmicon { padding: 5px 10px; }
.cmicon.on { color: #fff; background: var(--marker); border-color: var(--marker); }
.cmvis { font-size: 12px; padding: 5px 7px; }
.cmsend { background: var(--ink); border-color: var(--ink); color: #fff; padding: 7px 16px; }
.cmsend:hover { background: #262626 !important; }
.cmdraw { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); }
.cmtool { padding: 4px 9px; }
.cmtool.on { color: #fff; background: var(--marker); border-color: var(--marker); }
.cmdrawsep { width: 1px; height: 18px; background: var(--border); }
.cmswatch { width: 18px; height: 18px; min-height: 0; padding: 0; border-radius: 50%; border: 1px solid var(--border-strong); }
.cmswatch.on { outline: 2px solid var(--text); outline-offset: 2px; }
.cmsize { font-size: 12px; padding: 4px 6px; }

/* the 9:16 safe zones over a vertical cut */
.safezones { position: absolute; pointer-events: none; }
.safezones .sz { position: absolute; left: 0; right: 0; background: rgba(225, 19, 19, .18); outline: 1px dashed rgba(255, 255, 255, .6); outline-offset: -1px;
  display: flex; align-items: center; justify-content: center; }
.safezones .sz.top { top: 0; }
.safezones .sz.bottom { bottom: 0; }
.safezones .sz.right { left: auto; right: 0; }
.safezones .sz span { font: 500 10px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }

/* voice notes: the mic in the note box's corner (.cmicon.on while it records), the strip under the box, a small player on the note */
.cmnote { position: relative; }
.cmnote > .cmtext { display: block; }
.cmnote.voice > .cmtext { padding-right: 44px; }
.cmnote .cmmic { position: absolute; right: 6px; bottom: 7px; padding: 5px; min-width: 30px; min-height: 30px; }
.cmvbar { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 12px; color: var(--text-2); }
.cmrecdot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--marker); animation: cmrec 1s ease-in-out infinite alternate; }
@keyframes cmrec { to { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .cmrecdot { animation: none; } }
.cmvoice { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.cmaudio { flex: 1; min-width: 0; height: 32px; }
.cmvlen { font: 500 11.5px var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.cmtext[readonly] { background: var(--paper-warm); }
.cmsr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- printing (call sheets) ---- */
@media print {
  .side, .top, .tabs, .toolbar, .noprint, #toasts { display: none !important; }
  .app { display: block; height: auto; }
  .view { overflow: visible; }
  body { background: #fff; }
}

/* ---- narrow ---- */
@media (max-width: 1000px) {
  .review { grid-template-columns: 1fr; overflow-y: auto; }
  .review .rvmain { min-height: 70vh; }
  .review .rvside { min-height: 70vh; }
  .auth { grid-template-columns: 1fr; }
  .auth .pitch { padding: 32px 24px; }
  .grid.three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(280px, 86vw); z-index: 75; transform: translateX(-100%); transition: transform 160ms; box-shadow: var(--float); }
  .app.navopen .side { transform: none; }
  .menubtn { display: inline-flex; }
  .searchbox { width: 40vw; }
  .page { padding: 18px 16px 48px; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .system .ladder { grid-template-columns: 1fr 1fr; }
  .system .loop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields { grid-template-columns: 1fr; }
  .fields > .fk { padding-bottom: 0; }
  .board { padding: 12px; }
  .colm { width: 82vw; }
  .crumbs { white-space: nowrap; overflow: hidden; font-size: 14px; }
  .top { gap: 8px; padding: 0 10px; }
  .top > button.primary { padding: 7px; }
  .top > button.primary .createlabel { display: none; }
  .workrow { flex-wrap: wrap; row-gap: 6px; }
  .workrow .title { flex: 1 1 calc(100% - 70px); white-space: normal; }
  .grid.three.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat .v { font-size: 20px; }
}

/* ---- narrow: the rich drawer stacks (the cut, then its notes, then the ticket) and fills the screen ---- */
@media (max-width: 1000px) {
  .drawer.rich { width: 100vw; }
  .drawer.rich .drich { display: flex; flex-direction: column; overflow-y: auto; }
  .drawer.rich .dstage { flex: none; height: min(78vh, 680px); }
  .drawer.rich .dnotes { flex: none; height: 70vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .drawer.rich .dbody { flex: none; overflow: visible; }
}
