/*
 * Podman's new design (M5). Ported from the approved mockups
 * (docs/design/mockups/podman.css); keep the two in step when the
 * language changes. Plain CSS, no build step: edit this file and commit it.
 * Served by Design::asset(), which versions it by content hash.
 *
 * Fonts are self-hosted (public/fonts/design, SIL OFL, licences beside them).
 */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 600; font-display: swap; src: url("/fonts/design/bricolage-grotesque-600.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-display: swap; src: url("/fonts/design/bricolage-grotesque-700.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-display: swap; src: url("/fonts/design/instrument-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 500; font-display: swap; src: url("/fonts/design/instrument-sans-500.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-display: swap; src: url("/fonts/design/instrument-sans-600.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 700; font-display: swap; src: url("/fonts/design/instrument-sans-700.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("/fonts/design/jetbrains-mono-500.woff2") format("woff2"); }

:root {
  /* colour: neutrals tinted slightly cool; red is identity, not action */
  --paper: #e7e9ed;
  --surface: #ffffff;
  --sunken: #eef0f3;
  --ink: #15171c;
  --ink-2: #454b57;
  --ink-3: #5c6472;
  --line: #e1e4ea;
  --line-strong: #c4c9d2;
  --brand: #c8102e;          /* BackBeat on-air red: logo, current nav, nothing else */
  --brand-solid: #c8102e;    /* the same red in both themes, for solid fills under white text (#248) */
  --action: #15171c;         /* primary buttons are ink */
  --action-fg: #ffffff;
  --link: #0a5fc2;
  --focus: #2f6fe4;
  --ok: #12703b;   --ok-bg: #e4f4ea;
  --warn: #8a5300; --warn-bg: #fdf1dc;
  --crit: #b3261e; --crit-bg: #fde8e6;
  --info: #1a56b8; --info-bg: #e5eefc;
  --mute-bg: #eceef2;
  --hl: #fff3a8;            /* sponsor highlight colour in briefs */
  --icon-filter: none;      /* black-drawn icons we don't own (Trix's toolbar), turned white in dark */

  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-ui: "Instrument Sans", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --card-k: 7.5rem; /* the label column of a stacked .t.cards row (#297) */
  --t-xs: 0.75rem; --t-sm: 0.8125rem; --t-md: 0.875rem; --t-lg: 1rem; --t-xl: 1.25rem; --t-2xl: 1.5rem; --t-3xl: 2rem;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r1: 4px; --r2: 6px; --r3: 10px;
  --e1: 0 1px 0 rgba(20,24,32,.04), 0 0 0 1px var(--line);
  --e2: 0 8px 28px rgba(20,24,32,.14), 0 0 0 1px var(--line);
  --sidebar: 232px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #121419; --surface: #1a1d23; --sunken: #0d0f13; --ink: #eceef2; --ink-2: #b9bfca; --ink-3: #9198a5;
  --line: #2a2f38; --line-strong: #3a404b; --brand: #ff4d5e; --action: #eceef2; --action-fg: #111318; --link: #7fb2ff; --focus: #7fb2ff;
  --ok: #6fd69b; --ok-bg: #12301f; --warn: #f2bd62; --warn-bg: #33260c; --crit: #ff8a80; --crit-bg: #3a1614; --info: #8db8ff; --info-bg: #142640; --mute-bg: #23272f; --hl: #5b5114;
  --icon-filter: invert(1); color-scheme: dark; } }
:root[data-theme="dark"] {
  --paper: #121419; --surface: #1a1d23; --sunken: #0d0f13; --ink: #eceef2; --ink-2: #b9bfca; --ink-3: #9198a5;
  --line: #2a2f38; --line-strong: #3a404b; --brand: #ff4d5e; --action: #eceef2; --action-fg: #111318; --link: #7fb2ff; --focus: #7fb2ff;
  --ok: #6fd69b; --ok-bg: #12301f; --warn: #f2bd62; --warn-bg: #33260c; --crit: #ff8a80; --crit-bg: #3a1614; --info: #8db8ff; --info-bg: #142640; --mute-bg: #23272f; --hl: #5b5114;
  --icon-filter: invert(1); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 400 var(--t-md)/1.5 var(--f-ui); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r1); }
.mono, code { font-family: var(--f-mono); font-size: .92em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font: 600 var(--t-2xl)/1.2 var(--f-display); letter-spacing: -.01em; }
h2 { font: 600 var(--t-lg)/1.3 var(--f-ui); }
h3 { font: 600 var(--t-md)/1.3 var(--f-ui); }
.eyebrow { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: var(--s4) var(--s3); display: flex; flex-direction: column; gap: var(--s4); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: var(--s2); font: 700 var(--t-lg)/1 var(--f-display); padding: var(--s1) var(--s2); color: var(--ink); }
.logo .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.logo small { font: 500 var(--t-xs)/1 var(--f-ui); color: var(--ink-3); margin-left: auto; }
.logo .mark { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.logo .co { white-space: nowrap; }
.logo .tool { font: 500 var(--t-xs)/1 var(--f-ui); color: var(--ink-3); letter-spacing: .02em; }
/* Off production (#248): the wordmark, and the phone topbar around it, are solid brand red with white
   text, and the environment's name sits on its own line under "Podman". --brand-solid is the light
   theme's brand red in both themes: dark's lighter --brand is too pale under white text. */
.logo.env { background: var(--brand-solid); color: #fff; padding: var(--s3); border-radius: var(--r2); }
.logo.env:hover { text-decoration: none; }
.logo.env .dot { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.logo.env .tool { color: #fff; }
.logo.env .env-name { font: 700 var(--t-sm)/1 var(--f-ui); letter-spacing: .08em; margin-top: 2px; }
/* Graphite sidebar and phone top bar, both themes (Round 4, #282). Colours only: the design's own
   tokens are re-pointed inside .side and .topbar, so the existing rules (nav, jump box and its list,
   account menu, avatar) follow. --paper is the hover, --sunken the current page. --line-strong and
   --info-bg are re-pointed too, so the jump box's border and its highlighted result stay legible. */
.side, .topbar {
  --surface: #1e2025; --paper: #2a2d33; --sunken: #33363d; --line: #2f3239; --line-strong: #3a404b;
  --ink: #ffffff; --ink-2: #d3d6dc; --ink-3: #8d939e; --brand: #ff4d5e; --mute-bg: #33363d; --info-bg: #142640;
  color: var(--ink); color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.side, .topbar) {
  --surface: #0b0c0f; --paper: #17191e; --sunken: #1f2228; --line: #1c1f24; --ink-3: #858b96; --mute-bg: #1f2228; } }
:root[data-theme="dark"] :is(.side, .topbar) {
  --surface: #0b0c0f; --paper: #17191e; --sunken: #1f2228; --line: #1c1f24; --ink-3: #858b96; --mute-bg: #1f2228; }
.topbar.env { background: var(--brand-solid); border-bottom-color: transparent; }
.topbar.env .logo.env { padding: 0; border-radius: 0; }
.topbar.env .iconbtn { color: #fff; }
.topbar.env .iconbtn:hover { background: rgba(255,255,255,.18); color: #fff; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav .label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; padding: var(--s3) var(--s2) var(--s1); }
.nav a { display: flex; align-items: center; gap: var(--s2); padding: 6px var(--s2); border-radius: var(--r2); color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--sunken); text-decoration: none; }
.side .nav a:not([aria-current="page"]):hover { background: var(--paper); }
.nav a[aria-current="page"] { background: var(--sunken); color: var(--ink); box-shadow: inset 2px 0 0 var(--brand); }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--brand-solid); color: #fff; border-radius: 999px; padding: 0 7px; }
.nav .count.n { background: var(--mute-bg); color: var(--ink-2); }
.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.me { font: inherit; color: inherit; background: transparent; border: 0; border-top: 1px solid var(--line); width: 100%; cursor: pointer; text-align: left; }
.me:hover { background: var(--paper); }
.usermenu { margin-top: auto; display: flex; flex-direction: column; padding: var(--s1, 4px) 0; border-top: 1px solid var(--line); font-size: var(--t-sm); }
.usermenu a { padding: 6px var(--s2); color: var(--ink); border-radius: var(--r1); }
.usermenu a:hover { background: var(--paper); text-decoration: none; }
.usermenu:not([hidden]) + .me { margin-top: 0; }
.tip { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r2); border: 1px dashed var(--line-strong); font-size: var(--t-sm); color: var(--ink-2); }
.tip .x { margin-left: auto; background: transparent; border: 0; color: var(--ink-3); font: inherit; cursor: pointer; padding: 0 4px; white-space: nowrap; }
.tip .x:hover { color: var(--ink); }
.me { margin-top: auto; display: flex; align-items: center; gap: var(--s2); padding: var(--s2); border-top: 1px solid var(--line); font-size: var(--t-sm); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--sunken); display: grid; place-items: center; font-weight: 700; font-size: 11px; color: var(--ink-2); border: 1px solid var(--line); }
/* Width (Round 4, #232): forms and reading text stop at about 1,100px; the schedule grid and wide
   tables use the full width. Every block in .main is capped unless it carries .wide. A .stack.wide
   wrapper only passes the choice down: its own children are capped unless they are .wide too.
   :where() keeps this at zero specificity, so a narrower rule (.prose) still wins, and overlays
   (.scrim, .drawer, the view-as banner) are fixed to the viewport and left alone. */
.main { --cap: 1100px; min-width: 0; width: 100%; padding: var(--s5) var(--s6) var(--s7); display: flex; flex-direction: column; gap: var(--s5); }
:where(.main > :not(.wide, .scrim, .drawer, #bbm-view-as)),
:where(.main > .stack.wide > :not(.wide, .scrim, .drawer)) { max-width: var(--cap); }
.topbar { display: none; }

/* ---------- page header ---------- */
.crumbs { font-size: var(--t-sm); color: var(--ink-3); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-3); }
.pagehead { display: flex; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; }
.pagehead .titles { display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.pagehead .actions { margin-left: auto; display: flex; gap: var(--s2); flex-wrap: wrap; }
.meta { display: flex; gap: var(--s4); flex-wrap: wrap; color: var(--ink-2); font-size: var(--t-sm); }
.meta b { color: var(--ink); font-weight: 600; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; font: 600 var(--t-sm)/1 var(--f-ui); padding: 8px 12px; border-radius: var(--r2); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--sunken); text-decoration: none; }
.btn.primary { background: var(--action); color: var(--action-fg); border-color: var(--action); }
.btn.primary:hover { opacity: .9; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.danger { color: var(--crit); }
.btn.sm { padding: 5px 8px; font-size: var(--t-xs); }
.iconbtn { border: 0; background: transparent; padding: 4px; border-radius: var(--r1); color: var(--ink-3); cursor: pointer; display: inline-grid; place-items: center; }
.iconbtn:hover { background: var(--sunken); color: var(--ink); }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; font: 600 11px/1 var(--f-ui); padding: 4px 8px; border-radius: 999px; background: var(--mute-bg); color: var(--ink-2); white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip.plain::before { display: none; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.crit { background: var(--crit-bg); color: var(--crit); }
.chip.info { background: var(--info-bg); color: var(--info); }
/* #426: "Added by … · not reviewed" with Mark reviewed beside it (creative page, edit form). */
.cr-review { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s1); }
.cr-review .chip { white-space: normal; line-height: 1.3; }
.cr-review form { margin: 0; }
.cr-views { margin: var(--s1) 0 0; font-size: var(--t-sm); }

/* ---------- panels ---------- */
.panel { background: var(--surface); border-radius: var(--r3); box-shadow: var(--e1); min-width: 0; }
.panel > header { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel > header .right { margin-left: auto; display: flex; gap: var(--s2); align-items: center; }
.panel .body { padding: var(--s4); }
.grid2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.stack { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s4); font-size: var(--t-sm); }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; }

/* ---------- table ---------- */
.tablewrap { overflow-x: auto; }
/* Table body text is 14px (Round 3, "Across every screen"); headers stay small caps. */
table.t { width: 100%; border-collapse: collapse; font-size: var(--t-md); }
.t th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .05em; padding: 8px var(--s3); border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; white-space: nowrap; }
.t th button { all: unset; cursor: pointer; }
.t th[aria-sort] { color: var(--ink); }
.t td { padding: 9px var(--s3); border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:hover td { background: color-mix(in srgb, var(--sunken) 60%, transparent); }
.t tr.sel td { background: var(--info-bg); }
.t td.r, .t th.r { text-align: right; }
.t .sub { color: var(--ink-3); font-size: var(--t-xs); }
.t a.row { color: var(--ink); font-weight: 600; }
/* A heading row inside a table's body: an IO's billing periods, To send's "Not ready" (#531). */
.t tr.group td { background: var(--paper); font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; padding: 6px var(--s3); }
.t tr.group td a { text-transform: none; letter-spacing: 0; }
.rowact { opacity: 0; display: inline-flex; gap: 2px; }
.t tr:hover .rowact, .t tr:focus-within .rowact { opacity: 1; }

/* ---------- filter bar ---------- */
.filters { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.field-inline { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: var(--r2); padding: 6px 10px; background: var(--surface); font-size: var(--t-sm); color: var(--ink-2); }
.field-inline input { border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); min-width: 0; width: 220px; }
.filterchip { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--line-strong); border-radius: 999px; padding: 5px 10px; font-size: var(--t-sm); color: var(--ink-2); background: transparent; cursor: pointer; font-family: inherit; }
.filterchip.on { border-style: solid; background: var(--sunken); color: var(--ink); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r2); overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 10px; font: 600 var(--t-sm) var(--f-ui); color: var(--ink-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.seg a { background: var(--surface); padding: 6px 10px; font: 600 var(--t-sm) var(--f-ui); color: var(--ink-2); text-decoration: none; }
.seg a + a { border-left: 1px solid var(--line-strong); }
.seg a[aria-pressed="true"] { background: var(--ink); color: var(--surface); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .lab { font-weight: 600; font-size: var(--t-sm); }
.field .hint { font-size: var(--t-xs); color: var(--ink-3); }
.field .err { font-size: var(--t-xs); color: var(--crit); font-weight: 600; }
.input, textarea.input, select.input { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r2); padding: 8px 10px; width: 100%; }
.input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.input.bad { border-color: var(--crit); }
.choice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r2); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--ink); background: var(--sunken); }
.choice input { margin-top: 3px; accent-color: var(--ink); }

/* ---------- flash / callout ---------- */
.flash { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r2); font-size: var(--t-sm); background: var(--info-bg); color: var(--ink); border-left: 3px solid var(--info); }
.flash.ok { background: var(--ok-bg); border-color: var(--ok); }
.flash.warn { background: var(--warn-bg); border-color: var(--warn); }
.flash.crit { background: var(--crit-bg); border-color: var(--crit); }
/* A vetting's description is stored HTML (#347): the same tinted box, drawn as
   a plain block so bold stays inline and line breaks and paragraphs stack.
   As a flex row, each top-level piece of it became a column. */
.flash.description { display: block; }
.empty { text-align: center; padding: var(--s6) var(--s4); color: var(--ink-3); display: flex; flex-direction: column; gap: var(--s2); align-items: center; }
.empty strong { color: var(--ink); font-size: var(--t-lg); }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10,12,16,.35); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--surface); box-shadow: var(--e2); z-index: 21; display: flex; flex-direction: column; }
.drawer header { padding: var(--s4); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: var(--s3); }
.drawer .body { padding: var(--s4); overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: var(--s4); }
.drawer footer { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); display: flex; gap: var(--s2); justify-content: flex-end; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: max(16px, env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: var(--r2); font-weight: 600; font-size: var(--t-sm); z-index: 30; box-shadow: var(--e2); }


/* ---------- responsive ---------- */
@media (max-width: 1100px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side { display: none; }
  .topbar { display: flex; align-items: center; gap: var(--s3); padding: 10px max(16px, env(safe-area-inset-left, 0px)) 10px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
  .topbar .logo { padding: 0; }
  .topbar .right { margin-left: auto; display: flex; gap: var(--s2); }
  .main { padding: var(--s4) max(16px, env(safe-area-inset-right, 0px)) var(--s7) max(16px, env(safe-area-inset-left, 0px)); }
  .t.cards thead { display: none; }
  .t.cards, .t.cards tbody, .t.cards tr, .t.cards td { display: block; width: 100%; }
  .t.cards tr { border-bottom: 1px solid var(--line); padding: var(--s3) var(--s4); display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px var(--s3); }
  .t.cards td { border: 0; padding: 0; text-align: left; }
  .t.cards td[data-k]::before { content: attr(data-k) " "; color: var(--ink-3); font-size: var(--t-xs); }
  /* Phone layout (#297): one field to a line, a label column beside a value
     column. The label hangs in the cell's left padding, so a value with
     several parts (a link, then a note under it) stays in the value column.
     Missing Creative and the campaign's Episodes table draw their own. */
  .t.cards:not(.pairs, .mc-t, [id="cs-spots"]) td[data-k] { padding-left: calc(var(--card-k) + var(--s3)); overflow-wrap: anywhere; }
  .t.cards:not(.pairs, .mc-t, [id="cs-spots"]) td[data-k]::before { content: attr(data-k); float: left; width: var(--card-k); margin-left: calc(-1 * (var(--card-k) + var(--s3))); padding-top: 2px; line-height: 1.3; overflow-wrap: normal; }
  .t.cards td[data-k]:empty { display: none; }
  /* .pairs: two short fields to a line, the first left and the second right,
     for a table of short number pairs that reads better that way. */
  .t.cards.pairs tr { grid-template-columns: 1fr auto; gap: 2px var(--s3); }
  /* Fields at 16px, so iPhone Safari doesn't zoom the page in on a tap. */
  .ds :is(input:not([type=checkbox], [type=radio], [type=range], [type=file], [type=submit], [type=button]), select, textarea) { font-size: 16px !important; }
  .t.cards .hide-m { display: none; }
  .rowact { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

[hidden] { display: none !important; }

/* Round 1: floatovers and confirm dialog */
#floatover { position: fixed; z-index: 40; max-width: 260px; padding: 8px 10px; border-radius: var(--r2); background: var(--ink); color: var(--surface); font-size: var(--t-xs); line-height: 1.45; box-shadow: var(--e2); pointer-events: none; }
#floatover b { font-size: var(--t-sm); }
#floatover ul { margin: 4px 0 0; padding: 0 0 0 14px; }
.confirm { position: fixed; z-index: 31; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 32px)); background: var(--surface); border-radius: var(--r3); box-shadow: var(--e2); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.confirm h2 { font: 600 var(--t-lg) var(--f-display); margin: 0; }
.confirm .acts { display: flex; gap: var(--s2); justify-content: flex-end; }

/* ---------- app additions (not in the mockups) ---------- */
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: var(--r2); box-shadow: var(--e2); }
.skip:focus { left: 8px; }
.me-name { display: block; font-weight: 600; }
.me-role { display: block; font-size: 11px; }
.flash ul { margin: 4px 0 0; padding-left: 18px; }
.main > .flash, .main > #bbm-passkey-offer { margin: 0; }
/* The passkey offer (passkeys.offer) is a shared classic partial; dress its Foundation classes here. */
#bbm-passkey-offer { background: var(--surface); border-radius: var(--r3); box-shadow: var(--e1); }
#bbm-passkey-offer .button { font: 600 var(--t-sm)/1 var(--f-ui); padding: 8px 12px; border-radius: var(--r2); border: 1px solid var(--action); background: var(--action); color: var(--action-fg); cursor: pointer; }
#bbm-passkey-offer .button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.ds .alert-box { padding: var(--s3) var(--s4); border-radius: var(--r2); font-size: var(--t-sm); background: var(--ok-bg); border-left: 3px solid var(--ok); }
.ds .alert-box.alert { background: var(--crit-bg); border-color: var(--crit); }
/* Signed-out pages (#200, design.layouts.signed-out): one narrow column, the wordmark above a panel. */
.so-frame { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: var(--s7) var(--s4); gap: var(--s5); }
.so-head .logo { font-size: var(--t-xl); }
.so-main { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: var(--s4); }
.so-main > .flash { margin: 0; }
.so-main .dsform input.bad { border-color: var(--crit); }
.so-main .panel .body { display: flex; flex-direction: column; gap: var(--s4); }
.so-main .lede { margin: 0; color: var(--ink-2); }
.so-main .btn.primary { justify-content: center; width: 100%; padding: 10px 14px; font-size: var(--t-md); }
.so-main .row-between { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; font-size: var(--t-sm); }
.so-or { display: flex; align-items: center; gap: var(--s3); color: var(--ink-3); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; }
.so-or::before, .so-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
#bbm-passkey-signin { justify-content: center; width: 100%; padding: 10px 14px; font-size: var(--t-md); }
#bbm-passkey-signin[disabled] { opacity: .6; cursor: default; }
/* OAuth consent (#306): Authorize and Cancel side by side, stacked full width on a phone, Authorize first. */
.so-account { font-size: var(--t-sm); color: var(--ink-2); }
.so-account form { display: inline; margin: 0; }
.so-account button { font: inherit; color: var(--link); background: none; border: 0; padding: 0; cursor: pointer; }
.so-scopes { margin: var(--s2) 0 0; padding-left: 1.2em; }
.so-actions { display: flex; gap: var(--s3); }
.so-actions form { flex: 1; margin: 0; }
.so-actions .btn { justify-content: center; width: 100%; padding: 10px 14px; font-size: var(--t-md); }
@media (max-width: 480px) { .so-frame { padding: var(--s5) var(--s3); } .so-actions { flex-direction: column; } }
/* Small screens: the sidebar opens over the page from the top bar's menu button. */
@media (max-width: 860px) {
  body.nav-open .side { display: flex; position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 25; box-shadow: var(--e2); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(10,12,16,.35); z-index: 24; }
}
.nav a.label { display: block; color: var(--ink-3); background: none; box-shadow: none; }
.nav a.label:hover { color: var(--ink); text-decoration: underline; background: none; }

/* ---------- Classic icon-font glyphs on new screens (ad read fixes) ----------
   Classic partials reused here (the ad script drafter, AI help's Copy
   prompt) draw icons with Foundation's icon font, which the new design
   doesn't load, so an <i class="fi-..."> measured 8x0. Draw the three they
   use as masked SVG in the current text colour. Classic never loads this
   file, so its rendering is unchanged. */
.ds i.fi-clipboard, .ds i.fi-clipboard-pencil, .ds i.fi-check { display: inline-block; width: 1em; height: 1em; vertical-align: -0.125em; background-color: currentColor; -webkit-mask: var(--fi-svg) center / contain no-repeat; mask: var(--fi-svg) center / contain no-repeat; }
.ds i.fi-clipboard { --fi-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E"); }
.ds i.fi-clipboard-pencil { --fi-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='M9 17l.6-2.4 4.9-4.9 1.8 1.8-4.9 4.9z'/%3E%3C/svg%3E"); }
.ds i.fi-check { --fi-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
/* Floatovers open on tap (design.js); iOS Safari only sends a tap's click
   on to document from an element it treats as clickable. */
@media (hover: none) { [data-float] { cursor: pointer; } }

/* ---------- M6 shared pieces (host session owns this file; others ask) ----------
   Every remaining classic screen moves across in M6, so the pieces several
   screens need live here rather than in each page's own <style>. */

/* Saved-view tabs and page links, as on /campaigns (M5), for any screen. */
.views { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 var(--s4); border-bottom: 1px solid var(--line); }
.views a, .views button { padding: 10px var(--s3); color: var(--ink-2); font: 600 var(--t-sm) var(--f-ui); border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer; white-space: nowrap; }
.views a:hover, .views button:hover { color: var(--ink); text-decoration: none; }
.views a[aria-current], .views button[aria-pressed="true"], .views button[aria-selected="true"] { color: var(--ink); border-color: var(--ink); }
.pager { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); font-size: var(--t-sm); color: var(--ink-3); flex-wrap: wrap; }
.pager .right { margin-left: auto; display: flex; gap: var(--s1); flex-wrap: wrap; }
.pager .btn[aria-current] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.pager .btn[aria-disabled] { opacity: .45; pointer-events: none; }

/* Forms. .dsform dresses every control inside it, so a form built with the
   Form:: helpers (which print bare inputs) needs no class on each field.
   .formgrid lays .field blocks out two to a row on wide screens. */
.dsform { display: flex; flex-direction: column; gap: var(--s4); }
.dsform input[type=text], .dsform input[type=email], .dsform input[type=url], .dsform input[type=number],
.dsform input[type=password], .dsform input[type=date], .dsform input[type=datetime-local], .dsform input[type=time],
.dsform input[type=tel], .dsform input[type=search], .dsform select, .dsform textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r2); padding: 8px 10px; width: 100%; max-width: 100%; }
.dsform input:focus, .dsform select:focus, .dsform textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.dsform textarea { min-height: 96px; resize: vertical; }
.dsform input[type=checkbox], .dsform input[type=radio] { accent-color: var(--ink); width: auto; margin: 0 6px 0 0; }
.dsform input[type=file] { font: inherit; font-size: var(--t-sm); }
.dsform label { font-weight: 600; font-size: var(--t-sm); }
.dsform label.check { display: inline-flex; align-items: center; font-weight: 500; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.formgrid .wide, .formgrid > .field.wide { grid-column: 1 / -1; }
.formactions { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.formactions .right { margin-left: auto; display: flex; gap: var(--s2); }

/* Trix, the rich-text editor (#434): Notes and Talking Points on Edit creative, Description on
   Add and Edit Vetting. trix.css loads after this file and draws in light-theme greys with black
   SVG icons, so every rule here leads with .ds to outrank it, and the colours are the design's
   tokens, which follow prefers-color-scheme and data-theme. --icon-filter turns the icons white
   in dark; the active button keeps full-opacity icons on --info-bg, a disabled one stays faint. */
.ds trix-toolbar .trix-button-row { flex-wrap: wrap; row-gap: var(--s2); }
.ds trix-toolbar .trix-button-group { border: 1px solid var(--line-strong); border-radius: var(--r2); background: var(--surface); overflow: hidden; }
.ds trix-toolbar .trix-button { color: var(--ink-2); border-bottom: 0; background: transparent; }
.ds trix-toolbar .trix-button:not(:first-child) { border-left: 1px solid var(--line-strong); }
.ds trix-toolbar .trix-button:not(:disabled):hover { background: var(--sunken); }
.ds trix-toolbar .trix-button.trix-active { background: var(--info-bg); color: var(--ink); box-shadow: inset 0 -2px 0 var(--focus); }
.ds trix-toolbar .trix-button:disabled { color: var(--ink-3); }
.ds trix-toolbar .trix-button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.ds trix-toolbar .trix-button--icon::before { filter: var(--icon-filter); opacity: .7; }
.ds trix-toolbar .trix-button--icon.trix-active::before { opacity: 1; }
.ds trix-toolbar .trix-button--icon:disabled::before { opacity: .25; }
.ds trix-toolbar .trix-dialog { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-top: 2px solid var(--focus); border-radius: var(--r2); box-shadow: var(--e2); }
.ds trix-toolbar .trix-input--dialog { color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r2); }
.ds trix-toolbar .trix-input--dialog:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.ds trix-toolbar .trix-input--dialog.validate:invalid { box-shadow: none; border-color: var(--crit); }
.ds trix-editor { min-height: 140px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r2); padding: 8px 10px; }
.ds trix-editor:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.ds .trix-content a { color: var(--link); text-decoration: underline; }
.ds .trix-content pre { color: var(--ink); background: var(--sunken); border-radius: var(--r1); font-family: var(--f-mono); }
.ds .trix-content blockquote { border-color: var(--line-strong); color: var(--ink-2); }
.ds .trix-content .attachment--file { color: var(--ink); border-color: var(--line-strong); }
.ds .trix-content .attachment--preview .attachment__caption { color: var(--ink-3); }
.inline { display: inline; margin: 0; }
@media (max-width: 860px) { .formgrid { grid-template-columns: minmax(0, 1fr); } }

/* A section that opens and closes (vettings' groups, extra detail). */
details.fold { background: var(--surface); border-radius: var(--r3); box-shadow: var(--e1); }
details.fold > summary { cursor: pointer; list-style: none; padding: var(--s3) var(--s4); display: flex; align-items: center; gap: var(--s2); font-weight: 600; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸"; color: var(--ink-3); transition: transform .12s; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold[open] > summary { border-bottom: 1px solid var(--line); }
details.fold > .body { padding: var(--s4); }

/* Plain lists of records (addresses, phones, feeds, tokens) inside a panel. */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rows > li:last-child { border-bottom: 0; }
.rows > li .grow { flex: 1; min-width: 0; }
.rows > li .acts { display: flex; gap: var(--s1); flex-wrap: wrap; }
.prose { max-width: 72ch; }
.prose p { margin: 0 0 var(--s3); }
.prose ul, .prose ol { margin: 0 0 var(--s3); padding-left: 20px; }

/* jQuery UI's datepicker, which classic forms reused on new screens still
   use (design.partials.datepicker). Its own theme CSS isn't loaded. */
.ui-helper-hidden-accessible { position: absolute; left: -9999px; }
.ui-datepicker { display: none; background: var(--surface); border-radius: var(--r2); box-shadow: var(--e2); padding: var(--s2); font-size: var(--t-sm); z-index: 40 !important; }
.ui-datepicker-header { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); font-weight: 700; margin-bottom: 4px; }
.ui-datepicker-prev, .ui-datepicker-next { cursor: pointer; color: var(--link); font-weight: 600; }
.ui-datepicker-prev { order: -1; } .ui-datepicker-next { order: 1; }
.ui-datepicker table { border-collapse: collapse; }
.ui-datepicker th { font-size: var(--t-xs); color: var(--ink-3); padding: 2px 4px; }
.ui-datepicker td a, .ui-datepicker td span { display: block; padding: 3px 6px; text-align: center; color: var(--ink); border-radius: var(--r1); }
.ui-datepicker td a:hover { background: var(--sunken); text-decoration: none; }
.ui-datepicker .ui-state-active, .ui-datepicker .ui-state-highlight { background: var(--ink); color: var(--surface); }
/* Foundation Abide's messages on reused classic forms (data-abide). */
.ds small.error, .ds small.form-error { display: none; color: var(--crit); font-size: var(--t-xs); font-weight: 600; }
.ds .error small.error, .ds .error small.form-error, .ds small.form-error.is-visible { display: block; }
.ds input[data-invalid], .ds input.error { border-color: var(--crit) !important; }
/* Foundation 5's JS reads its data-attribute namespace from this rule in
   classic's stylesheet; without it every data-abide form is ignored. */
meta.foundation-data-attribute-namespace { font-family: false; }


/* The schedule grid: shows by broadcast week, one cell per episode (Round 3).
   The campaign page and the show page both draw it, through
   design.campaigns.partials.schedule-grid. Colours are CampaignSchedule's
   states; the glyph inside says the same thing without colour. */
.sched { border-collapse: separate; border-spacing: 3px; font-size: var(--t-xs); }
.sched th { font-weight: 600; color: var(--ink-3); padding: 2px 4px; white-space: nowrap; }
.sched th.show { text-align: left; color: var(--ink); font-size: var(--t-sm); padding-right: var(--s3); position: sticky; left: 0; background: var(--surface); z-index: 1; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.sched th .cs-note { display: block; font-weight: 400; color: var(--ink-3); font-size: var(--t-xs); }
.sched .now { color: var(--brand); }
.sched td.wk { padding: 0; min-width: 46px; height: 34px; vertical-align: middle; }
.sched .eps { display: flex; gap: 2px; }
.sched .ep { flex: 1 0 46px; min-width: 46px; height: 34px; border-radius: var(--r1); display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; color: inherit; text-decoration: none; }
.sched .ep[role="button"], .sched a.ep { cursor: pointer; }
.sched a.ep:hover { text-decoration: none; filter: brightness(.94); }
.sched .ep.sel { outline: 2px solid var(--focus); outline-offset: 1px; }
.sched .ep .g { display: block; line-height: 1; min-height: 12px; }
.c-booked { background: var(--ink); color: var(--surface); }
.c-booked_no_creative { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.c-aired { background: var(--ok-bg); color: var(--ok); }
.c-aired_no_ts { background: var(--crit-bg); color: var(--crit); }
.c-smart { background: var(--info-bg); color: var(--info); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 40%, transparent); }
.c-open { background: var(--paper); color: var(--ink-3); }
.c-full { background: repeating-linear-gradient(135deg, var(--sunken) 0 4px, var(--paper) 4px 8px); color: var(--ink-3); }
.c-past { background: var(--sunken); color: var(--ink-3); opacity: .5; }
/* #603: every open slot held by the show itself: grey, not bookable. */
.c-held { background: var(--sunken); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.pips { display: flex; justify-content: center; gap: 2px; margin-top: 3px; }
.pips i { width: 4px; height: 4px; border-radius: 50%; box-shadow: inset 0 0 0 1px currentColor; opacity: .55; }
.pips i.on { background: currentColor; opacity: 1; }
/* #256: with a year on screen the grid scrolls a long way. Its wrap scrolls both ways inside the
   window, so the show column (above) and the header row of week dates both stay in view. */
.sched-wrap { max-height: 75vh; overflow: auto; }
.sched thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; }
.sched thead th.show { z-index: 3; }
/* S8 (#537): a rule above the weeks the campaign's IO runs; the dates are in its title and for screen readers. */
.sched thead th.io-run { box-shadow: inset 0 3px 0 var(--brand); }
.sched thead th .io-run-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.sched td.cs-end { text-align: left; white-space: nowrap; padding: 0 var(--s2); color: var(--ink-3); font-size: var(--t-xs); }
.sched td.cs-end a { margin-left: var(--s2); font-weight: 600; }
/* The "Through" control: how far the grid reaches, Later, and a month picker. */
.reach { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; font-size: var(--t-sm); }
.reach select { width: auto; }
.reach [hidden] { display: none; }
.sched-legend { display: flex; gap: var(--s3); flex-wrap: wrap; font-size: var(--t-xs); color: var(--ink-2); }
.sched-legend span { display: inline-flex; gap: 6px; align-items: center; }
.sched-legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }

/* The searchable show picker (components/ds/show-picker). design.js puts the
   text box and its list in front of the select it hides. */
.showpick { position: relative; display: inline-block; min-width: 240px; max-width: 100%; }
.showpick > .input { width: 100%; }
.showpick-list { position: absolute; z-index: 25; left: 0; right: 0; top: calc(100% + 4px); max-height: 300px; overflow: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r2); box-shadow: var(--e2); font-size: var(--t-sm); }
.showpick-list li { padding: 6px 10px; border-radius: var(--r1); cursor: pointer; }
.showpick-list li.active { background: var(--info-bg); color: var(--ink); }
.showpick-list li.picked::before { content: "✓"; display: inline-block; width: 1.2em; font-weight: 700; }
.showpick-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.showpick-tags:empty { display: none; }
.showpick-tag { border: 0; cursor: pointer; font-family: inherit; }
.showpick-tag:hover { background: var(--crit-bg); color: var(--crit); }
.showpick-list li.none { color: var(--ink-3); cursor: default; }

/* The sidebar's jump box (Round 4, #233). Its list reuses the show picker's. */
.jump { position: relative; }
.jump > .input { padding-right: 30px; }
.jump > .input::-webkit-search-cancel-button { display: none; }
.jump-key { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 600 11px/1 var(--f-mono); color: var(--ink-3); border: 1px solid var(--line-strong); border-radius: var(--r1); padding: 2px 5px; pointer-events: none; }
.jump:focus-within .jump-key { display: none; }
.jump-list { z-index: 30; }
.jump-list li.group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; padding: 8px 10px 2px; cursor: default; }
.jump-list li .jump-detail { display: block; font-size: var(--t-xs); color: var(--ink-3); }
/* The collapsible sidebar (#528). The toggle sits beside the wordmark. html.side-rail (set before paint
   by the layout's inline script, then by design.js) narrows the sidebar to an icon rail above the phone
   layout: each link keeps its label for screen readers (.nl, clipped) and gets it as a tooltip, the
   current item keeps its highlight, a count shrinks onto its icon, group headings become a rule, the
   jump box becomes a search button, and the account menu opens beside the rail. The main area takes
   the room; the --cap/.wide rules still apply inside it. */
.side-head { display: flex; align-items: flex-start; gap: var(--s1); }
.side-head .logo { flex: 1 1 auto; min-width: 0; }
.side-toggle { flex: none; margin-top: 2px; }
.jump-open { display: none; }
@media (max-width: 860px) { .side-toggle { display: none; } }
@media (min-width: 861px) {
  :root.side-rail { --sidebar: 64px; }
  .side-rail .side { padding: var(--s3) var(--s2); align-items: center; gap: var(--s3); overflow-x: hidden; }
  .side-rail .side-head { flex-direction: column; align-items: center; gap: var(--s2); }
  .side-rail .side .logo { padding: var(--s2); justify-content: center; }
  .side-rail .side .logo .mark { display: none; }
  .side-rail .side .jump > .input, .side-rail .side .jump-key, .side-rail .side .jump-list { display: none; }
  .side-rail .side .jump-open { display: inline-grid; padding: 8px; }
  .side-rail .side .nav { width: 100%; align-items: center; }
  .side-rail .side .nav a { position: relative; justify-content: center; width: 40px; padding: 9px 0; }
  .side-rail .side .nl, .side-rail .side .me > span:not(.avatar) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  .side-rail .side .nav .label { font-size: 0; padding: 0; margin: var(--s2) 0; height: 1px; width: 24px; background: var(--line); }
  .side-rail .side .nav .count { position: absolute; top: 1px; right: 0; margin: 0; min-width: 15px; padding: 0 3px; font-size: 10px; line-height: 15px; text-align: center; }
  .side-rail .side .me { position: relative; justify-content: center; width: 100%; padding: var(--s2) 0; }
  .side-rail .side .usermenu { position: fixed; left: calc(var(--sidebar) + 6px); bottom: var(--s3); width: 230px; z-index: 30; margin: 0; padding: var(--s1); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--e2); }
  .side-rail .side .usermenu:not([hidden]) + .me { margin-top: auto; }
}

/* ---------- M7 stage 1: the CRM's companies and people ----------
   Ported from docs/design/mockups/crm/crm.css (only what the pages use),
   on this file's tokens. */
.views .n { margin-left: 6px; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* timeline: one feed of notes, newest first, pinned and open follow-ups on top */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.timeline > li:last-child { border-bottom: 0; }
.timeline .dot { width: 28px; height: 28px; border-radius: 50%; background: var(--sunken); color: var(--ink-2); display: grid; place-items: center; }
.timeline .dot .ico { width: 14px; height: 14px; }
.timeline .dot.due { background: var(--warn-bg); color: var(--warn); }
.timeline .head { display: flex; gap: var(--s2); align-items: baseline; flex-wrap: wrap; font-size: var(--t-sm); }
.timeline .head b { font-weight: 600; }
.timeline .when { margin-left: auto; color: var(--ink-3); font-size: var(--t-xs); white-space: nowrap; }
.timeline .text { margin: 2px 0 0; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.timeline .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.timeline .tags form { display: inline; }
.timeline li.pinned { background: color-mix(in srgb, var(--warn-bg) 55%, transparent); }
.timeline li.system .text { color: var(--ink-2); }
.timeline details.note-long > summary { cursor: pointer; list-style: none; }
.timeline details.note-long > summary::-webkit-details-marker { display: none; }
.timeline details.note-long > summary .excerpt { display: block; }
.timeline details.note-long > summary .more { display: inline-block; margin-top: 2px; font-size: var(--t-xs); color: var(--link); }
.timeline details.note-long[open] > summary .excerpt { display: none; }
.timeline details.note-long[open] > summary .more::after { content: " (hide)"; }
.timeline .edit-link { font-size: var(--t-xs); color: var(--link); cursor: pointer; }
.timeline > li > div { position: relative; min-width: 0; }
.timeline .note-edit-toggle { position: absolute; top: 0; left: 0; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.timeline .note-edit-toggle:focus-visible + .head .edit-link { outline: 2px solid var(--focus, var(--link)); outline-offset: 2px; border-radius: 3px; }
.timeline .note-edit { display: none; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-top: var(--s2); padding: var(--s3); border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: var(--t-sm); }
.timeline .note-edit-toggle:checked ~ .note-edit { display: flex; }
.timeline .note-edit-toggle:checked + .head .edit-link { visibility: hidden; }
.timeline .note-edit .input { width: auto; padding: 5px 8px; font-size: var(--t-sm); }
.timeline .note-edit label.full { flex: 1 1 100%; display: grid; gap: 4px; }
.timeline .note-edit label.full .input { width: 100%; }
.timeline .note-edit .hint { flex: 1 1 100%; font-size: var(--t-xs); }
.tl-day { padding: var(--s2) var(--s4); font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; background: var(--paper); border-bottom: 1px solid var(--line); }
details.tl-imported > summary, details.tl-system > summary { padding: var(--s3) var(--s4); cursor: pointer; font-size: var(--t-sm); color: var(--ink-2); border-top: 1px solid var(--line); }
details.tl-imported > summary b, details.tl-system > summary b { color: var(--ink); }
details.more-rows > summary { padding: var(--s3) var(--s4); cursor: pointer; font-size: var(--t-sm); color: var(--link); border-top: 1px solid var(--line); }

/* the note composer on top of a timeline: one line, with a follow-up and a person beside it */
.composer { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--s2); }
.composer .row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.composer .row .input { width: auto; padding: 5px 8px; font-size: var(--t-sm); }
.composer .row .input.grow { flex: 1; min-width: 160px; }
.composer .row label { font-size: var(--t-xs); color: var(--ink-3); display: inline-flex; gap: 6px; align-items: center; }

/* people rows */
.person { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--s3); align-items: start; }
.person .nm { font-weight: 600; color: var(--ink); }
.person .ti { font-size: var(--t-xs); color: var(--ink-3); }
.person .how { font-size: var(--t-sm); color: var(--ink-2); display: flex; gap: var(--s3); flex-wrap: wrap; margin-top: 2px; overflow-wrap: anywhere; }
.person.old .nm, .person.old .how { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.rolechips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.unverified { font: 600 10px/1 var(--f-mono); color: var(--ink-3); border: 1px dashed var(--line-strong); border-radius: 3px; padding: 2px 4px; white-space: nowrap; }
.inline-form { display: inline-flex; gap: var(--s1); align-items: center; flex-wrap: wrap; }
.inline-form .input { width: auto; padding: 4px 6px; font-size: var(--t-sm); }

/* M7 Today
   The Today screen (design.crm.today), ported from docs/design/mockups/crm/crm.css. */
/* tiles: My week's tiles as a shared piece; a quiet one is dashed */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s3); }
.tiles .tile { display: flex; flex-direction: column; gap: 2px; padding: var(--s3) var(--s4); border-radius: var(--r3); box-shadow: var(--e1); background: var(--surface); color: var(--ink); }
.tiles a.tile:hover { text-decoration: none; box-shadow: 0 0 0 1px var(--line-strong); }
.tiles .n { font: 700 var(--t-3xl)/1 var(--f-display); font-variant-numeric: tabular-nums; }
.tiles .n.crit { color: var(--crit); } .tiles .n.warn { color: var(--warn); }
.tiles .what { font-weight: 600; } .tiles .why { font-size: var(--t-xs); color: var(--ink-3); }
.tiles .tile.quiet { box-shadow: none; border: 1px dashed var(--line-strong); background: transparent; }
.tiles .tile.quiet .n, .tiles .tile.quiet .what { color: var(--ink-2); }
/* M7 billing (#377): Commissions' total row and mark-paid bar, and the export screen. From crm.css. */
.total-row td { font-weight: 700; border-top: 2px solid var(--line-strong); border-bottom: 0; }
.field-inline select { border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); }
.field-inline input[type="date"] { width: auto; }
.mark-paid { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); }
.main > .filters { border-bottom: 0; padding: 0; }
.billing-problems { margin: 4px 0 0; padding-left: 18px; }
/* turn: whose turn it is, and for how long */
.turn { display: inline-flex; align-items: center; gap: 5px; font: 600 11px/1 var(--f-ui); padding: 4px 8px; border-radius: 999px; white-space: nowrap; background: var(--mute-bg); color: var(--ink-2); }
.turn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.turn.us { background: var(--warn-bg); color: var(--warn); }
.turn.us.long { background: var(--crit-bg); color: var(--crit); }
.turn.due { background: var(--info-bg); color: var(--info); }
/* quote: words from a note or an email; prep: a line under a row; newmark: something Podman opened */
.quote { display: block; margin-top: 4px; padding-left: var(--s3); border-left: 2px solid var(--line-strong); color: var(--ink-2); font-size: var(--t-sm); overflow-wrap: anywhere; }
.prep { font-size: var(--t-sm); color: var(--ink-2); margin-top: 2px; }
.rows > li.quietrow { color: var(--ink-3); font-size: var(--t-sm); }
.newmark { font: 600 10px/1 var(--f-mono); color: var(--info); border: 1px solid currentColor; border-radius: 3px; padding: 1px 4px; vertical-align: middle; margin-left: 6px; }
.today .rows > li .acts { align-items: center; }
.today .rows > li .acts form { margin: 0; }
/* sales by month: one bar per month */
.salesmonths { display: flex; flex-direction: column; }
.hbar { display: grid; grid-template-columns: 5.5em minmax(0, 1fr) 6.5em; gap: var(--s3); align-items: center; font-size: var(--t-sm); padding: 3px 0; }
.hbar .track { height: 8px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.hbar .val { font-variant-numeric: tabular-nums; color: var(--ink-2); text-align: right; }
.salesmonths + .prep { margin: var(--s3) 0 0; }
@media (max-width: 860px) { .today .rows > li .grow { flex-basis: 100%; } }

/* M7 To confirm and capture
   Captured mail and meetings in the timeline, the thread page, and the To
   confirm screen (design.crm.to-confirm, design.crm.thread), ported from
   docs/design/mockups/crm/crm.css (.thread, .sugg, .timeline .dot.mail). */
.timeline .dot.mail { background: var(--info-bg); color: var(--info); }
.timeline li.private { background: color-mix(in srgb, var(--warn-bg) 35%, transparent); }
.timeline .text.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.timeline details.tl-thread { margin-top: 6px; }
.timeline details.tl-thread > summary { cursor: pointer; }
.timeline details.tl-thread .thread { padding: var(--s2) 0 0; }
.tl-more { font-size: var(--t-xs); padding: 0 var(--s4) var(--s3); margin: 0; }
/* thread: an email thread, inbound and outbound */
.thread { list-style: none; margin: 0; padding: var(--s3) var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.thread li { max-width: 88%; padding: var(--s3); border-radius: var(--r3); background: var(--sunken); min-width: 0; }
.thread li.out { align-self: flex-end; background: var(--info-bg); }
.thread .hd { display: flex; gap: var(--s2); align-items: baseline; flex-wrap: wrap; font-size: var(--t-xs); color: var(--ink-3); }
.thread .hd b { color: var(--ink); font-size: var(--t-sm); }
.thread .hd .when { margin-left: auto; white-space: nowrap; }
.thread p { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.thread .att { display: inline-flex; gap: 5px; align-items: center; margin-top: 6px; margin-right: 6px; font-size: var(--t-xs); padding: 3px 8px; border-radius: 999px; background: var(--surface); color: var(--ink-2); }
.thread .att .ico { width: 12px; height: 12px; }
/* sugg: a suggestion with its quoted evidence and its two buttons */
.sugg { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); align-items: start; }
.sugg:last-child { border-bottom: 0; }
.sugg > .dot { width: 28px; height: 28px; border-radius: 50%; background: var(--sunken); color: var(--ink-2); display: grid; place-items: center; }
.sugg > .dot .ico { width: 14px; height: 14px; }
.sugg .what { font-weight: 600; overflow-wrap: anywhere; }
.sugg .what small { font-weight: 400; color: var(--ink-3); }
.sugg q { display: block; quotes: none; margin-top: 4px; padding-left: var(--s3); border-left: 2px solid var(--line-strong); color: var(--ink-2); font-size: var(--t-sm); overflow-wrap: anywhere; }
.sugg q::before, .sugg q::after { content: none; }
.sugg .from { font-size: var(--t-xs); color: var(--ink-3); margin-top: 4px; }
.sugg .acts { display: flex; gap: var(--s1); flex-wrap: wrap; justify-content: flex-end; }
.sugg .acts .input { width: 12em; }
.sugg .acts .near-match { flex-basis: 100%; display: flex; flex-direction: column; align-items: flex-end; gap: var(--s1); }
@media (max-width: 860px) {
  .thread li { max-width: 100%; }
  .sugg { grid-template-columns: 28px minmax(0, 1fr); }
  .sugg .acts { grid-column: 2; justify-content: flex-start; }
  .sugg .acts .near-match { align-items: flex-start; }
}

/* ---------- M7 billing: the Invoices list, the A/R report and the invoice page (#375).
   Ported from docs/design/mockups/crm/crm.css (.steps, .aging, .monthbars,
   .total-row, .billto, .bigmoney, .grid3) and invoice.html's .paper. */
.steps { display: flex; gap: 0; list-style: none; margin: 0; padding: 0; font-size: var(--t-sm); flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 6px; padding: 6px var(--s3) 6px 0; color: var(--ink-3); font-weight: 600; }
.steps li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-strong); }
.steps li + li::before { margin-left: var(--s3); }
.steps li.done { color: var(--ink-2); }
.steps li.done::before { background: var(--ink); box-shadow: none; }
.steps li.now { color: var(--ink); }
.steps li.now::before { background: var(--surface); box-shadow: inset 0 0 0 3px var(--brand); }
.aging { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--sunken); }
.aging i { display: block; height: 100%; }
.aging .a0 { background: var(--ink-3); } .aging .a1 { background: var(--warn); } .aging .a2 { background: var(--crit); }
.aging-key { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: var(--t-xs); color: var(--ink-2); margin-top: 6px; }
.aging-key b { font-variant-numeric: tabular-nums; color: var(--ink); }
.monthbars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(56px, 1fr); gap: var(--s2); align-items: end; height: 120px; overflow-x: auto; }
.monthbars .m { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; font-size: var(--t-xs); color: var(--ink-3); }
.monthbars .bar { width: 100%; border-radius: var(--r1) var(--r1) 0 0; background: var(--ink); min-height: 2px; position: relative; }
.monthbars .bar .paid { position: absolute; left: 0; right: 0; bottom: 0; background: var(--ok); border-radius: 0; opacity: .85; }
.monthbars .m.future .bar { background: repeating-linear-gradient(135deg, var(--line-strong) 0 4px, var(--sunken) 4px 8px); }
.monthbars .m.now { color: var(--brand); font-weight: 700; }
.monthbars .v { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.total-row td { font-weight: 700; border-top: 2px solid var(--line-strong); border-bottom: 0; }
.billto { font-size: var(--t-sm); line-height: 1.5; }
.billto b { display: block; font-size: var(--t-md); }
.bigmoney { font: 700 var(--t-2xl)/1.1 var(--f-display); font-variant-numeric: tabular-nums; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
@media (max-width: 1100px) { .grid3 { grid-template-columns: minmax(0, 1fr); } }
.paper { background: var(--surface); border-radius: var(--r3); box-shadow: var(--e1); padding: var(--s6); display: flex; flex-direction: column; gap: var(--s5); }
.paper .top { display: flex; justify-content: space-between; gap: var(--s5); flex-wrap: wrap; }
.paper .from { font-size: var(--t-sm); color: var(--ink-2); }
.paper .from b { font: 700 var(--t-lg) var(--f-display); color: var(--ink); display: block; }
.paper .no { text-align: right; }
.paper .no .mono { font-size: var(--t-xl); }
details > summary.btn { list-style: none; display: inline-flex; }
details > summary.btn::-webkit-details-marker { display: none; }

/* #427: competitor exclusions. A week that would put the campaign near a competitor gets an amber edge on the grid. */
.sched .ep.has-conflict { box-shadow: inset 0 0 0 2px var(--warn); }
.sched .ep.has-conflict.sel { outline: 2px solid var(--focus); }
.cs-conflict-line { color: var(--warn); }
.cs-dconflict { grid-column: 1 / -1; background: var(--warn-bg); color: var(--warn); border-radius: var(--r1); padding: 4px 8px; font-size: 13px; }
/* #668: right of first refusal: a note, quieter than a conflict. */
.cs-refusal-line { color: var(--ink-3); font-style: italic; }
.cs-drefusal { grid-column: 1 / -1; color: var(--ink-3); padding: 2px 8px; font-size: 13px; font-style: italic; }
.cs-refusal { font-size: 13px; }
.cs-refusal ul { margin: 4px 0 0; padding-left: 1.2em; }
/* #515: the panel is a fold, closed to one line until it has something in it. */
details.cs-excl > summary { flex-wrap: wrap; column-gap: var(--s3); }
details.cs-excl > summary .cs-excl-h { margin: 0; }
details.cs-excl > summary .cs-excl-summary { font-weight: 400; font-size: var(--t-sm); }
details.cs-excl[open] > summary .cs-excl-summary { display: none; }
.cs-excl-row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.cs-excl-row select, .cs-excl-row input:not([type=radio]) { width: auto; }
.cs-excl-chips { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.cs-excl-item { display: inline-flex; gap: 4px; align-items: center; }
.cs-excl-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.cs-excl-list li { display: flex; gap: var(--s2); align-items: center; }
form.inline { display: inline; margin: 0; }
.cs-excl-item-read { border: 1px solid var(--line); border-radius: var(--r2); padding: var(--s2) var(--s3); margin: 0; display: flex; flex-direction: column; gap: 4px; }
.cs-excl-item-read legend { font-weight: 700; padding: 0 4px; }
.cs-av-conflicts ul { margin: 4px 0 0; padding-left: 1.2em; }
/* The pipeline (#575), from the mockups' crm.css: board is the three open stages as columns, stacked under 1100px; deal is one card. */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); align-items: start; }
.board .col { background: var(--sunken); border-radius: var(--r3); padding: var(--s2); display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.board .col > header { display: flex; align-items: baseline; gap: var(--s2); padding: var(--s2) var(--s2) 0; }
.board .col > header h2 { font: 700 var(--t-sm)/1.2 var(--f-ui); margin: 0; }
.board .col > header .n { color: var(--ink-3); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
.board .col > header .sum { margin-left: auto; font: 600 var(--t-sm)/1 var(--f-ui); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.board .col > .how { padding: 0 var(--s2); font-size: var(--t-xs); color: var(--ink-3); }
@media (max-width: 1100px) { .board { grid-template-columns: minmax(0, 1fr); } }
.deal { display: block; background: var(--surface); border-radius: var(--r2); box-shadow: var(--e1); padding: var(--s3); color: var(--ink); min-width: 0; }
a.deal:hover { text-decoration: none; box-shadow: 0 0 0 1px var(--line-strong); }
.deal .top { display: flex; gap: var(--s2); align-items: baseline; }
.deal .brand { font-weight: 700; overflow-wrap: anywhere; }
.deal .amt { margin-left: auto; font: 600 var(--t-sm)/1.2 var(--f-ui); font-variant-numeric: tabular-nums; white-space: nowrap; }
.deal .amt.est { color: var(--ink-3); font-weight: 500; }
.deal .via { font-size: var(--t-xs); color: var(--ink-3); margin-top: 1px; overflow-wrap: anywhere; }
.deal .foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: var(--s2); font-size: var(--t-xs); color: var(--ink-2); }
.deal .foot .who { margin-left: auto; }
.deal.unconfirmed { box-shadow: none; border: 1px dashed var(--line-strong); background: transparent; }
.deal .say { font-size: var(--t-xs); color: var(--ink-2); margin-top: var(--s2); }
.origin { font: 600 10px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.origin.renewal { color: var(--ok); } .origin.outbound { color: var(--info); }
.pipeline-filters { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
/* #669: Mine / Everyone's / one person read as one control; a picked person is drawn pressed, like the seg. */
.pipeline-filters .whose { display: inline-flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-right: var(--s3); }
.pipeline-filters select.picked { background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 600; }
.steps-due > summary h2 { margin: 0; font: 700 var(--t-md)/1.2 var(--f-ui); }
.steps-due > summary .n { color: var(--ink-3); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
.steps-due > summary .right { margin-left: auto; font-weight: 400; font-size: var(--t-sm); }
/* #669: a card's Move menu (its keyboard and phone move) sits in its top right corner; dragging marks the columns. */
.dealcard { position: relative; min-width: 0; }
.dealcard .deal .top { padding-right: 52px; }
.deal-move { position: absolute; top: 6px; right: 6px; z-index: 2; }
.deal-move > summary { list-style: none; cursor: pointer; font: 600 var(--t-xs)/1 var(--f-ui); color: var(--ink-3); padding: 5px 7px; border-radius: var(--r1); }
.deal-move > summary::-webkit-details-marker { display: none; }
.deal-move > summary:hover, .deal-move[open] > summary { background: var(--sunken); color: var(--ink); }
.deal-move-list { position: absolute; right: 0; top: calc(100% + 4px); min-width: 180px; display: flex; flex-direction: column; padding: 4px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r2); box-shadow: var(--e2); }
.deal-move-list form { margin: 0; }
.deal-move-list button, .deal-move-list a { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; font: 500 var(--t-sm)/1.2 var(--f-ui); color: var(--ink); border-radius: var(--r1); cursor: pointer; }
.deal-move-list button:hover, .deal-move-list a:hover { background: var(--sunken); text-decoration: none; }
.deal-move-list a { color: var(--ink-2); border-top: 1px solid var(--line); border-radius: 0; margin-top: 2px; }
.dealcard.dragging { opacity: .5; }
.board.dragging .col { outline: 2px dashed transparent; outline-offset: -2px; }
.board.dragging .col.drop-ok { outline-color: var(--line-strong); }
.board.dragging .col.drop-over { outline-color: var(--action); background: color-mix(in srgb, var(--action) 8%, var(--sunken)); }
@media (max-width: 860px) { .deal .foot .who { margin-left: 0; } }

/* M7 Numbers (#578; design.crm.numbers), .stat ported from the CRM mockups' crm.css */
/* Scoped under .numstats: the campaign page draws its own .stats/.stat. */
.numstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--s4); }
.numstats .stat { background: var(--surface); border-radius: var(--r3); box-shadow: var(--e1); padding: var(--s4); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.numstats .stat .k { font-size: var(--t-xs); font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.numstats .stat .n { font: 700 var(--t-3xl)/1 var(--f-display); font-variant-numeric: tabular-nums; }
.numstats .stat .n small { font: 600 var(--t-sm)/1 var(--f-ui); margin-left: 6px; }
.numstats .stat .n small.up { color: var(--ok); } .numstats .stat .n small.down { color: var(--crit); } .numstats .stat .n small.flat { color: var(--ink-3); }
.numstats .stat .why { font-size: var(--t-sm); color: var(--ink-2); }
.numbers-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--s5); align-items: start; }
.numbers-split .hbar, [data-panel="days-in-stage"] .hbar { grid-template-columns: 11em minmax(0, 1fr) 10em; }
@media (max-width: 860px) { .numbers-split .hbar, [data-panel="days-in-stage"] .hbar { grid-template-columns: 8em minmax(0, 1fr) 8em; } }

/* Signature fields (M10, #629): the placing screen (design.signatures.fields,
   driven by design.js) and the signer's highlighted fields on the signing
   screen. Pages are white paper in either theme. */
.sf-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }
.sf-tools .sf-for { display: inline-flex; align-items: center; gap: var(--s2); }
.sf-status { flex: 1 1 100%; min-height: 1.4em; }
.sf-selected { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); padding: var(--s3); margin-bottom: var(--s3); border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); }
.sf-selected[hidden], .sf-selected [hidden] { display: none; }
.sf-pages { display: grid; gap: var(--s4); max-width: 920px; }
.sf-page { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.sf-page img { display: block; width: 100%; height: 100%; pointer-events: none; }
.sf-arming .sf-page { cursor: crosshair; }
.sf-box { position: absolute; box-sizing: border-box; border: 2px solid currentColor; border-radius: 3px; background: color-mix(in srgb, currentColor 14%, transparent); cursor: move; font: 600 11px/1.2 var(--f-ui); overflow: hidden; }
.sf-box.on, .sf-box:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.sf-box .sf-label { display: block; padding: 1px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-box .sf-handle { position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; background: currentColor; cursor: nwse-resize; }
.sf-c0 { color: #2f6fde; } .sf-c1 { color: #c2410c; } .sf-c2 { color: #15803d; }
.sf-c3 { color: #9333ea; } .sf-c4 { color: #b91c1c; } .sf-c5 { color: #0e7490; }
.sf-save { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); padding: var(--s3) 0; margin-top: var(--s3); background: var(--paper); }
.sf-phone { display: none; }
@media (max-width: 860px) {
	.sf-tools, .sf-selected, .sf-save { display: none; }
	.sf-phone { display: block; }
	.sf-box { pointer-events: none; }
	.sf-box .sf-handle { display: none; }
}
.sign-page { position: relative; container-type: inline-size; background: #fff; border-radius: 4px; }
.sign-page img { height: 100%; }
.sign-field { position: absolute; box-sizing: border-box; margin: 0; padding: 0 0.3em; border: 2px solid #e0a100; border-radius: 3px; background: rgba(255, 214, 0, 0.22); color: #15171c; display: flex; align-items: center; overflow: hidden; white-space: nowrap; line-height: 1; }
.sign-field.mark { font-family: "DejaVu Serif", Georgia, "Times New Roman", serif; font-style: italic; font-weight: 700; }
.sign-field.text { font-family: var(--f-ui); outline: none; }
.sign-field.text:focus { border-color: var(--focus); background: rgba(255, 255, 255, 0.9); }
.sign-field.text:invalid:not(:placeholder-shown) { border-color: var(--crit); }
.sign-field [data-sign-fill]:empty::before { content: attr(data-placeholder); color: #6b7280; font-style: normal; font-weight: 400; font-family: var(--f-ui); }

/* #681: the help chat. The Help button sits at the sidebar's foot, above the account menu; the panel floats bottom right. */
.side .help-open { margin-top: auto; display: flex; align-items: center; gap: var(--s2); width: 100%; padding: 6px var(--s2); border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink-2); font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.side .help-open:hover, .side .help-open[aria-expanded="true"] { background: var(--paper); }
.side .help-open ~ .usermenu, .side .help-open ~ .me { margin-top: 0; }
@media (min-width: 861px) {
  .side-rail .side .help-open { justify-content: center; padding: 9px 0; }
  .side-rail .side .help-open ~ .usermenu:not([hidden]) + .me { margin-top: 0; }
}
.help-panel { position: fixed; right: var(--s4); bottom: var(--s4); z-index: 40; width: min(420px, calc(100vw - 2 * var(--s4))); max-height: min(640px, calc(100vh - 2 * var(--s4))); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r2); box-shadow: var(--e2); font-size: var(--t-sm); }
.help-panel[hidden] { display: none; }
.help-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); }
.help-head h2 { flex: 1 1 auto; margin: 0; font-size: var(--t-md); }
.help-log { flex: 1 1 auto; overflow-y: auto; padding: var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.help-msg { padding: var(--s2) var(--s3); border-radius: var(--r2); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.help-msg.user { align-self: flex-end; max-width: 85%; background: var(--sunken); }
.help-msg.assistant { align-self: flex-start; max-width: 95%; background: var(--paper); }
.help-msg.note { align-self: center; background: none; color: var(--ink-3); font-size: var(--t-xs); }
.help-msg .help-suggest { display: block; margin-top: var(--s2); }
.help-msg ol, .help-msg ul { margin: var(--s1) 0; padding-left: 1.4em; white-space: normal; }
.help-msg li + li { margin-top: 2px; }
.help-msg code { background: var(--sunken); padding: 0 3px; border-radius: var(--r1); }
.help-ask, .help-feedback { display: flex; gap: var(--s2); padding: var(--s2) var(--s3); border-top: 1px solid var(--line); }
.help-ask textarea { flex: 1 1 auto; resize: vertical; min-height: 44px; }
.help-feedback { flex-direction: column; }
.help-feedback[hidden] { display: none; }
.help-feedback label { font-weight: 600; }
.help-feedback-actions { display: flex; gap: var(--s2); }
.help-foot { margin: 0; padding: 0 var(--s3) var(--s2); text-align: right; }
.help-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
