/* ==========================================================================================================
   iTech Valet — DESIGN SYSTEM v0  (tools.itechvalet.com)
   ONE shared stylesheet. Every tool imports it; no tool ships its own colours, type or spacing.

   1. TOKENS      every value lives here, as a custom property. Reskin = change tokens, never components.
   2. STATUS      the sacred colours (see the rules block). Used for status and NOTHING else.
   3. SHELL       header, left nav, main area, phone menu
   4. COMPONENTS  cards, tabs, tables, pills, bars, states, forms

   Values follow the 2.0 UI standard (a light SaaS look: navy header, brand blue, soft shadows, rounded corners)
   and reuse Client Manager 2.0's palette, so the shell and the older 2.0 tools read as one family.
   ========================================================================================================== */

/* ---- 1. TOKENS ------------------------------------------------------------------------------------------- */
:root {
  /* brand */
  /* DASH-2: the navy of the approved "Tools Dashboard — One Look" mockup, for the header and the menu alike */
  --brand-navy:       #0f2440;
  --brand-navy-deep:  #0f2440;
  --brand-blue:       #2494e0;
  --brand-blue-pale:  #e8f3fd;
  --accent:           #0b5fd9;   /* DASH-2: the mockup's one blue (links, the active tab, primary buttons) = --sales-blue */
  --on-brand:         #ffffff;
  --on-brand-dim:     #b9d9f5;
  /* BILL-7, THE ACTION COLOUR: the one button on a screen that sends something to a client ("Send invoice"). Solid orange,
     white words (5.2:1, AA). It is NOT a status colour and says nothing about state: amber stays "waiting / needs action".
     A later UI pass may reuse these three for any other primary action. */
  --action:           #c2410c;
  --action-hover:     #9a3412;
  --on-action:        #ffffff;

  /* surfaces and ink */
  --bg:          #f4f5f7;   /* DASH-2: the mockup's grey ground */
  --surface:     #ffffff;
  --surface-alt: #f9fafc;
  --ink:         #15181d;   /* DASH-2: the mockup's ink, grey and borders */
  --ink-dim:     #5b6470;
  --ink-mute:    #5b6470;
  --line:        #e3e6eb;
  --line-strong: #d5dae1;

  /* type */
  --font:      Inter, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs:  12px;
  --fs-sm:  13px;
  --fs-md:  14px;
  --fs-lg:  16px;
  --fs-xl:  20px;
  --fs-2xl: 26px;
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-bold:    650;
  --lh: 1.45;

  /* spacing (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  /* shape and depth */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-md: 0 2px 4px rgba(16, 24, 40, .05), 0 4px 12px rgba(16, 24, 40, .06);

  /* layout */
  --header-h:     56px;
  --nav-w:        232px;
  --nav-w-collapsed: 64px;
  --content-max:  1600px;   /* NAV-1: the sections left the page for the menu, so the data takes the width (was 1280px) */

  /* AUD-17: the three marks of the AI visibility grid. Told apart by SHAPE first (circle, square, diamond); these hues are
     outside the status set on purpose, so a mark is never read as red, amber or green. */
  --mark-uses:       #2494e0;
  --mark-cites:      #7a4fc4;
  --mark-recommends: #063a6c;

  /* SHELL-SCHED1: THE LOCKED SCHEDULED PURPLE. "Scheduled, waiting on the clock" is purple wherever a cluster is drawn: these
     are the AEO article tool's own three values (tools/aeo-articles/legacy/css/aeo.css: --cluster-purple, -ink, -card), and
     the Scheduler's proof holds the two files against each other. Outside the status set, like the marks above. */
  --scheduled-purple:      #6b3fa0;
  --scheduled-purple-ink:  #543182;
  --scheduled-purple-card: #e7caf3;
  /* SHELL-AEO3B: THE LOCKED WRITTEN TEAL, the same way. "Written, not scheduled" is teal wherever a cluster is drawn: the AEO
     article tool's own three values (--cluster-teal, -ink, -card). */
  --written-teal:          #0f7480;
  --written-teal-ink:      #0a5a63;
  --written-teal-card:     #acf8ff;
  /* SALES-1: the two values of the approved "Lead Page — Sales Story" mockup that the tokens above did not have. The blue is
     the lead page's ONE next step (Build proposal) and the strip's current step; the orange marks a number the owner changed
     from its package (an owner's screen mark, never a status and never printed on the proposal). */
  --sales-blue:            #0b5fd9;
  --sales-blue-wash:       #e8f0fd;
  --changed:               #b4540a;
  /* DASH-2: the rest of the "Tools Dashboard — One Look" mockup, on top of SALES-1's blue and orange (never a second
     set): green for DONE (sealed, locked, a kept subscription), the orange above for ATTENTION, a quiet grey for WAITING.
     These mark the state of a piece of work. They are not the sacred status colours below, which still mean only what
     the status rules say. */
  --done:                  #1e8e4b;
  --done-wash:             #e6f4ec;
  --done-ink:              #146a38;
  --attention-wash:        #fdeedc;
  --attention-ink:         #8a3e05;
  --waiting-bg:            #e3e6eb;
  --waiting-ink:           #5b6470;
  --nav-ink:               #c9d3e3;

  /* ---- 2. STATUS — THE SACRED COLOURS ------------------------------------------------------------------
     RED     route status "over", and anything broken or failed.
     AMBER   NOT VERIFIED: not_tracked items, NOT ENTERED retainers, INCOMPLETE profit, "pre-gateway" labels.
     (none)  route status "ok" — quiet success shows nothing.
     GRAY    route status "watch" — a plain neutral "near target" label. Never amber.
     GREEN   verified confirmations only, e.g. "0 cost mismatches — verified".
     These five meanings are the only uses of these colours anywhere in the shell or any tool.            */
  --red:        #b3261e;
  --red-ink:    #8d1c15;
  --red-wash:   rgba(179, 38, 30, .08);
  --red-line:   rgba(179, 38, 30, .30);
  --amber:      #9a6b00;
  --amber-ink:  #6d4a00;
  --amber-wash: rgba(214, 158, 0, .10);
  --amber-line: rgba(154, 107, 0, .35);
  --green:      #1a7a4d;
  --green-ink:  #0f5c39;
  --green-wash: rgba(26, 122, 77, .08);
  --green-line: rgba(26, 122, 77, .30);
  --watch-ink:  #4e5a6a;
  --watch-bg:   #eef1f5;
  --watch-line: #d3dae4;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: var(--fw-regular) var(--fs-md)/var(--lh) var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
code, .mono { font-family: var(--font-mono); font-size: var(--fs-sm); }
[hidden] { display: none !important; }

/* ---- status classes (the ONLY way a status colour reaches the page) ----------------------------------- */
.st-over       { color: var(--red-ink); }
.st-over.cell-box, .row-over > td { background: var(--red-wash); }
.row-over > td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.unverified    { color: var(--amber-ink); }
.verified      { color: var(--green-ink); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: var(--fw-medium); border: 1px solid transparent; white-space: nowrap; vertical-align: 1px; }
.pill-watch      { color: var(--watch-ink); background: var(--watch-bg); border-color: var(--watch-line); }
.pill-over       { color: var(--red-ink); background: var(--red-wash); border-color: var(--red-line); }
.pill-unverified { color: var(--amber-ink); background: var(--amber-wash); border-color: var(--amber-line); }
.pill-verified   { color: var(--green-ink); background: var(--green-wash); border-color: var(--green-line); }
/* SCHEMA-2: "Doesn't apply" — closed, but neither good nor bad news */
.pill-quiet      { color: var(--ink-dim); background: var(--surface); border-color: var(--line-strong); }
/* REPORT-7B: a client's own site icon, wherever a client is named (src/client-icons.js sets its size) */
.client-icon { display: inline-block; flex: none; vertical-align: middle; border-radius: 22%; object-fit: contain; background: #fff; border: 1px solid var(--line-strong); box-sizing: border-box; margin: -2px .45em 0 0; }
.vp-wholink .client-icon { margin: 0; } /* the Reports row spaces its own square */
.fnote.stance    { color: var(--ink-dim); white-space: normal; }
.note-unverified { color: var(--amber-ink); background: var(--amber-wash); border: 1px solid var(--amber-line); border-radius: var(--radius-md); padding: var(--sp-2) var(--sp-3); }
.note-verified   { color: var(--green-ink); background: var(--green-wash); border: 1px solid var(--green-line); border-radius: var(--radius-md); padding: var(--sp-2) var(--sp-3); }

/* ---- 3. SHELL ------------------------------------------------------------------------------------------- */
.shell-header { position: sticky; top: 0; z-index: 20; height: var(--header-h); display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-4); background: var(--brand-navy); color: var(--on-brand); box-shadow: var(--shadow-sm); }
.shell-brand { font-weight: var(--fw-bold); font-size: var(--fs-lg); letter-spacing: .2px; }
.shell-brand small { font-weight: var(--fw-regular); color: var(--on-brand-dim); margin-left: var(--sp-2); font-size: var(--fs-sm); }
.shell-spacer { flex: 1; }
.shell-user { color: var(--on-brand-dim); font-size: var(--fs-sm); }
.btn-on-brand { font: inherit; font-size: var(--fs-sm); color: var(--on-brand); background: transparent; border: 1px solid rgba(255,255,255,.35); border-radius: var(--radius-sm); padding: 4px 10px; cursor: pointer; }
.btn-on-brand:hover { background: rgba(255,255,255,.10); }
/* SHELL-AEO2: the one button that opens and closes the left menu, on every screen (src/shell.js) */
.menu-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; }
.menu-btn svg { width: 16px; height: 16px; flex: none; }

.shell-body { display: flex; min-height: calc(100vh - var(--header-h)); }
.shell-nav { width: var(--nav-w); flex: none; background: var(--brand-navy-deep); color: var(--on-brand-dim); padding: var(--sp-3) var(--sp-2); transition: width .15s ease; }
.shell-nav.collapsed { width: var(--nav-w-collapsed); }
.shell-nav.collapsed .nav-label { display: none; }
.nav-item { display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; padding: 0 var(--sp-3); margin: 2px 0; border-radius: var(--radius-md); color: var(--nav-ink); text-decoration: none; font-weight: var(--fw-medium); }   /* DASH-2: 44px tall */
.nav-item:hover { background: rgba(255,255,255,.07); color: var(--on-brand); }
.nav-item.active { background: var(--sales-blue); color: var(--on-brand); font-weight: 600; }   /* DASH-2: the current one blue */
.nav-item svg { width: 20px; height: 20px; flex: none; }
.nav-empty { padding: var(--sp-3); font-size: var(--fs-sm); color: var(--on-brand-dim); }
.shell-main { flex: 1; min-width: 0; padding: var(--sp-5); }
.shell-main > .inner { max-width: var(--content-max); margin: 0 auto; }

@media (max-width: 767px) {
  .shell-nav { position: fixed; top: var(--header-h); bottom: 0; left: 0; z-index: 30; transform: translateX(-100%); transition: transform .15s ease; width: var(--nav-w); }
  .shell-nav.open { transform: none; box-shadow: var(--shadow-md); }
  .shell-nav.collapsed { width: var(--nav-w); }
  .shell-nav.collapsed .nav-label { display: inline; }
  .shell-main { padding: var(--sp-3); }
  .shell-user { display: none; }
}

/* ---- sign-in ------------------------------------------------------------------------------------------- */
.signin { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: var(--sp-4); }
.signin form { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: var(--sp-6) var(--sp-5); }
.signin h1 { margin: 0 0 var(--sp-1); font-size: var(--fs-2xl); color: var(--brand-navy); }
.signin p { margin: 0 0 var(--sp-5); color: var(--ink-mute); font-size: var(--fs-sm); }
.field { display: block; width: 100%; margin-bottom: var(--sp-3); padding: 11px 13px; font: inherit; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.field:focus { outline: 2px solid var(--brand-blue-pale); border-color: var(--brand-blue); }
.btn-primary { width: 100%; padding: 11px; font: inherit; font-weight: var(--fw-bold); color: var(--on-brand); background: var(--accent); border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.form-error { margin-top: var(--sp-3); min-height: 18px; font-size: var(--fs-sm); color: var(--red-ink); }

/* ---- 4. COMPONENTS -------------------------------------------------------------------------------------- */
.page-title { margin: 0 0 var(--sp-1); font-size: var(--fs-xl); font-weight: var(--fw-bold); }
.page-sub { margin: 0 0 var(--sp-4); color: var(--ink-mute); font-size: var(--fs-sm); }
.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--line); margin-bottom: var(--sp-4); overflow-x: auto; }
.tab { padding: var(--sp-2) var(--sp-4); color: var(--ink-dim); text-decoration: none; font-weight: var(--fw-medium); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.frame-line { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); align-items: flex-start; margin-bottom: var(--sp-4); font-size: var(--fs-sm); color: var(--ink-mute); }
.frame-line .nt { flex-basis: 100%; }
.frame-line ul { margin: var(--sp-1) 0 0; padding-left: var(--sp-5); }

.grid { display: grid; gap: var(--sp-4); }
.grid-cards { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
/* P-128: Dashboard cards are links; the whole card is the target. */
.card-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.card-link:hover, .card-link:focus-visible { border-color: var(--brand-blue); box-shadow: var(--shadow-md); }
.card-link .card-go { margin-top: var(--sp-3); font-size: var(--fs-sm); color: var(--accent); }
/* P-128: the Needs-attention list. Colour comes only from the pills (sacred status set). */
.attention { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.attention .att { display: flex; align-items: baseline; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.attention .att:last-child { border-bottom: 0; }
.attention .att-text { flex: 1; }
.attention .att-go { white-space: nowrap; font-size: var(--fs-sm); color: var(--accent); }
@media (max-width: 767px) { .attention .att { flex-wrap: wrap; } .attention .att-go { width: 100%; } }
/* DASH-1: Needs you, the Dashboard's first card. Green only when clear; an ordinary list is plain; red only for a ceiling or an outage. */
.needs-you { margin-top: 0; margin-bottom: var(--sp-5); }
.needs-you .ny-head { display: flex; align-items: center; gap: var(--sp-2); }
.pill-count { color: var(--ink); background: var(--surface); border-color: var(--line-strong); }
.ny-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.ny-red .ny-list { border-color: var(--red-line); }
.ny-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.ny-item:last-child { border-bottom: 0; }
.ny-item-red { background: var(--red-wash); box-shadow: inset 3px 0 0 var(--red); }
.ny-client { flex: 0 0 200px; font-weight: var(--fw-bold); }
.ny-what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ny-detail { font-size: var(--fs-sm); color: var(--ink-mute); }
.ny-acts { display: flex; gap: var(--sp-2); white-space: nowrap; }
.ny-go { text-decoration: none; color: var(--accent); }
.ny-said { flex-basis: 100%; }
.ny-said:empty { display: none; }
#ny-said { margin-bottom: var(--sp-3); }
@media (max-width: 767px) { .ny-client { flex-basis: 100%; } .ny-acts { width: 100%; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); padding: var(--sp-4); }
.card h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--ink-mute); text-transform: none; }
.card .big { font-size: var(--fs-2xl); font-weight: var(--fw-bold); line-height: 1.15; }
/* P-127: an amber (partial / not verified) big number keeps the card's size; only the colour says it is partial. A status
   pill after a number ("over", "near target") stays pill-sized (P-128). */
.card .big .pill-unverified { font-size: inherit; font-weight: inherit; padding: 0 var(--sp-2); border-radius: var(--radius-sm); vertical-align: baseline; }
.card .sub { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--ink-dim); }
.section { margin-top: var(--sp-5); }
.section > h2 { margin: 0 0 var(--sp-3); font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.section > .hint { margin: calc(-1 * var(--sp-2)) 0 var(--sp-3); font-size: var(--fs-sm); color: var(--ink-mute); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.data th { text-align: left; font-weight: var(--fw-medium); color: var(--ink-mute); background: var(--surface-alt); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.reason { max-width: 520px; color: var(--ink-dim); }

.bars { display: grid; gap: var(--sp-2); }
.bar-row { display: grid; grid-template-columns: minmax(120px, 220px) 1fr auto; gap: var(--sp-3); align-items: center; font-size: var(--fs-sm); }
.bar-track { height: 10px; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: calc(var(--f, 0) * 100%); background: var(--brand-blue); border-radius: 999px; }
.bar-fill.pre { background: var(--line-strong); }

.story { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.story-line { display: flex; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.story-line:last-child { border-bottom: 0; font-weight: var(--fw-bold); font-size: var(--fs-lg); }
.story-line .v { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 0; text-align: right; }
/* SHELL-AEO2: an amount never wraps; the list of what is missing (a sentence of any length) does, so the line fits its page */
.story-line > div:first-child { min-width: 0; }
.story-line .v span.unverified { white-space: normal; }
/* P-127: the amber "partial: data starts …" line under a window's number. */
.partial-note { margin-top: var(--sp-1); font-size: var(--fs-sm); font-weight: var(--fw-regular); }

.side-by-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--sp-4); }
dl.kv { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2) var(--sp-4); margin: 0; font-size: var(--fs-sm); }
dl.kv dt { color: var(--ink-mute); }
dl.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.state { padding: var(--sp-5); border-radius: var(--radius-md); border: 1px dashed var(--line-strong); color: var(--ink-mute); background: var(--surface); text-align: center; }
.state-error { border: 1px solid var(--red-line); border-style: solid; background: var(--red-wash); color: var(--red-ink); text-align: left; }
.empty { color: var(--ink-mute); font-style: italic; }
.muted { color: var(--ink-mute); }
details summary { cursor: pointer; color: var(--accent); font-size: var(--fs-sm); margin: var(--sp-2) 0; }

/* ---- CMR-S1 / S2: CLIENTS (the new Client Manager) -------------------------------------------------------------------
   Neutral components only. Amber = "needs filling" (a required field not closed). Green = a section whose required
   fields are all closed, or a stored "verified" / "approved" answer. Red = the article gate's HARD_STOP (from
   /readiness), and a save that failed or a value that was refused. */
.nav-sub { display: flex; align-items: center; padding: 5px var(--sp-3) 5px 44px; margin: 0 0 2px; border-radius: var(--radius-sm); color: var(--on-brand-dim); text-decoration: none; font-size: var(--fs-sm); }
.nav-sub small { color: var(--on-brand-dim); opacity: .75; font-size: var(--fs-xs); }
.nav-sub:hover { background: rgba(255,255,255,.07); color: var(--on-brand); }
.nav-sub.active { color: var(--on-brand); background: rgba(255,255,255,.10); }
/* Icons only while a tool needs the width (a Clients record is open). The saved preference is untouched. */
.shell-nav.compact { width: var(--nav-w-collapsed); }
.shell-nav.compact .nav-label { display: none; }
@media (max-width: 767px) { .shell-nav.compact { width: var(--nav-w); } .shell-nav.compact .nav-label { display: inline; } }
/* SHELL-AEO2: with the menu closed, an icon shows its name at once on hover (or when reached by keyboard): no waiting for
   the browser's own tooltip. Not on a phone, where the menu always has its names. */
@media (min-width: 768px) {
  .shell-nav:is(.collapsed, .compact) .nav-item { position: relative; }
  .shell-nav:is(.collapsed, .compact) .nav-item::after { content: attr(data-label); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); z-index: 40; visibility: hidden; pointer-events: none; white-space: nowrap; padding: 5px 10px; border-radius: var(--radius-sm); background: #101828; color: #fff; font-size: var(--fs-sm); font-weight: var(--fw-medium); box-shadow: var(--shadow-md); }
  .shell-nav:is(.collapsed, .compact) .nav-item:is(:hover, :focus-visible)::after { visibility: visible; }
}

.pill-stage { color: var(--accent); background: var(--brand-blue-pale); border-color: rgba(36, 148, 224, .25); }
.tag { display: inline-block; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: var(--fs-xs); color: var(--ink-dim); background: var(--surface); white-space: nowrap; line-height: 18px; }
.tag-quiet { border-color: var(--line); color: var(--ink-mute); }
.muted-line { font-size: var(--fs-sm); color: var(--ink-mute); }

/* The list */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-4); }
.toolbar .field { width: 280px; max-width: 100%; margin: 0; padding: 7px 11px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.chip-btn { font: inherit; font-size: var(--fs-sm); padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-dim); cursor: pointer; }
.chip-btn:hover { border-color: var(--brand-blue); }
.chip-btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-brand); }
.chip-btn .n { opacity: .75; margin-left: 4px; }
.toggle { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-sm); color: var(--ink-dim); }
table.data tr.row-link { cursor: pointer; }
table.data tr.row-link:hover > td { background: var(--surface-alt); }
table.data td .under { display: block; font-size: var(--fs-xs); color: var(--ink-mute); margin-top: 2px; }
table.data td a.client-link { color: var(--ink); font-weight: var(--fw-medium); text-decoration: none; }
table.data td a.client-link:hover { color: var(--accent); }
.progress { display: block; width: 140px; height: 4px; margin-top: 5px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; width: calc(var(--n, 0) / var(--d, 1) * 100%); background: var(--brand-blue); border-radius: 999px; }

/* The record: column of sections + the open section */
.rec-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-4); }
.rec-top h1 { margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-bold); }
.rec-top .back { font-size: var(--fs-sm); text-decoration: none; flex-basis: 100%; }
.rec-top .sent { font-size: var(--fs-sm); color: var(--ink-mute); }
.rec { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.rec-col { position: sticky; top: calc(var(--header-h) + var(--sp-3)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); padding: var(--sp-2); }
.rec-part { margin: var(--sp-3) var(--sp-2) var(--sp-1); font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute); }
.rec-part:first-child { margin-top: var(--sp-1); }
.rec-sec { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 6px var(--sp-2); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font-size: var(--fs-md); }
.rec-sec:hover { background: var(--surface-alt); }
.rec-sec.active { background: var(--brand-blue-pale); color: var(--accent); font-weight: var(--fw-medium); }
.rec-sec .count { font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.rec-pane { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.rec-pane > h2 { margin: 0 0 var(--sp-1); font-size: var(--fs-lg); font-weight: var(--fw-bold); }
@media (max-width: 900px) { .rec { grid-template-columns: 1fr; } .rec-col { position: static; } .rec-pane { padding: var(--sp-3); } }

.fgroup { margin-top: var(--sp-5); }
.fgroup > h3 { margin: 0 0 var(--sp-2); padding-bottom: var(--sp-1); font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-dim); border-bottom: 1px solid var(--line); }
.frow { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--sp-1) var(--sp-4); padding: var(--sp-2) 0; border-bottom: 1px dashed var(--line); }
.frow:last-child { border-bottom: 0; }
.frow .flabel { font-size: var(--fs-sm); color: var(--ink-dim); font-weight: var(--fw-medium); }
.frow .flabel .tag { margin-top: 3px; }
.frow .flabel .sub { display: block; font-weight: var(--fw-regular); color: var(--ink-mute); font-size: var(--fs-xs); }
.fval { font-size: var(--fs-md); white-space: pre-wrap; overflow-wrap: anywhere; }
.fval.empty-box { min-height: 30px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-alt); }
.fval .none { color: var(--ink-mute); font-style: italic; }
.fmeta { margin-top: var(--sp-1); font-size: var(--fs-xs); color: var(--ink-mute); }
.fkey { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); }
.fnote { margin-top: var(--sp-1); font-size: var(--fs-sm); color: var(--ink-dim); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line-strong); vertical-align: -2px; margin-right: 6px; }
@media (max-width: 767px) { .frow { grid-template-columns: 1fr; } }

.rows { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.lrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-2); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); white-space: normal; }
.lrow:last-child { border-bottom: 0; }
.lrow .main { font-weight: var(--fw-medium); }
.lrow .line { flex-basis: 100%; font-size: var(--fs-xs); color: var(--ink-mute); }
.lrow .grow { flex: 1; min-width: 200px; }
.fval .table-wrap { box-shadow: none; white-space: normal; }
details.more summary { display: inline; margin: 0; font-size: var(--fs-xs); }
details.more[open] summary { display: block; margin-bottom: var(--sp-1); }
.open-line { margin-top: var(--sp-5); }
.soon { margin-top: var(--sp-3); }
.pager { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-3); font-size: var(--fs-sm); color: var(--ink-mute); }
.btn-quiet { font: inherit; font-size: var(--fs-sm); padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); cursor: pointer; }
.btn-quiet:disabled { opacity: .45; cursor: default; }
/* NAV-2: the menu's group labels (Money · Sales · Clients · Content · Results) — small grey capitals, no click, no fold; Settings
   under a plain line. Closed to icons, a label is a thin line between the groups. */
.nav-section { padding: 14px var(--sp-3) 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--on-brand-dim); opacity: .75; user-select: none; }
.nav-section.nav-rule { margin: 10px var(--sp-3) 6px; padding: 0; border-top: 1px solid rgba(255,255,255,.12); }
.shell-nav:is(.collapsed, .compact) .nav-section { margin: 6px 12px; padding: 0; height: 0; border-top: 1px solid rgba(255,255,255,.14); }
@media (max-width: 767px) { .shell-nav:is(.collapsed, .compact) .nav-section:not(.nav-rule) { margin: 0; padding: 14px var(--sp-3) 4px; height: auto; border-top: 0; } }
.nav-version { margin-top: var(--sp-2); padding: 0 var(--sp-3); font-size: 11px; color: var(--on-brand-dim); opacity: .6; }
.shell-nav.collapsed .nav-version, .shell-nav.compact .nav-version { display: none; }

/* CMR-S2: editing one field at a time */
.hdr-item { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); }
.hdr-item.editing { padding: var(--sp-1) var(--sp-2); border: 1px solid var(--brand-blue); border-radius: var(--radius-sm); background: var(--surface); }
.gate-line { flex-basis: 100%; font-size: var(--fs-sm); color: var(--red-ink); }
.edit-btn { font: inherit; font-size: var(--fs-xs); padding: 1px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--accent); cursor: pointer; }
.edit-btn:hover { border-color: var(--brand-blue); }
.link-btn { font: inherit; font-size: var(--fs-sm); padding: 0; border: 0; background: none; color: var(--accent); text-decoration: underline; cursor: pointer; }
.fval-edit { cursor: pointer; border-radius: var(--radius-sm); margin: -3px -6px; padding: 3px 6px; }
.fval-edit:hover, .fval-edit:focus-visible { background: var(--brand-blue-pale); outline: none; }
.fval-edit.empty-box { margin: 0; }
.fval-edit.empty-box:hover { border-color: var(--brand-blue); }
.fvalue-host.editing, .closeouts.editing, .fnote.editing, .fmeta.editing { padding: var(--sp-2); border: 1px solid var(--brand-blue); border-radius: var(--radius-sm); background: var(--surface); }
.field-sm { display: inline-block; width: auto; min-width: 220px; max-width: 100%; margin: 0; padding: 6px 10px; }
.fvalue-host .field-sm { width: 100%; }
.field-area { width: 100%; margin: 0; padding: 8px 10px; font: inherit; line-height: var(--lh); resize: vertical; }
.edit-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
.hdr-item .edit-actions { margin-top: 0; }
.btn-save { font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium); padding: 4px 14px; border: 0; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-brand); cursor: pointer; }
.btn-save:disabled { opacity: .6; cursor: wait; }
.edit-msg { flex-basis: 100%; margin-top: var(--sp-1); font-size: var(--fs-sm); color: var(--red-ink); }
.edit-msg:empty { display: none; }
.saved-flash { margin-left: var(--sp-2); font-size: var(--fs-xs); color: var(--ink-mute); }
.fitem > .saved-flash { display: block; margin: var(--sp-1) 0 0; }
.closeouts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); }
.closeouts.editing { display: block; }
.closeouts .btn-quiet { padding: 2px 10px; font-size: var(--fs-xs); }
.intake-step { margin-bottom: var(--sp-4); }
.intake-step-head { margin-bottom: var(--sp-2); font-size: var(--fs-sm); }
/* "Exclude by ruling…" is a rare act: quiet, and shown only while the reader is on that field (hover or keyboard focus). */
[data-exclude-host] { margin-top: 2px; }
[data-exclude-host] .link-btn { font-size: var(--fs-xs); color: var(--ink-mute); text-decoration: none; opacity: 0; transition: opacity .12s; }
.fitem:hover [data-exclude-host] .link-btn, [data-exclude-host] .link-btn:focus-visible { opacity: 1; }
[data-exclude-host] .link-btn:hover { color: var(--accent); text-decoration: underline; }
@media (hover: none) { [data-exclude-host] .link-btn { opacity: 1; } }

/* CMR-S3: list rows, one at a time */
.rows .lrow { position: relative; }
.row-edit { margin-left: auto; font: inherit; font-size: var(--fs-sm); line-height: 1; padding: 3px 7px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; color: var(--ink-mute); cursor: pointer; }
.row-edit:hover, .row-edit:focus-visible { border-color: var(--line-strong); color: var(--accent); background: var(--surface); }
.list-tools { margin-top: var(--sp-2); }
.add-row { padding: 2px 10px; font-size: var(--fs-xs); }
.row-editor-host:empty { display: none; }
.row-editor-host.editing { margin-top: var(--sp-2); padding: var(--sp-3); border: 1px solid var(--brand-blue); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.row-form-head { margin-bottom: var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-dim); }
.row-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-2) var(--sp-3); }
.row-cell { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-xs); color: var(--ink-mute); }
.row-cell .field-sm, .row-cell .field-area { width: 100%; min-width: 0; font-size: var(--fs-sm); }
.rule-line { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--ink-dim); }
.rule-line:empty { display: none; }
.rule-line.rule-block { color: var(--red-ink); }
.btn-delete { margin-left: auto; color: var(--red-ink); }
.btn-danger { background: var(--red); }
/* BILL-7: the action button (see --action). Off, it is plainly gray: nothing to send. */
.btn-action { font: inherit; font-size: var(--fs-md); font-weight: var(--fw-bold); padding: 8px 18px; border: 0; border-radius: var(--radius-sm); background: var(--action); color: var(--on-action); cursor: pointer; }
.btn-action:hover:not(:disabled), .btn-action:focus-visible { background: var(--action-hover); }
.btn-action:disabled { background: var(--line-strong); color: var(--ink-mute); cursor: not-allowed; }
.xw-form-actions .btn-action { flex: 1; padding: 11px 18px; }
.delete-ask { align-items: center; }
.conflict-line { margin-bottom: var(--sp-2); font-weight: var(--fw-medium); color: var(--red-ink); }
.conflict-table td { white-space: pre-wrap; }
.hnote { margin-top: 2px; font-size: var(--fs-xs); color: var(--ink-dim); }

/* CMR-S4: the old Client Manager's last tools (Add a client, Import, Library, Intake actions, Export, Preview) and the
   System admin pages (Users, Field registry, Fleet protection). Neutral components; colour only from verdicts and status. */
.verdict { margin: var(--sp-2) 0 var(--sp-3); text-align: left; }
.admin-card { margin: var(--sp-2) 0 var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.admin-card > h2 { margin: 0 0 var(--sp-2); font-size: var(--fs-lg); }
.admin-sub { margin: var(--sp-3) 0 var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-dim); }
.admin-editor-row > td { background: var(--surface-alt); }
.tools-picker { display: grid; gap: var(--sp-1); }
.tools-picker .field-area { margin-top: var(--sp-1); }
.secret-box { margin: var(--sp-2) 0 var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 2px solid var(--brand-blue); border-radius: var(--radius-md); background: var(--brand-blue-pale); }
.secret-box h3 { margin: 0 0 var(--sp-1); }
.secret-value { display: inline-block; margin: var(--sp-2) 0; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-lg); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); user-select: all; }
.add-client { text-decoration: none; display: inline-block; }
.confirm-box { margin-top: var(--sp-3); padding: var(--sp-3); border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--surface-alt); }
.rec-tools { display: inline-flex; gap: var(--sp-2); margin-left: auto; }
.rec-tools a.btn-quiet { text-decoration: none; }
.rec-top-verdict { flex-basis: 100%; }
.import-target { margin-bottom: var(--sp-2); }
.import-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-top: var(--sp-3); }
.import-bar .verdict { flex-basis: 100%; margin: 0; }
.import-refusal ul { margin: var(--sp-2) 0 0; padding-left: var(--sp-5); }
.count { font-weight: var(--fw-medium); }
.lib-part { margin-top: var(--sp-4); }
.lib-part-head { margin: var(--sp-3) 0 var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-dim); }
.lib-category h4 { margin: var(--sp-3) 0 var(--sp-1); font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--ink-mute); }
.lib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.lib-entry { padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: var(--fs-sm); }
.lib-entry-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); margin-bottom: 2px; }
.lib-claim { white-space: pre-wrap; }
.lib-why { margin-top: 2px; color: var(--ink-dim); font-style: italic; }
.lib-shelf { margin-top: var(--sp-2); padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-alt); }
.lib-summary { margin: var(--sp-2) 0 0; padding-left: var(--sp-5); font-size: var(--fs-sm); }
.intake-actions-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.intake-action { max-width: 360px; }
.intake-status { margin-bottom: var(--sp-2); }

/* CMR-S6: the monthly price (read-only, from billing) */
.money-big { font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }

/* AIV-DASH-1: AI Visibility Reports — the shared client picker, the latest-report card, and one row per month */
.client-picker { min-width: 240px; max-width: 100%; }
.aiv-latest .big { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.aiv-file { overflow-wrap: anywhere; }
.aiv-actions { margin-top: var(--sp-3); }
a.btn-quiet.aiv-open { display: inline-block; text-decoration: none; white-space: nowrap; }
/* VIS-3: the preview's holes, in the report's own red (a hole stops the send) */
.aiv-preview-out { margin-top: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); }
.aiv-preview-file { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.aiv-holes { color: var(--red-ink); background: var(--red-wash); border: 1px solid var(--red-line); border-radius: var(--radius-md); padding: var(--sp-3) var(--sp-4); }
.aiv-holes ul { margin: var(--sp-2) 0 0; padding-left: var(--sp-4); }
.aiv-hole { overflow-wrap: anywhere; margin-bottom: var(--sp-1); }
.aiv-hole-value { font-weight: var(--fw-bold); }
.aiv-months { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.aiv-month { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto auto; gap: var(--sp-2) var(--sp-4); align-items: start; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.aiv-month:last-child { border-bottom: 0; }
.aiv-month .aiv-actions { margin-top: 0; }
.aiv-wins { display: flex; gap: var(--sp-4); }
.aiv-cell { display: flex; flex-direction: column; gap: 2px; min-width: 64px; }
.aiv-label { font-size: var(--fs-xs); color: var(--ink-mute); }
.aiv-num { font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.aiv-others { margin-top: var(--sp-1); font-size: var(--fs-xs); color: var(--ink-mute); }
.aiv-others summary { cursor: pointer; }
.aiv-others ul { margin: var(--sp-1) 0 0; padding-left: var(--sp-4); }
@media (max-width: 900px) { .aiv-month { grid-template-columns: 1fr; } .aiv-wins { flex-wrap: wrap; } }

/* AIV-23: the buttons beside a report, the all-time line, the race, and the resend email shown before it is sent */
.aiv-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.aiv-slot:empty { display: none; }
.aiv-slot { margin-top: var(--sp-3); }
.aiv-month .aiv-slot { grid-column: 1 / -1; margin-top: var(--sp-1); }
.aiv-alltime { margin-top: var(--sp-1); }
.aiv-place { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--sp-3); }
.aiv-place strong { font-size: var(--fs-lg); }
.aiv-race-rows { list-style: none; margin: 0; padding: 0; }
.aiv-race-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-4); padding: var(--sp-2) 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.aiv-race-row.is-client { font-weight: var(--fw-bold); color: var(--accent); }
.aiv-race-name { overflow-wrap: anywhere; }
.aiv-race-tag { margin-left: var(--sp-2); font-weight: var(--fw-medium); }
.aiv-mail { border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: var(--sp-4); background: var(--surface); max-width: 720px; }
.aiv-mail h3 { margin: 0 0 var(--sp-3); font-size: var(--fs-md); }
.aiv-mail-line { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: var(--sp-2); font-size: var(--fs-sm); padding: 2px 0; }
.aiv-mail-value { overflow-wrap: anywhere; }
.aiv-mail-body { margin: var(--sp-3) 0; padding: var(--sp-3); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; font-size: var(--fs-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.aiv-mail-approve { margin: var(--sp-2) 0; font-size: var(--fs-sm); }
.aiv-mail-out { margin-top: var(--sp-2); }

/* AUD-7: LEADS — the list's filters, the pipeline board, one lead's record and its audit. Neutral components; colour only
   from the status set: red = failed / not saved / no answer, amber = not complete or not checked, green = a Google profile
   itv-core confirmed. "Ready" is the plain brand pill. */
.leads-bar select.field { width: auto; min-width: 150px; max-width: 100%; }
.lead-tags { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); }
.lead-tag { display: inline-flex; align-items: center; gap: 2px; }
.lead-tag-x { font: inherit; line-height: 1; padding: 0 2px; border: 0; background: none; color: var(--ink-mute); cursor: pointer; }
.lead-tag-x:hover, .lead-tag-x:focus-visible { color: var(--red-ink); }
a.btn-quiet.lead-cancel { display: inline-block; text-decoration: none; }
.lead-checks { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); margin: var(--sp-3) 0; }
.lead-note { margin: var(--sp-2) 0; padding: var(--sp-2) var(--sp-3); border: 1px solid rgba(36, 148, 224, .25); border-radius: var(--radius-md); background: var(--brand-blue-pale); color: var(--ink); font-size: var(--fs-sm); }

/* the board: one column per stage, scrolling sideways inside itself (never the page) */
.board-hint { margin: 0 0 var(--sp-2); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: var(--sp-3); align-items: start; overflow-x: auto; padding-bottom: var(--sp-2); }
.board-col { display: flex; flex-direction: column; min-height: 180px; background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-md); }
.board-col.drop { border-color: var(--brand-blue); background: var(--brand-blue-pale); }
.board-col-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); font-weight: var(--fw-bold); border-bottom: 1px solid var(--line); }
.board-col-head .n { font-weight: var(--fw-medium); color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.board-col-note { padding: var(--sp-1) var(--sp-3) 0; font-size: 11px; color: var(--ink-mute); }
.board-cards { flex: 1; display: grid; align-content: start; gap: var(--sp-2); padding: var(--sp-2); }
.board-none { padding: var(--sp-3) var(--sp-2); font-size: var(--fs-xs); color: var(--ink-mute); text-align: center; }
.lead-card { display: grid; gap: var(--sp-1); padding: var(--sp-2) var(--sp-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-xs); font-size: var(--fs-sm); cursor: grab; overflow-wrap: anywhere; }
.lead-card:hover { border-color: var(--brand-blue); }
.lead-card.is-dragging, .lead-card.is-moving { opacity: .5; }
.lead-card .client-link { color: var(--ink); font-weight: var(--fw-medium); text-decoration: none; }
.lead-card .client-link:hover { color: var(--accent); }
.lead-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); }
.lead-card .lead-move { width: 100%; min-width: 0; padding: 3px 6px; font-size: var(--fs-xs); color: var(--ink-dim); }

/* the record: who and stage on the left, the audit on the right */
.lead-missing { margin-bottom: var(--sp-4); }
.lead-grid { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.lead-side, .lead-main { min-width: 0; }
.lead-side .admin-card:first-child, .lead-main .admin-card:first-child { margin-top: 0; }
@media (max-width: 1100px) { .lead-grid { grid-template-columns: 1fr; } }
.lead-who .frow { grid-template-columns: 124px minmax(0, 1fr); }
@media (max-width: 767px) { .lead-who .frow { grid-template-columns: 1fr; } }
.lead-typed { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-1) var(--sp-4); }
.lead-typed > .fval, .lead-typed > .fvalue-host { flex: 1 1 150px; min-width: 0; }
.lead-typed > .fval-edit { margin: -3px 0 -3px -6px; }
.lead-typed > .fval-edit.empty-box { margin: 0; }
.lead-used { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding-left: var(--sp-3); border-left: 2px solid var(--line-strong); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.lead-edits { margin-top: var(--sp-3); }
.lead-history { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); }
.lead-history li { padding: var(--sp-2) 0; border-bottom: 1px dashed var(--line); overflow-wrap: anywhere; }
.lead-history li:last-child { border-bottom: 0; }
.lead-stage-now { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); font-size: var(--fs-sm); }
.lead-stage-form { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.lead-stage-form .field-sm { flex: 1 1 140px; min-width: 0; }

/* the audit */
.lead-audit-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.lead-audit-top h2 { margin: 0; font-size: var(--fs-lg); }
.lead-audit-status { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) var(--sp-3); margin: var(--sp-2) 0 var(--sp-3); font-size: var(--fs-md); }
.lead-audit-status .pill { font-size: var(--fs-sm); padding: 2px 10px; }
.lead-block { margin-top: var(--sp-4); }
.lead-block-hint { margin: calc(-1 * var(--sp-1)) 0 var(--sp-2); }
.lead-pillar-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--sp-3); }
.lead-pillar h3 { color: var(--ink); font-size: var(--fs-md); font-weight: var(--fw-bold); }
.lead-rungs { list-style: none; margin: 0; padding: 0; }
.lead-rung { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-2) 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.lead-rung-words { color: var(--ink-dim); }
.lead-rung-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--sp-1); white-space: pre-wrap; }
.lead-rung-count .aiv-num { font-size: var(--fs-lg); }
.lead-na { font-weight: var(--fw-medium); color: var(--ink-mute); }
.lead-rung-count .muted-line { flex-basis: 100%; font-size: var(--fs-xs); }
.lead-engines { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-2); }
.lead-engine { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: var(--fs-sm); }
.lead-engine.is-yes { border-color: var(--brand-blue); }
.lead-engine .pill { white-space: normal; }
@media (max-width: 900px) { .lead-engines { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); } }
.lead-named { margin: 0; padding-left: var(--sp-5); font-size: var(--fs-sm); }
.lead-named li { padding: 3px 0; }
.lead-named-name { font-weight: var(--fw-medium); margin-right: var(--sp-2); }
.lead-unchecked { margin: 0; padding-left: var(--sp-6); font-size: var(--fs-sm); }
.lead-facts { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: var(--sp-2) var(--sp-4); margin: 0; font-size: var(--fs-sm); }
.lead-facts dt { color: var(--ink-mute); }
.lead-facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 767px) { .lead-facts { grid-template-columns: 1fr; gap: 2px; } .lead-facts dd { margin-bottom: var(--sp-2); } }
.lead-url { overflow-wrap: anywhere; }
.lead-q { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: var(--sp-2); padding: 0 var(--sp-3); }
.lead-q > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-2); margin: 0; padding: var(--sp-2) 0; color: var(--ink); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.lead-q[open] > summary { border-bottom: 1px solid var(--line); }
.lead-answer { padding: var(--sp-3) 0; border-bottom: 1px dashed var(--line); font-size: var(--fs-sm); }
.lead-answer:last-child { border-bottom: 0; }
.lead-answer-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); margin-bottom: var(--sp-1); }
.lead-answer-named { margin-bottom: var(--sp-1); }
.lead-answer-text { margin: var(--sp-2) 0; padding: var(--sp-3); max-height: 420px; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; font-size: var(--fs-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.lead-sources { margin: 0; padding-left: var(--sp-5); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.lead-soon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-3); margin-top: var(--sp-4); }
.lead-soon { border-style: dashed; box-shadow: none; background: var(--surface-alt); }
.lead-soon h3 { color: var(--ink); font-weight: var(--fw-bold); }

/* AUD-17: AI VISIBILITY › QUESTION LISTS — the overview, one client's list, and a test run's picture. Neutral components;
   colour only from the status set: red = a save that failed, an AI that gave no answer, a fact AI got wrong, a run that
   failed. Amber = areas only proposed, an answer cut off, a run stopped at its limit. Green = an approved list.
   "Recommended" is the plain brand pill. */
a.btn-quiet.ql-open { display: inline-block; text-decoration: none; }
.ql-key { margin-top: var(--sp-3); }
.ql-count { font-size: var(--fs-md); color: var(--ink-dim); }
.ql-count strong { font-size: var(--fs-lg); color: var(--ink); font-variant-numeric: tabular-nums; }
.ql-areas h3 { color: var(--ink); font-size: var(--fs-md); font-weight: var(--fw-bold); }
.ql-area-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-4); }
.ql-area { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.ql-area-value { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: var(--fs-lg); overflow-wrap: anywhere; }
.ql-area .fvalue-host .field-sm { width: 100%; }
.ql-group { margin-top: var(--sp-4); }
.ql-group-title { margin: 0 0 var(--sp-2); padding-bottom: var(--sp-1); font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--ink); border-bottom: 1px solid var(--line); }
.ql-part-label { margin: var(--sp-3) 0 var(--sp-1); font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute); }
.ql-group-empty { padding: var(--sp-2) 0; font-size: var(--fs-sm); }
.ql-lines { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.ql-line { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.ql-line:last-child { border-bottom: 0; }
.ql-line.is-editing { display: block; }
.ql-line-main { flex: 1; min-width: 0; }
.ql-q { font-size: var(--fs-lg); line-height: 1.4; overflow-wrap: anywhere; }
.ql-for { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); margin-top: 2px; font-size: var(--fs-xs); color: var(--ink-dim); }
/* REPORT-7B: a long area label wraps on a phone instead of pushing the page sideways */
.ql-for .tag { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
.ql-line-actions { display: flex; gap: var(--sp-1); flex: none; }
.ql-advice { margin-top: var(--sp-2); padding: var(--sp-1) var(--sp-3); border-left: 3px solid var(--brand-blue); background: var(--brand-blue-pale); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: var(--fs-sm); color: var(--ink); overflow-wrap: anywhere; }
.ql-flash { display: block; margin: var(--sp-2) 0 0; font-size: var(--fs-sm); color: var(--ink-dim); }
.ql-line .row-cell { margin-bottom: var(--sp-2); }
.ql-sf { max-width: 420px; }
.ql-add { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-top: var(--sp-3); }
.ql-add.row-editor-host { display: block; }
.ql-add .row-cell { margin-bottom: var(--sp-2); }
.ql-suggestions, .ql-cutbox { margin-top: var(--sp-5); }
.ql-suggestions h3 { color: var(--ink); font-size: var(--fs-md); font-weight: var(--fw-bold); }
.ql-suggestions .ql-lines, .ql-cutbox .ql-lines { box-shadow: none; }
.ql-suggestion .ql-q, .ql-was-cut .ql-q { font-size: var(--fs-md); }
.ql-foot { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sp-3) var(--sp-5); margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.ql-foot .confirm-box { margin-top: 0; max-width: 640px; }
.ql-tool { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.ql-approve { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); max-width: 640px; }
.ql-approve .btn-save:disabled { cursor: not-allowed; }
#ql-test { margin-top: var(--sp-6); padding-top: var(--sp-2); border-top: 1px solid var(--line-strong); }
#ql-test .confirm-box { max-width: 640px; }
.ql-picture { margin-top: var(--sp-4); }
.ql-picture-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); }
.ql-picture-head h3 { margin: 0; font-size: var(--fs-lg); }
.ql-picture-head .muted-line { flex-basis: 100%; }
.ql-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); margin: var(--sp-3) 0; font-size: var(--fs-sm); }
.ql-legend .muted-line { flex-basis: 100%; }
.ql-legend-item { display: inline-flex; align-items: center; gap: 6px; }

/* the three marks: a circle, a square and a diamond; filled = yes, outline = no */
.ql-mark { display: inline-block; flex: none; width: 13px; height: 13px; border: 2px solid var(--line-strong); background: var(--surface); }
.ql-m-uses { border-radius: 50%; }
.ql-m-cites { border-radius: 2px; }
.ql-m-recs { width: 11px; height: 11px; margin: 0 3px; transform: rotate(45deg); border-radius: 1px; }
.ql-m-uses.is-yes { background: var(--mark-uses); border-color: var(--mark-uses); }
.ql-m-cites.is-yes { background: var(--mark-cites); border-color: var(--mark-cites); }
.ql-m-recs.is-yes { background: var(--mark-recommends); border-color: var(--mark-recommends); }
.ql-m-uses.is-wrong { background: var(--red-wash); border-color: var(--red); }
.ql-m-recs.is-nobody { border-style: dotted; }
.ql-marks { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 22px; }
.ql-marks + .ql-marks { margin-top: var(--sp-1); padding-top: var(--sp-1); border-top: 1px dashed var(--line); }
.ql-place { min-width: 26px; font-size: var(--fs-xs); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; color: var(--mark-recommends); }
.ql-facts { flex-basis: 100%; display: flex; flex-direction: column; gap: 1px; font-size: var(--fs-xs); color: var(--ink-dim); }
table.ql-grid th.ql-grid-q { min-width: 260px; max-width: 420px; white-space: normal; background: var(--surface); font-weight: var(--fw-regular); color: var(--ink); text-align: left; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); vertical-align: top; }
table.ql-grid .ql-q { font-size: var(--fs-sm); }
table.ql-grid td.ql-cell { min-width: 104px; white-space: nowrap; }
table.ql-grid td.ql-cond { white-space: nowrap; }
table.ql-grid tr.ql-grid-group th { background: var(--surface-alt); color: var(--ink-dim); font-weight: var(--fw-bold); border-top: 1px solid var(--line); }
.ql-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: var(--sp-4); margin-top: var(--sp-4); }
.ql-source h3 { color: var(--ink); font-size: var(--fs-md); font-weight: var(--fw-bold); }
.ql-source-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-4); }
.ql-sub { margin-bottom: var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-dim); }
.ql-from-sites, .ql-related { margin-top: var(--sp-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.ql-cost { margin-top: var(--sp-4); max-width: 640px; }
.ql-cost-more .table-wrap { margin-top: var(--sp-2); box-shadow: none; }
.ql-past-row { display: grid; grid-template-columns: 250px minmax(0, 1fr) auto auto; gap: var(--sp-2) var(--sp-4); align-items: center; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.ql-past-row:last-child { border-bottom: 0; }
.ql-past-row.is-shown { background: var(--brand-blue-pale); }
.ql-past-note { overflow-wrap: anywhere; }
@media (max-width: 900px) { .ql-past-row { grid-template-columns: 1fr; } .ql-line { flex-wrap: wrap; } }

/* AUD-23: LEADS — an audit on the new questions on a lead's record (the questions as asked, the results as the report
   shows them, the report's three buttons, Send locked, ask again or rebuild), "Needs your look", and the form's hints.
   Neutral components; colour only from the status set. The marks are told apart by SHAPE first and always carry their word. */
.tab-count { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--amber-ink); background: var(--amber-wash); border: 1px solid var(--amber-line); }
.row-cell[hidden] { display: none; }
.lead-hint { font-size: var(--fs-xs); color: var(--ink-mute); }
a.lead-open { display: inline-block; text-decoration: none; }

/* Needs your look */
.look-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.look-row { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); padding: var(--sp-3) var(--sp-4); }
.look-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); margin-bottom: var(--sp-2); }
.look-name { font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--ink); text-decoration: none; }
.look-name:hover { color: var(--accent); }
.look-why ul { margin: 2px 0 var(--sp-2); padding-left: var(--sp-5); }

/* the hold, on the record */
.lead-held-go { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-top: var(--sp-2); }
.lead-held-go .field-sm { flex: 1 1 220px; }

/* the questions that were asked */
.lead-qas { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.lead-qa { display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.lead-qa:last-child { border-bottom: 0; }
.lead-qa-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-blue-pale); color: var(--accent); font-size: var(--fs-sm); font-weight: var(--fw-bold); display: flex; align-items: center; justify-content: center; }
.lead-qa-main { flex: 1; min-width: 0; }
.lead-qa-text { font-size: var(--fs-lg); line-height: 1.4; overflow-wrap: anywhere; }
.lead-qa-meta { display: flex; flex-wrap: wrap; gap: 0 var(--sp-2); margin-top: 2px; }
.lead-qa-meta .muted-line + .muted-line::before { content: "·"; margin-right: var(--sp-2); }
.lead-qa-from { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-2); margin-top: var(--sp-1); font-size: var(--fs-sm); }
.lead-qa-evidence { flex-basis: 100%; overflow-wrap: anywhere; }
.lead-line { margin-top: var(--sp-2); padding: var(--sp-2) var(--sp-3); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-alt); }
.lead-line-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-1); }
.lead-line-text { font-size: var(--fs-md); overflow-wrap: anywhere; }
.lead-line textarea.field { width: 100%; margin: 0 0 var(--sp-1); padding: 8px 10px; font-size: var(--fs-md); resize: vertical; }
.lead-line-problem { max-width: 360px; margin-bottom: var(--sp-2); }

/* what came back */
.lead-verdict-line { font-size: var(--fs-2xl); font-weight: var(--fw-bold); line-height: 1.2; color: var(--brand-navy); }
.lead-say { margin: var(--sp-3) 0 0; padding: var(--sp-2) var(--sp-3); border-left: 3px solid var(--brand-blue); background: var(--brand-blue-pale); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: var(--fs-md); }
.lead-say-why { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--ink-dim); }
table.lead-marks th.lead-marks-label { text-align: left; font-weight: var(--fw-medium); color: var(--ink); background: var(--surface); white-space: normal; min-width: 180px; max-width: 340px; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); vertical-align: top; }
table.lead-marks td { white-space: nowrap; min-width: 112px; }
.lead-marks-q { font-weight: var(--fw-regular); font-size: var(--fs-xs); }
.lead-mark { display: inline-flex; align-items: center; gap: 6px; }
.lead-mark-shape { display: inline-block; flex: none; width: 12px; height: 12px; border: 2px solid var(--line-strong); border-radius: 50%; background: var(--surface); }
.lead-mark-shape.is-right, .lead-mark-shape.is-named { background: var(--mark-uses); border-color: var(--mark-uses); }
.lead-mark-shape.is-first { width: 11px; height: 11px; margin: 0 2px; border-radius: 1px; transform: rotate(45deg); background: var(--mark-recommends); border-color: var(--mark-recommends); }
.lead-mark-shape.is-wrong { border-radius: 2px; background: var(--red-wash); border-color: var(--red); }
.lead-ranks { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.lead-rank { display: grid; grid-template-columns: 32px minmax(0, 1fr) 56px minmax(0, 190px); gap: var(--sp-2) var(--sp-3); align-items: baseline; padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.lead-rank:last-child { border-bottom: 0; }
.lead-rank.is-you { background: var(--brand-blue-pale); font-weight: var(--fw-medium); }
.lead-rank-n { font-weight: var(--fw-bold); color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.lead-rank-name { overflow-wrap: anywhere; }
.lead-rank-name .tag { margin-left: var(--sp-2); }
.lead-rank-pct { text-align: right; }

/* the report's three buttons, and Send (locked) */

/* ask again, or rebuild */
.lead-again-cost { font-size: var(--fs-sm); margin-top: var(--sp-1); }
@media (max-width: 767px) {
  .lead-rank { grid-template-columns: 28px minmax(0, 1fr) 52px; }
  .lead-rank-of { grid-column: 2 / -1; }
  .lead-qa { padding: var(--sp-3); }
}

/* AUD-23: the report panel — a lead's report, its PDF or its "read every answer" page, over the lead's record. */
.viewer-back { position: fixed; inset: 0; z-index: 100; display: flex; align-items: stretch; justify-content: center; padding: var(--sp-4); background: rgba(4, 41, 76, .55); }
.viewer { display: flex; flex-direction: column; width: min(1120px, 100%); background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 12px 40px rgba(16, 24, 40, .35); overflow: hidden; }
.viewer-head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--line); background: var(--surface); }
.viewer-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-3); min-width: 0; font-size: var(--fs-lg); }
.viewer-newtab { font-size: var(--fs-sm); white-space: nowrap; }
.viewer-newtab[aria-disabled="true"] { pointer-events: none; color: var(--ink-mute); text-decoration: none; }
.viewer-x { flex: none; width: 40px; height: 40px; font: inherit; font-size: 28px; line-height: 1; color: var(--ink); background: var(--surface-alt); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.viewer-x:hover, .viewer-x:focus-visible { background: var(--brand-blue-pale); border-color: var(--brand-blue); outline: none; }
.viewer-stage { flex: 1; min-height: 0; display: flex; background: var(--bg); }
.viewer-frame { flex: 1; width: 100%; height: 100%; border: 0; background: #fff; }
.viewer-wait { margin: auto; padding: var(--sp-5); color: var(--ink-mute); }
.viewer-error { margin: var(--sp-5); align-self: flex-start; flex: 1; }
@media (max-width: 767px) { .viewer-back { padding: 0; } .viewer { border-radius: 0; } }

/* AUD-26: LEADS — the quick lists and the list's status / last-event columns; the top of a lead's record (the status, the
   four progress marks, the source, the market hold, the tags); the timeline and what is recorded by hand. Neutral
   components; colour only from the status set. A progress mark is told apart by SHAPE and always carries its word. */
.leads-asks { margin-bottom: var(--sp-3); }
.leads-ask { display: inline-flex; align-items: center; gap: 6px; }
.leads-ask-n { min-width: 20px; padding: 0 6px; border-radius: 999px; font-size: var(--fs-xs); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; background: var(--surface-alt); border: 1px solid var(--line); color: var(--ink-dim); text-align: center; }
.leads-ask.active .leads-ask-n { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .35); color: var(--on-brand); }
.lead-status-cell { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); }

/* SHELL-LEAD1: LEADS, the list the way a sales tool keeps one — the to-dos box, taller rows that open the lead, the
   "Existing client" tag, Email and Call; and what Mark won / Mark lost ask inside a lead. Neutral components; the stage
   pill is the brand pill (Won is green: itv-core confirmed it; Lost is quiet). */
.leads-todos { margin: 0 0 var(--sp-4); }
.leads-todo-list { list-style: none; margin: 0; padding: 0; }
.leads-todo-list li + li { border-top: 1px solid var(--line); }
.leads-todo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--sp-2); padding: var(--sp-2) 0; font-size: var(--fs-md); color: var(--ink); text-decoration: none; }
.leads-todo-lead { font-weight: var(--fw-medium); }
.leads-todo-lead::after { content: "\2014"; margin-left: var(--sp-2); color: var(--ink-mute); font-weight: var(--fw-regular); }
.leads-todo-what { color: var(--accent); }
.leads-todo:hover .leads-todo-what, .leads-todo:focus-visible .leads-todo-what { text-decoration: underline; }
table.leads-table { font-size: var(--fs-md); }
table.leads-table td { padding: var(--sp-3); vertical-align: middle; }
table.leads-table td .under { font-size: var(--fs-sm); }
table.leads-table td a.client-link { font-weight: var(--fw-bold); }
.lead-row-name { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); }
.tag-client { color: var(--brand-navy); background: var(--brand-blue-pale); border-color: rgba(36, 148, 224, .35); font-weight: var(--fw-medium); }
a.tag-client { text-decoration: none; }
a.tag-client:hover, a.tag-client:focus-visible { border-color: var(--brand-blue); }
table.data td.lead-row-reach, table.data th.lead-row-reach { white-space: nowrap; text-align: right; }
.lead-row-reach .lead-reach { display: inline-block; margin-left: var(--sp-2); padding: 6px 14px; font-size: var(--fs-sm); text-decoration: none; }
.lead-row-reach .lead-reach:disabled { cursor: not-allowed; }
a.lead-reach:hover, a.lead-reach:focus-visible { border-color: var(--brand-blue); color: var(--accent); }
.lead-card-closed { margin-top: var(--sp-1); }
.lead-close-how { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); margin: 0 0 var(--sp-2); }
.lead-close-form .row-cell { font-size: var(--fs-sm); }
@media (max-width: 767px) { table.data td.lead-row-reach { text-align: left; } .lead-row-reach .lead-reach { margin: 0 var(--sp-2) 0 0; min-height: 40px; } }
table.data td.lead-last { min-width: 220px; max-width: 420px; white-space: normal; }
.lead-card-last { font-size: var(--fs-xs); color: var(--ink-dim); overflow-wrap: anywhere; }
.lead-card-last .under { display: block; color: var(--ink-mute); }

.lead-status-form { margin-top: var(--sp-2); padding: var(--sp-3); border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--surface-alt); }
.lead-status-form .lead-stage-form { margin-top: 0; margin-bottom: var(--sp-2); }
.lead-tag-form { margin-top: var(--sp-2); max-width: 420px; }


.lead-timeline > .muted-line { margin: 0 0 var(--sp-3); }
.lead-hand-form { margin: 0 0 var(--sp-3); }
.lead-hand-form p { margin: 0 0 var(--sp-2); }
.lead-hand-form .row-cell { margin-bottom: var(--sp-2); max-width: 560px; }
.lead-hand-when .field-sm { max-width: 260px; }
.lead-tl { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.lead-tl-item { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--sp-1) var(--sp-4); padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--line); }
.lead-tl-item:last-child { border-bottom: 0; }
.lead-tl-when { font-size: var(--fs-sm); color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.lead-tl-line { overflow-wrap: anywhere; }
.lead-tl-note { margin-top: 2px; padding-left: var(--sp-3); border-left: 2px solid var(--line-strong); font-size: var(--fs-sm); color: var(--ink-dim); white-space: pre-wrap; overflow-wrap: anywhere; }
.lead-tl-by { font-size: var(--fs-xs); }
.lead-tl-foot { display: flex; gap: var(--sp-4); margin-top: var(--sp-2); }
.lead-own { margin-top: var(--sp-3); }
.lead-own .muted-line { margin: 0 0 var(--sp-2); }
.lead-tl-own { background: var(--surface-alt); }
@media (max-width: 767px) { .lead-tl-item { grid-template-columns: 1fr; padding: var(--sp-2) var(--sp-3); } }

/* ---- BILL-1: Extra Work billing (tools/billing, tools/invoicing/invoicing.js, tools/clients/extra-work.js) ---------------
   Status colours as everywhere: green = paid, amber = waiting / past due / needs the bank / not linked, red = a failed
   charge or an error. The modal is the shell's first: one use, "Charge card on file (approved)". */
.xw-note { margin: 0 0 var(--sp-3); }
.xw-add-area { margin-top: var(--sp-5); }
.xw-add-big { max-width: 320px; padding: 14px; font-size: var(--fs-lg); }
.xw-form { max-width: 520px; display: grid; gap: var(--sp-3); }
.xw-form h3 { margin: 0; font-size: var(--fs-lg); }
.xw-form .row-cell { font-size: var(--fs-sm); gap: var(--sp-1); }
.xw-form .field { margin: 0; font-size: var(--fs-lg); }
.xw-form select.field { appearance: auto; min-height: 46px; }
.xw-form .client-picker { min-width: 0; }
.xw-fixed-client { font-size: var(--fs-lg); font-weight: var(--fw-medium); color: var(--ink); }
.xw-kind .chip-btn { padding: 9px 20px; font-size: var(--fs-md); }
.xw-form-actions { display: flex; gap: var(--sp-3); align-items: center; }
.xw-form-actions .btn-primary { flex: 1; padding: 13px; }
.xw-form-actions .btn-quiet { padding: 11px 16px; }
.xw-form-msg:empty { display: none; }
.xw-form-msg { font-size: var(--fs-sm); color: var(--ink-mute); }
.xw-form-msg.is-error { color: var(--red-ink); background: var(--red-wash); border: 1px solid var(--red-line); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); }
.xw-form-msg.is-ok { color: var(--green-ink); background: var(--green-wash); border: 1px solid var(--green-line); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); }
.xw-total { display: flex; justify-content: flex-end; align-items: baseline; gap: var(--sp-3); margin-top: var(--sp-3); font-size: var(--fs-sm); color: var(--ink-mute); }
.xw-total strong { font-size: var(--fs-xl); color: var(--ink); }
.xw-break { word-break: break-all; }
.att-text .btn-quiet { margin-left: var(--sp-2); }
.xw-client > h3 { font-size: var(--fs-lg); color: var(--ink); }
.xw-part { margin-top: var(--sp-5); }
.xw-part:first-of-type { margin-top: var(--sp-3); }
.xw-part > h4 { margin: 0 0 var(--sp-1); font-size: var(--fs-md); font-weight: var(--fw-bold); }
.xw-part > .muted-line { margin: 0 0 var(--sp-2); }
.xw-msg { margin-top: var(--sp-2); padding: var(--sp-2) var(--sp-3); text-align: left; }
.xw-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
.xw-btn { padding: 8px 16px; font-size: var(--fs-md); }
table.xw-lines td.xw-date { white-space: nowrap; }
table.xw-lines tfoot td { border-bottom: 0; background: var(--surface-alt); }
.xw-total-label { text-align: right; color: var(--ink-mute); font-size: var(--fs-sm); }
.xw-remove-ask { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--red-ink); }
.xw-rate-editor { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.xw-rate-editor .field-sm { min-width: 0; width: 110px; }
.xw-rate-editor #xw-greeting-input { width: 190px; }   /* BILL-7: a name, not a number */
.xw-confirm-lines { list-style: none; margin: var(--sp-2) 0 0; padding: 0; font-size: var(--fs-sm); }
.xw-confirm-lines li { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-1) 0; border-bottom: 1px solid var(--line); }
.xw-confirm-lines .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.xw-inv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-1); }
.xw-inv-actions .btn-save { padding: 7px 14px; }
.xw-inv.st-over { color: inherit; }
.modal-back { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: var(--sp-4); background: rgba(16, 24, 40, .45); }
.modal { width: 100%; max-width: 480px; max-height: 100%; overflow: auto; display: grid; gap: var(--sp-3); padding: var(--sp-5); background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.modal h2 { margin: 0; font-size: var(--fs-lg); }
.modal .field { margin: 0; }
.xw-charge-facts { margin: 0; }
.xw-charge-amount { font-size: var(--fs-2xl); }
.xw-charge-out:empty { display: none; }
.xw-charge-out { padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-md); text-align: left; font-size: var(--fs-sm); }
.xw-charge-out .btn-quiet { margin-left: var(--sp-2); }
@media (max-width: 767px) {
  .xw-add-big { max-width: none; }
  .xw-form { max-width: none; }
  .xw-form-actions { flex-direction: column; align-items: stretch; }
  .xw-form-actions .btn-quiet { width: 100%; }
  .xw-actions .xw-btn { flex: 1; }
  .modal { padding: var(--sp-4); }
}

/* ---- BILL-2: "Send reminder" on an open invoice, and the open-invoices table as cards on a phone ----------------------- */
.xw-remind { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); }
.xw-remind-ask { font-size: var(--fs-sm); color: var(--ink); }
.xw-remind-error { font-size: var(--fs-sm); color: var(--red-ink); background: var(--red-wash); border: 1px solid var(--red-line); border-radius: var(--radius-sm); padding: 2px var(--sp-2); }
table.xw-stack td .xw-remind { max-width: 300px; }
@media (max-width: 767px) {
  table.xw-stack, table.xw-stack tbody, table.xw-stack tr, table.xw-stack td { display: block; width: 100%; }
  table.xw-stack thead { display: none; }
  table.xw-stack tr { padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); }
  table.xw-stack tr:last-child { border-bottom: 0; }
  table.xw-stack td, table.xw-stack td.num { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: var(--sp-2); padding: 3px var(--sp-3); border: 0; text-align: left; white-space: normal; }
  table.xw-stack td::before { content: attr(data-label); font-size: var(--fs-xs); color: var(--ink-mute); padding-top: 2px; }
  table.xw-stack td .xw-remind { max-width: none; }
  table.xw-stack td .xw-remind .btn-quiet, table.xw-stack td .xw-remind .btn-save { padding: 8px 14px; }
}

/* ---- FIN-1 (itv-core's AUD-27): a progress mark's reason, in itv-core's words; ending a market hold early --------------- */
.lead-hold-end { margin-top: var(--sp-2); }
.lead-hold-end-form { max-width: 560px; }
.lead-hold-end-form p { margin: 0 0 var(--sp-2); }
.lead-hold-end-form .row-cell { margin-bottom: var(--sp-2); }
#lead-hold-said { margin-top: var(--sp-2); }

/* ---- BILL-4: "Invoicing test mode" (the switch on the Invoicing page, the bar on every page) and the page's new order ------
   Amber, as every "this is not real / not verified" mark is. The bar is full width, under the header. */
.test-bar { position: sticky; top: var(--header-h); z-index: 19; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-1) var(--sp-4); padding: var(--sp-2) var(--sp-4); background: var(--amber-wash); color: var(--amber-ink); border-bottom: 1px solid var(--amber-line); font-size: var(--fs-sm); text-align: center; }
.test-bar strong { font-size: var(--fs-md); letter-spacing: .02em; }
.test-bar a, .test-bar .test-bar-off { color: inherit; font-size: var(--fs-sm); text-decoration: underline; }
/* BILL-5: the bar is the ONLY sign of test mode, so it stays in view: it sticks under the header when the page is scrolled. */
/* BILL-5: test mode is one small on/off switch at the right end of the Invoicing title row (a track and a thumb; amber when
   on), and one slim bar. The switch is a button with role="switch": the shell's first. */
.title-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.title-row .page-title { margin-bottom: 0; }
.title-row + .page-sub { margin-top: var(--sp-1); }
.switch { display: inline-flex; align-items: center; gap: var(--sp-2); flex: none; padding: 4px; border: 0; background: none; color: var(--ink-mute); font: inherit; font-size: var(--fs-sm); cursor: pointer; border-radius: var(--radius-sm); }
.switch:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.switch-track { position: relative; width: 36px; height: 20px; border-radius: 10px; background: var(--line-strong); transition: background .15s; flex: none; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform .15s; }
.switch.on { color: var(--amber-ink); }
.switch.on .switch-track { background: var(--amber-ink); }
.switch.on .switch-thumb { transform: translateX(16px); }
/* ---- BILL-6: the Invoicing page's layout, its pop-ups, the private note and the backup line -------------------------------
   Title row: the name on the left; the Test mode switch, then "+ Add work", on the right (they wrap under it on a phone). */
.title-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-2) var(--sp-3); }
.title-row { flex-wrap: wrap; }
.xw-add-top { width: auto; padding: 9px 18px; font-size: var(--fs-md); }
@media (max-width: 767px) { .xw-add-top { min-height: 44px; } .title-actions .switch { min-height: 40px; } }   /* a thumb's worth of button on a phone */
.xw-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-2); }
.xw-strip-num { display: grid; gap: 2px; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.xw-strip-num:hover, .xw-strip-num:focus-visible { border-color: var(--brand-blue); box-shadow: var(--shadow-md); }
.xw-strip-label { font-size: var(--fs-sm); color: var(--ink-mute); }
.xw-strip-num .big { font-size: var(--fs-xl); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.xw-strip-num .big .pill { font-size: inherit; font-weight: inherit; padding: 0 var(--sp-2); border-radius: var(--radius-sm); }
.xw-strip-num .sub { margin-top: 0; font-size: var(--fs-xs); color: var(--ink-mute); }
.xw-said:empty { display: none; }
.xw-said { margin-top: var(--sp-3); }
.xw-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); }
.xw-row-actions .btn-quiet { padding: 5px 10px; font-size: var(--fs-sm); }
.xw-history-tabs { margin-bottom: var(--sp-3); }
.xw-history-tabs .tab { font: inherit; cursor: pointer; } /* DESIGN-1 sets its look */
.xw-count { margin-left: 6px; font-size: var(--fs-xs); color: var(--ink-mute); }
.xw-pager { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); margin-top: var(--sp-3); }
.xw-backup { margin-top: var(--sp-6, 32px); padding-top: var(--sp-3); border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.xw-backup-failed { color: var(--red-ink); }
/* BILL-8: "Processor: Stripe", the one line under the backup's: the same small gray, with no rule of its own above it */
.xw-processor { margin-top: var(--sp-1); padding-top: 0; border-top: 0; }
.xw-private { margin-top: 2px; font-size: var(--fs-xs); color: var(--ink-mute); }
.xw-private-tag { font-weight: var(--fw-medium); }
.xw-line-actions { white-space: nowrap; }
.modal.modal-wide { max-width: 720px; }
.modal .xw-form { max-width: none; }
.xw-modal-msg:empty { display: none; }
.xw-modal-msg { margin: var(--sp-3) 0; padding: var(--sp-2) var(--sp-3); text-align: left; font-size: var(--fs-sm); }
.xw-check { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-3) 0; font-size: var(--fs-sm); cursor: pointer; }
.xw-check input { width: 18px; height: 18px; margin: 0; flex: none; }
.xw-preview-facts { margin: 0 0 var(--sp-3); }
.xw-preview-frame { display: block; width: 100%; height: 420px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #f3f6fa; pointer-events: none; }
.xw-void-actions { flex-wrap: wrap; }
.xw-void-actions .btn-save { padding: 11px 16px; }
textarea.field { resize: vertical; min-height: 56px; font-family: inherit; }
@media (max-width: 767px) {
  .xw-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xw-preview-frame { height: 340px; }
  .xw-void-actions { flex-direction: column; align-items: stretch; }
}
/* BILL-5: Hours and this line's Rate, side by side (on a phone too: two short fields) */
.xw-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
/* BILL-9, THE NEW CLIENT CHECKOUT (tools/billing/new-client.js): the pop-up's three money fields in a row (one column on a
   phone), the "New clients" section's rows, and the amber "already on a plan" box with its tick. No new colour: green is
   paid and ready to start, amber is waiting, red is something that needs a look. */
.xw-pair.nc-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 767px) { .xw-pair.nc-three { grid-template-columns: minmax(0, 1fr); } }
.nc-existing { margin: var(--sp-3) 0; }
.nc-existing .xw-check { margin: var(--sp-2) 0 0; font-weight: var(--fw-medium); }
.nc-name { font-weight: var(--fw-medium); }
.nc-check.nc-yes { color: var(--green-ink, #1c6b3a); font-weight: var(--fw-medium); }
.nc-contract { margin: 0; white-space: nowrap; }
.nc-table .xw-remind-error:empty, .nc-convert-row .xw-remind-error:empty { display: none; }   /* a refusal is drawn only when there is one */
.nc-check { white-space: nowrap; }
table.nc-table td { vertical-align: top; }
@media (max-width: 767px) { table.xw-stack.nc-table td.nc-none { display: none; } }
.nc-convert-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); }
.nc-convert-new[hidden], .nc-convert-have[hidden] { display: none; }
.nc-convert-new, .nc-convert-have { display: grid; gap: var(--sp-3); }
table.nc-table td .pill + .pill { margin-left: var(--sp-1); }
.nc-actions[data-state="asking"] { max-width: 320px; }
.title-actions .xw-add-top + .xw-add-top { margin-left: 0; }
.xw-pair > [hidden] { display: none !important; }
.xw-pair:has(> [hidden]) { grid-template-columns: minmax(0, 1fr); }
.xw-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-3); }
.xw-head h2 { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.xw-head .xw-total-top { margin: 0; }
#xw-waiting > .hint { margin: 0 0 var(--sp-3); font-size: var(--fs-sm); color: var(--ink-mute); }
.xw-test-control { margin-bottom: var(--sp-4); }
.xw-test-control .chips { margin-bottom: var(--sp-2); }

/* ---- BILL-3: the "Invoicing" card on Financials › Overview (tools/financials/invoicing-card.js) ---------------------------
   Three numbers side by side, the whole card a link (.card-link). "Needs you" takes the colour of the worst item (red or
   amber, the sacred pills); the two money figures are plain. On a phone the numbers stack. */
.inv-card { margin-top: var(--sp-5); }
.inv-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.inv-label { margin-bottom: var(--sp-1); font-size: var(--fs-sm); color: var(--ink-mute); }
.inv-num .big { font-variant-numeric: tabular-nums; }
.inv-num .big .pill { font-size: inherit; font-weight: inherit; padding: 0 var(--sp-2); border-radius: var(--radius-sm); vertical-align: baseline; }
.inv-num .sub { margin-top: var(--sp-1); }
.inv-state { color: var(--ink-mute); }
.inv-error { padding: var(--sp-2) var(--sp-3); }
@media (max-width: 767px) { .inv-nums { grid-template-columns: 1fr; gap: var(--sp-3); } }
/* Found while placing the card (it was so before BILL-3): on a phone, Overview's profit line could not wrap its amber
   "INCOMPLETE — missing: …" sentence (.v is nowrap) and pushed the whole page to 1067px wide. At phone width a value that
   does not fit drops under its label and wraps; a short amount stays on the label's line, at the right, as before. */
@media (max-width: 767px) { .story-line { flex-wrap: wrap; } .story-line > div:first-child { flex: 1 1 0; min-width: 0; } .story-line .v { white-space: normal; min-width: 0; } }

/* ---- FIN-2: Financials › Costs (tools/financials/costs*.js, subscriptions.js), and a cost that is a link ----------------
   Colours as everywhere: amber = not measured, not entered, not tracked, needs a look; red = a failed call or an error.
   A cost is shown as a plain link (the brand blue), never in a status colour. */
a.cost-link, a.cost-open { color: var(--accent); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
a.cost-link:hover, a.cost-open:hover, a.cost-link:focus-visible, a.cost-open:focus-visible { text-decoration-style: solid; }
.card .big a.cost-link, .card .big a.cost-open { color: inherit; }
.story-line .v a.cost-link { color: inherit; }
.cost-head { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.cost-back { font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--accent); justify-self: start; }
.cost-nav .chip-btn, .cost-bar .chip-btn, .cost-split-chips .chip-btn { text-decoration: none; }
.cost-title { margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-bold); }
.cost-head .hint { margin: 0; color: var(--ink-mute); font-size: var(--fs-sm); }
.cost-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); }
.cost-test-toggle { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--ink-dim); cursor: pointer; }
.cost-custom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-2) var(--sp-3); flex-basis: 100%; }
.cost-custom .field-sm { min-width: 0; }
.cost-totals { margin-bottom: var(--sp-3); }
.cost-none { font-size: var(--fs-lg); font-weight: var(--fw-medium); color: var(--ink-mute); }
.cost-apart { margin: var(--sp-4) 0 var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-dim); }
.cost-split-chips { margin-bottom: var(--sp-3); }
.cost-owners, .cost-usage-items { margin-top: var(--sp-4); }
.cost-owners h3, .cost-usage-items h3, #cost-leads h3, .cost-bill-month h3, #subs-history h3 { margin: var(--sp-4) 0 var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-dim); }
.cost-rule { margin-top: var(--sp-2); }
.cost-rule p { margin: var(--sp-1) 0 0; }
.cost-unit .sub > div { margin-top: var(--sp-1); }
.cost-waste-line { font-size: var(--fs-md); }
.cost-waste-big { font-size: var(--fs-2xl); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
#cost-waste-open { margin-top: var(--sp-3); }
.cost-waste-calls { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); }
#cost-notes .note-unverified { margin-bottom: var(--sp-2); }
#cost-notes ul, .cost-causes, #usage-not-measured ul { margin: var(--sp-1) 0 0; padding-left: 18px; }
.cost-items-foot { margin-top: var(--sp-3); font-size: var(--fs-sm); color: var(--ink-mute); }
.cost-item { max-width: 720px; }
.cost-item-top { display: flex; align-items: center; gap: var(--sp-3); }
.cost-facts { grid-template-columns: 180px minmax(0, 1fr); margin-top: var(--sp-3); }
.cost-facts dd { text-align: left; }
.cost-lead-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.cost-lead-top a.btn-quiet { text-decoration: none; }
.cost-focus { margin-bottom: var(--sp-4); border-color: var(--brand-blue); }
table.data tr.is-focus > td { background: var(--brand-blue-pale); }
.cost-form { max-width: 560px; display: grid; gap: var(--sp-3); }
.cost-form h3 { margin: 0; font-size: var(--fs-lg); }
.cost-form p { margin: 0; }
.cost-form .row-cell { font-size: var(--fs-sm); gap: var(--sp-1); }
.cost-form .field { margin: 0; }
.cost-form select.field { appearance: auto; min-height: 44px; }
.cost-causes { font-size: var(--fs-xs); color: var(--amber-ink); max-width: 360px; text-align: left; white-space: normal; }
.cost-price-table td { white-space: normal; }
.cost-price-actions { min-width: 260px; }
.cost-price-actions .btn-quiet { margin-bottom: 2px; }
.cost-price-changed { margin: 0; max-width: 420px; }
table.data tr.row-flag > td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.cost-sub-actions { white-space: nowrap; }
.cost-sub-changes { margin: 0; padding-left: 20px; }
@media (max-width: 767px) {
  .cost-facts { grid-template-columns: 1fr; }
  .cost-facts dt { margin-top: var(--sp-2); }
  .cost-form { max-width: none; }
  .cost-price-actions { min-width: 200px; }
}
.cost-bill-month table.data { table-layout: fixed; }
.cost-bill-month table.data th:nth-child(1) { width: 22%; } .cost-bill-month table.data th:nth-child(2) { width: 26%; } .cost-bill-month table.data th:nth-child(3) { width: 16%; }
.cost-bill-month table.data th:nth-child(4) { width: 14%; } .cost-bill-month table.data th:nth-child(5) { width: 22%; }
.cost-bill-month table.data td { white-space: normal; overflow-wrap: anywhere; }
.cost-bill-month .link-btn { white-space: nowrap; }
.cost-causes { max-width: none; }
@media (max-width: 767px) { .cost-bill-month table.data { table-layout: auto; min-width: 720px; } }

/* =====================================================================================================================
   UI-1: THE LEAD PAGE AND THE LEADS LIST, REBUILT AROUND WHAT THE OWNER DOES
   The top of a lead's page is ONE box that answers, without scrolling: where does this lead stand (the header), what do I
   do next (the next step bar), and what can I do (the action row); then the four progress marks and what the audit found.
   Everything else is in tabs under it. Colour is still only status: amber = waiting on the owner, red = failed. The one
   main button is the action colour (--action), which is not a status.
   ===================================================================================================================== */

/* ---- menus and reasons: anything that floats beside the thing that opened it (src/ui.js) ---- */
.pop { position: fixed; z-index: 120; max-width: min(360px, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.menu { min-width: 232px; padding: var(--sp-1); display: grid; gap: 1px; max-height: calc(100vh - 16px); overflow: auto; }
.menu-item { display: grid; gap: 1px; width: 100%; text-align: left; font: inherit; font-size: var(--fs-md); padding: 8px 12px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--brand-blue-pale); outline: none; }
.menu-item-label { font-weight: var(--fw-medium); }
.menu-item-note { font-size: var(--fs-xs); color: var(--ink-mute); line-height: 1.35; }
.menu-item[aria-disabled="true"] { cursor: not-allowed; }
.menu-item[aria-disabled="true"] .menu-item-label { color: var(--ink-mute); font-weight: var(--fw-regular); }
.menu-item[aria-disabled="true"]:hover, .menu-item[aria-disabled="true"]:focus-visible { background: var(--surface-alt); }
.menu-heading { padding: 6px 12px 2px; font-size: var(--fs-xs); color: var(--ink-mute); }
.menu-caret { display: inline-block; margin-left: 7px; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; vertical-align: middle; opacity: .7; }
.has-menu[aria-expanded="true"] { border-color: var(--brand-blue); background: var(--brand-blue-pale); color: var(--accent); }
.tipbox { padding: 8px 12px; font-size: var(--fs-sm); line-height: 1.4; color: var(--ink); }
.tipbox ul { margin: 0; padding-left: var(--sp-4); }
.tipbox li + li { margin-top: var(--sp-1); }
.tip-wrap { display: inline-flex; border-radius: var(--radius-sm); cursor: not-allowed; }
.tip-wrap > button:disabled { pointer-events: none; }
.has-tip:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

/* ---- the top box ---- */
.lead-top { margin-bottom: var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.lead-top > div:empty { display: none; }

/* 1. the header (SHELL-LEAD2): the name and its tags, the person and place, then the four facts a row of the list shows */
.lead-hd { padding: var(--sp-4) var(--sp-5) var(--sp-3); }
.lead-hd h1 { margin: 0; font-size: var(--fs-2xl); line-height: 1.15; font-weight: var(--fw-bold); color: var(--brand-navy); overflow-wrap: anywhere; }
.lead-hd-name { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); }
.lead-hd-line { margin-top: var(--sp-1); font-size: var(--fs-md); color: var(--ink-dim); }
.lead-facts { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.lead-fact { min-width: 0; max-width: 420px; }
.lead-fact + .lead-fact { padding-left: var(--sp-5); border-left: 1px solid var(--line); }
.lead-fact-label, .lead-found-label, .lead-todos-title { margin: 0 0 4px; font-size: 11px; font-weight: var(--fw-bold); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-mute); }
.lead-fact-what { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: var(--fs-md); color: var(--ink); overflow-wrap: anywhere; }
.lead-fact-what .under { font-size: var(--fs-sm); color: var(--ink-mute); }
.lead-fact-what .empty { color: var(--ink-mute); }
.lead-status-tag { padding: 4px 14px; font-size: var(--fs-md); font-weight: var(--fw-bold); }
.lead-arrived { margin: 0 var(--sp-5) var(--sp-3); }

/* 3. the action row, the sheet an action opens under it, and what itv-core said afterwards */
.lead-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-5) 0; }
.lead-acts .lead-opens { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; }
.lead-acts .btn-quiet { padding: 6px 14px; font-size: var(--fs-md); }
.lead-acts button:disabled { cursor: not-allowed; opacity: .5; }
.lead-send-btn { display: inline-flex; align-items: center; gap: 6px; }
.lead-acts .lead-send-btn:disabled { opacity: 1; color: var(--ink-mute); background: var(--surface-alt); }
.lead-send-btn .pill { padding: 0 6px; font-size: 11px; }
.lead-send-why { margin: 0; padding-left: var(--sp-4); }
.lead-sheet { padding: var(--sp-3) var(--sp-5) 0; }
.lead-sheet-box { margin: 0; max-width: 760px; }
.lead-sheet-box p { margin: 0 0 var(--sp-2); }
.lead-sheet-box .row-cell { margin-bottom: var(--sp-2); max-width: 560px; }
.lead-sheet .lead-status-form { padding: var(--sp-3); }
/* SEND-2: the "Send it?" question: the email and its address, then the two buttons (a lead's page, under the action row; the
   list, in a pop-up) */
.send-ask .aiv-mail-line { grid-template-columns: 72px minmax(0, 1fr); }
.send-ask-starts { margin-top: var(--sp-2); }
.send-ask .aiv-mail-body { margin: 4px 0 var(--sp-2); background: var(--surface); }
.send-ask .send-ask-q { margin: var(--sp-3) 0 var(--sp-2); }
.send-ask .note-unverified { margin-bottom: var(--sp-2); }
.send-ask .state-error, .send-ask .edit-msg { margin-top: var(--sp-2); }
.row-mail .send-ask { margin-top: 0; padding: 0; border: 0; background: none; max-width: none; }
.lead-again-cost { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); }
.lead-said { display: grid; gap: var(--sp-2); padding: var(--sp-3) var(--sp-5) 0; }
.lead-said > * { margin: 0; }

/* 1b. how they found you (LST-2): right under the header. The headline, five facts, and their trip. A lead with no visit
   on file has one plain line. An AI assistant's name is a small tag in the brand blue; a source is never green, amber or
   red (those are statuses). */
.lead-how { margin: 0 var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-alt); }
.lead-how-none, .lead-how-quiet { margin: 0; font-size: var(--fs-md); color: var(--ink-dim); }
.lead-how-failed { margin: 0; font-size: var(--fs-md); color: var(--red-ink); }
.lead-how-headline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: 1.25; color: var(--brand-navy); overflow-wrap: anywhere; }
.lead-how-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--sp-3) var(--sp-5); margin: var(--sp-3) 0 0; }
.lead-how-fact { min-width: 0; }
.lead-how-fact dt, .lead-how-trip-title { margin: 0 0 4px; font-size: 11px; font-weight: var(--fw-bold); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-mute); }
.lead-how-fact dd { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: var(--fs-md); color: var(--ink); overflow-wrap: anywhere; }
.lead-how .under { font-size: var(--fs-sm); color: var(--ink-mute); overflow-wrap: anywhere; }
.lead-how .empty { color: var(--ink-mute); }
.lead-how-trip { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.lead-how-stops { list-style: none; margin: 0; padding: 0; }
.lead-how-stop { display: grid; grid-template-columns: 110px minmax(120px, 220px) minmax(0, 1fr); gap: 2px var(--sp-4); align-items: baseline; padding: 6px 0; font-size: var(--fs-md); }
.lead-how-stop + .lead-how-stop { border-top: 1px solid var(--line); }
.lead-how-when { color: var(--ink-dim); white-space: nowrap; }
.lead-how-from { color: var(--ink); overflow-wrap: anywhere; }
.lead-how-page { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.tag-ai { color: var(--accent); background: var(--brand-blue-pale); border-color: rgba(36, 148, 224, .35); font-weight: var(--fw-medium); }
@media (max-width: 767px) {
  .lead-how-facts { grid-template-columns: 1fr; gap: var(--sp-2); }
  .lead-how-stop { grid-template-columns: 1fr; gap: 2px; padding: var(--sp-2) 0; }
}
/* LST-2, the list: the Source column and the Source filter beside the search */
table.leads-table td.lead-row-source { white-space: nowrap; }
/* LST-5, the list: Came in on one line, its header a quiet button that turns the order round */
table.leads-table td.lead-row-at { white-space: nowrap; }
.lead-sort { padding: 0; border: 0; background: none; font: inherit; font-weight: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.lead-sort:hover, .lead-sort:focus-visible { color: var(--accent); }
/* LST-5, one lead: the block at a glance, right under the header and above "How they found you". Plain lines, no colour. */
.lead-glance { display: grid; gap: 2px; margin: 0 var(--sp-3) var(--sp-3); padding: var(--sp-2) var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); font-size: var(--fs-md); color: var(--ink); }
.lead-glance-line { overflow-wrap: anywhere; }
.lead-glance-label { color: var(--ink-mute); }
.lead-glance-at { color: var(--ink-dim); }
.lead-glance .empty { color: var(--ink-mute); }
.lead-src-failed { color: var(--red-ink); font-size: var(--fs-sm); }
.toolbar .leads-found .field { width: auto; min-width: 150px; }

/* an audit under way: the page's "working" sign (blue = running), with the way to stop it */
.lead-running { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin: var(--sp-3) var(--sp-3) 0; padding: var(--sp-3) var(--sp-4); border: 1px solid rgba(36, 148, 224, .25); border-left: 4px solid var(--accent); border-radius: var(--radius-md); background: var(--brand-blue-pale); font-size: var(--fs-md); }
.lead-running-words { flex: 1 1 320px; min-width: 0; }
.lead-running-words strong { font-size: var(--fs-lg); }

/* 4. to-dos (SHELL-LEAD2): what waits on the owner, with its button. Amber = needs you; red = an audit that did not
   finish. With none, one quiet line. */
.lead-todos { margin: var(--sp-3) var(--sp-3) 0; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-alt); }
.lead-todos-none { margin: 0; font-size: var(--fs-md); color: var(--ink-dim); }
.lead-todos > .unverified { margin: 0; font-size: var(--fs-md); }
.lead-todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.lead-todo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3) var(--sp-4); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--amber-line); border-left: 4px solid var(--amber); border-radius: var(--radius-md); background: var(--amber-wash); }
.lead-todo.is-red { background: var(--red-wash); border-color: var(--red-line); border-left-color: var(--red); }
.lead-todo-words { flex: 1 1 420px; min-width: 0; }
.lead-todo-line { font-size: var(--fs-lg); font-weight: var(--fw-bold); line-height: 1.3; color: var(--ink); }
.lead-todo-sub { margin-top: 2px; font-size: var(--fs-sm); color: var(--ink-dim); }
.lead-todo-go { display: flex; flex: none; flex-wrap: wrap; gap: var(--sp-2); }
.lead-todo-other { padding: 8px 16px; font-size: var(--fs-md); background: var(--surface); }

/* 5. the report email: when it was sent, and whether the lead opened it */
.lead-email { margin-top: var(--sp-3); padding: var(--sp-3) var(--sp-5) 0; border-top: 1px solid var(--line); }
.lead-email-facts { display: flex; flex-wrap: wrap; gap: 2px var(--sp-2); font-size: var(--fs-md); color: var(--ink-dim); }
.lead-email-facts strong { color: var(--ink); }

/* 6. what the audit found: three lines at most */
.lead-found { margin-top: var(--sp-3); padding: var(--sp-3) var(--sp-5) var(--sp-4); border-top: 1px solid var(--line); }
.lead-found-verdict { font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: 1.25; color: var(--brand-navy); }
.lead-found-quiet { font-size: var(--fs-md); font-weight: var(--fw-regular); color: var(--ink-dim); }
.lead-found-facts { display: flex; flex-wrap: wrap; gap: 2px var(--sp-2); margin-top: 2px; font-size: var(--fs-md); color: var(--ink-dim); }
.lead-found-dot { color: var(--ink-mute); }

/* 7. the tabs and what each holds */
.lead-tabs .tab { cursor: pointer; white-space: nowrap; }
.tab-n { margin-left: 6px; font-size: var(--fs-xs); color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.lead-panel > .admin-card:first-child { margin-top: 0; }
.lead-panel .lead-block:first-child { margin-top: 0; }
.lead-audit .lead-audit-status { margin-top: var(--sp-2); }

/* Summary: the two tables in compact form, and the ranked list beside them */
.lead-sum { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: var(--sp-4); align-items: start; }
.lead-sum-tables { display: grid; gap: var(--sp-4); min-width: 0; }
.lead-sum-block { min-width: 0; padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.lead-sum-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--sp-3); margin-bottom: var(--sp-2); }
.lead-sum-head h3 { margin: 0; }
table.lead-marks.is-compact th.lead-marks-label { min-width: 150px; padding: 6px var(--sp-3); vertical-align: middle; }
table.lead-marks.is-compact td { min-width: 96px; padding-top: 6px; padding-bottom: 6px; }
.lead-sum-label.has-tip { border-bottom: 1px dotted var(--ink-mute); cursor: help; }
.lead-ranks.is-compact .lead-rank { grid-template-columns: 28px minmax(0, 1fr) 52px; padding: 6px var(--sp-3); cursor: help; }
.lead-sum-block > .link-btn { margin-top: var(--sp-2); }
.lead-sum-foot { margin-top: var(--sp-3); }
@media (max-width: 1100px) { .lead-sum { grid-template-columns: 1fr; } }

/* Questions: the release at the top for a held lead; the rest folded away */
.lead-release { margin-bottom: var(--sp-4); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--amber-line); border-radius: var(--radius-md); background: var(--amber-wash); }
.lead-release p { margin: var(--sp-2) 0 0; }
.lead-release .lead-held-go { margin-top: 0; }
.lead-fold { margin-top: var(--sp-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-alt); }
.lead-fold > summary { padding: var(--sp-2) var(--sp-4); font-weight: var(--fw-medium); cursor: pointer; }
.lead-fold > .lead-qas { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-md) var(--radius-md); }

/* ---- the leads list: a short status tag, and buttons on the row ---- */
table.leads-table td { vertical-align: top; }
table.leads-table td.lead-row-acts, table.leads-table th.lead-row-acts { width: 1%; text-align: right; white-space: nowrap; }
.row-acts { display: inline-flex; flex-wrap: nowrap; justify-content: flex-end; gap: var(--sp-1); }
@media (max-width: 1250px) { .row-acts { flex-wrap: wrap; max-width: 250px; } }
.row-act { padding: 4px 10px; font-size: var(--fs-sm); white-space: nowrap; }
.lead-row-tags { display: flex; margin-top: 3px; }
.lead-row-tags:empty { display: none; }
.lead-held-tag { cursor: help; }
.row-ask p { margin: 0 0 var(--sp-2); }
.row-ask .row-cell { display: grid; gap: 4px; margin-bottom: var(--sp-2); }
.row-ask .field { width: 100%; }
.row-ask-who { font-size: var(--fs-md); }

@media (max-width: 767px) {
  .lead-hd { padding: var(--sp-3); }
  .lead-hd h1 { font-size: var(--fs-xl); }
  .lead-facts { flex-direction: column; gap: var(--sp-3); }
  .lead-fact + .lead-fact { padding-left: 0; border-left: 0; }
  .lead-found-facts, .lead-email-facts { flex-direction: column; }
  .lead-found-dot { display: none; }
  .lead-todos, .lead-running { margin: var(--sp-3) var(--sp-2) 0; padding: var(--sp-3); }
  .lead-todo { padding: var(--sp-3); }
  .lead-todo-go, .lead-todo-go .btn-action, .lead-todo-go .btn-quiet { width: 100%; }
  .lead-acts, .lead-sheet, .lead-said, .lead-email { padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .lead-acts .btn-quiet { min-height: 40px; }
  .lead-found { padding: var(--sp-3); }
  .lead-arrived { margin-left: var(--sp-3); margin-right: var(--sp-3); }
  .row-act { min-height: 36px; }
}

/* ---- DOCS-1: CLIENTS › ON FILE (a client's documents by Part, its pages, its articles) ---------------------------------
   One line per thing; anything long opens in the panel over the page (.reader, on the Leads report panel's .viewer).
   Neutral throughout: a gap says "Nothing here yet" in plain ink, not in a status colour (an empty Part is not an error).
   AMBER is used once: facts that wait on the owner's decision ("needs you", as on the Clients list). */
.of-lead { margin: 0 0 var(--sp-3); color: var(--ink-dim); font-size: var(--fs-sm); }
.of-search { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-3); }
.of-search .field { flex: 1 1 260px; min-width: 0; max-width: 560px; margin: 0; padding: 7px 11px; }
.of-search .btn-save { padding: 7px 16px; }
.of-search .edit-msg { margin-top: 0; }
.of-summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); margin: 0 0 var(--sp-4); font-size: var(--fs-sm); }
.of-held { font-variant-numeric: tabular-nums; }
.of-held.has-tip { cursor: help; }
.of-held.has-tip > span[data-held] { border-bottom: 1px dotted var(--line-strong); }
.of-dot { color: var(--ink-mute); }
.of-held > span { white-space: nowrap; }
.of-tabs { display: none; margin-bottom: var(--sp-3); }
@media (max-width: 900px) { .of-tabs { display: flex; } .rec-pane { scroll-margin-top: calc(var(--header-h) + var(--sp-2)); } }
.of-to-decide { margin-left: var(--sp-2); text-decoration: none; }
.of-waiting-link { text-decoration: none; }
.rec-sec .count:empty { display: none; }

.of-list { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.of-row { display: grid; grid-template-columns: 60px minmax(0, 1fr) minmax(140px, 250px) 104px; gap: var(--sp-1) var(--sp-3); align-items: baseline; padding: 9px var(--sp-3); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.of-list > .of-row:last-child, .of-list > .of-fold:last-child > summary:only-child, .of-list > .of-fold:last-child > .of-row:last-child { border-bottom: 0; }
.of-head { padding-top: 6px; padding-bottom: 6px; background: var(--surface-alt); color: var(--ink-mute); font-weight: var(--fw-medium); font-size: var(--fs-xs); }
.of-click { cursor: pointer; }
.of-click:hover { background: var(--surface-alt); }
.of-lead-cell { font-weight: var(--fw-bold); color: var(--ink-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.of-head .of-lead-cell { font-weight: var(--fw-medium); color: var(--ink-mute); }
.of-main { min-width: 0; overflow-wrap: anywhere; }
.of-name { font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--ink); text-align: left; }
.of-name.link-btn { text-decoration: none; }
.of-click:hover .of-name, .of-name.link-btn:focus-visible { color: var(--accent); }
.of-name-plain { color: var(--ink-dim); }
.of-under { margin-top: 1px; font-size: var(--fs-xs); color: var(--ink-mute); }
.of-held-cell { color: var(--ink-dim); }
.of-date { color: var(--ink-mute); white-space: nowrap; font-variant-numeric: tabular-nums; }
.of-nothing { color: var(--ink-mute); }
.of-gap .of-held-cell .of-nothing { color: var(--ink-dim); font-weight: var(--fw-medium); }
.of-fold > summary { margin: 0; color: inherit; font-size: var(--fs-sm); list-style: none; }
.of-fold > summary::-webkit-details-marker { display: none; }
.of-fold > summary .of-name::after { content: " ▸"; color: var(--ink-mute); }
.of-fold[open] > summary .of-name::after { content: " ▾"; }
.of-fold[open] > summary { background: var(--surface-alt); }
.of-sub { background: var(--surface); }
.of-sub .of-name { font-weight: var(--fw-regular); }
.of-fold > summary:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: -2px; }
.of-extra { margin-top: var(--sp-4); }
.of-extra > summary { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); color: var(--accent); list-style: revert; }
.of-also { margin-top: var(--sp-4); }
.of-list-pages .of-row { grid-template-columns: 36px minmax(0, 1fr) minmax(0, 340px) 104px; }
.of-list-articles .of-row { grid-template-columns: minmax(0, 1fr) 170px 104px; }
.of-list-articles .of-lead-cell { display: none; }
.of-has-row { display: flex; flex-wrap: wrap; gap: 2px var(--sp-3); }
.of-has { white-space: nowrap; }
.of-has-no { color: var(--ink-dim); font-weight: var(--fw-medium); }
.of-articles-bar { margin-bottom: var(--sp-3); }
.of-articles-bar .field-sm { width: auto; min-width: 150px; padding: 7px 10px; }

.of-decisions { margin: 0 0 var(--sp-4); }
.of-decisions-none { font-size: var(--fs-sm); }
.of-decisions.note-unverified { padding: var(--sp-3) var(--sp-4); color: var(--ink); }
.of-decisions-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-2); color: var(--amber-ink); font-size: var(--fs-md); }
.of-decisions-why { margin: 2px 0 var(--sp-2); font-size: var(--fs-sm); color: var(--ink-dim); }
.of-decision { margin-top: var(--sp-3); padding: var(--sp-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.of-decision-fact { margin-bottom: var(--sp-2); font-size: var(--fs-md); font-weight: var(--fw-bold); }
.of-sides { display: grid; gap: var(--sp-2); }
.of-side { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0 var(--sp-3); align-items: baseline; }
.of-side-who { font-size: var(--fs-sm); color: var(--ink-dim); font-weight: var(--fw-medium); }
.of-side-what { font-size: var(--fs-md); overflow-wrap: anywhere; }
.of-side .muted-line { grid-column: 2; }
.of-decide { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
.of-decide .btn-quiet { padding: 6px 14px; }
.of-ask { flex: 1 1 100%; margin-top: 0; }
.of-ask p { margin: 0 0 var(--sp-2); }
.of-ask .field-sm { display: block; width: 100%; max-width: 520px; margin-bottom: var(--sp-2); }
.of-chosen { margin-top: var(--sp-2); }
.of-result .main .link-btn, .of-file .main a { font-size: var(--fs-md); font-weight: var(--fw-medium); text-align: left; }
.of-snippet { color: var(--ink-dim); font-size: var(--fs-sm); }
mark { padding: 0 2px; border-radius: 3px; color: inherit; background: var(--brand-blue-pale); box-shadow: inset 0 -2px 0 var(--brand-blue); }

/* the panel: the Leads report panel's frame, with a head that says what is open and a body that scrolls */
.reader { width: min(980px, 100%); }
.reader-head { align-items: flex-start; }
.reader-heading { flex: 1; min-width: 0; display: grid; gap: 2px; }
.reader-back { justify-self: start; margin-bottom: 2px; }
.reader .viewer-title { font-size: var(--fs-lg); overflow-wrap: anywhere; }
.reader-sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--sp-3); font-size: var(--fs-sm); color: var(--ink-mute); }
.reader-sub a { white-space: nowrap; }
.reader-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--line); background: var(--surface-alt); }
.reader-tools a.btn-quiet { text-decoration: none; display: inline-block; }
.reader-tools .btn-quiet { padding: 6px 12px; }
.reader-switch { margin-left: auto; }
.reader-stage { display: block; overflow: hidden; }
.reader-body { height: 100%; overflow: auto; padding: var(--sp-4); }
.reader-body > * { max-width: 800px; margin-left: auto; margin-right: auto; }
.reader-body > * + * { margin-top: var(--sp-3); }
.reader-body .fgroup { margin-top: var(--sp-4); }
.reader-paper { padding: var(--sp-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.reader-text { font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.reader-text.reader-mono { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; }
.reader-reading { font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.reader-reading p { margin: 0 0 var(--sp-3); }
.reader-reading .rd-h { margin: var(--sp-5) 0 var(--sp-2); font-weight: var(--fw-bold); line-height: 1.25; }
.reader-reading .rd-h:first-child { margin-top: 0; }
.reader-reading .rd-h1 { font-size: 22px; }
.reader-reading .rd-h2 { font-size: 18px; }
.reader-reading .rd-h3, .reader-reading .rd-h4, .reader-reading .rd-h5, .reader-reading .rd-h6 { font-size: var(--fs-lg); }
.rd-li { position: relative; margin: 0 0 var(--sp-2); padding-left: var(--sp-4); }
.rd-li::before { content: "•"; position: absolute; left: 4px; color: var(--ink-mute); }
.reader-note { padding: var(--sp-2) var(--sp-3); background: var(--brand-blue-pale); border: 1px solid var(--brand-blue); border-radius: var(--radius-md); font-size: var(--fs-sm); }
.reader-history { padding: var(--sp-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.reader-history-head { margin-bottom: var(--sp-2); font-size: var(--fs-sm); color: var(--ink-dim); }
.reader-version.here { background: var(--brand-blue-pale); }
.reader-facts { padding: var(--sp-2) var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.reader-foot { text-align: center; }

@media (max-width: 767px) {
  .of-row, .of-list-pages .of-row { grid-template-columns: 44px minmax(0, 1fr); }
  .of-list-articles .of-row { grid-template-columns: minmax(0, 1fr); }
  .of-row > .of-held-cell, .of-row > .of-date { grid-column: 2; }
  .of-list-articles .of-row > .of-held-cell, .of-list-articles .of-row > .of-date { grid-column: 1; }
  .of-row > .of-held-cell:empty, .of-row > .of-date:empty, .of-head { display: none; }
  .of-row { padding: var(--sp-3); }
  .of-search .field { flex-basis: 100%; max-width: none; }
  .of-search .btn-save { min-height: 40px; }
  .of-side { grid-template-columns: 1fr; }
  .of-side .muted-line { grid-column: 1; }
  .of-decide .btn-quiet { flex: 1 1 100%; min-height: 40px; }
  .reader-tools { padding: var(--sp-2) var(--sp-3); }
  .reader-tools .btn-quiet { min-height: 40px; }
  .reader-switch { margin-left: 0; }
  .reader-body { padding: var(--sp-3) var(--sp-2); }
  .reader-paper { padding: var(--sp-3); }
}

/* ---- SHELL-TCG, SHELL-TCG2: CLUSTERED TOPICS (a main tool) ---------------------------------------------------------------
   The same one-line rows as On file (.of-row); a row drops down to what is under it. THE COLOURS HERE ARE THE OWNER'S RULE
   FOR THIS TOOL (status at a glance): not written yet neutral · partly written AMBER · done / live GREEN · needs attention
   RED · retired or withdrawn GREY, never hidden. An action's check-then-confirm is the shared pop-up (.modal). */
.tp-counts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-2); margin: 0 0 var(--sp-3); }
.tp-count { padding: var(--sp-2) var(--sp-3); background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-md); }
.tp-count-n { font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: 1.2; font-variant-numeric: tabular-nums; }
.tp-count-n .tp-unknown { font-size: var(--fs-sm); font-weight: var(--fw-regular); }
.tp-count-l { font-size: var(--fs-xs); color: var(--ink-mute); }
.tp-year-acts, .tp-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.tp-year-acts { margin: 0 0 var(--sp-4); }
.tp-act { padding: 6px 12px; }
.tp-said { margin: 0 0 var(--sp-4); }
.tp-said .verdict { margin: var(--sp-1) 0 0; }
.tp-tabs { margin-bottom: var(--sp-3); }
.tp-list .of-row { grid-template-columns: 44px minmax(0, 1fr) minmax(120px, 230px) 110px; }
.tp-fold-body { padding: var(--sp-3) var(--sp-3) var(--sp-3) calc(44px + var(--sp-3) + var(--sp-3)); border-bottom: 1px solid var(--line); background: var(--surface); display: grid; gap: var(--sp-3); }
.tp-fold-body > .tp-titles { margin-left: calc(-1 * (44px + var(--sp-3))); }
.tp-titles .tp-fold-body { background: var(--surface-alt); }
.tp-titles .of-name { font-weight: var(--fw-regular); }
.tp-facts .frow { grid-template-columns: 170px minmax(0, 1fr); }
.tp-facts .fval { font-size: var(--fs-sm); white-space: normal; }
.tp-sub { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-dim); }
.tp-grey > summary .of-name, .tp-grey > summary .of-lead-cell, .tp-grey > summary .of-under, .tp-grey-list .of-name { color: var(--ink-mute); }
.tp-grey > summary .of-name { font-weight: var(--fw-regular); }
.tp-live-link { display: inline-block; margin-left: 6px; padding: 0 4px; border-radius: 4px; white-space: nowrap; font-size: var(--fs-sm); font-weight: var(--fw-bold); line-height: 1.4; text-decoration: none; vertical-align: baseline; }
.tp-live-link:hover, .tp-live-link:focus-visible { background: var(--surface-alt); text-decoration: none; }
.tp-bar .field-sm { width: auto; }
.tp-tail > .of-list { margin-top: var(--sp-2); }
/* the pop-up of an action: what it will do, the check, the verdict and the cost, then Confirm */
.tp-action { display: grid; gap: var(--sp-3); }
.tp-action p { margin: 0; }
.tp-action .row-cell .field, .tp-action .row-cell .field-area { width: 100%; margin: 0; font-size: var(--fs-md); }
.tp-action .row-cell > span { font-size: var(--fs-sm); color: var(--ink-dim); }
.tp-was { font-size: var(--fs-sm); color: var(--ink-dim); overflow-wrap: anywhere; }
.tp-check { padding: var(--sp-3); border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-alt); display: grid; gap: var(--sp-2); }
.tp-check-head { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-dim); }
.tp-check dl.kv { grid-template-columns: 150px minmax(0, 1fr); }
.tp-check dl.kv dd { text-align: left; overflow-wrap: anywhere; }
.tp-check ul { margin: 0; padding-left: var(--sp-4); font-size: var(--fs-sm); }
.tp-check .verdict { margin: 0; }
@media (max-width: 767px) {
  .tp-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tp-list .of-row { grid-template-columns: 34px minmax(0, 1fr); }
  .tp-fold-body { padding-left: var(--sp-3); }
  .tp-fold-body > .tp-titles { margin-left: 0; }
  .tp-facts .frow { grid-template-columns: 1fr; }
  .tp-act { min-height: 40px; }
  .tp-year-acts .tp-act { flex: 1 1 100%; }
}

/* SHELL-TCG2: the tool's own page */
.ct-bar { margin-bottom: var(--sp-3); }
.ct-pdf { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-1) var(--sp-2); max-width: 520px; }
.ct-pdf-why { flex-basis: 100%; text-align: right; font-size: var(--fs-xs); color: var(--ink-mute); }
.ct-summary { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-5); margin: 0 0 var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); font-size: var(--fs-md); color: var(--ink-dim); }
.ct-summary strong { color: var(--ink); font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.ct-go-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); margin: 0 0 var(--sp-4); max-width: 1040px; }
.ct-go { width: 100%; padding: 11px 18px; }
.ct-go-why { margin-top: var(--sp-1); font-size: var(--fs-sm); color: var(--ink-dim); }
.ct-group > h3 { font-size: var(--fs-sm); letter-spacing: .06em; text-transform: uppercase; }
.ct-hint { margin: 0 0 var(--sp-2); }
.ct-list .of-row { grid-template-columns: 48px minmax(0, 1fr) minmax(90px, 190px) minmax(120px, 200px); align-items: center; }
.ct-list .tp-fold-body { padding-left: calc(48px + var(--sp-3) + var(--sp-3)); }
.ct-list .tp-fold-body > .tp-titles { margin-left: calc(-1 * (48px + var(--sp-3))); }
.ct-list .tp-titles .of-row { grid-template-columns: 34px minmax(0, 1fr) minmax(90px, 210px) minmax(90px, 190px); }
.ct-right { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-1) var(--sp-2); white-space: normal; }
.ct-menu { padding: 3px 10px; font-size: var(--fs-xs); }
.ct-fold > summary, .ct-later-row { box-shadow: inset 3px 0 0 transparent; }
.ct-tone-green > summary { box-shadow: inset 3px 0 0 var(--green); }
.ct-tone-amber > summary { box-shadow: inset 3px 0 0 var(--amber); }
.ct-tone-red > summary { box-shadow: inset 3px 0 0 var(--red); }
.ct-tone-purple > summary { box-shadow: inset 3px 0 0 var(--scheduled-purple); }
.ct-tone-teal > summary { box-shadow: inset 3px 0 0 var(--written-teal); }
.ct-pill-purple { color: var(--scheduled-purple-ink); background: var(--scheduled-purple-card); border-color: var(--scheduled-purple); }
.ct-pill-teal { color: var(--written-teal-ink); background: var(--written-teal-card); border-color: var(--written-teal); }
.ct-tone-grey > summary .of-name, .ct-tone-grey > summary .of-lead-cell, .ct-tone-grey .of-name-plain, .ct-grey .of-name { color: var(--ink-mute); font-weight: var(--fw-regular); }
.ct-theme-name { color: var(--ink); }
.ct-theme-line { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-sm); }
.ct-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-5); margin-top: var(--sp-5); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.ct-toggle { font-size: var(--fs-md); color: var(--ink); font-weight: var(--fw-medium); cursor: pointer; }
.ct-toggle-small { font-size: var(--fs-sm); color: var(--ink-mute); font-weight: var(--fw-regular); }
.ct-retired { margin-top: var(--sp-4); }
/* REV-2, REV-2B: when the plan was last reviewed; the Review panel (part of the page, so it reads the same on a phone):
   working, then "What changed". Nothing waits for an approval, so there is no Approve button */
.ct-review-line { display: flex; flex-wrap: wrap; gap: 0 var(--sp-4); margin: calc(-1 * var(--sp-1)) 0 var(--sp-3); font-size: var(--fs-xs); color: var(--ink-mute); }
.ct-review { margin: 0 0 var(--sp-4); padding: var(--sp-4); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-md); display: grid; gap: var(--sp-3); max-width: 1040px; }
.ct-rv-head h2 { margin: 0; font-size: var(--fs-lg); }
.ct-review .verdict { margin: 0; }
.ct-rv-part > h3 { margin: 0 0 var(--sp-1); padding-bottom: var(--sp-1); font-size: var(--fs-sm); font-weight: var(--fw-bold); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); border-bottom: 1px solid var(--line); }
.ct-rv-part p { margin: 0; }
.ct-rv-list { margin: 0; padding-left: var(--sp-4); display: grid; gap: var(--sp-2); font-size: var(--fs-md); overflow-wrap: anywhere; }
.ct-rv-name { font-weight: var(--fw-medium); color: var(--ink); }
.ct-rv-why, .ct-rv-swap { font-size: var(--fs-sm); color: var(--ink-dim); }
.ct-rv-move { font-weight: var(--fw-regular); color: var(--ink-dim); }
.ct-rv-sub { margin: var(--sp-2) 0 var(--sp-1); font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-dim); }
.ct-rv-note { margin-bottom: var(--sp-1); }
.ct-rv-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.ct-rv-small { font-size: var(--fs-sm); gap: var(--sp-1); }
.ct-rv-more > summary { cursor: pointer; font-size: var(--fs-sm); color: var(--accent); margin: var(--sp-1) 0; }
.ct-rv-more[open] > summary { margin-bottom: var(--sp-2); }
.ct-rv-acts .muted-line { flex: 1 1 260px; }
.ct-review-line .link-btn { font-size: inherit; }
.ct-review-working { background: var(--brand-blue-pale); border-color: rgba(36, 148, 224, .35); border-left: 4px solid var(--accent); }
.ct-review-working .sch-prog-title { font-size: 18px; }
.ct-rv-bar { width: 100%; }
.ct-rv-nothing { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--ink); }
#ct-review-refused strong { font-weight: var(--fw-bold); }
@media (max-width: 1100px) { .ct-go-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .ct-review { padding: var(--sp-3); }
  .ct-rv-acts .btn-action, .ct-rv-acts .btn-quiet { min-height: 44px; }
  .ct-rv-acts .btn-action { flex: 1 1 100%; }
  .title-row .ct-pdf { justify-content: flex-start; max-width: none; }
  .ct-pdf-why { text-align: left; }
  .ct-go-row { grid-template-columns: 1fr; }
  .ct-go { min-height: 44px; }
  .ct-summary { flex-direction: column; padding: var(--sp-3); }
  .ct-list .of-row, .ct-list .tp-titles .of-row { grid-template-columns: 34px minmax(0, 1fr); }
  .ct-list .tp-fold-body { padding-left: var(--sp-3); }
  .ct-list .tp-fold-body > .tp-titles { margin-left: 0; }
  .ct-right { justify-content: flex-start; }
  .ct-menu { min-height: 36px; }
}

/* ---- LEADS-BOOK-1: calls booked by someone who matches no lead (the line at the top of Leads, and its list) -------------
   Quiet when none still stands; the count of those still booked is AMBER (it needs the owner). */
.ubk { margin: 0 0 var(--sp-3); padding: var(--sp-2) var(--sp-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.ubk.ubk-standing { border-color: var(--amber-line); }
.ubk-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-3); }
.ubk-line { font-size: var(--fs-md); font-weight: var(--fw-medium); text-align: left; }
.ubk-line::after { content: "▸"; display: inline-block; margin-left: 6px; text-decoration: none; }
.ubk-line[aria-expanded="true"]::after { content: "▾"; }
.ubk-box { margin-top: var(--sp-2); }
.ubk-why { margin: 0 0 var(--sp-2); }
.ubk-row { align-items: center; }
.ubk-row .ubk-facts { color: var(--ink-dim); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.ubk-cancelled .main { color: var(--ink-mute); font-weight: var(--fw-regular); }
.ubk-acts { flex-basis: 100%; }
.ubk-pick { margin-top: var(--sp-1); max-width: 640px; display: grid; gap: var(--sp-2); }
.ubk-pick p { margin: 0; }
.ubk-pick .field { margin: 0; width: 100%; }
.ubk-pick .ubk-leads { padding: 4px; font-size: var(--fs-sm); }
.ubk-foot { margin-top: var(--sp-2); }
@media (max-width: 767px) { .ubk-pick .btn-save, .ubk-pick .btn-quiet, .ubk-row .btn-quiet { min-height: 40px; } }

/* ---- SHELL-SCHED1: SCHEDULER (a main tool) --------------------------------------------------------------------------------
   The same one-line rows as Clustered Topics (.of-row). ONE orange button (.btn-action). A cluster that is scheduled and
   not live yet is drawn in the locked Scheduled purple, and nothing else on the page is. */
.sch-group > .sch-hint { margin: 0 0 var(--sp-2); }
.sch-row { grid-template-columns: 26px 40px minmax(0, 1fr) minmax(110px, 190px) 176px; align-items: center; }
.sch-row.is-picked { background: var(--brand-blue-pale); }
.sch-pick { display: flex; align-items: center; }
.sch-pick input { width: 18px; height: 18px; margin: 0; cursor: pointer; }
.sch-row label.of-main { cursor: pointer; }
.sch-day .field { width: 100%; min-width: 0; margin: 0; padding: 6px 8px; font-size: var(--fs-sm); }
.sch-waiting { margin-top: var(--sp-2); }
.sch-go-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-4); }
.sch-go { padding: 11px 28px; font-size: var(--fs-lg); }
.sch-go-why { font-size: var(--fs-sm); color: var(--ink-mute); }
/* SCHED-2: "it is working". A spinner, what is happening, a bar, a clock. The bar's solid part is the clusters finished; the
   striped part, which moves, is the cluster being worked on now. Brand blue: it is activity, not a status. */
@keyframes sch-spin { to { transform: rotate(360deg); } }
@keyframes sch-slide { to { background-position: 28px 0; } }
.sch-spin { display: inline-block; flex: none; width: 16px; height: 16px; border: 2px solid rgba(14, 90, 166, .25); border-top-color: var(--accent); border-radius: 50%; animation: sch-spin .8s linear infinite; vertical-align: -3px; }
.btn-action .sch-spin { margin-right: 8px; border-color: rgba(255, 255, 255, .4); border-top-color: var(--on-action); }
.btn-action.is-busy:disabled { background: var(--action); color: var(--on-action); opacity: .8; cursor: progress; }
.sch-prog { display: grid; gap: var(--sp-2); margin-top: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid rgba(36, 148, 224, .35); border-left: 4px solid var(--accent); border-radius: var(--radius-md); background: var(--brand-blue-pale); }
.sch-prog[hidden], .sch-confirm-actions [hidden] { display: none; }
.sch-prog-head { display: flex; align-items: center; gap: var(--sp-2); }
.sch-prog-title { flex: 1; font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--ink); }
.sch-prog-clock { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.sch-prog-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: rgba(14, 90, 166, .15); }
.sch-prog-done { background: var(--accent); }
.sch-prog-now { background: repeating-linear-gradient(-45deg, var(--brand-blue) 0 10px, #7cc0f0 10px 20px); background-size: 28px 100%; animation: sch-slide .7s linear infinite; }
.sch-prog-sub { font-size: var(--fs-sm); color: var(--ink-dim); }
@media (prefers-reduced-motion: reduce) { .sch-spin { animation-duration: 2.4s; } .sch-prog-now { animation: none; } }
table.sch-plan .sch-plan-mark { width: 124px; white-space: nowrap; font-size: var(--fs-sm); color: var(--ink-dim); }
table.sch-plan .sch-plan-mark .sch-spin { width: 13px; height: 13px; margin-right: 6px; }
table.sch-plan td.sch-plan-mark[data-state="doing"] { color: var(--accent); font-weight: var(--fw-bold); }
table.sch-plan td.sch-plan-mark[data-state="done"] { color: var(--green-ink); font-weight: var(--fw-bold); }
table.sch-plan td.sch-plan-mark[data-state="stopped"] { color: var(--red-ink); font-weight: var(--fw-bold); }
.sch-new { display: inline-block; margin-left: var(--sp-2); padding: 0 8px; border: 1px solid var(--scheduled-purple); border-radius: 999px; background: var(--surface); color: var(--scheduled-purple-ink); font-size: var(--fs-xs); font-weight: var(--fw-bold); line-height: 18px; white-space: nowrap; vertical-align: 1px; }
.sch-srow.is-new { box-shadow: inset 4px 0 0 var(--scheduled-purple); }
.sch-said { display: grid; gap: var(--sp-2); margin-top: var(--sp-4); }
.sch-panel { padding: var(--sp-3) var(--sp-4); }
.sch-fail { margin-top: var(--sp-3); }
.sch-fail-head { font-weight: var(--fw-bold); }
.sch-fail ul { margin: var(--sp-1) 0 0; padding-left: var(--sp-5); overflow-wrap: anywhere; }
.sch-fail li + li { margin-top: var(--sp-1); }
.sch-fail-ok { margin-top: var(--sp-3); font-size: var(--fs-sm); }
.sch-result { overflow-wrap: anywhere; }
.state.sch-result { padding: var(--sp-2) var(--sp-3); }
.sch-not-listed { display: grid; gap: var(--sp-2); text-align: left; border-style: solid; color: var(--ink); }
.sch-confirm { display: grid; gap: var(--sp-3); }
.sch-confirm p { margin: 0; }
table.sch-plan td { vertical-align: top; }
table.sch-plan .sch-plan-day { white-space: nowrap; }
.sch-confirm-actions .btn-action { flex: 1; padding: 11px 18px; }
.sch-scheduled .sch-list { border-color: var(--scheduled-purple); }
.sch-srow { grid-template-columns: 40px minmax(0, 1fr) minmax(110px, 200px) minmax(170px, 230px) 92px; align-items: center; background: var(--scheduled-purple-card); border-bottom-color: var(--scheduled-purple); }
.sch-srow, .sch-srow .of-lead-cell, .sch-srow .of-name, .sch-srow .of-held-cell, .sch-srow .of-under { color: var(--scheduled-purple-ink); }
.sch-when { font-variant-numeric: tabular-nums; }
.sch-when-time { font-size: var(--fs-sm); }
.sch-pill-cell { text-align: right; }
.sch-pill { background: var(--scheduled-purple-ink); border-color: var(--scheduled-purple-ink); color: var(--on-brand); font-weight: var(--fw-bold); }
@media (max-width: 767px) {
  .sch-row { grid-template-columns: 30px 34px minmax(0, 1fr); }
  .sch-row > .of-held-cell, .sch-row > .sch-day { grid-column: 3; }
  .sch-row.of-head { display: none; }
  .sch-day .field { min-height: 40px; }
  .sch-go-row { flex-direction: column; align-items: stretch; }
  .sch-go { width: 100%; min-height: 46px; }
  .sch-srow { grid-template-columns: 34px minmax(0, 1fr); }
  .sch-srow > .of-held-cell, .sch-srow > .sch-when, .sch-srow > .sch-pill-cell { grid-column: 2; text-align: left; }
  .sch-confirm-actions .btn-action, .sch-confirm-actions .btn-quiet { min-height: 44px; }
}

/* ---- SALES-1: THE LEADS SCREENS AS THE SALES STORY (tools/leads/sales.js, leads.js; the approved mockup) ------------------ */
.sp-top { display: flex; flex-direction: column; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.sp-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); }
.sp-name { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.3px; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.sp-contact { font-size: 15px; color: var(--ink-dim); margin-top: 6px; overflow-wrap: anywhere; }
.sp-head-acts, .sp-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.sp-btn, .sp-go { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: var(--radius-md); font: inherit; font-size: var(--fs-md); font-weight: var(--fw-medium); text-decoration: none; cursor: pointer; }
.sp-btn { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.sp-btn-quiet { color: var(--ink-dim); }
.sp-btn:disabled { color: var(--ink-mute); background: var(--surface-alt); cursor: not-allowed; }
.sp-go { border: 0; background: var(--sales-blue); color: #fff; font-weight: var(--fw-bold); }
.sp-go:disabled { opacity: .55; cursor: progress; }
.sp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); box-shadow: var(--shadow-xs); }
.sp-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-dim); }
.sp-label-pad { padding: 0 4px; }
.sp-label-sub { margin-top: var(--sp-2); }
.sp-small { font-size: var(--fs-sm); color: var(--ink-dim); line-height: 1.5; }
/* the strip */
.sp-strip { list-style: none; margin: 0; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; flex-wrap: wrap; gap: 10px 0; }
.sp-step { display: flex; align-items: center; gap: 10px; padding-right: 24px; color: var(--ink-dim); }
.sp-step + .sp-step::before { content: ""; width: 28px; height: 2px; background: var(--line-strong); margin-right: 14px; }
.sp-step.is-done + .sp-step::before { background: var(--green); }
.sp-dot { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-dim); background: var(--surface); }
.sp-step.is-done .sp-dot { background: var(--green); border-color: var(--green); color: #fff; }
.sp-step.is-now .sp-dot { background: var(--sales-blue); border-color: var(--sales-blue); color: #fff; }
.sp-step.is-done, .sp-step.is-now { color: var(--ink); }
.sp-step.is-now .sp-step-label { color: var(--sales-blue); }
.sp-step-words { display: flex; flex-direction: column; line-height: 1.2; }
.sp-step-label { font-size: var(--fs-md); font-weight: 600; }
.sp-step-at { font-size: var(--fs-xs); color: var(--ink-dim); font-weight: 400; }
.sp-step-lost .sp-dot { background: var(--watch-bg); color: var(--watch-ink); }
/* what the audit found, and the next step */
.sp-grid { display: flex; flex-wrap: wrap; gap: var(--sp-5); align-items: flex-start; }
.sp-found { flex: 999 1 520px; min-width: 0; }
.sp-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.sp-sentence { font-size: 21px; font-weight: 600; line-height: 1.3; }
.sp-bigs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.sp-big { background: var(--bg); border-radius: var(--radius-md); padding: 14px 16px; }
.sp-big-n { font-size: 26px; font-weight: 700; }
.sp-big-label { font-size: var(--fs-sm); color: var(--ink-dim); }
.sp-para { margin: 0; font-size: 15px; line-height: 1.55; }
.sp-next { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 72px; padding: 16px 20px; border-radius: var(--radius-lg); font: inherit; font-size: 17px; font-weight: 600; text-align: left; cursor: pointer; width: 100%; }
.sp-next-main { border: 0; background: var(--sales-blue); color: #fff; }
.sp-next-stub { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: not-allowed; }
.sp-next-sub { font-size: var(--fs-sm); font-weight: 400; opacity: .85; }
.sp-next-stub .sp-next-sub { color: var(--ink-dim); opacity: 1; }
.sp-note-line { font-size: var(--fs-md); line-height: 1.5; }
.sp-note-form, .sp-fix { display: flex; flex-direction: column; gap: var(--sp-2); }
.sp-radios { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.sp-radio { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-md); min-height: 32px; }
.sp-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.sp-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
/* the build panel */
.sp-panel { border: 2px solid var(--sales-blue); }
.sp-panel-hd { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--sp-2); }
.sp-panel-title { font-size: 18px; font-weight: 700; display: inline-flex; align-items: center; gap: var(--sp-2); }
.sp-pills { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.sp-pill { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-md); font-weight: var(--fw-medium); cursor: pointer; }
.sp-pill.is-on { background: var(--sales-blue); border-color: var(--sales-blue); color: #fff; font-weight: 600; }
.sp-boxes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }
.sp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sp-field-label { font-size: var(--fs-sm); font-weight: 600; }
.sp-box { height: 48px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: 0 12px; font: inherit; font-size: 18px; font-weight: 600; width: 100%; min-width: 0; }
.sp-box.is-changed { border: 2px solid var(--changed); }
.sp-field-says { font-size: var(--fs-xs); color: var(--ink-dim); }
.sp-field-says.is-changed { color: var(--changed); font-weight: 600; }
.sp-more { border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.sp-more > summary { cursor: pointer; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-dim); min-height: 32px; display: flex; align-items: center; }
.sp-more-body { display: flex; flex-wrap: wrap; gap: var(--sp-5); margin-top: var(--sp-3); }
.sp-more-col { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
/* the proposal */
.sp-flags { margin: 0; padding-left: 28px; display: flex; flex-direction: column; gap: 4px; }
.sp-ask { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-3); border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-alt); }
.sp-frame { width: 100%; height: 900px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.sp-folds { margin-top: var(--sp-2); }
.lead-top-folded { margin-bottom: var(--sp-4); }
/* the list */
.sp-list-hd { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-3); }
.sp-list-hd .page-title { margin-bottom: 4px; }
.sp-list-sub { font-size: 15px; color: var(--ink-dim); }
.sp-today { margin-bottom: var(--sp-4); }
.sp-today-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.sp-today-name { font-weight: 600; }
.sp-today-says { color: var(--ink-dim); }
.sp-lead-order { display: flex; justify-content: flex-end; margin: var(--sp-2) 0; }
.sp-leads { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.sp-lead { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); padding: 16px 22px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.sp-lead:last-child { border-bottom: 0; }
.sp-lead:hover { background: var(--surface-alt); }
.sp-lead-who { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-lead-name { font-size: var(--fs-lg); font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.sp-lead-line { font-size: var(--fs-sm); color: var(--ink-dim); overflow-wrap: anywhere; }
.sp-lead-stage { flex: 0 0 170px; display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--ink-dim); }
.sp-lead-dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa3af; flex: none; }
.sp-lead-stage[data-step="call"], .sp-lead-stage[data-step="proposal"] { color: var(--sales-blue); }
.sp-lead-stage[data-step="call"] .sp-lead-dot, .sp-lead-stage[data-step="proposal"] .sp-lead-dot { background: var(--sales-blue); }
.sp-lead-stage[data-step="contract"] { color: var(--changed); }
.sp-lead-stage[data-step="contract"] .sp-lead-dot { background: var(--changed); }
.sp-lead-stage[data-step="won"] { color: var(--green-ink); }
.sp-lead-stage[data-step="won"] .sp-lead-dot { background: var(--green); }
.sp-lead-named { flex: 0 0 140px; font-size: var(--fs-sm); color: var(--ink-dim); }
.sp-lead-touch { flex: 0 0 120px; font-size: var(--fs-sm); color: var(--ink-dim); }
@media (max-width: 767px) {
  .sp-name { font-size: 24px; }
  .sp-strip { padding: 14px 16px; }
  .sp-step { padding-right: 12px; }
  .sp-step + .sp-step::before { width: 14px; margin-right: 8px; }
  .sp-card { padding: var(--sp-4); }
  .sp-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-bigs { gap: var(--sp-2); }
  .sp-big { padding: 10px; }
  .sp-big-n { font-size: 20px; }
  .sp-grid2, .sp-grid3 { grid-template-columns: 1fr; }
  .sp-frame { height: 70vh; }
  .sp-lead { gap: 6px var(--sp-3); padding: 14px 16px; }
  .sp-lead-stage, .sp-lead-named, .sp-lead-touch { flex: 0 1 auto; }
}

/* ---- DASH-2: ONE LOOK FOR EVERY SCREEN (the approved "Tools Dashboard — One Look" mockup) ------------------------------
   Shared component classes, prefixed ui-, for any screen. Nothing screen-specific lives here. They extend SALES-1's look
   (the same blue, orange, radius and labels: .sp-* above) and use only the tokens. Screens that keep their own markup
   pick up the new look through the tokens alone (and the three lines just below). */
.card, .table-wrap, .attention { border-radius: var(--radius-lg); }
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -.3px; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
/* a page's title row: the title and its line on the left, the chips or buttons on the right; wraps on a phone */
.ui-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.ui-head .page-title { margin: 0; }
.ui-head .page-sub { margin: 4px 0 0; font-size: var(--fs-md); }
.ui-stack { display: flex; flex-direction: column; gap: var(--sp-5); }
/* the section label: uppercase, 12px */
.ui-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-dim); }
.ui-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin: 0 0 calc(-1 * var(--sp-2)); }
/* the card */
.ui-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 24px; display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.ui-card-hd { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); padding-bottom: var(--sp-2); }
.ui-card-title { font-size: var(--fs-lg); font-weight: 700; }
.ui-card-sub { font-size: var(--fs-sm); color: var(--ink-dim); }
.ui-dashed { border: 1.5px dashed var(--line-strong); background: transparent; }
/* pills: the state of a piece of work */
.ui-pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; border: 0; }
.ui-pill-keep      { background: var(--done-wash); color: var(--done-ink); }
.ui-pill-cut-later { background: var(--attention-wash); color: var(--attention-ink); }
.ui-pill-done      { background: var(--done); color: #fff; }
.ui-pill-running   { background: var(--sales-blue); color: #fff; }
.ui-pill-waiting   { background: var(--waiting-bg); color: var(--waiting-ink); }
.ui-pill-attention { background: var(--attention-wash); color: var(--attention-ink); }
.ui-pills { display: flex; flex-wrap: wrap; gap: 6px; }
/* buttons: one primary action a screen, secondary everywhere else; 44px to touch */
.ui-btn, .ui-go { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: var(--radius-md); font: inherit; font-size: var(--fs-md); font-weight: var(--fw-medium); text-decoration: none; cursor: pointer; white-space: nowrap; }
.ui-btn { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.ui-btn:hover { border-color: var(--accent); color: var(--accent); }
.ui-btn:disabled { color: var(--ink-mute); background: var(--surface-alt); cursor: not-allowed; }
.ui-btn-sm { min-height: 36px; padding: 0 12px; font-size: var(--fs-sm); border-radius: 8px; }
.ui-btn-quiet { color: var(--ink-dim); }
.ui-go { border: 0; background: var(--sales-blue); color: #fff; font-weight: 600; }
.ui-go:hover { background: #0a50b8; color: #fff; }
.ui-link { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--accent); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.ui-link:hover { text-decoration: underline; }
/* the chip row: periods, and a page's views */
.ui-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.ui-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium); text-decoration: none; cursor: pointer; }
.ui-chip:hover { border-color: var(--ink); }
.ui-chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
/* stat tiles: a number, its line, and "how" (the formula and the rows behind it) */
.ui-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-4); }
.ui-tiles-6 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ui-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; color: inherit; text-decoration: none; }
a.ui-tile:hover { border-color: var(--accent); }
.ui-tile-n { font-size: 30px; font-weight: 700; line-height: 1.15; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); font-variant-numeric: tabular-nums; }
.ui-tile-n small { font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--ink-dim); }
.ui-tile-n small.is-attention { color: var(--changed); }
.ui-tile-sub { font-size: var(--fs-sm); color: var(--ink-dim); line-height: 1.45; }
.ui-tile-null { font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--ink-dim); line-height: 1.4; }
.ui-tile-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-top: auto; padding-top: 6px; }
.ui-how { font-size: var(--fs-xs); }
.ui-how-box { margin-top: 6px; padding: 10px 12px; background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-md); font-size: var(--fs-sm); line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.ui-how-box ul { margin: 6px 0 0; padding-left: 18px; }
/* list rows inside a card */
.ui-rows { display: flex; flex-direction: column; }
.ui-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); padding: 14px 0; border-top: 1px solid var(--line); }
.ui-row-main { flex: 1 1 260px; min-width: 0; }
.ui-row-title { font-size: 15px; font-weight: 600; }
.ui-row-sub { font-size: var(--fs-sm); color: var(--ink-dim); }
.ui-row-num { flex: 0 0 110px; font-size: var(--fs-lg); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.ui-row-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.ui-row-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-2); padding-top: 14px; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-dim); }
/* the folded tabs strip: everything else a page holds, one press away */
.ui-folds { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 6px 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.ui-fold { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--radius-md); font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--ink-dim); text-decoration: none; }
.ui-fold:hover { background: var(--surface-alt); color: var(--ink); }
.ui-fold.is-open { background: var(--sales-blue-wash); color: var(--sales-blue); }
/* two columns that stack on a phone */
.ui-two { display: flex; flex-wrap: wrap; gap: var(--sp-5); align-items: flex-start; }
.ui-two > .ui-main { flex: 999 1 520px; min-width: 0; }
.ui-two > .ui-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-4); }
/* dots: a month's clusters (grey planned, blue writing, green published) */
.ui-dots { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ui-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--waiting-bg); flex: none; }
.ui-dot.is-running { background: var(--sales-blue); }
.ui-dot.is-done { background: var(--done); }
/* a bar under a card's lines */
.ui-bar { height: 8px; border-radius: 999px; background: var(--waiting-bg); overflow: hidden; }
.ui-bar > span { display: block; height: 100%; background: var(--sales-blue); }
@media (max-width: 767px) {
  .page-title { font-size: 24px; }
  .ui-card { padding: 16px; }
  .ui-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
  .ui-tiles-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ui-tile { padding: 14px; }
  .ui-tile-n { font-size: 22px; }
  .ui-row-num { flex: 0 1 auto; text-align: left; }
  .ui-head { align-items: flex-start; }
}
@media (max-width: 380px) { .ui-tiles { grid-template-columns: minmax(0, 1fr); } }

/* ---- DASH-2: THE SCREENS DRAWN IN THE ONE LOOK (tools/dashboard, tools/clients/overview.js, clients.js's cards) -----------
   Only what those screens need beyond the shared ui-* classes above. */
/* the menu runs the full height beside the page and stays put while the page scrolls (the mockup's navy column) */
@media (min-width: 768px) { .shell-nav { position: sticky; top: var(--header-h); align-self: flex-start; height: calc(100vh - var(--header-h)); overflow-y: auto; } }
/* the Scoreboard's compact Needs-you strip: one line each, inside its card; a detail keeps to one line */
.ui-card.needs-you .ny-detail { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ui-card.needs-you .ny-what { min-width: 0; }
.ui-card.needs-you { margin: 0; }
.ui-card.needs-you .ny-list { border: 0; box-shadow: none; background: transparent; }
.ui-card.needs-you .ny-item { padding-left: 0; padding-right: 0; }
/* the Clients list as cards */
.client-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-4); margin-top: var(--sp-4); }
.client-card { gap: 10px; }
.client-card .cc-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.client-card .cc-top .client-link { color: var(--ink); text-decoration: none; font-size: var(--fs-lg); }
.client-card .cc-top .client-link:hover { color: var(--accent); }
.client-card .cc-more { line-height: 1.5; }
.client-card .cc-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-top: auto; padding-top: var(--sp-2); border-top: 1px solid var(--line); }
.client-card .cc-marks { flex: 1 1 200px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--ink-dim); }
.client-card .cc-marks .pill { margin-left: 0 !important; }
/* the client page: the record under its folds keeps its own layout */
#client-record { min-width: 0; }
#client-needs .cn-text { font-size: var(--fs-md); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 767px) { .client-cards { grid-template-columns: minmax(0, 1fr); } }

/* ---- SALES-2: THE CONTRACT PANEL (tools/leads/contract.js) ----------------------------------------------------------------- */
.sp-next.sp-next-stub.is-live { cursor: pointer; }
.ct-panel { gap: var(--sp-4); }
.ct-block { display: flex; flex-direction: column; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--line); min-width: 0; }
.ct-slot-grid { gap: var(--sp-2) var(--sp-3); }
.ct-slot.is-empty > span { color: var(--red-ink); font-weight: 600; }
.field.is-empty { border: 2px solid var(--red); background: var(--red-wash); }
.ct-empty-tag { color: var(--red-ink); }
.ct-items { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: var(--sp-3); }
.ct-item { display: flex; flex-direction: column; gap: 6px; }
.ct-item.is-done .ct-item-hd strong::after { content: " ✓"; color: var(--green-ink); }
.ct-wording { font-size: var(--fs-md); line-height: 1.5; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-alt); overflow-wrap: anywhere; }
.ct-item.is-legal .ct-wording { border-color: var(--amber-line); background: var(--amber-wash); }
.ct-section { display: inline-block; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-dim); margin-right: 4px; }
.ct-amber, .ct-amber-line { color: var(--amber-ink); font-weight: 600; }
.ct-amber { font-size: var(--fs-sm); padding: 6px 10px; border: 1px solid var(--amber-line); background: var(--amber-wash); border-radius: var(--radius-md); align-self: flex-start; }
.ct-q { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-md); }
.sp-btn.is-on { border-color: var(--sales-blue); color: var(--sales-blue); font-weight: 600; }
.ct-flaglist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.ct-flag { padding: 10px 12px; border: 1px solid var(--amber-line); background: var(--amber-wash); border-radius: var(--radius-md); }
.ct-flag.is-checked { border-color: var(--line); background: var(--surface-alt); }
.ct-rb { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 4px var(--sp-3); margin: var(--sp-2) 0; font-size: var(--fs-md); }
.ct-rb dt { color: var(--ink-dim); }
.ct-rb dd { margin: 0; overflow-wrap: anywhere; }
.ct-strip { padding: 12px 16px; }
/* long unbroken ids (a Stripe session id is 66 characters) wrap instead of pushing the page sideways at phone width */
.ct-panel, .ct-block, .ct-block .sp-row { min-width: 0; max-width: 100%; }
.ct-block .sp-small, #ct-ids, .ct-panel .state, .ct-panel .lead-note { overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 767px) {
  .ct-rb { grid-template-columns: 1fr; }
  .ct-rb dd { margin-bottom: 6px; }
  .ct-q { flex-direction: column; align-items: flex-start; }
}

/* ---- DASH-3: SCOREBOARD v2 (tools/dashboard) AND THE NEEDS-YOU PILL + DRAWER (src/needs-you.js) ----------------------------
   The four bands' colours are the owner-approved artboard's: each band a tint, a small square of its colour before its
   title, the tiles white inside. Tones on a chip mean one thing each: green better, orange worse or stuck, grey flat/none. */
.dash-head { margin-bottom: var(--sp-3); }
.dash-head-right { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.dash-custom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-2) var(--sp-3); margin: 0 0 var(--sp-4); }
.dash-custom[hidden] { display: none; }
.dash-custom label { display: flex; flex-direction: column; gap: 4px; }
.dash-custom .field { min-height: 40px; }
.dash-page { display: flex; flex-direction: column; gap: 18px; }
.dash-band { border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dash-band-hd { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px var(--sp-3); }
.dash-band-title { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.dash-mark { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.dash-band-note { font-size: var(--fs-xs); color: var(--ink-dim); }
.band-money { background: #eef3fb; } .band-money .dash-mark { background: #0b5fd9; }
.band-worth { background: #ecf7f0; } .band-worth .dash-mark { background: #1e8e4b; }
.band-funnel { background: #fbf3e8; } .band-funnel .dash-mark { background: #b4540a; }
.band-delivery { background: #f0f1f4; } .band-delivery .dash-mark { background: #5b6470; }
.dash-tiles { display: grid; gap: 14px; }
.dash-tiles-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dash-tiles-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } /* BOOK-7: the money row + Show rate */
.dash-tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-tile .ui-tile-n { font-size: 28px; }
.dash-tile .ui-tile-n.is-null { color: #6b7380; }
.dash-chip { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.tone-green { background: var(--done-wash); color: var(--done-ink); }
.tone-orange { background: var(--attention-wash); color: var(--attention-ink); }
.tone-grey { background: #eef0f3; color: var(--ink-dim); }
.dash-small-note.tone-green, .dash-small-note.tone-orange, .dash-small-note.tone-grey { background: none; }
.dash-small-note.tone-green { color: var(--done-ink); }
.dash-small-note.tone-orange { color: var(--changed); }
.dash-spark { display: block; width: 100%; height: 44px; margin: 2px 0; }
.dash-spark-none { font-size: var(--fs-xs); color: var(--ink-dim); height: 44px; display: flex; align-items: center; }
.dash-note { font-size: var(--fs-xs); color: var(--ink-dim); }
.dash-plain { color: var(--ink); }
.dash-reason { font-size: var(--fs-xs); }
.dash-bars { display: flex; gap: 4px; height: 8px; margin: 4px 0 2px; }
.dash-bars > span { flex: 1; border-radius: 4px; background: var(--line); }
.dash-bars > span.is-on { background: var(--done); }
/* the funnel: narrowing bars, the stuck step in orange */
.dash-funnel { gap: 10px; }
.dash-frows, .dash-fgroup { display: flex; flex-direction: column; gap: 10px; }
.dash-fgroups { display: flex; flex-direction: column; gap: 22px; }
.dash-fgroup-hd { font-size: var(--fs-sm); font-weight: 700; }
.dash-frow { display: grid; grid-template-columns: 150px minmax(0, 1fr) 240px; align-items: center; gap: 14px; color: inherit; text-decoration: none; min-height: 32px; }
.dash-frow:hover .dash-flabel { color: var(--accent); }
.dash-flabel { font-size: var(--fs-sm); font-weight: 600; }
.dash-fbar { height: 28px; border-radius: 6px; background: #eef0f3; overflow: hidden; }
.dash-fbar > span { display: block; height: 100%; background: #0b5fd9; }
.dash-frow.is-won .dash-fbar > span { background: var(--done); }
.dash-frow.is-stuck .dash-fbar > span { background: var(--changed); }
.dash-fright { font-size: var(--fs-sm); color: var(--ink-dim); }
.dash-fright strong { font-size: var(--fs-lg); color: var(--ink); }
.dash-frow.is-stuck .dash-fright, .dash-frow.is-stuck .dash-fright strong { color: var(--changed); }
.dash-ffoot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding-top: 4px; font-size: var(--fs-xs); color: var(--ink-dim); }
/* delivery's four small numbers */
.dash-smalls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.dash-small-label { font-size: var(--fs-xs); color: var(--ink-dim); }
.dash-small-n { font-size: var(--fs-xl); font-weight: 700; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.dash-small-note { font-size: var(--fs-xs); font-weight: 500; color: var(--ink-dim); }
/* the inputs: one dashed line */
.dash-inputs { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 18px; border: 1px dashed var(--line-strong); border-radius: 12px; font-size: var(--fs-sm); color: var(--ink-dim); }
.dash-inputs strong { color: var(--ink); }
.dash-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--sp-3); align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
/* skeletons: the frame draws at once, grey until its route answers */
.skel { display: block; border-radius: 6px; background: linear-gradient(90deg, #eceff3 0%, #f6f7f9 50%, #eceff3 100%); background-size: 200% 100%; animation: dash-skel 1.2s ease-in-out infinite; }
.skel-label { width: 55%; height: 12px; }
.skel-big { width: 45%; height: 30px; margin: 6px 0; }
.skel-line { width: 100%; height: 28px; }
.skel-sub { width: 80%; height: 12px; margin-top: 6px; }
.skel-bar { width: 100%; height: 28px; }
@keyframes dash-skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
/* the Needs-you pill: red whenever anything needs you (itv-core's pill_red), quiet when nothing does */
.ny-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 0; font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; white-space: nowrap; background: #eef0f3; color: var(--ink-dim); }
.ny-pill.ny-pill-red { background: var(--red); color: #fff; }
.ny-pill-bar { min-height: 34px; background: rgba(255, 255, 255, .14); color: var(--on-brand); }
.ny-pill-bar.ny-pill-red { background: var(--red); color: #fff; }
.ny-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the drawer: from the right; a full-screen sheet on a phone */
.ny-drawer-back { position: fixed; inset: 0; z-index: 60; background: rgba(15, 24, 40, .35); display: flex; justify-content: flex-end; }
.ny-drawer { width: min(440px, 100%); height: 100%; background: var(--surface); box-shadow: var(--shadow-md); display: flex; flex-direction: column; overflow: hidden; }
.ny-drawer-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.ny-drawer-hd h2 { margin: 0; font-size: var(--fs-xl); }
.ny-close { min-width: 44px; min-height: 44px; border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--ink-dim); border-radius: var(--radius-md); }
.ny-close:hover { background: var(--surface-alt); color: var(--ink); }
.ny-drawer-body { overflow-y: auto; padding: 8px 12px 20px; }
.ny-drawer-list { list-style: none; margin: 0; padding: 0; }
.ny-li { border-bottom: 1px solid var(--line); padding: 2px 0; }
.ny-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 56px; padding: 8px; border-radius: var(--radius-md); color: inherit; text-decoration: none; }
.ny-row:hover, .ny-row:focus-visible { background: var(--surface-alt); }
.ny-dot { width: 10px; height: 10px; border-radius: 50%; }
.ny-dot-urgent { background: var(--red); }
.ny-dot-normal { background: #9aa3af; }
.ny-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ny-row-title { font-weight: 600; font-size: var(--fs-md); }
.ny-row-sub { font-size: var(--fs-sm); color: var(--ink-dim); overflow-wrap: anywhere; }
.ny-row-go { color: var(--accent); }
.ny-li .ny-clear { margin: 0 0 6px 32px; }
@media (max-width: 1100px) {
  .dash-tiles-5, .dash-tiles-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .dash-band { padding: 14px; border-radius: 14px; }
  .dash-tiles-5, .dash-tiles-6, .dash-tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dash-tile .ui-tile-n { font-size: 22px; }
  .dash-frow { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "label right" "bar bar"; gap: 4px 10px; align-items: baseline; }
  .dash-frow .dash-flabel { grid-area: label; }
  .dash-frow .dash-fbar { grid-area: bar; height: 18px; }
  .dash-frow .dash-fright { grid-area: right; text-align: right; }
  .dash-smalls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ny-drawer { width: 100%; }
  .ny-pill-bar .ny-pill-word, .ny-pill-bar .ny-pill-dot { display: none; }
  .ny-pill-bar { min-height: 34px; padding: 0 12px; }
}
@media (max-width: 380px) { .dash-tiles-5, .dash-tiles-6, .dash-tiles-4 { grid-template-columns: minmax(0, 1fr); } }

/* STYLE-1: the article-style editor on a client's Branding section (tools/clients/style-editor.js) */
.sed-controls { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: var(--sp-2) 0; }
.sed-from { font: inherit; font-size: var(--fs-sm); padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); max-width: 100%; }
.sed-panel { margin-top: var(--sp-3); }
.sed-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); align-items: start; margin-top: var(--sp-2); }
.sed-reset { white-space: nowrap; font-size: var(--fs-xs); padding: 2px 8px; margin-top: 4px; }
.sed-nums { display: grid !important; grid-template-columns: repeat(4, auto); justify-content: start; }
.sed-src { max-width: 16em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sed-table td { vertical-align: middle; }
.sed-table tr.sed-changed > td:first-child { box-shadow: inset 3px 0 0 var(--action); }
.sed-edit input[type=color] { width: 34px; height: 28px; padding: 0 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); vertical-align: middle; background: var(--surface); }
.sed-edit .sed-hex { font: inherit; font-size: var(--fs-sm); margin-left: 6px; padding: 3px 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); width: 7.5em; }
.sed-edit select, .sed-edit input[type=text] { font: inherit; font-size: var(--fs-sm); padding: 3px 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); max-width: 100%; }
.sed-nums { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; }
.sed-num { display: flex; flex-direction: column; font-size: var(--fs-xs); color: var(--ink-mute); }
.sed-num input { font: inherit; font-size: var(--fs-sm); width: 4.2em; padding: 3px 4px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.sed-copied { margin-left: 6px; }
.sed-site code, .sed-rec code { font-size: var(--fs-sm); }
.sed-h4 { margin: var(--sp-3) 0 var(--sp-1); font-size: var(--fs-sm); color: var(--ink-dim); }
.sed-c { font-size: var(--fs-sm); padding: 2px 0; }
.sed-c-pass .sed-c-mark { color: var(--green-ink); font-weight: var(--fw-bold); }
.sed-c-fail { color: var(--red-ink); }
.sed-c-fail .sed-c-mark { color: var(--red); font-weight: var(--fw-bold); }
.sed-frame { width: 100%; height: 1100px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; margin-top: var(--sp-1); }
.sed-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-top: var(--sp-3); }
@media (max-width: 1000px) {
  .sed-nums { grid-template-columns: repeat(2, auto); }
  .sed-frame { height: 820px; }
}

/* ---- CLIENTS-1: THE CLIENTS LIST (the owner-approved mockup, Oct 23, 2026: one list, two tiles) ---------------------------
   The header line, four summary tiles (a coloured top edge and dot, like the Dashboard bands), the filter bar (the active
   chip navy), and two tiles of rows under a navy title bar (#0F2440) and a second-shade column header (#1B3A66). On a phone
   each row stacks: name and monthly on line one, the rest below. */
.cl-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.cl-head .page-sub { margin: 6px 0 0; font-size: var(--fs-md); color: var(--ink-dim); }
.cl-head-act { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.cl-search { margin: 0; }
.cl-search .field { width: 300px; max-width: 100%; height: 44px; margin: 0; padding: 0 14px; border-radius: 10px; font-size: var(--fs-md); }
.cl-add { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; border-radius: 10px; }
.cl-add:hover { background: #0a52bd; color: #fff; }
.cl-search-msg:empty { display: none; }
.cl-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-5, 24px); }
.cl-tile { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--cl-tone); border-radius: 14px; padding: 16px 20px 18px; min-width: 0; }
.cl-tile-label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--cl-tone); }
.cl-tile-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--cl-tone); flex: none; }
.cl-tile-fig { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-top: 4px; }
.cl-tile-value { font-size: 30px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.cl-tone-red .cl-tile-value { color: var(--cl-tone); }
.cl-tile-of { color: #8a9bb5; font-weight: 500; }
.cl-tile-words, .cl-tile-line { font-size: var(--fs-sm); color: var(--ink-dim); }
.cl-tile-line { margin-top: 2px; }
.cl-tone-red { --cl-tone: #b42318; } .cl-tone-blue { --cl-tone: #0b5fd9; } .cl-tone-purple { --cl-tone: #6d28d9; } .cl-tone-green { --cl-tone: #1e8e4b; }
.cl-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.cl-seg { display: inline-flex; flex-wrap: wrap; background: #eef0f3; border-radius: 10px; padding: 3px; gap: 2px; }
.cl-chip { font: inherit; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-dim); cursor: pointer; }
.cl-chip:hover { color: var(--ink); }
.cl-chip.on { background: var(--brand-navy); color: #fff; font-weight: 600; }
.cl-sort { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--ink-dim); }
.cl-sort .field { width: auto; height: 36px; margin: 0; padding: 0 10px; border-radius: 8px; font-size: var(--fs-sm); color: var(--ink); }
.cl-hint { margin: var(--sp-2) 0 var(--sp-4); font-size: var(--fs-xs); color: var(--ink-dim); }
.cl-groups { display: flex; flex-direction: column; gap: var(--sp-5, 24px); }
.cl-group { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cl-group-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 14px 20px; background: #0f2440; color: #fff; }
.cl-group-title { margin: 0; font-size: var(--fs-lg); font-weight: 700; color: #fff; }
.cl-group-n { opacity: .6; font-weight: 500; }
.cl-group-money { font-size: var(--fs-sm); color: #c9d3e3; }
/* CLIENTS-2: each tile's own search in its navy bar, and the page foot (Showing 10 of N · Show 10 more · Show all N) */
.cl-group-act { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 14px; }
.cl-find { width: 240px; max-width: 100%; height: 36px; margin: 0; padding: 0 12px; border: 1px solid #2f4a70; border-radius: 8px; background: #fff; color: var(--ink); font-size: var(--fs-sm); }
.cl-find::placeholder { color: #8a94a6; }
.cl-more { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; padding: 12px 20px; border-top: 1px solid #eef0f3; font-size: var(--fs-sm); }
.cl-more-btn { min-height: 36px; padding: 0 14px; border: 1px solid #bfd3f2; border-radius: 8px; background: #f3f7fd; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.cl-more-btn:hover { border-color: var(--accent); }
.cl-row { display: grid; grid-template-columns: minmax(240px, 2.4fr) 130px minmax(180px, 1.3fr) minmax(160px, 1.1fr) 130px 204px; gap: 16px; align-items: center; padding: 14px 20px; border-top: 1px solid #eef0f3; }
.cl-group .cl-row:nth-of-type(even):not(.cl-hd) { background: #fafbfc; }
.cl-row:not(.cl-hd):hover { background: #f3f7fd; }
/* CLIENTS-3: a row opens its client wherever it is clicked (its links and buttons do their own thing) */
.cl-row[data-href] { cursor: pointer; }
.cl-compact { padding-top: 10px; padding-bottom: 10px; }
.cl-hd { padding-top: 10px; padding-bottom: 10px; background: #1b3a66; color: #c9d3e3; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.cl-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 15px; font-weight: 600; line-height: 1.3; }
.cl-name-link { color: var(--ink); text-decoration: none; }
.cl-name-link:hover { color: var(--accent); }
.cl-compact .cl-name { font-weight: 500; }
.cl-sub-line { margin-top: 2px; font-size: var(--fs-sm); color: var(--ink-dim); }
.cl-num { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cl-compact .cl-num { font-weight: 500; }
.cl-muted { font-size: var(--fs-sm); color: var(--ink-dim); }
.cl-c-content { line-height: 1.5; }
.cl-c-content .ui-dots { display: inline-flex; margin-right: 6px; vertical-align: 0; }
.cl-down { color: var(--red-ink); font-weight: 600; }
.cl-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: #b42318; color: #fff; font-size: var(--fs-xs); font-weight: 700; }
.cl-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.cl-name .cl-pill { height: 20px; font-size: 11px; }
.cl-green { background: #e8f5ec; color: #1e7a42; } .cl-amber { background: #fff4e5; color: #9a4708; } .cl-grey { background: #eef0f3; color: var(--ink-dim); }
.cl-open { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; white-space: nowrap; border: 1px solid #bfd3f2; border-radius: 8px; background: #f3f7fd; color: var(--accent); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.cl-open:hover { border-color: var(--accent); }
/* SHELL-1: Log In, just left of Open (Open stays far right); quieter than Open, the same size */
.cl-c-open { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.cl-login { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; white-space: nowrap; }
.cl-login:hover { border-color: var(--accent); color: var(--accent); }
.cl-none { padding: 14px 20px; border-top: 1px solid #eef0f3; font-size: var(--fs-sm); color: var(--ink-dim); }
.cl-names { grid-template-columns: minmax(0, 1fr) auto; }
.cl-foot { margin: var(--sp-4) 0 0; font-size: var(--fs-xs); color: var(--ink-dim); }
/* UI-3: a site covered by another client's account sits under it as a branch: a thin guide line down from the lead's name,
   a short elbow into the covered name, the name a size smaller, the Monthly cell ("covered by …") grey. */
.cl-row.cl-child { position: relative; }
.cl-child .cl-c-name { padding-left: 26px; }
.cl-row.cl-child::before { content: ""; position: absolute; left: 30px; top: 0; bottom: 0; border-left: 1px solid #c3ccd9; }
.cl-row.cl-child-last::before { bottom: 50%; }
.cl-row.cl-child::after { content: ""; position: absolute; left: 30px; top: 50%; width: 14px; border-top: 1px solid #c3ccd9; }
.cl-child .cl-name { font-size: 13px; font-weight: 500; }
.cl-num.cl-covered { font-size: var(--fs-sm); font-weight: 400; color: var(--ink-dim); }
@media (max-width: 1180px) { .cl-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .cl-row { grid-template-columns: minmax(200px, 2fr) 110px minmax(150px, 1.3fr) minmax(130px, 1fr) 110px 192px; gap: 12px; padding-left: 14px; padding-right: 14px; }
  .cl-row.cl-child::before, .cl-row.cl-child::after { left: 24px; }
}
@media (max-width: 900px) {
  .cl-tiles { grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
  .cl-search, .cl-search .field { width: 100%; }
  .cl-head-act { width: 100%; }
  .cl-head-act .cl-search { flex: 1 1 200px; }
  .cl-hd { display: none; }
  /* the row stacks: name and monthly on line one, the rest below */
  .cl-row { grid-template-columns: minmax(0, 1fr) minmax(0, max-content); grid-template-areas: "name money" "content content" "vis vis" "record open"; gap: 6px 12px; padding: 14px 16px; align-items: start; }
  .cl-compact { grid-template-areas: "name money" "plan site" "record open"; }
  .cl-names { grid-template-areas: "name open"; }
  .cl-c-name { grid-area: name; min-width: 0; } .cl-c-money { grid-area: money; text-align: right; max-width: 40vw; }
  .cl-c-record, .cl-c-open { align-self: center; } .cl-c-content { grid-area: content; }
  .cl-c-vis { grid-area: vis; } .cl-c-plan { grid-area: plan; } .cl-c-site { grid-area: site; text-align: right; }
  .cl-c-record { grid-area: record; } .cl-c-open { grid-area: open; text-align: right; }
  .cl-group-bar { padding: 12px 16px; }
  .cl-group-act { width: 100%; justify-content: space-between; } .cl-find { flex: 1 1 160px; width: auto; }
  .cl-row.cl-child::before, .cl-row.cl-child::after { left: 24px; }
  .cl-row.cl-child-last::before { bottom: auto; height: 24px; }
  .cl-row.cl-child::after { top: 24px; }
}

/* ---- SCHED-2: THE SCHEDULER, ONE SCROLL (the owner-approved mockup, Oct 23, 2026: month calendar + queue) ----------------
   The header (title, itv-core's subtitle, the client filter chips: CLIENTS-1's .cl-seg / .cl-chip). Three tiles under a navy
   title bar (#0F2440): the calendar (a second-shade #1B3A66 row of weekdays, a 7-column grid, Sunday first, weekends tinted,
   today in a blue circle), Ready to schedule and Scheduled, not live yet (a #1B3A66 column header, then rows). A chip is the
   locked Live green or Scheduled purple, with the colour's edge on its left. A clicked chip and its row light up purple.
   On a phone the calendar is a list of the days that have chips (and today), the same chips; the rows stack. */
.sc-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-5, 24px); }
.sc-head .page-title { margin: 0; }
.sc-head .page-sub { margin: 6px 0 0; font-size: var(--fs-md); color: var(--ink-dim); }
/* SCHED-2B: the client filter is one drop-down, All clients by default */
.sc-client-wrap { display: inline-flex; align-items: center; gap: 10px; }
.sc-client-label { font-size: var(--fs-sm); font-weight: 600; color: #5b6470; }
.sc-client.field { width: 300px; max-width: 100%; height: 44px; margin: 0; padding: 0 12px; border-radius: 10px; font-size: var(--fs-md); background: #fff; cursor: pointer; }
.sc-tile { background: var(--surface); border: 1px solid #e3e6eb; border-radius: 14px; overflow: hidden; margin-bottom: var(--sp-5, 24px); }
.sc-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 14px 20px; background: #0f2440; color: #fff; }
.sc-bar-title { margin: 0; font-size: 16px; font-weight: 700; color: #fff; }
.sc-bar-n { opacity: .6; font-weight: 500; }
.sc-bar-hint, .sc-legend { font-size: var(--fs-sm); color: #c9d3e3; }
.sc-nav { display: flex; align-items: center; gap: 14px; }
.sc-month { font-size: 16px; font-weight: 700; }
.sc-arrow { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; border-radius: 8px; color: #fff; font-size: 20px; text-decoration: none; }
.sc-arrow:hover, .sc-todaylink:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.sc-todaylink { margin-left: 4px; padding: 4px 8px; border-radius: 8px; font-size: var(--fs-sm); color: #c9d3e3; text-decoration: none; }
.sc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.sc-key { display: inline-flex; align-items: center; gap: 6px; }
.sc-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.sc-sw-live { background: #1e8e4b; } .sc-sw-scheduled { background: #6d28d9; }
.sc-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: #1b3a66; }
.sc-week > div { padding: 10px 8px; font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: #c9d3e3; border-right: 1px solid rgba(255, 255, 255, .08); }
.sc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid #eef0f3; }
.sc-cell { min-height: 118px; min-width: 0; padding: 8px; background: #fff; border-right: 1px solid #eef0f3; border-bottom: 1px solid #eef0f3; }
.sc-cell.is-blank { background: #f8f9fb; }
.sc-cell.is-weekend { background: #fafbfc; }
.sc-cell.is-pickable { cursor: pointer; }
.sc-cell.is-pickable:hover { background: #f3f7fd; }
.sc-cell-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.sc-num { font-size: 13px; font-weight: 500; color: #15181d; }
.sc-cell.is-weekend .sc-num { color: #8a9bb5; }
.sc-cell.is-today .sc-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 999px; background: #0b5fd9; color: #fff; font-weight: 700; }
.sc-today-tag { font-size: 11px; color: #8a9bb5; }
.sc-dw { display: none; }
.sc-chips { display: flex; flex-direction: column; gap: 4px; }
.sc-chip { font: inherit; display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-width: 0; padding: 4px 8px; border: 0; border-left: 3px solid; border-radius: 6px; font-size: 12px; line-height: 1.25; text-align: left; cursor: pointer; }
.sc-chip-live { background: #e8f5ec; color: #14532d; border-left-color: #1e8e4b; }
.sc-chip-scheduled { background: #f1ecfd; color: #3b1e7a; border-left-color: #6d28d9; }
.sc-chip-1 { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-chip-2 { opacity: .75; }
.sc-chip:hover { filter: brightness(.97); }
.sc-chip.is-lit { outline: 2px solid #6d28d9; outline-offset: 1px; }
.sc-cal-none, .sc-cal-say:not(:empty) { padding: 12px 20px; font-size: var(--fs-sm); color: var(--ink-dim); border-top: 1px solid #eef0f3; }
.sc-row { display: grid; grid-template-columns: minmax(240px, 2.4fr) 90px 236px minmax(140px, 1fr) 190px; gap: 16px; align-items: center; padding: 14px 20px; border-top: 1px solid #eef0f3; }
.sc-tile .sc-row:nth-of-type(even):not(.sc-hd) { background: #fafbfc; }
.sc-hd { padding-top: 10px; padding-bottom: 10px; background: #1b3a66 !important; color: #c9d3e3; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.sc-row.is-picked { background: #f3f7fd !important; box-shadow: inset 4px 0 0 #0b5fd9; }
.sc-row.is-lit { background: #f1ecfd !important; }
.sc-row.is-new { box-shadow: inset 4px 0 0 #6d28d9; }
.sc-rrow { cursor: default; }
.sc-name { font-size: 15px; font-weight: 600; line-height: 1.3; }
.sc-name-n { color: #5b6470; font-weight: 500; }
.sc-under { margin-top: 2px; font-size: var(--fs-sm); color: #5b6470; }
.sc-cannot { color: #9a4708; }
.sc-num-cell { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sc-daywrap { position: relative; display: inline-flex; max-width: 100%; }
.sc-daybtn { font: inherit; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid #d5dae1; border-radius: 8px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.sc-daybtn:hover { border-color: var(--accent); }
.sc-caret { color: #5b6470; font-size: 11px; }
/* the real date input sits under the button: the button opens its picker; a browser without showPicker gets it on focus */
.sc-date-input { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.sc-slot { font-size: var(--fs-sm); color: #5b6470; }
.sc-slot.is-full { color: #b42318; font-weight: 600; }
.sc-slot.is-checking { color: var(--accent); }
.sc-slot-why { margin-top: 2px; font-size: var(--fs-xs); color: #5b6470; }
.sc-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-act { font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.sc-act:disabled { opacity: .45; cursor: not-allowed; }
.sc-act-red { color: #b42318; border-color: #f3c4c0; background: #fdf3f2; }
.sc-act-red:hover:not(:disabled) { border-color: #b42318; }
.sc-pill { background: #f1ecfd; color: #6d28d9; }
.sc-pill-going { background: #e8f5ec; color: #1e7a42; }
.sc-when { font-size: var(--fs-sm); font-weight: 500; color: #15181d; }
.sc-tile-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 16px; padding: 14px 20px; border-top: 1px solid #eef0f3; background: #fafbfc; }
.sc-go-why { font-size: var(--fs-sm); color: #5b6470; }
.sc-go { font: inherit; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: #0b5fd9; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.sc-go:disabled { background: #a9c3ea; cursor: not-allowed; }
.sc-tile > .sch-prog { margin: 0 20px 16px; }
.sc-said { margin: 12px 20px 0; }
.sc-panel { margin: 0 20px 16px; text-align: left; }
.sc-btn-red { background: #b42318; border-color: #b42318; }
.sc-move-label { font-weight: 600; }
.sc-move-date { max-width: 220px; }
.sc-move-slot.is-full strong { color: #b42318; }
.sc-foot { margin: 0 0 var(--sp-4); font-size: 12px; color: #5b6470; }
/* SCHED-1: THE SCHEDULE JOB (owner, Nov 12, 2026). One press is one job on the server; this tile only watches it. The head is
   unmissable while it runs (a spinner, the words in large type, a clock, the striped bar). Each cluster's pill keeps the
   locked colours: grey waiting · blue checking/scheduling · teal passed (written, not scheduled) · purple scheduled ·
   amber not scheduled (it needs you) · red only when the job itself broke. Nothing scheduled is ever drawn as an error. */
.sc-job { border-color: #c9d6ea; }
.sc-job-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-left: 5px solid var(--sc-job-tone, #0b5fd9); background: var(--sc-job-wash, #f3f7fd); }
.sc-job-head .sch-spin { width: 22px; height: 22px; border-width: 3px; }
.sc-job-text { flex: 1 1 auto; min-width: 0; }
.sc-job-headline { font-size: 20px; font-weight: 700; line-height: 1.3; color: #15181d; overflow-wrap: anywhere; }
.sc-job-sub { margin-top: 4px; font-size: var(--fs-sm); color: #3d4652; }
.sc-job-clock { flex: none; font-size: 15px; }
.sc-job-blue { --sc-job-tone: #0b5fd9; --sc-job-wash: #f3f7fd; }
.sc-job-teal { --sc-job-tone: var(--written-teal); --sc-job-wash: #eefcfd; }
.sc-job-purple { --sc-job-tone: #6d28d9; --sc-job-wash: #f6f2fe; }
.sc-job-amber { --sc-job-tone: var(--amber); --sc-job-wash: var(--amber-wash); }
.sc-job-grey { --sc-job-tone: #8a9bb5; --sc-job-wash: #f8f9fb; }
.sc-job-red { --sc-job-tone: #b42318; --sc-job-wash: #fdf3f2; }
.sc-job-bar { margin: 0 20px 12px; height: 10px; }
.sc-jrows { border-top: 1px solid #eef0f3; }
.sc-jrow { display: grid; grid-template-columns: minmax(220px, 1.4fr) 120px 230px minmax(0, 2fr); gap: 8px 16px; align-items: center; padding: 10px 20px; border-bottom: 1px solid #eef0f3; }
.sc-jrow-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.sc-jrow-day { font-size: var(--fs-sm); color: #3d4652; }
.sc-jrow-line { min-width: 0; font-size: var(--fs-sm); color: #3d4652; overflow-wrap: anywhere; }
.sc-jpill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.sc-jpill .sch-spin { width: 12px; height: 12px; }
.sc-jpill-grey { color: #4b5563; background: #f3f4f6; border-color: #d1d5db; }
.sc-jpill-blue { color: #0b4fb3; background: #eef4fd; border-color: #b8cff3; }
.sc-jpill-teal { color: var(--written-teal-ink); background: #e6fbfd; border-color: var(--written-teal); }
.sc-jpill-purple { color: #5b21b6; background: #f1ecfd; border-color: #c4b0f2; }
.sc-jpill-amber { color: var(--amber-ink); background: var(--amber-wash); border-color: var(--amber-line); }
.sc-reasons { margin: 0; padding: 14px 20px 6px; border-bottom: 1px solid #eef0f3; background: #fffdf6; }
.sc-reasons-title { margin: 0 0 8px; font-size: 15px; font-weight: 700; color: var(--amber-ink); }
.sc-reason { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--amber-line); border-left: 4px solid var(--amber); border-radius: 8px; background: #fff; }
.sc-reason-line { font-weight: 600; color: #15181d; overflow-wrap: anywhere; }
.sc-reason-eg { margin-top: 4px; font-size: var(--fs-sm); color: #3d4652; overflow-wrap: anywhere; }
.sc-reason-eg-where { color: #5b6470; }
.sc-reason-more { margin-top: 6px; font-size: var(--fs-sm); }
.sc-reason-more summary { cursor: pointer; color: #0b5fd9; font-weight: 600; }
.sc-reason-more ul { margin: 6px 0 0; padding-left: 18px; }
.sc-job-say:not(:empty), .sc-start-say:not(:empty) { flex: 1 1 100%; font-size: var(--fs-sm); color: #b42318; }
.sc-job > .sc-job-say:not(:empty) { padding: 10px 20px; }
.sc-clash:not(:empty) { color: #b42318; font-weight: 600; }
@media (max-width: 900px) {
  .sc-jrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name state" "day day" "line line"; gap: 4px 10px; padding: 12px 16px; }
  .sc-jrow-name { grid-area: name; } .sc-jrow-state { grid-area: state; text-align: right; } .sc-jrow-day { grid-area: day; } .sc-jrow-line { grid-area: line; }
  .sc-job-head { padding: 14px 16px; } .sc-job-headline { font-size: 18px; }
  .sc-job-bar { margin: 0 16px 12px; }
  .sc-reasons { padding: 12px 16px 4px; }
  .sc-job-acts button { min-height: 44px; flex: 1 1 auto; }
}
@media (max-width: 1100px) {
  .sc-row { grid-template-columns: minmax(200px, 2fr) 70px 220px minmax(120px, 1fr) 180px; gap: 12px; padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 900px) {
  .sc-hd { display: none; }
  .sc-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name num" "day slot" "act act"; gap: 8px 12px; padding: 14px 16px; align-items: start; }
  .sc-srow { grid-template-areas: "name num" "when status" "act act"; }
  .sc-c-name { grid-area: name; min-width: 0; } .sc-c-num { grid-area: num; text-align: right; }
  .sc-c-day { grid-area: day; } .sc-c-slot { grid-area: slot; align-self: center; text-align: right; }
  .sc-c-when { grid-area: when; } .sc-c-status { grid-area: status; text-align: right; }
  .sc-c-act { grid-area: act; }
  .sc-rrow .sc-c-act .sc-act, .sc-srow .sc-acts .sc-act { min-height: 44px; flex: 1 1 0; }
  .sc-acts { flex-wrap: nowrap; }
  .sc-bar { padding: 12px 16px; }
}
@media (max-width: 760px) {
  /* the calendar becomes a list of the days that hold chips (and today), the same chips */
  .sc-week { display: none; }
  .sc-grid { display: block; border-left: 0; }
  .sc-cell { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; min-height: 0; padding: 10px 16px; border-right: 0; }
  .sc-cell.is-blank, .sc-cell.is-empty:not(.is-today) { display: none; }
  .sc-cell-head { flex-direction: column; align-items: flex-start; justify-content: flex-start; margin: 0; }
  .sc-num { display: none; }
  .sc-cell.is-today .sc-num { display: none; }
  .sc-dw { display: block; font-size: 13px; font-weight: 600; color: #15181d; }
  .sc-cell.is-today .sc-dw { color: #0b5fd9; }
  .sc-chip { min-height: 44px; justify-content: center; }
  .sc-head { align-items: flex-start; }
  .sc-client-wrap { width: 100%; }
  .sc-client.field { flex: 1 1 auto; width: auto; }
}

/* ---- BUILDS-1B: WEBSITE BUILDS (tools/builds), THE BELL (src/bell.js), SETTINGS › TEAM (tools/system/team.js) -------------------
   The approved artboards "Website Builds", "One build" and "One build — Files & Images" of the "Tools Dashboard — One Look"
   canvas. Their own values: the navy bar #0F2440 over a card, the table header #1B3A66, the brand blue #0B5FD9, the green row
   #DDF3E4. A step is quiet text (a check, a dot, a name), never a circle or a pill. These colours mark where a piece of work
   is; they are not the sacred status colours. */
.bd-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 14px 20px; background: #0f2440; color: #fff; }
.bd-bar b { font-size: 16px; font-weight: 700; }
.bd-bar span { font-size: 13px; color: var(--nav-ink); }
.bd-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #d92d20; color: #fff; font-size: 12px; margin-left: 6px; vertical-align: 1px; }
.bd-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.bd-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bd-empty { padding: 18px 20px; font-size: var(--fs-md); color: var(--ink-dim); }
.bd-seg { display: inline-flex; background: #eef0f3; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.bd-seg a, .bd-seg button { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink-dim); text-decoration: none; background: transparent; border: 0; cursor: pointer; }
.bd-seg .is-on { background: #0f2440; color: #fff; font-weight: 600; }
.bd-av { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; border: 2px solid #fff; }
.bd-team .bd-av + .bd-av { margin-left: -6px; }
.bd-open { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; border: 1px solid #bfd3f2; border-radius: 8px; font-size: 13px; font-weight: 600; background: #f3f7fd; color: #0b5fd9; text-decoration: none; white-space: nowrap; }
.bd-open:hover { background: #e7f0fd; }
.bd-name { font-size: 15px; font-weight: 600; }
.bd-sub, .bd-muted { font-size: 13px; color: var(--ink-dim); }
.bd-sub { margin-top: 2px; }
/* Needs you */
.bd-inb { display: grid; grid-template-columns: 36px minmax(0, 1fr) 140px 90px; gap: 14px; align-items: center; padding: 14px 20px; border-top: 1px solid #eef0f3; }
.bd-inb .bd-name { font-size: 14px; }
/* the list of builds */
.bd-lhd, .bd-lrow { display: grid; grid-template-columns: minmax(200px, 2fr) 110px 110px minmax(200px, 2fr) 160px 130px 70px; gap: 14px; align-items: center; padding: 0 20px; }
.bd-lhd { padding-top: 10px; padding-bottom: 10px; font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--nav-ink); background: #1b3a66; }
.bd-lrow { padding-top: 16px; padding-bottom: 16px; border-top: 1px solid #eef0f3; }
.bd-list { min-width: 1040px; }
.bd-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.bd-route-full { background: #e7f0fd; color: #0b4fb3; }
.bd-route-ai { background: #f1ecfd; color: #5b21b6; }
.bd-route-copy, .bd-hp-send, .bd-hp-not_needed { background: #f2f4f7; color: #344054; }
.bd-hp-approved { background: #e8f5ec; color: #14532d; }
.bd-hp-waiting { background: #fef3e2; color: #93370d; }
.bd-mini { display: grid; grid-template-columns: 52px 1fr 44px; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-dim); }
.bd-track { height: 6px; border-radius: 999px; background: #eef0f3; overflow: hidden; }
.bd-track > span { display: block; height: 6px; }
.bd-fill-copy { background: #1e8e4b; } .bd-fill-design { background: #0b5fd9; } .bd-fill-built { background: #6d28d9; }
.bd-bars { display: flex; flex-direction: column; gap: 6px; }
/* one build */
.bd-back { font-size: 13px; font-weight: 600; color: #0b5fd9; text-decoration: none; }
.bd-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; font-size: 13px; font-weight: 600; background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; white-space: nowrap; }
.bd-btn:hover { border-color: #0b5fd9; color: #0b5fd9; }
.bd-btn:disabled { color: var(--ink-mute); background: var(--surface-alt); cursor: not-allowed; border-color: var(--line); }
.bd-btn-navy { background: #0f2440; color: #fff; border-color: #0f2440; }
.bd-btn-navy:hover { background: #1b3a66; color: #fff; border-color: #1b3a66; }
.bd-pri { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 600; background: #0b5fd9; color: #fff; border: 0; cursor: pointer; }
.bd-pri:hover { background: #0a50b8; }
.bd-pri:disabled { opacity: .7; cursor: progress; }
.bd-links { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.bd-links-label { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-dim); margin-right: 4px; }
.bd-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 500; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; cursor: pointer; }
.bd-chip:hover { border-color: #0b5fd9; }
.bd-chip-copy { border-color: #bfd3f2; color: #0b4fb3; font-weight: 600; }
.bd-chip-add { border-style: dashed; color: #0b5fd9; font-weight: 600; }
.bd-chip-off { color: var(--ink-mute); border-style: dashed; cursor: default; }
.bd-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.bd-tab { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; color: #667085; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; padding: 0; font-family: inherit; cursor: pointer; }
.bd-tab.is-on { color: var(--ink); border-bottom-color: #0b5fd9; }
.bd-hp { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.bd-hp-ok { background: #e8f5ec; border: 1px solid #b7e1c4; color: #14532d; }
.bd-hp-ok a { font-size: 13px; font-weight: 600; color: #14532d; }
.bd-hp-wait { background: #fef3e2; border: 1px solid #f5cf9b; color: #93370d; }
.bd-hp-go { background: #f3f7fd; border: 1px solid #bfd3f2; color: #0b4fb3; }
.bd-sel { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; background: #eef4ff; border-bottom: 1px solid #d6e4fb; }
.bd-sel-n { font-size: 13px; font-weight: 700; color: #0b4fb3; margin-right: 6px; }
.bd-sel-ctl { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid #bfd3f2; background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: #0b4fb3; cursor: pointer; }
.bd-sel-ctl.is-quiet { color: #344054; border-color: var(--line-strong); }
.bd-pages { min-width: 1040px; }
.bd-phd, .bd-prow { display: grid; grid-template-columns: 40px 36px minmax(170px, 1.6fr) 84px repeat(4, minmax(118px, 1fr)) 60px 44px; gap: 12px; align-items: center; padding: 0 16px; }
.bd-phd { min-height: 40px; font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--nav-ink); background: #1b3a66; }
.bd-prow { min-height: 52px; border-top: 1px solid #eef0f3; background: #fff; cursor: pointer; }
.bd-prow:hover { background: #fafbfd; }
.bd-prow.is-done { background: #ddf3e4; border-top-color: #c3e6ce; }
.bd-prow.is-sel { background: #eef4ff; }
.bd-prow.is-open { background: #f8faff; border-top: 2px solid #0b5fd9; }
.bd-prow.is-removed { opacity: .55; }
.bd-cb { width: 18px; height: 18px; accent-color: #0b5fd9; margin: 0; cursor: pointer; }
.bd-no { font-size: 12px; font-weight: 600; color: #98a2b3; }
.bd-pg { font-size: 15px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-ty { font-size: 12px; font-weight: 500; color: var(--ink-dim); }
.bd-c { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-c-done { color: var(--ink-dim); }
.bd-c-work { color: #0b4fb3; font-weight: 600; }
.bd-c-you { color: #b54708; font-weight: 700; }
.bd-c-wait { color: #98a2b3; }
.bd-c-no { color: #b0b7c3; font-style: italic; }
.bd-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 999px; }
.bd-dot-blue { background: #0b5fd9; } .bd-dot-orange { background: #f79009; }
.bd-check { flex: none; }
.bd-cnt { font-size: 12px; color: var(--ink-dim); }
.bd-chev { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 14px; color: #344054; cursor: pointer; }
.bd-chev:hover { border-color: #0b5fd9; color: #0b5fd9; }
.bd-prow.is-open .bd-chev { background: #0b5fd9; color: #fff; border-color: #0b5fd9; }
.bd-legend { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; font-size: 12px; color: var(--ink-dim); }
.bd-legend .bd-c { font-size: 12px; }
.bd-say:empty { display: none; }
.bd-copied { color: #146a38; }
/* the slide-in panel: from the right, over the page (the list stays still under it) */
.bd-panel { position: fixed; top: var(--header-h); right: 0; bottom: 0; z-index: 25; max-width: 100vw; background: #fff; border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(15, 36, 64, .14); display: flex; flex-direction: column; }
/* the panel scrolls as one (its head, the thread), with the composer held at the bottom, so a short window still shows the thread */
.bd-pscroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; overscroll-behavior: contain; }
.bd-grip { position: absolute; left: -6px; top: 50%; width: 12px; height: 56px; margin-top: -28px; border-radius: 999px; background: #d0d5dd; border: 2px solid #fff; cursor: col-resize; touch-action: none; }
.bd-grip:hover, .bd-grip.is-drag { background: #0b5fd9; }
.bd-panel.is-full .bd-grip { display: none; }
.bd-ph { padding: 22px 24px 0; display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid #eef0f3; }
.bd-ph-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.bd-ph-kicker { font-size: 12px; font-weight: 600; color: #98a2b3; }
.bd-ph h2 { margin: 4px 0 0; font-size: 24px; font-weight: 700; overflow-wrap: anywhere; }
.bd-ph-btns { display: flex; gap: 6px; flex: none; }
.bd-ph-btns .bd-chev { width: 40px; height: 40px; }
.bd-steps4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bd-steps4 > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bd-step-lbl { font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: #98a2b3; }
.bd-linkbox { background: #f8f9fb; border: 1px solid #eef0f3; border-radius: 10px; padding: 4px 14px 12px; }
.bd-lb-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 40px; border-bottom: 1px solid #eef0f3; font-size: 13px; }
.bd-lb-row > span:first-child { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-lb-acts { display: flex; gap: 12px; align-items: center; flex: none; }
.bd-lb-acts a, .bd-lb-acts button { color: #0b5fd9; font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; font: inherit; font-size: 13px; cursor: pointer; }
.bd-lb-acts .is-quiet { color: var(--ink-dim); font-weight: 500; }
.bd-lb-none { color: #98a2b3; }
.bd-lb-add { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.bd-lb-add > div { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bd-lbl { font-size: 12px; font-weight: 600; color: #344054; }
.bd-in { min-height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; font: inherit; font-size: 13px; background: #fff; width: 100%; min-width: 0; }
.bd-in:focus, .bd-ta:focus { outline: 2px solid var(--brand-blue-pale); border-color: #0b5fd9; }
.bd-hint { font-size: 12px; color: #667085; }
.bd-pbody { flex: 1 0 auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; min-height: 120px; }
.bd-pfoot { position: sticky; bottom: 0; z-index: 2; background: #fff; box-shadow: 0 -6px 12px rgba(15, 36, 64, .05); padding: 16px 24px 24px; border-top: 1px solid #eef0f3; display: flex; flex-direction: column; gap: 10px; }
.bd-sys { background: #f8f9fb; border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--ink-dim); }
.bd-sys .bd-when { margin-left: 4px; }
.bd-msg { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
.bd-msg .bd-av { width: 30px; height: 30px; border: 0; }
.bd-who { font-size: 13px; font-weight: 600; }
.bd-when { font-size: 12px; font-weight: 400; color: #667085; margin-left: 6px; }
.bd-txt { font-size: 14px; line-height: 1.45; margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bd-at { color: #0b5fd9; font-weight: 600; }
.bd-txt a { color: #0b5fd9; }
.bd-rl { display: inline-flex; align-items: center; min-height: 28px; padding: 0 6px; margin-top: 4px; border: 0; background: transparent; font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-dim); cursor: pointer; }
.bd-rl:hover { color: #0b5fd9; }
.bd-reply { margin: 10px 0 0; padding: 10px 12px; background: #f2f4f7; border-radius: 10px; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; }
.bd-reply .bd-av { width: 24px; height: 24px; font-size: 9px; }
.bd-reply .bd-txt { font-size: 13px; }
.bd-file { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-radius: 8px; background: #f2f4f7; font-size: 12px; font-weight: 500; color: #344054; text-decoration: none; border: 0; font-family: inherit; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-imgs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.bd-imgs .bd-th { cursor: pointer; }
.bd-files-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bd-ta { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; resize: vertical; min-height: 64px; }
.bd-row-btns { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.bd-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.bd-acts .bd-pri { flex: 1 1 auto; }
.bd-mention { position: relative; }
.bd-mlist { position: absolute; left: 0; bottom: 100%; margin-bottom: 4px; z-index: 5; min-width: 220px; max-width: 100%; max-height: 220px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-md); padding: 4px; }
.bd-mlist button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.bd-mlist button:hover, .bd-mlist button.is-on { background: #eef4ff; }
.bd-mlist small { color: var(--ink-dim); }
.bd-offer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid #bfd3f2; background: #f3f7fd; border-radius: 10px; font-size: 13px; }
.bd-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bd-hist li { padding: 10px 0; border-top: 1px solid #eef0f3; font-size: 13px; }
.bd-pick { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.bd-pick select, .bd-sel-in { min-height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; font: inherit; font-size: 14px; background: #fff; max-width: 100%; }
.bd-busy { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.bd-prev { display: flex; align-items: center; justify-content: center; background: #f2f4f7; border-radius: 12px; min-height: 240px; overflow: hidden; }
.bd-prev img { max-width: 100%; max-height: 60vh; display: block; }
.bd-prev-doc { font-size: 15px; font-weight: 600; color: #475467; padding: 40px; text-align: center; }
.bd-kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 12px; font-size: 14px; align-items: center; }
.bd-kv dt { color: var(--ink-dim); font-size: 13px; }
.bd-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.bd-danger { color: var(--red-ink); border-color: var(--red-line); }
.bd-danger:hover { color: #fff; background: var(--red); border-color: var(--red); }
/* Files & Images */
.bd-drop { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; background: #fff; border: 2px dashed #bfd3f2; border-radius: 14px; padding: 22px 24px; }
.bd-drop.is-over { background: #f3f7fd; border-color: #0b5fd9; }
.bd-drop-t { font-size: 17px; font-weight: 700; }
.bd-drop-l { display: flex; flex-direction: column; gap: 6px; flex: 1 1 420px; min-width: 0; }
.bd-drop-r { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bd-drop-r select { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 14px; background: #fff; max-width: 100%; }
.bd-alt-pill { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; background: #fef3e2; color: #b54708; font-size: 12px; font-weight: 700; border: 0; font-family: inherit; cursor: pointer; }
.bd-alt-pill.is-on { outline: 2px solid #b54708; }
.bd-search { min-height: 40px; width: 220px; max-width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 14px; background: #fff; }
.bd-sec { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.bd-sh { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.bd-sh h2 { margin: 0; font-size: 16px; font-weight: 700; }
.bd-sh span { font-size: 13px; color: var(--ink-dim); }
.bd-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.bd-tile, .bd-tile a, .bd-imgs a { text-decoration: none; color: inherit; }
.bd-tile { display: flex; flex-direction: column; gap: 6px; min-width: 0; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.bd-th { aspect-ratio: 4 / 3; border-radius: 10px; background: #e4e7ec; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #475467; text-align: center; padding: 6px; overflow: hidden; width: 100%; }
.bd-th img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; }
.bd-th.is-doc { background: #f2f4f7; font-weight: 600; }
.bd-th.is-noname { outline: 2px dashed #f79009; outline-offset: -2px; }
.bd-th.is-more { background: #f8f9fb; border: 1px dashed #d0d5dd; color: #0b5fd9; font-weight: 600; }
.bd-fn { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-fm { font-size: 12px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-fm.is-warn { color: #b54708; font-weight: 600; }
.bd-sync { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; font-weight: 600; }
.bd-sync .is-ok { color: #1e8e4b; } .bd-sync .is-na { color: #98a2b3; } .bd-sync .is-pending { color: #b54708; } .bd-sync .is-failed { color: var(--red-ink); }
.bd-grp { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; padding-top: 4px; }
.bd-grp .bd-no { font-size: 12px; }
.bd-gtag { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #f2f4f7; color: #344054; }
.bd-up { display: flex; flex-direction: column; gap: 6px; }
.bd-up li { font-size: 13px; }
/* Team (per build) and Settings › Team */
.bd-team-grid { display: grid; grid-template-columns: 160px minmax(0, 320px); gap: 12px 16px; align-items: center; }
.tm-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(160px, 1fr) 150px minmax(200px, 1.6fr) 100px 220px; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid #eef0f3; font-size: 14px; }
.tm-hd { padding-top: 10px; padding-bottom: 10px; font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--nav-ink); background: #1b3a66; border-top: 0; }
.tm-list { min-width: 1060px; }
.tm-row.is-off { color: var(--ink-mute); }
.tm-add { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.tm-add label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: #344054; }
.tm-clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 12px; max-height: 50vh; overflow: auto; }
.tm-clients label { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; }
/* the bell, in the top bar on every screen */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 999px; border: 0; background: transparent; color: #fff; cursor: pointer; }
.bell:hover { background: rgba(255, 255, 255, .10); }
.bell svg { width: 20px; height: 20px; }
.bell-n { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #d92d20; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.bell-n[hidden] { display: none; }
.bell-pop { position: fixed; z-index: 60; top: calc(var(--header-h) - 4px); right: 12px; width: 400px; max-width: calc(100vw - 24px); max-height: calc(100vh - var(--header-h) - 16px); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-md); color: var(--ink); overflow: hidden; }
.bell-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; background: #0f2440; color: #fff; }
.bell-hd b { font-size: 15px; }
.bell-hd button { color: #c9d3e3; background: none; border: 0; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 32px; }
.bell-list { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1 1 auto; }
.bell-item { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; padding: 12px 16px; border-top: 1px solid #eef0f3; text-decoration: none; color: inherit; }
.bell-item:hover { background: #f8faff; }
.bell-item .bell-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 999px; background: transparent; }
.bell-item.is-unread .bell-dot { background: #0b5fd9; }
.bell-item.is-unread .bell-text { font-weight: 600; }
.bell-text { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.bell-when { font-size: 12px; color: #667085; margin-top: 2px; }
.bell-ft { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; }
.bell-ft label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; }
.bell-empty { padding: 18px 16px; font-size: 14px; color: var(--ink-dim); }
@media (max-width: 1100px) { .bd-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .bd-panel { left: 0; width: 100vw !important; }
  .bd-grip, #bd-full { display: none; }
  .bd-ph { padding: 16px 16px 0; }
  .bd-pbody { padding: 16px; }
  .bd-pfoot { padding: 12px 16px 16px; }
  .bd-pfoot .bd-ta { min-height: 52px; }
  .bd-steps4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bd-inb { grid-template-columns: 36px minmax(0, 1fr); padding: 14px 16px; }
  .bd-inb > .bd-muted { grid-column: 2; }
  .bd-inb > div:last-child { grid-column: 2; }
  .bd-bar { padding: 12px 16px; }
  .bd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bd-drop { padding: 16px; }
  .bd-search { width: 100%; }
  .bd-team-grid, .bd-pick, .bd-kv { grid-template-columns: minmax(0, 1fr); }
  .bell-pop { right: 0; left: 0; top: var(--header-h); width: auto; max-width: none; border-radius: 0; max-height: calc(100vh - var(--header-h)); }
}

/* BOOK-3: THE TODAY CARD (tools/dashboard/today.js). Phone-first: the slots are a grid of 44px buttons that wraps to the
   width; the state colours reuse the sacred set (open = blue wash, blocked = attention, call = done). */
.today-card { margin-bottom: var(--sp-4); overflow-wrap: anywhere; } /* 1.70.1: Google's long addresses in an error wrap */
.today-card .ui-card-hd { align-items: flex-start; }
.today-calls { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-md); }
.today-city { margin-left: 6px; font-size: var(--fs-xs); color: var(--ink-dim); background: var(--surface-alt); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.today-none { margin: 0; color: var(--ink-dim); font-size: var(--fs-sm); }
.today-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: var(--sp-2); }
.today-slot { min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; padding: 4px; }
.today-slot-time { font-size: var(--fs-md); font-weight: 700; }
.today-slot-state { font-size: var(--fs-xs); color: var(--ink-dim); }
.today-slot.is-open { background: #eef4ff; border-color: #c7d7f5; color: #063a6c; }
.today-slot.is-open:hover { border-color: var(--accent); }
.today-slot.is-soon { background: var(--surface); border-style: dashed; } /* 1.70.2: open, but inside Zoom's 2 hours' notice */
.today-slot.is-blocked { background: var(--attention-wash); border-color: transparent; color: var(--attention-ink); }
.today-slot.is-blocked .today-slot-state { color: var(--attention-ink); }
.today-slot.is-call { background: var(--done-wash); border-color: transparent; color: var(--done-ink); }
.today-slot.is-busy, .today-slot.is-buffer, .today-slot.is-past { background: var(--surface-alt); color: var(--ink-mute); border-style: dashed; }
.today-slot:disabled { cursor: default; }
.today-range { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.today-range .field { min-height: 44px; width: auto; flex: 1 1 80px; min-width: 0; } /* 1.70.2: one line at 390 */
.today-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); min-height: 24px; }
.today-said { font-size: var(--fs-sm); color: var(--ink-dim); }
.today-said[data-kind="error"] { color: var(--attention-ink); }
.today-card[data-state="working"] .today-slots { opacity: .6; pointer-events: none; }
.today-chips .ui-chip { min-height: 36px; }
@media (max-width: 480px) { .today-slots { grid-template-columns: repeat(4, 1fr); } .today-undo, #today-undo { white-space: normal; text-align: left; } }

/* CAL-2: "Today's availability" on the Calendar page: the Today card in a panel from the right (the Needs-you drawer's
   frame, .ny-drawer); a full-screen sheet on a phone. Closed until pressed. */
.cal-avail-short { display: none; }
.cal-slide { width: min(520px, 100%); }
.cal-avail-panel .ny-drawer-body { padding: 0; }
/* CAL-3: Book a call: the days as a list, then BOOK-8's picker */
.cal-head .cal-acts { display: flex; flex-wrap: wrap; gap: 12px; }
.cal-bk-panel .ny-drawer-body { padding: 16px 20px 24px; }
.cal-bk { display: flex; flex-direction: column; gap: 12px; }
.cal-bk-days { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cal-bk-day { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 56px; padding: 8px 12px; border: 1px solid #c7d7f5; border-radius: 10px; background: #eef4ff; color: #063a6c; font: inherit; text-align: left; cursor: pointer; }
.cal-bk-day:hover { border-color: #2563eb; }
.cal-bk-day b { font-size: 15px; } .cal-bk-day small { font-size: 12px; color: #4b5563; }
.cal-bk-prev { align-self: flex-start; min-height: 36px; padding: 0 8px; border: 0; background: none; color: #2563eb; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 6px; }
.cal-bk .cal-picker { margin: 0; padding: 0; border: 0; box-shadow: none; background: none; }
.cal-bk-done { display: flex; flex-direction: column; gap: 12px; }
.cal-avail-panel .today-card { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
/* BOOK-7: THE CALENDAR PAGE AS A MONTH (tools/calendar/calendar.js), the approved mock "Calendar Tool Mockup" (Desktop
   1440, Calls tab, Phone 390). White cards on #f3f4f6; blue #2563eb for the active tab, today and secondary buttons;
   light blue (#eff6ff / #93c5fd) for open slots and filter chips; the orange gradient for the one doing-action on a card
   (Send, Whole day off, Join Zoom). Pills: scheduled blue, showed green, no-show/canceled red, rescheduled purple,
   blocked and busy grey, day off amber. At 390: the month's cells are a number and coloured dots, the day panel comes in
   under the month, the chat box is pinned to the bottom and rides above the keyboard (--cal-kb), every button 44px+. */
.cal-page { display: flex; flex-direction: column; gap: 18px; min-width: 0; color: #111827; overflow-wrap: anywhere; }
.cal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cal-title { margin: 0; flex: 1 1 auto; }
.cal-tabs { display: flex; gap: 8px; }
.cal-tab { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid #d1d5db; background: #fff; color: #374151; font-size: 14px; font-weight: 600; text-decoration: none; }
.cal-tab.is-on { background: #2563eb; border-color: #2563eb; color: #fff; }
.cal-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid #2563eb; background: #fff; color: #2563eb; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.cal-btn:hover { background: #eff6ff; }
.cal-btn.is-go { background: linear-gradient(180deg, #f7a21b, #e8730f); border-color: #e8730f; color: #fff; }
.cal-btn.is-go:hover { filter: brightness(1.05); }
.cal-btn:disabled { opacity: .55; cursor: default; }
.cal-btn-sm { font-size: 13px; padding: 0 12px; }
.cal-btn.is-on { background: #2563eb; color: #fff; }
.cal-copy[data-state="copied"] { background: #dcfce7; border-color: #16a34a; color: #166534; }
.cal-copy[data-state="error"] { border-color: #dc2626; color: #991b1b; }
.cal-card { background: #fff; border-radius: 12px; padding: 20px; box-sizing: border-box; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); min-width: 0; }
.cal-card h2 { margin: 0 0 10px; font-size: 18px; font-weight: 700; }
.cal-hint { margin: 6px 0 0; font-size: 13px; color: #6b7280; }
.cal-eyebrow { font-size: 12px; font-weight: 600; color: #6b7280; letter-spacing: .4px; }
.cal-said-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 24px; }
.cal-said { font-size: 14px; color: #374151; }
.cal-said[data-kind="error"] { color: #991b1b; }
.cal-said[data-kind="working"] { color: #6b7280; }

/* the month and the day panel */
.cal-month-wrap { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cal-month { flex: 1 1 640px; }
.cal-month-hd { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-month-hd .cal-month-name { margin: 0 0 0 6px; font-size: 22px; }
.cal-ico { width: 44px; height: 44px; border-radius: 8px; border: 1px solid #bfdbfe; background: #eff6ff; color: #1e40af; font: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.cal-ico:hover { border-color: #2563eb; }
.cal-today { min-height: 44px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-left: auto; }
.cal-leg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: #6b7280; }
.cal-leg i, .cal-dots i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { padding: 6px 0; text-align: center; font-size: 12px; font-weight: 600; color: #6b7280; letter-spacing: .3px; }
.cal-dow-short { display: none; }
.cal-cell { min-height: 104px; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 8px; text-align: left; font: inherit; font-size: 13px; color: #111827; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; cursor: pointer; }
.cal-cell:hover:not(:disabled) { border-color: #93c5fd; }
.cal-cell:disabled { cursor: default; }
.cal-cell.is-dim { background: #f9fafb; color: #9ca3af; }
.cal-cell.is-sun { background: #f3f4f6; color: #9ca3af; }
.cal-cell.is-today { border: 2px solid #2563eb; padding: 7px; }
.cal-cell.is-sel { background: #eff6ff; border-color: #2563eb; }
.cal-num { display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; }
.cal-open { font-size: 12px; font-weight: 500; color: #6b7280; white-space: nowrap; }
.cal-pills { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-pill { padding: 3px 6px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: 11px; font-weight: 600; color: #6b7280; padding-left: 2px; }
.cal-dots { display: none; }
.k-call { background: #dbeafe; color: #1e40af; }
.k-ok { background: #dcfce7; color: #166534; }
.k-no { background: #fee2e2; color: #991b1b; }
.k-re { background: #ede9fe; color: #5b21b6; }
.k-blk, .k-busy { background: #e5e7eb; color: #4b5563; }
.k-off { background: #fde68a; color: #92400e; }
.k-sun { background: #f3f4f6; color: #6b7280; }
.cal-leg i.k-call, .cal-dots i.k-call { background: #2563eb; }
.cal-leg i.k-ok, .cal-dots i.k-ok { background: #16a34a; }
.cal-leg i.k-no, .cal-dots i.k-no { background: #dc2626; }
.cal-leg i.k-re, .cal-dots i.k-re { background: #7c3aed; }
.cal-leg i.k-blk, .cal-dots i.k-blk, .cal-dots i.k-busy { background: #9ca3af; }
.cal-leg i.k-off, .cal-dots i.k-off { background: #f59e0b; }
.cal-leg i.k-sun { background: #e5e7eb; border: 1px solid #d1d5db; box-sizing: border-box; }
.cal-day { flex: 0 1 340px; min-width: 280px; display: flex; flex-direction: column; gap: 10px; }
.cal-day.is-new { animation: cal-in .18s ease-out; }
.cal-day.is-empty { justify-content: center; min-height: 160px; text-align: center; }
.cal-day-says { margin: 4px 0 0 !important; font-size: 20px !important; }
.cal-day-btns { display: flex; gap: 8px; }
.cal-day-btns .cal-btn { flex: 1; }
.cal-slots, .cal-others { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cal-others .cal-eyebrow { grid-column: 1 / -1; margin-top: 4px; }
.cal-slot { min-height: 44px; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 12px; border-radius: 8px; border: 1px solid #93c5fd; background: #eff6ff; color: #1e3a8a; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; box-sizing: border-box; }
.cal-slot small { font-size: 12px; font-weight: 500; color: #2563eb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.cal-slot:hover:not(:disabled) { border-color: #2563eb; }
.cal-slot.is-soon { border-style: dashed; }
.cal-slot.is-blocked { background: #e5e7eb; border-color: #e5e7eb; color: #6b7280; }
.cal-slot.is-blocked .cal-slot-time { text-decoration: line-through; }
.cal-slot.is-blocked small { color: #4b5563; }
.cal-slot.is-busy, .cal-slot.is-buffer { background: #f3f4f6; border-color: #e5e7eb; color: #6b7280; cursor: default; }
.cal-slot.is-busy small, .cal-slot.is-buffer small { color: #6b7280; }
.cal-slot.is-past { background: #f9fafb; border: 1px dashed #d1d5db; color: #9ca3af; cursor: default; }
.cal-slot.is-past small { color: #9ca3af; }
/* BOOK-8: the small "Book" tap target on a slot Zoom would book (the slot itself still blocks), and the picker it opens */
.cal-slotbox { position: relative; min-width: 0; }
.cal-slotbox > .cal-slot { width: 100%; padding-right: 74px; }
.cal-book { min-height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid #e8730f; background: #fff; color: #c2410c; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.cal-book:hover, .cal-book[aria-expanded="true"] { background: #fff7ed; }
.cal-slotbox > .cal-book { position: absolute; top: 0; right: 0; bottom: 0; min-height: 0; border-radius: 0 8px 8px 0; } /* the slot's full 44px height */
.cal-slotbox.is-picking > .cal-slot { border-color: #e8730f; box-shadow: 0 0 0 2px #fed7aa; }
.cal-picker { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid #fed7aa; border-radius: 10px; background: #fffbf5; }
.cal-pick-title { margin: 0; font-size: 16px; }
.cal-pick-q, .cal-pick-note { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; font-size: 16px; box-sizing: border-box; background: #fff; }
.cal-pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; }
.cal-pick-person { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 44px; padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; color: #111827; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.cal-pick-person small { color: #6b7280; font-size: 12px; overflow-wrap: anywhere; }
.cal-pick-person.is-on { border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 1px #2563eb; }
.cal-pick-person:disabled { opacity: .55; cursor: default; }
.cal-pick-times { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-pick-btns { display: flex; gap: 8px; }
.cal-pick-btns .cal-btn { flex: 1; }
.cal-pick-row { padding: 8px 16px; border-top: 1px solid #e5e7eb; }
/* BOOK-9: Someone new (name and email) and who the invite goes to */
.cal-pick-who { display: flex; flex-direction: column; gap: 8px; }
.cal-link { align-self: flex-start; min-height: 36px; padding: 0 4px; border: 0; background: none; color: #2563eb; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 6px; text-align: left; }
.cal-link:hover { text-decoration: underline; }
.cal-hint .cal-link { min-height: 0; padding: 0; font-size: inherit; }
.cal-pick-to { margin: 0; min-height: 20px; font-size: 14px; color: #063a6c; overflow-wrap: anywhere; }
.cal-dayhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; } /* room for "Book" */
.cal-callrow { grid-column: 1 / -1; flex-wrap: wrap; justify-content: flex-start; padding: 6px 12px; cursor: default; }
/* a call in the panel: blue while it is ahead (the mock), its outcome's colour once it has a word */
.cal-callrow.k-call { background: #2563eb; border-color: #2563eb; color: #fff; }
.cal-callrow.k-ok { background: #dcfce7; border-color: #86efac; color: #166534; }
.cal-callrow.k-no { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.cal-callrow.k-re { background: #ede9fe; border-color: #c4b5fd; color: #5b21b6; }
.cal-callrow .cal-call-who { flex: 1 1 120px; min-width: 0; display: flex; flex-direction: column; }
.cal-callrow .cal-call-name { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.cal-callrow small { color: inherit; opacity: .85; }
.cal-override { display: flex; gap: 6px; }
.cal-foot { margin: 4px 0 0; font-size: 12px; color: #6b7280; }
@keyframes cal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* calls */
.cal-calls, .cal-off { display: flex; flex-direction: column; gap: 18px; }
.cal-stats { display: flex; flex-wrap: wrap; gap: 14px; }
.cal-stat { flex: 1 1 180px; background: #fff; border-radius: 12px; padding: 16px 20px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.cal-stat b { display: block; font-size: 28px; font-weight: 700; }
.cal-stat span { font-size: 13px; font-weight: 500; color: #6b7280; }
.cal-list { padding: 0; overflow: hidden; }
.cal-list-hd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 16px 12px; }
.cal-list-hd h2 { margin: 0; flex: 1 1 auto; }
.cal-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-chip { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid #93c5fd; background: #eff6ff; color: #1e40af; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cal-chip.is-on { background: #2563eb; border-color: #2563eb; color: #fff; }
.cal-row { display: grid; grid-template-columns: 170px 100px minmax(0, 1fr) 140px 120px; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid #e5e7eb; font-size: 14px; }
.cal-row.is-head { border-top: 0; padding-top: 0; padding-bottom: 6px; font-size: 12px; font-weight: 600; color: #6b7280; letter-spacing: .3px; }
.cal-row.is-quiet .cal-when, .cal-row.is-quiet .cal-who { color: #9ca3af; }
.cal-when { font-weight: 600; }
.cal-in { font-size: 12px; font-weight: 500; color: #6b7280; }
.cal-dayhead { padding: 8px 16px; background: #f9fafb; border-top: 1px solid #e5e7eb; font-size: 12px; font-weight: 600; color: #6b7280; }
.cal-list > .cal-said-row { padding: 8px 16px 14px; }

/* time off */
.cal-ul { list-style: none; margin: 0; padding: 0; }
.cal-off-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 4px 0; border-top: 1px solid #e5e7eb; font-size: 15px; }
.cal-ul .cal-off-row:first-child { border-top: 0; }
.cal-holidays { margin-top: 8px; border-top: 1px solid #e5e7eb; }
.cal-off-says small { color: #6b7280; }
.cal-built { color: #6b7280; font-size: 12px; }

/* the chat: the exchanges in a card, the box under it (pinned to the bottom on a phone) */
.cal-chat { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px; border-radius: 12px 12px 0 0; margin-bottom: -18px; }
.cal-chat[hidden] { display: none; }
.cal-chat-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 40vh; overflow-y: auto; }
.cal-ex { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.cal-ex-text { align-self: flex-start; max-width: 85%; padding: 8px 12px; border-radius: 10px; background: #f3f4f6; color: #374151; }
.cal-ex-reply { align-self: flex-end; max-width: 92%; display: flex; align-items: center; gap: 10px; }
.cal-ex-says { padding: 8px 12px; border-radius: 10px; background: #eff6ff; color: #1e40af; }
.cal-ex[data-kind="error"] .cal-ex-says, .cal-ex[data-kind="not-understood"] .cal-ex-says { background: #fee2e2; color: #991b1b; }
.cal-ex[data-kind="working"] .cal-ex-says { background: #f9fafb; color: #6b7280; }
.cal-ex-undo { flex: none; }
/* CAL-2: the chat's head: what the log holds (today's) and Clear */
.cal-chat-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cal-chat-hd .cal-eyebrow { margin: 0; }
.cal-chat-clear { min-height: 32px; padding: 0 10px; border: 0; background: none; color: #6b7280; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 6px; }
.cal-chat-clear:hover { background: #f3f4f6; color: #374151; }
.cal-chat-form { display: flex; gap: 10px; padding: 16px 20px; background: #fff; border-radius: 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.cal-chat:not([hidden]) + .cal-chat-form { border-radius: 0 0 12px 12px; padding-top: 6px; }
.cal-chat-input { flex: 1; min-width: 0; min-height: 48px; margin: 0; padding: 0 14px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 16px; } /* 16px: iOS does not zoom into the box */
.cal-chat-send { min-height: 48px; padding: 0 22px; }

@media (min-width: 768px) and (max-width: 1100px) {
  .cal-row { grid-template-columns: 150px 90px minmax(0, 1fr) auto; }
  .cal-row > :nth-child(4) { display: none; } /* the lane: no room between the who and the button */
}
@media (max-width: 767px) {
  .cal-page { gap: 14px; }
  .cal-title { font-size: 22px; }
  .cal-head .cal-tabs { order: 3; width: 100%; }
  .cal-tab { flex: 1; padding: 0 8px; font-size: 13px; }
  .cal-copy, .cal-avail, .cal-bookcall { font-size: 13px; padding: 0 10px; }
  .cal-head .cal-acts { order: 2; width: 100%; gap: 8px; } .cal-acts .cal-btn { flex: 1 1 auto; } /* CAL-3: the three under the title */
  .cal-avail-long { display: none; } .cal-avail-short { display: inline; } /* CAL-2: one line beside the title at 390 */
  .cal-card { padding: 14px; }
  .cal-card.cal-list { padding: 0; }
  .cal-list-hd { padding: 14px 14px 10px; }
  .cal-chips { width: 100%; flex-wrap: nowrap; gap: 6px; }
  .cal-chip { flex: 1 1 auto; padding: 0 8px; }
  .cal-row { padding: 10px 14px; }
  .cal-dayhead { padding: 8px 14px; }
  .cal-month-hd { gap: 8px; }
  .cal-month-hd .cal-month-name { flex: 1; margin: 0; text-align: center; font-size: 17px; order: 2; }
  #cal-prev { order: 1; } #cal-next { order: 3; }
  .cal-today { order: 4; flex: 1 1 100%; }
  .cal-legend { order: 5; margin: 0; width: 100%; justify-content: center; }
  .cal-leg { font-size: 11px; }
  .cal-leg i { width: 10px; height: 10px; }
  .cal-grid { gap: 4px; }
  .cal-dow { padding: 2px 0; font-size: 11px; }
  .cal-dow-long { display: none; } .cal-dow-short { display: inline; }
  .cal-cell { min-height: 48px; height: 48px; padding: 0; align-items: center; justify-content: center; gap: 3px; border-radius: 8px; font-size: 13px; }
  .cal-cell.is-today { padding: 0; }
  .cal-cell.is-sel { background: #2563eb; border-color: #2563eb; color: #fff; }
  .cal-cell.is-sel .cal-dots i { background: #fff; }
  .cal-num { justify-content: center; font-size: 13px; }
  .cal-open, .cal-pills { display: none; }
  .cal-dots { display: flex; gap: 3px; height: 6px; }
  .cal-dots i { width: 6px; height: 6px; border-radius: 50%; }
  .cal-day { flex: 1 1 100%; min-width: 0; }
  .cal-day-says { font-size: 18px !important; }
  .cal-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .cal-row.is-head { display: none; }
  .cal-row .cal-when { grid-column: 1; }
  .cal-row .cal-in { grid-column: 2; text-align: right; }
  .cal-row .cal-who { grid-column: 1 / -1; }
  .cal-row .cal-lane:empty { display: none; }
  .cal-row .cal-lane { grid-column: 1; color: #6b7280; font-size: 13px; }
  .cal-row > .cal-btn, .cal-row > a.cal-btn { grid-column: 1 / -1; }
  .cal-row > span:empty { display: none; }
  .cal-stat { flex: 1 1 140px; padding: 12px 14px; }
  .cal-stat b { font-size: 24px; }
  .cal-chat { padding: 12px 14px; }
  .cal-chat-form { position: sticky; bottom: var(--cal-kb, 0px); z-index: 20; margin: 0 calc(-1 * var(--sp-3)) calc(-1 * var(--sp-3)); padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); border-radius: 0; border-top: 1px solid #e5e7eb; box-shadow: 0 -4px 14px rgba(16, 24, 40, .08); }
  .cal-chat:not([hidden]) + .cal-chat-form { border-radius: 0; padding-top: 10px; }
  .cal-chat { margin-bottom: 0; border-radius: 12px; }
  .cal-chat-input { min-height: 44px; }
  .cal-chat-send { min-height: 44px; padding: 0 18px; }
}

/* =====================================================================================================================
   MARKETING-1 — MARKETING (#/marketing) AND FINANCIALS › MARKETING (#/financials/marketing)
   Phone first: Gerek runs this from his phone. Every table is a CSS grid that collapses to stacked, labelled lines
   under 860px, so nothing ever scrolls sideways. A record opens over the page from the right, full width on a phone.
   COLOUR: the step colours below are a blue-to-purple ramp. They are NOT the sacred status set — red, amber and green
   appear here only through .pill-over / .pill-unverified / .pill-verified, and mean only what the rules block says.
   ===================================================================================================================== */

/* the head row: where the queue stands, and the one button that changes it */
.mk-head { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; justify-content: space-between; margin: var(--sp-2) 0 var(--sp-4); }
.mk-queue-state { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; font-size: var(--fs-sm); color: var(--ink-dim); }
.mk-dot { color: var(--line-strong); }
.mk-head-r { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.mk-ask { display: inline-flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; font-size: var(--fs-sm); }
.mk-runwrap { display: inline-flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.mk-say:empty { display: none; }
.mk-say { margin: var(--sp-3) 0; }

/* five or six tiles across on a wide screen, never four and a lonely fifth on a line of its own */
.mk-tiles { margin-bottom: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.mk-chiprow { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); align-items: center; margin: var(--sp-4) 0 var(--sp-3); }
.mk-chip-note { font-size: var(--fs-xs); color: var(--ink-dim); flex: 1 1 260px; min-width: 0; }
.mk-rule, .mk-zb, .mk-citysum, .mk-foot { font-size: var(--fs-xs); }
.mk-none { color: var(--ink-dim); font-style: italic; }

/* a chip for a part that is named but not built: greyed, not a link (ui.js mountTabbed, `soon: true`) */
.ui-chip.is-soon { color: var(--ink-dim); background: var(--surface-alt); border-style: dashed; cursor: default; display: inline-flex; gap: var(--sp-2); align-items: center; }
.ui-chip-soon { font-size: var(--fs-xs); color: var(--ink-dim); background: var(--waiting-bg); border-radius: 999px; padding: 0 6px; }

/* ---- the grid tables ------------------------------------------------------------------------------------------- */
.mk-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-xs); }
.mk-tr { display: grid; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); align-items: center; border-top: 1px solid var(--line); min-width: 0; }
.mk-tr:first-child { border-top: 0; }
.mk-th { background: var(--surface-alt); font-size: var(--fs-xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .4px; color: var(--ink-dim); }
.mk-td { min-width: 0; overflow-wrap: anywhere; font-size: var(--fs-sm); }
.mk-strong { font-weight: var(--fw-bold); }
.mk-n { text-align: right; font-variant-numeric: tabular-nums; }
.mk-tag { margin-left: var(--sp-2); }
.mk-tot { background: var(--surface-alt); font-weight: var(--fw-bold); }
.mk-acts { display: flex; gap: var(--sp-3); align-items: center; justify-content: flex-end; }
.mk-rowbtn { background: none; border: 0; padding: 0; font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--accent); cursor: pointer; }
.mk-row { cursor: pointer; }
.mk-row:hover { background: var(--brand-blue-pale); }
.mk-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* City · Status · Clinics · Grade A · Page cost · Last built · Refresh due · actions */
#mk-city-table .mk-tr { grid-template-columns: minmax(0, 1.3fr) 150px 100px 110px 80px 105px 105px 250px; }
/* Clinic · City · State · Grade · Class · Email status · Source · Last verified */
.mk-table-pr .mk-tr { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 60px 70px 110px 110px minmax(0, 1fr) 110px; }
.mk-table-3 .mk-tr { grid-template-columns: minmax(0, 1.4fr) 1fr 1fr 1fr; }
.mk-table-city .mk-tr { grid-template-columns: minmax(0, 1.2fr) 100px 100px minmax(0, 2fr); }
.mk-table-step .mk-tr { grid-template-columns: minmax(0, 1.4fr) 1fr 1fr; }
.mk-table-bills .mk-tr { grid-template-columns: minmax(0, 1.2fr) 90px 100px 120px 90px minmax(0, 1.6fr); }
.mk-table-src .mk-tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 90px minmax(0, 1fr) 70px 80px 90px; }

/* ---- filters and paging ---------------------------------------------------------------------------------------- */
.mk-filters { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-end; margin: var(--sp-3) 0; }
.mk-filter { display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--ink-dim); min-width: 0; }
.mk-filter select { min-width: 150px; max-width: 100%; }
.mk-pager { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); align-items: center; margin: var(--sp-3) 0 var(--sp-5); font-size: var(--fs-sm); color: var(--ink-dim); }
.mk-pager-b { display: flex; gap: var(--sp-2); }

/* ---- the twelve-month chart ------------------------------------------------------------------------------------ */
.mk-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-2); align-items: end; padding: var(--sp-4) 0 0; min-height: 190px; }
.mk-bar-col { display: flex; flex-direction: column; justify-content: flex-end; gap: var(--sp-1); min-width: 0; text-align: center; cursor: default; }
.mk-bar-col:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }
.mk-bar-n { font-size: 10px; color: var(--ink-dim); font-variant-numeric: tabular-nums; min-height: 14px; overflow: hidden; }
/* a month with no spend draws nothing but the baseline, so an empty bar is never mistaken for a full one */
.mk-bar { display: flex; flex-direction: column-reverse; height: 120px; justify-content: flex-start; border-radius: 4px 4px 0 0; overflow: hidden; border-bottom: 1px solid var(--line-strong); }
.mk-bar-s, .mk-sw { background: #9aa8bd; }
.mk-bar-s { height: calc(var(--f) * 120px); min-height: 2px; }
.mk-bar-l { font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.mk-bar-y { font-size: 10px; color: var(--ink-dim); }
.mk-legend { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-4); font-size: var(--fs-xs); color: var(--ink-dim); }
.mk-leg { display: inline-flex; gap: 6px; align-items: center; }
.mk-sw { display: block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
/* one colour a step — a blue-to-purple-to-slate ramp, never the sacred three. A step with no rule here takes the grey above. */
.mk-s-sweep     { background: #2494e0; }
.mk-s-write     { background: #0b5fd9; }
.mk-s-edit      { background: #0f2440; }
.mk-s-verify    { background: #0f7480; }
.mk-s-finder    { background: #6b3fa0; }
.mk-s-google    { background: #7a4fc4; }
.mk-s-instantly { background: #063a6c; }
.mk-s-mailboxes { background: #4a90b8; }
.mk-s-domains   { background: #9aa8bd; }
.mk-s-other     { background: #c3cad6; }
/* the steps the ledger actually writes today, beside D-059's list */
.mk-s-gate       { background: #5b6470; }
.mk-s-master     { background: #35628f; }
.mk-s-email      { background: #1f8f8f; }
.mk-s-footprints { background: #8a6fc9; }
.mk-s-geocode    { background: #d08a3c; }
.mk-s-license    { background: #7a8b9e; }
.mk-s-listing    { background: #4f6d8c; }
.mk-s-named_match, .mk-s-namedmatch { background: #a05fb0; }
.mk-s-site       { background: #66798f; }

/* ---- the waiting cards (Cold Email, Bills) --------------------------------------------------------------------- */
.mk-wait-body { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); font-size: var(--fs-sm); }
.mk-wait-body p { margin: 0; }

/* ---- the record, over the page --------------------------------------------------------------------------------- */
.mk-backdrop { position: fixed; inset: var(--header-h) 0 0 0; z-index: 24; background: rgba(15, 36, 64, .22); }
.mk-panel { position: fixed; top: var(--header-h); right: 0; bottom: 0; z-index: 25; width: 520px; max-width: 100vw; background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -12px 0 32px rgba(15, 36, 64, .14); display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
.mk-ph { padding: var(--sp-5) var(--sp-5) var(--sp-4); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--sp-3); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.mk-ph-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); }
.mk-ph-name { min-width: 0; }
.mk-ph h2 { margin: 2px 0 0; font-size: var(--fs-2xl); font-weight: var(--fw-bold); overflow-wrap: anywhere; }
.mk-kicker { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--ink-dim); text-transform: uppercase; letter-spacing: .4px; }
.mk-x { flex: none; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); font-size: 15px; color: var(--ink-dim); cursor: pointer; }
.mk-x:hover { background: var(--surface-alt); color: var(--ink); }
/* THE RULE: a record's buttons sit at the top, never under its numbers */
.mk-ph-acts { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.mk-pbody { padding: var(--sp-4) var(--sp-5) var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-5); }
.mk-pwait { color: var(--ink-dim); }
.mk-block h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .5px; color: var(--ink-dim); }
.mk-line { display: flex; gap: var(--sp-3); justify-content: space-between; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); min-width: 0; }
.mk-line:last-child { border-bottom: 0; }
.mk-line-l { color: var(--ink-dim); flex: 0 1 auto; }
.mk-line-v { text-align: right; font-weight: var(--fw-medium); overflow-wrap: anywhere; min-width: 0; }
.mk-pstatus { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.mk-why { font-size: var(--fs-xs); color: var(--ink-dim); }
.mk-said { margin: 0; padding: var(--sp-3); background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: var(--fs-xs); white-space: pre-wrap; overflow-wrap: anywhere; }
.mk-night + .mk-night { margin-top: var(--sp-3); }
.mk-night-h { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-dim); margin-bottom: var(--sp-1); }
.mk-seats { display: flex; flex-direction: column; gap: var(--sp-2); }
.mk-seat { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: baseline; font-size: var(--fs-sm); }
.mk-seat-l { font-weight: var(--fw-medium); }
.mk-seat-s { font-size: var(--fs-xs); color: var(--ink-dim); flex: 1 1 100%; }
.mk-steps { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--sp-2); }
.mk-step { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-sm); }
.mk-step .mk-n { font-variant-numeric: tabular-nums; }

/* MARKETING-1B: the bills band in By month, the prepaid minus line under the Bills card, the credit packs, Add a bill */
.mk-s-bills { background: repeating-linear-gradient(135deg, #0f2440 0 4px, #35628f 4px 8px); }
.mk-minus { margin-top: var(--sp-1); font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--ink-dim); font-variant-numeric: tabular-nums; width: fit-content; border-bottom: 1px dotted var(--ink-mute); cursor: help; }
.mk-sw-in { display: inline-block; margin-right: var(--sp-2); vertical-align: middle; }
.mk-packs { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-3) var(--sp-4) 0; font-size: var(--fs-sm); color: var(--ink-dim); }
.mk-pack strong { color: var(--ink); }
#mk-f-bills .ui-card-hd { gap: var(--sp-3); flex-wrap: wrap; }
#mk-bill-box:empty { display: none; }
#mk-bill-box { margin-bottom: var(--sp-4); }
.mk-bill-amount { margin: 0; font-size: var(--fs-2xl); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.mk-bill-confirm p { margin: 0 0 var(--sp-2); }
/* MARKETING-1B: one city's marks and controls, and itv-core's sentence under the row it changed */
.mk-pills { display: flex; flex-wrap: wrap; gap: var(--sp-1); align-items: center; }
.mk-act { min-height: 36px; padding: 6px 12px; }
.mk-rowsay { grid-column: 1 / -1; cursor: default; }
.mk-rowsay .verdict { margin: 0; }

/* ---- phone and small tablet: every table becomes stacked, labelled lines; the record fills the window ----------- */
@media (max-width: 860px) {
  .mk-tr { grid-template-columns: 1fr !important; gap: var(--sp-1); padding: var(--sp-3) var(--sp-4); }
  .mk-th { display: none; }
  .mk-td[data-l] { display: flex; justify-content: space-between; gap: var(--sp-3); align-items: baseline; }
  .mk-td[data-l]::before { content: attr(data-l); color: var(--ink-dim); font-size: var(--fs-xs); flex: none; }
  .mk-td.mk-strong[data-l]::before { display: none; }
  .mk-td.mk-strong { font-size: var(--fs-lg); padding-bottom: var(--sp-1); }
  .mk-n { text-align: right; }
  .mk-acts { justify-content: flex-start; flex-wrap: wrap; padding-top: var(--sp-2); }
  .mk-act { min-height: 44px; }
  .mk-pills { justify-content: flex-end; }
  .mk-panel { left: 0; width: 100vw; }
  .mk-ph, .mk-pbody { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .mk-chart { grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: var(--sp-4); }
  .mk-filter select { min-width: 0; width: 100%; }
  .mk-filter { flex: 1 1 140px; }
}
@media (max-width: 420px) {
  .mk-chart { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mk-bar-n { font-size: 9px; }
}

/* MARKETING-1: the Cities table's status chips (they hide rows; they never ask itv-core for anything) and the By city fold */
.mk-statuses .ui-chip { cursor: pointer; font: inherit; font-size: var(--fs-sm); display: inline-flex; gap: 6px; align-items: center; } /* DESIGN-1 sets its look */
.mk-chip-n { font-size: var(--fs-xs); opacity: .75; font-variant-numeric: tabular-nums; }
.mk-rest { display: contents; }
.mk-row[hidden] { display: none; }
/* MARKETING-1: a record's buttons sit side by side, each only as wide as its words */
.mk-ph-acts .btn, .mk-ph-acts > a { flex: 0 1 auto; width: auto; }

/* MARKETING-3: Cities by step — the top strip, one row per city with a storefront list, the 7 steps when a row opens */
.mk-k-over { color: var(--red-ink); font-weight: var(--fw-bold); }
.mk-k-verified { color: var(--green-ink); }
.mk-k-unverified { color: var(--amber-ink); }
.mk-strip { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); align-items: stretch; }
.mk-of { font-size: var(--fs-sm); color: var(--ink-dim); font-weight: var(--fw-regular, 400); }
.mk-tile-word { font-size: var(--fs-md, 15px); }
.mk-small { font-size: var(--fs-xs); }
.mk-buckets, .mk-checks { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: grid; gap: 2px; font-size: var(--fs-xs); }
.mk-buckets li { display: flex; justify-content: space-between; gap: var(--sp-2); color: var(--ink-dim); }
.mk-buckets li.mk-k-over, .mk-buckets li.mk-k-unverified { color: inherit; }
.mk-checks li { display: grid; grid-template-columns: 14px 1fr; column-gap: 6px; align-items: baseline; }
.mk-checks .mk-check-v { grid-column: 2; color: var(--ink-dim); font-weight: normal; }
.mk-checks li.mk-k-over { font-weight: normal; }
.mk-tick { font-weight: var(--fw-bold); }
.mk-strip-role .mk-act { margin-top: var(--sp-2); align-self: flex-start; white-space: nowrap; font-size: var(--fs-xs); }
.mk-strip-line { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); margin-top: var(--sp-3); }
.mk-quad { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2) var(--sp-3); margin: var(--sp-1) 0; }
.mk-quad-n { font-size: var(--fs-lg); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.mk-quad-l { font-size: var(--fs-xs); color: var(--ink-dim); }
.mk-steps-label { margin-top: var(--sp-4); }
#mk-step-table .mk-tr { grid-template-columns: minmax(0, 1.2fr) 80px 90px 85px 80px 80px 60px 105px 95px 250px; }
.mk-srow { cursor: pointer; }
.mk-srow[aria-expanded="true"] { background: var(--surface-alt); }
.mk-pl { font-variant-numeric: tabular-nums; }
.mk-x-body { grid-column: 1 / -1; cursor: default; padding-top: var(--sp-2); }
.mk-sgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--sp-3); align-items: start; }
.mk-sg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--sp-3); display: grid; gap: 4px; align-content: start; }
.mk-sg-wide { grid-column: span 2; }
.mk-sg-gap { border-color: var(--line-strong); }
.mk-sg-h { margin: 0 0 var(--sp-1); font-size: var(--fs-sm); font-weight: var(--fw-bold); display: flex; align-items: center; gap: var(--sp-2); }
.mk-sg-n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--navy, #0f2440); color: #fff; font-size: 11px; flex: none; }
.mk-sl { display: flex; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-sm); align-items: baseline; }
.mk-sl-l { color: var(--ink-dim); }
.mk-sl-v { font-variant-numeric: tabular-nums; text-align: right; }
.mk-sg-small { font-size: var(--fs-xs); color: var(--ink-dim); }
.mk-sg-acts { margin-top: var(--sp-2); display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.mk-lbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-alt); margin: var(--sp-1) 0; }
.mk-lseg { display: block; min-width: 3px; background: #9aa8bd; } /* a layer not named below */
.mk-lkey { display: flex; flex-wrap: wrap; gap: 4px var(--sp-3); font-size: var(--fs-xs); color: var(--ink-dim); }
.mk-lk { display: inline-flex; align-items: center; gap: 4px; }
:where(.mk-lk) i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: #9aa8bd; } /* :where keeps it under the layer colours */
/* the layers: one blue-navy family, so none reads as a status colour */
.mk-l-carried { background: #0f2440; } .mk-l-homepage { background: #0b5fd9; } .mk-l-innerpage { background: #2494e0; }
.mk-l-guess { background: #35628f; } .mk-l-guessmx { background: #4a90b8; } .mk-l-wayback { background: #7f9bbf; }
.mk-l-ai { background: #6b3fa0; } .mk-l-aiwithserper { background: #9a7fc9; } .mk-l-serperdoctor { background: #5b6470; }
.mk-fold { margin-top: var(--sp-5); }
.mk-fold > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: baseline; padding: var(--sp-3) 0; list-style-position: inside; }
@media (max-width: 860px) {
  .mk-sg-wide { grid-column: auto; }
  .mk-sgs { grid-template-columns: 1fr; }
  .mk-srow .mk-acts { justify-content: flex-start; }
}

/* ==========================================================================================================
   DESIGN-1 — ONE SET OF CONTROLS (owner, Oct 31, 2026: "the branding buttons that I like in blue and orange, with small
   rounded corners ... with slightly rounded corners and the brand colors on all the different tabs, not the pills").
   The Calendar's look is the model. This block comes last, so it is the one place a clickable control's shape and colour
   are set; earlier rules for these classes keep only their size and layout.
     tabs and filters   8px corners; white with a grey line; the one that is on is filled brand blue
     main action        orange (Book a call, Send, Save, Add)
     other actions      white with a blue line and blue words (Cancel, Pause, Open, Copy)
     quiet action       white with a grey line (the code asked for "quiet": a second, lesser choice)
     danger             red
   Round pills are left only on things nobody clicks: a status (queued, Scheduled, paused), a count, a tag.
   ========================================================================================================== */
:root {
  --ctl-blue: #2563eb;
  --ctl-blue-hover: #1d4ed8;
  --ctl-blue-wash: #eff6ff;
  --ctl-line: #d1d5db;
  --ctl-ink: #374151;
  --ctl-go: linear-gradient(180deg, #f7a21b, #e8730f);
  --ctl-go-line: #e8730f;
  --ctl-red: #dc2626;
  --ctl-red-ink: #b42318;
  --ctl-red-wash: #fdf3f2;
  --ctl-radius: 8px;
}

/* -- tabs and filters ---------------------------------------------------------------------------------------- */
.tabs, .bd-tabs { gap: 8px; border-bottom: 0; padding-bottom: 2px; }
.ui-folds { background: none; border: 0; padding: 0; gap: 8px; }
.cl-seg, .bd-seg { background: none; padding: 0; gap: 8px; border-radius: 0; }
.tab, .bd-tab { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; margin-bottom: 0; font: inherit; font-size: 14px; }
.xw-history-tabs .tab { border: 1px solid var(--ctl-line); }
:is(.tab, .bd-tab, .ui-fold, .cal-tab, .bd-seg a, .bd-seg button, .ui-chip, .chip-btn, .cl-chip, .cal-chip, .sp-pill, .bd-alt-pill) {
  border: 1px solid var(--ctl-line); border-radius: var(--ctl-radius); background: #fff; color: var(--ctl-ink);
  font-weight: 600; text-decoration: none; cursor: pointer; outline: 0;
}
:is(.tab, .bd-tab, .ui-fold, .cal-tab, .bd-seg a, .bd-seg button, .ui-chip, .chip-btn, .cl-chip, .cal-chip, .sp-pill, .bd-alt-pill):hover {
  border-color: var(--ctl-blue); color: var(--ctl-blue); background: var(--ctl-blue-wash);
}
:is(.tab, .bd-tab, .ui-fold, .cal-tab, .bd-seg a, .bd-seg button, .ui-chip, .chip-btn, .cl-chip, .cal-chip, .sp-pill, .bd-alt-pill):is(.active, .is-on, .on, .is-open),
:is(.tab, .bd-tab, .ui-fold, .cal-tab, .bd-seg a, .bd-seg button, .ui-chip, .chip-btn, .cl-chip, .cal-chip, .sp-pill, .bd-alt-pill):is(.active, .is-on, .on, .is-open):hover {
  background: var(--ctl-blue); border-color: var(--ctl-blue); color: #fff; outline: 0;
}
:is(.tab, .bd-tab, .ui-fold, .cal-tab, .bd-seg a, .bd-seg button, .ui-chip, .chip-btn, .cl-chip, .cal-chip, .sp-pill, .bd-alt-pill):focus-visible { outline: 2px solid var(--ctl-blue); outline-offset: 2px; }
.ui-chip.is-soon, .ui-chip.is-soon:hover { border-style: dashed; border-color: var(--ctl-line); background: var(--surface-alt); color: var(--ink-dim); cursor: default; }
.ui-chip.is-soon .ui-chip-soon { border-radius: 4px; }
:is(.chip-btn, .ui-chip, .cl-chip):disabled { opacity: .5; cursor: default; }

/* -- the main action: orange ----------------------------------------------------------------------------------- */
:is(.btn-save, .btn-primary, .btn-action, .ui-go, .sp-go, .bd-pri, .sc-go, .bd-btn-navy, .cal-btn.is-go, .ui-btn.cl-add) {
  background: var(--ctl-go); border: 1px solid var(--ctl-go-line); border-radius: var(--ctl-radius); color: #fff;
  font-weight: 600; text-decoration: none;
}
:is(.btn-save, .btn-primary, .btn-action, .ui-go, .sp-go, .bd-pri, .sc-go, .bd-btn-navy, .cal-btn.is-go, .ui-btn.cl-add):hover:not(:disabled) {
  background: var(--ctl-go); border-color: var(--ctl-go-line); color: #fff; filter: brightness(1.06);
}
:is(.btn-save, .btn-primary, .btn-action, .ui-go, .sp-go, .bd-pri, .sc-go, .bd-btn-navy, .cal-btn.is-go):disabled { opacity: .55; filter: none; cursor: default; }

/* keyboard focus keeps the colour and shows a ring */
:is(.btn-save, .btn-primary, .btn-action, .ui-go, .sp-go, .bd-pri, .sc-go, .bd-btn-navy, .cal-btn.is-go, .ui-btn.cl-add):focus-visible { background: var(--ctl-go); outline: 2px solid var(--ctl-blue); outline-offset: 2px; }

/* -- other actions: blue line, blue words (the exclusions sit in :where(), so the rule weighs one class) ------------- */
:is(.btn-quiet, .ui-btn, .sp-btn, .bd-btn, .cal-btn, .cl-more-btn, .cl-open, .cl-login, .sc-daybtn, .edit-btn, .bd-sel-ctl, .bd-chip, .bd-open):not(:where(.cl-add, .is-go, .btn-danger, .btn-delete, .bd-danger, .bd-btn-navy, .sc-act-red)) {
  background: #fff; border: 1px solid var(--ctl-blue); border-radius: var(--ctl-radius); color: var(--ctl-blue);
  font-weight: 600; text-decoration: none;
}
:is(.btn-quiet, .ui-btn, .sp-btn, .bd-btn, .cal-btn, .cl-more-btn, .cl-open, .cl-login, .sc-daybtn, .edit-btn, .bd-sel-ctl, .bd-chip, .bd-open):not(:where(.cl-add, .is-go, .btn-danger, .btn-delete, .bd-danger, .bd-btn-navy, .sc-act-red)):hover:not(:disabled) {
  background: var(--ctl-blue-wash); border-color: var(--ctl-blue-hover); color: var(--ctl-blue-hover);
}
:is(.btn-quiet, .ui-btn, .sp-btn, .bd-btn, .cal-btn, .edit-btn):disabled { opacity: .5; cursor: default; }
/* an action that is "on" (Showed, a yes/no answer, a menu that is open) reads like a tab that is on */
:is(.cal-btn, .sp-btn, .btn-quiet, .bd-btn):is(.is-on, [aria-expanded="true"]):not(.is-go) { background: var(--ctl-blue); border-color: var(--ctl-blue); color: #fff; }
/* quiet: a second, lesser choice */
:is(.ui-btn-quiet, .sp-btn-quiet, .bd-sel-ctl.is-quiet) { border-color: var(--ctl-line); color: var(--ctl-ink); }

/* -- danger ---------------------------------------------------------------------------------------------------- */
:is(.btn-save, .btn-action, .btn-quiet).btn-danger, :is(.btn-save, .btn-action).btn-danger:hover:not(:disabled) { background: var(--ctl-red); border-color: var(--ctl-red); color: #fff; filter: none; }
:is(.bd-danger, .sc-act-red, .sc-btn-red, .btn-delete) { background: var(--ctl-red-wash); border: 1px solid #f3c4c0; border-radius: var(--ctl-radius); color: var(--ctl-red-ink); }
:is(.bd-danger, .sc-act-red, .btn-delete):hover:not(:disabled) { background: var(--ctl-red); border-color: var(--ctl-red); color: #fff; }
.btn-action.sc-btn-red { background: var(--ctl-red); border-color: var(--ctl-red); color: #fff; }

/* -- the header's Needs-you button: a button, so the same corners -------------------------------------------- */
.ny-pill { border-radius: var(--ctl-radius); }

/* ==========================================================================================================
   NAV-1 — A TOOL'S SECTIONS IN THE LEFT MENU (owner, Oct 31, 2026: "what you do with the marketing, with having a
   subsection, really needs to be with all the different 14 tools ... It all should be unified ... that gives more space in
   the actual tool for more data to be shown left to right"). src/shell.js draws each tool as a group: its item, then its
   sections. Open menu: the open tool's sections show under it. Menu closed to icons: a tool's sections open beside its icon
   on hover or keyboard focus. Phone: the menu is a drawer with names, so the open tool's sections show under it.
   ========================================================================================================== */
/* NAV-1B (owner, Oct 31, 2026: "I want it more like a Wordpress look. maybe a different background color to show easily
   what's tied to that Tier 1 tool"): the open tool and its sections are one block — the tool's blue bar on top, its
   sections on a lighter navy panel joined under it; a section is a plain line of text, the open one white and bold. */
:root { --nav-sub-bg: #1b3a61; --nav-sub-ink: #c3d4ea; --nav-sub-hover: #93c5fd; }
.nav-subs { display: none; margin: 0 0 8px; padding: 6px 0 8px; border-radius: 0 0 var(--radius-md) var(--radius-md); background: var(--nav-sub-bg); }
.nav-group.is-current .nav-subs { display: block; }
.nav-group.is-current .nav-item.has-subs { margin-bottom: 0; border-radius: var(--radius-md) var(--radius-md) 0 0; }
.nav-subs-hd { display: none; }
.nav-sub { min-height: 34px; margin: 0; padding: 0 var(--sp-3) 0 44px; border-radius: 0; background: none; color: var(--nav-sub-ink); font-size: 14px; font-weight: 500; }
.nav-sub:hover { background: none; color: var(--nav-sub-hover); }
.nav-sub.active, .nav-sub.active:hover { background: none; color: #fff; font-weight: 700; box-shadow: none; }
.nav-sub.is-soon { color: rgba(195, 212, 234, .6); }
.nav-later { margin-left: 8px; padding: 0 6px; border-radius: 4px; background: rgba(255, 255, 255, .1); color: var(--nav-sub-ink); font-size: 11px; font-weight: 600; opacity: 1; }
@media (max-width: 767px) { .nav-sub { min-height: 44px; } }
/* NAV-1C: the open tool pressed again folds its sections away; its blue bar stands alone again, page unchanged */
.nav-group.is-current.is-folded .nav-subs { display: none; }
.nav-group.is-current.is-folded .nav-item.has-subs { margin-bottom: 2px; border-radius: var(--radius-md); }
@media (min-width: 768px) {
  .shell-nav:is(.collapsed, .compact) { overflow: visible; } /* the menu scrolls when open; closed, its icons fit, and a scroller would clip the sections beside them */
  .shell-nav:is(.collapsed, .compact) .nav-group { position: relative; }
  .shell-nav:is(.collapsed, .compact) .nav-item.has-subs::after { display: none; }
  .shell-nav:is(.collapsed, .compact) .nav-subs { display: none; position: absolute; left: 100%; top: 0; z-index: 40; min-width: 210px; margin: 0; padding: 6px 0 8px; border-radius: 0 10px 10px 0; background: var(--nav-sub-bg); box-shadow: var(--shadow-md); }
  .shell-nav:is(.collapsed, .compact) .nav-group:is(:hover, :focus-within) .nav-subs { display: block; }
  .shell-nav:is(.collapsed, .compact) .nav-subs .nav-label { display: inline; }
  .shell-nav:is(.collapsed, .compact) .nav-subs-hd { display: block; padding: 4px 12px 6px; color: #fff; font-size: 13px; font-weight: 600; }
  .shell-nav:is(.collapsed, .compact) .nav-sub { padding-left: 16px; white-space: nowrap; }
  .shell-nav:is(.collapsed, .compact) .nav-group.is-current .nav-item.has-subs { border-radius: var(--radius-md); }
  .shell-nav:is(.collapsed, .compact) .nav-subs-hd { padding: 4px 16px 6px; }
}
/* the title names the open section: "Financials / AI costs" */
.page-sec { color: var(--ink-dim); font-weight: 500; }
.page-sec::before { content: '/'; margin: 0 .4em; color: var(--line-strong); font-weight: 400; }

/* MARKETING-3: Marketing › Cold email */
/* MARKETING-4: a plain status line, no box (what needs the owner is in the red Needs-you button alone) */
.mk-ce-status { padding: 0; margin: var(--sp-1) 0 var(--sp-4); }
.mk-ce-line { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.mk-ce-sub { font-size: var(--fs-sm); color: var(--ink-dim); margin-top: var(--sp-1); }
.mk-ce-card { margin-bottom: var(--sp-4); }
.mk-ce-inboxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-3); }
.mk-ce-inbox { gap: 4px; }
.mk-ce-dom { font-weight: var(--fw-bold); }
.mk-ce-local { font-size: var(--fs-xs); color: var(--ink-dim); overflow-wrap: anywhere; margin-bottom: var(--sp-1); }
.mk-table-gates .mk-tr { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr) minmax(0, 1.6fr); }
.mk-gate { display: inline-flex; flex-wrap: wrap; gap: var(--sp-2); align-items: baseline; }
.mk-gate-why { color: var(--ink-dim); font-size: var(--fs-xs); }
.mk-seq { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--sp-2); }
.mk-seq-step { border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--sp-2) var(--sp-3); display: grid; gap: 2px; font-size: var(--fs-sm); }
.mk-seq-step[data-step="5"] { border-left: 3px solid var(--line-strong); }
.mk-seq-n { font-weight: var(--fw-bold); }
.mk-seq-d, .mk-seq-c { color: var(--ink-dim); font-size: var(--fs-xs); }
.mk-rcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--sp-3); }
.mk-rc { border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--sp-2) var(--sp-3); }
.mk-ce-role { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: baseline; margin-top: var(--sp-3); }
.mk-ce-camps { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); font-size: var(--fs-sm); }
.mk-ce-camp { display: inline-flex; gap: var(--sp-2); align-items: center; }
@media (max-width: 860px) {
  .mk-seq { grid-template-columns: 1fr; }
  .mk-seq-step { grid-template-columns: 70px 60px 1fr auto; align-items: baseline; }
  .mk-ce-inboxes { grid-template-columns: 1fr; }
}

/* ==========================================================================================================
   MARKETING-4 — MARKETING › CITY PAGES AS A SCOREBOARD (owner, Nov 1, 2026: "a scoreboard a CEO reads in 10 seconds").
   Big numbers, small labels, plain words, no tiles inside tiles. Phone first: the six numbers are 2 across and 3 down,
   one row of six from 900px. A city row is a compact block on a phone and a table row on a wide screen. The only colour is
   status: "stopped" is the red word (MARKETING-4B colours the verified % instead of tinting a row under 30%). The controls are DESIGN-1's.
   src/fresh.js: the "read 10:41 AM" stamp (amber when the fresh read failed) and the first visit's skeleton.
   ========================================================================================================== */
.fr-bar { display: flex; justify-content: flex-end; margin-bottom: var(--sp-2); }
.fr-stamp { font-size: var(--fs-xs); color: var(--ink-mute); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fr-stamp.fr-stale { color: var(--amber-ink); background: var(--amber-wash); border: 1px solid var(--amber-line); border-radius: var(--radius-sm); padding: 1px 8px; }
.fr-skel { display: grid; gap: var(--sp-3); }
.fr-skel-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.fr-skel-big .fr-skel-bar { height: 72px; }
.fr-skel-bar { display: block; height: 14px; border-radius: var(--radius-sm); background: linear-gradient(90deg, #eceef2 0%, #f6f7f9 50%, #eceef2 100%); background-size: 200% 100%; animation: fr-shimmer 1.4s ease-in-out infinite; }
.fr-skel-line { grid-column: 1 / -1; height: 40px; }
@keyframes fr-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .fr-skel-bar { animation: none; } }
@media (min-width: 900px) { .fr-skel-row { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.mk4-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); }
.mk4-toggle { display: inline-flex; gap: 8px; }
.mk4-toggle .ui-chip { min-height: 36px; padding: 0 14px; font-size: var(--fs-sm); }
.mk4-back { font-weight: 600; color: var(--accent); text-decoration: none; }
/* on a phone the stamp has a line of its own, so "· refreshing…" coming and going never moves what is under it */
@media (max-width: 899px) { .mk4-bar > .fr-stamp { flex-basis: 100%; text-align: right; } }

.mk4-score { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5) var(--sp-4); padding: var(--sp-5) var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.mk4-stat { min-width: 0; }
.mk4-n { font-size: 34px; line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.mk4-pct { margin-left: 8px; font-size: 17px; font-weight: 600; letter-spacing: 0; color: var(--ink-dim); }
.mk4-l { margin-top: 6px; font-size: var(--fs-sm); color: var(--ink-dim); }
.mk4-sub { margin-top: 2px; font-size: var(--fs-xs); color: var(--ink-mute); }
@media (min-width: 900px) {
  .mk4-score { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; padding: var(--sp-5) var(--sp-2); }
  .mk4-stat { position: relative; padding: 0 var(--sp-4); }
  .mk4-stat + .mk4-stat::before { content: '›'; position: absolute; left: -6px; top: 6px; font-size: 24px; line-height: 1; color: var(--line-strong); }
  .mk4-n { font-size: 44px; }
}

.mk4-money { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-4); margin: var(--sp-4) 0 var(--sp-5); padding: 0 var(--sp-1); }
.mk4-m { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mk4-m:first-child { grid-column: 1 / -1; }
.mk4-m-l { font-size: var(--fs-xs); color: var(--ink-dim); }
.mk4-m-v { font-size: var(--fs-lg); font-weight: 650; font-variant-numeric: tabular-nums; }
.mk4-m-of { font-size: var(--fs-sm); font-weight: 400; color: var(--ink-dim); }
@media (min-width: 900px) {
  .mk4-money { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) 0; }
  .mk4-m { flex-direction: row; align-items: baseline; gap: 6px; }
  .mk4-m + .mk4-m::before { content: '·'; margin: 0 var(--sp-3); color: var(--line-strong); }
  .mk4-m-l { font-size: var(--fs-sm); }
}

.mk4-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.mk4-tr.mk4-th { display: none; }
.mk4-tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 44px; grid-template-areas: "city city city city act" "built built built built built" "a b c d ."; gap: 6px var(--sp-2); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); align-items: center; }
.mk4-tr:first-of-type, .mk4-th + .mk4-tr { border-top: 0; }
.mk4-td { min-width: 0; font-size: var(--fs-md); }
.mk4-city { grid-area: city; font-weight: 650; font-size: var(--fs-lg); }
.mk4-tr > .mk4-td:nth-child(2) { grid-area: built; font-size: var(--fs-sm); }
.mk4-tr > .mk4-td:nth-child(3) { grid-area: a; } .mk4-tr > .mk4-td:nth-child(4) { grid-area: b; }
.mk4-tr > .mk4-td:nth-child(5) { grid-area: c; } .mk4-tr > .mk4-td:nth-child(6) { grid-area: d; }
.mk4-act { grid-area: act; justify-self: end; }
.mk4-num { font-variant-numeric: tabular-nums; }
.mk4-num::before { content: attr(data-l); display: block; font-size: 11px; color: var(--ink-mute); }
.mk4-said { grid-column: 1 / -1; }
.mk4-said .verdict { margin: 0; font-size: var(--fs-sm); }
.mk4-live { color: var(--ink); }
.mk4-stopped { color: var(--red-ink); }
.mk4-quiet { color: var(--ink-mute); }
.mk4-tag { margin-left: 8px; font-size: 11px; vertical-align: middle; }
.mk4-cost { cursor: help; text-decoration: underline dotted var(--line-strong); text-underline-offset: 3px; }
.mk4-more { min-width: 40px; min-height: 36px; padding: 0 8px; font-size: 18px; line-height: 1; }
.mk4-more .menu-caret { display: none; }
.mk4-flash { animation: mk4-flash 2.4s ease-out; }
@keyframes mk4-flash { 0%, 40% { box-shadow: inset 4px 0 0 var(--ctl-blue); background: var(--ctl-blue-wash); } 100% { box-shadow: inset 4px 0 0 transparent; } }
.mk4-ask { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.mk4-details { display: inline-block; margin: var(--sp-5) 0 var(--sp-2); font-weight: 600; color: var(--accent); text-decoration: none; }
.mk4-details:hover { text-decoration: underline; }
@media (min-width: 900px) {
  .mk4-tr.mk4-th { display: grid; padding-top: var(--sp-2); padding-bottom: var(--sp-2); background: var(--surface-alt); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-dim); }
  .mk4-tr { grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr) repeat(3, minmax(0, .7fr)) minmax(0, .9fr) 52px; grid-template-areas: none; padding: var(--sp-3) var(--sp-4); }
  .mk4-tr > .mk4-td { grid-area: auto !important; }
  .mk4-city { font-size: var(--fs-md); }
  .mk4-tr > .mk4-td:nth-child(2) { font-size: var(--fs-md); }
  .mk4-num { text-align: right; }
  .mk4-num::before { content: none; }
  .mk4-th .mk4-td:nth-child(n+3):nth-child(-n+6) { text-align: right; }
}

/* the red Needs-you button's Retry (a stopped city) */
.ny-retry-wrap { display: block; margin: 0 0 6px 32px; }
.ny-ask { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); }
.ny-ask[hidden] { display: none; }
.ny-retries { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-3); font-size: var(--fs-sm); }
.ny-retry-note .verdict, .ny-retry-note .state { margin: 4px 0 0; }
/* ONE-RUN-1: an item's own action (Rewrite this article on an article left NOT COMPLETE), its wait and itv-core's answer */
.ny-action-said { margin: 0 0 6px 32px; font-size: var(--fs-sm); }
.ny-spin { display: inline-block; width: 11px; height: 11px; border: 2px solid #c9d2de; border-top-color: #0e5aa6; border-radius: 50%; animation: ny-spin .8s linear infinite; vertical-align: -1px; }
@keyframes ny-spin { to { transform: rotate(360deg); } }

/* ==========================================================================================================
   MARKETING-4B — DATE RANGES, ONE DARK SCOREBOARD, THE VERIFIED COLOUR, CITIES BY STATE (owner, Nov 1, 2026). Inside
   DESIGN-1: the range chips and the pickers are its controls (8px corners, grey line, the one that is on filled blue).
     the scoreboard   one dark card (the menu's navy), the six numbers white, the funnel's arrows the brand orange
     verified %       green 40% and over · amber 30 to under 40 · red under 30, on the card and on every row and header
     the money line   plain, as MARKETING-4 drew it; nothing else is recoloured
   A state header is a row you press to fold or open its cities; a county header sits inside a state past 25 cities.
   ========================================================================================================== */
.mk4b-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px var(--sp-3); min-width: 0; }
.mk4b-range .mk4-toggle { flex-wrap: wrap; }
.mk4b-days { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mk4b-days[hidden] { display: none; }
.mk4b-dl { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-dim); }
.mk4b-day, .mk4b-select { min-height: 36px; padding: 0 10px; border: 1px solid var(--ctl-line); border-radius: var(--ctl-radius); background: #fff; color: var(--ctl-ink); font: inherit; font-size: var(--fs-sm); }
.mk4b-day:focus-visible, .mk4b-select:focus-visible { outline: 2px solid var(--ctl-blue); outline-offset: 2px; border-color: var(--ctl-blue); }
.mk4b-pt { font-size: var(--fs-xs); color: var(--ink-mute); }
.mk4b-pt-bad { color: var(--red-ink); }
.mk4b-stamp-slot { display: contents; }

/* the one dark card */
.mk4-score { background: var(--brand-navy); border-color: var(--brand-navy); box-shadow: var(--shadow-sm); }
.mk4-score .mk4-n { color: #fff; }
.mk4-score .mk4-l { color: rgba(255, 255, 255, .78); }
.mk4-score .mk4-sub { color: rgba(255, 255, 255, .6); }
@media (min-width: 900px) { .mk4-score .mk4-stat + .mk4-stat::before { color: #f7a21b; } }

/* verified %: on the light page, and lighter shades of the same three on the dark card */
.mk4b-pct-good { color: var(--green-ink); }
.mk4b-pct-mid { color: var(--amber-ink); }
.mk4b-pct-low { color: var(--red-ink); }
.mk4-score .mk4-pct { font-weight: 700; }
.mk4-score .mk4b-pct-good { color: #4ade80; }
.mk4-score .mk4b-pct-mid { color: #fbbf24; }
.mk4-score .mk4b-pct-low { color: #f87171; }
.mk4-score .mk4b-pct-none { color: rgba(255, 255, 255, .6); }
.mk4-num .mk4b-pct-good, .mk4-num .mk4b-pct-mid, .mk4-num .mk4b-pct-low, .mk4b-gpct { font-weight: 650; }

/* the area picker */
.mk4b-area { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 var(--sp-3); }
.mk4b-area-l { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-dim); }
.mk4b-select { max-width: 100%; cursor: pointer; }

/* state and county headers */
.mk4b-ghead { border-top: 1px solid var(--line); }
.mk4-th + .mk4b-group > .mk4b-ghead { border-top: 0; }
.mk4b-gbody[hidden] { display: none; }
.mk4b-gbody > .mk4-tr:first-child { border-top: 1px solid var(--line); }
.mk4b-gbtn { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0; width: 100%; min-height: 48px; padding: var(--sp-3) var(--sp-4); border: 0; background: var(--surface-alt); color: var(--ink); font: inherit; font-size: var(--fs-md); text-align: left; cursor: pointer; }
.mk4b-gbtn:hover { background: var(--ctl-blue-wash); }
.mk4b-gbtn:focus-visible { outline: 2px solid var(--ctl-blue); outline-offset: -2px; }
.mk4b-gname { font-weight: 700; }
.mk4b-gfig { color: var(--ink-dim); white-space: pre-wrap; font-variant-numeric: tabular-nums; }
.mk4b-gpct { font-variant-numeric: tabular-nums; }
.mk4b-chev { display: inline-block; width: 18px; flex: none; align-self: center; }
.mk4b-chev::before { content: ''; display: block; width: 7px; height: 7px; border-right: 2px solid var(--ink-dim); border-bottom: 2px solid var(--ink-dim); transform: rotate(-45deg); transition: transform .15s ease; }
.mk4b-gbtn[aria-expanded="true"] .mk4b-chev::before { transform: rotate(45deg); }
.mk4b-county { min-height: 44px; padding-left: calc(var(--sp-4) + 18px); background: #fff; font-size: var(--fs-sm); }
.mk4b-group-county .mk4-row { padding-left: calc(var(--sp-4) + 18px); }
.mk4b-empty { padding: var(--sp-4); color: var(--ink-dim); font-size: var(--fs-sm); }
@media (prefers-reduced-motion: reduce) { .mk4b-chev::before { transition: none; } }

/* ==========================================================================================================
   VISPAGE-1 — VISIBILITY › REPORTS AS FOUR SCREENS (owner, Nov 1, 2026: the page showed every client in a drop-down and read
   like developer output). The shell's own control layer (DESIGN-1, above) draws every button and chip; this block adds the
   navy band, its number cards, the client rows, the Review & send panel, the Fix page and One client. No new colours: the
   brand navy and blue, the menu's sub-navy, the sacred greens, ambers and reds, and the main action's orange.
   ========================================================================================================== */
:root { --vp-orange: #f7a21b; --vp-orange-deep: #e8730f; }
.vp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.vp-muted { color: var(--ink-dim); font-size: var(--fs-sm); }
.vp-none { color: var(--ink-dim); }
.vp-line { padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); color: var(--ink-dim); }
.vp-go { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; font-size: var(--fs-md); white-space: nowrap; }
.vp-go.is-off { opacity: .5; pointer-events: none; }

/* -- the navy band ------------------------------------------------------------------------------------------- */
.vp-band { background: var(--brand-navy); color: #fff; border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: var(--sp-4); }
.vp-band-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--sp-4); }
.vp-eyebrow { font-size: var(--fs-sm); font-weight: 600; color: var(--on-brand-dim); }
.vp-titlerow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.vp-title { margin: 2px 0 0; font-size: var(--fs-2xl); font-weight: 700; color: inherit; line-height: 1.2; }
.vp-month { min-height: 34px; padding: 0 10px; font: inherit; font-size: var(--fs-sm); font-weight: 600; color: #fff; background: var(--nav-sub-bg); border: 1px solid rgba(255, 255, 255, .25); border-radius: var(--ctl-radius); cursor: pointer; }
.vp-month:focus-visible { outline: 2px solid var(--on-brand-dim); outline-offset: 2px; }
.vp-searchbox { flex: 0 1 300px; min-width: 200px; }
.vp-search { width: 100%; min-height: 40px; padding: 0 12px; font: inherit; font-size: var(--fs-md); border: 1px solid transparent; border-radius: var(--ctl-radius); background: #fff; color: var(--ink); }
.vp-search:focus { outline: 2px solid var(--brand-blue); outline-offset: 1px; }
.vp-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-3); margin-top: 18px; }
.vp-num { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--nav-sub-bg); border-top: 4px solid var(--brand-blue); border-radius: 12px; }
.vp-num-ready { border-top-color: var(--done); }
.vp-num-needs { border-top-color: var(--vp-orange); }
.vp-num-sent { border-top-color: var(--on-brand-dim); }
.vp-num-l { font-size: var(--fs-sm); font-weight: 600; color: rgba(255, 255, 255, .82); }
.vp-num-n { font-size: 32px; font-weight: 700; line-height: 1.15; color: #fff; font-variant-numeric: tabular-nums; }
.vp-num-of { font-size: var(--fs-lg); font-weight: 600; color: rgba(255, 255, 255, .7); }
.vp-num-s { font-size: var(--fs-sm); color: rgba(255, 255, 255, .7); }
.vp-num .vp-go { align-self: flex-start; margin-top: var(--sp-2); }
.vp-back-link { display: inline-block; margin-bottom: 6px; color: var(--on-brand-dim); font-size: var(--fs-md); font-weight: 600; text-decoration: none; }
.vp-back-link:hover, .vp-back-link:focus-visible { color: #fff; text-decoration: underline; }

/* -- screen 1: the chips and the client rows --------------------------------------------------------------- */
.vp-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0 0 var(--sp-3); }
.vp-chip { min-height: 36px; }
.vp-tablewrap { border-radius: var(--radius-lg); }
.vp-page .table-wrap { position: relative; } /* the hidden "Actions" words stay inside the box that scrolls */
.vp-table { min-width: 640px; }
table.data.vp-table thead th { background: var(--brand-blue-pale); color: var(--brand-navy); font-weight: 700; }
table.data.vp-table td { vertical-align: middle; }
.vp-row-fix > td { background: var(--amber-wash); }
.vp-row-norun > td { background: var(--red-wash); }
/* REPORT-7 (owner, Nov 3, 2026): a sent month is done — the whole row light green, and its Sent pill green (the list only) */
.vp-row-sent > td { background: var(--green-wash); }
.vp-row-sent .vp-pill { color: var(--green-ink); background: var(--green-wash); border-color: var(--green-line); }
.vp-wholink { display: inline-flex; align-items: center; gap: var(--sp-3); color: inherit; text-decoration: none; }
.vp-wholink:hover .vp-name, .vp-wholink:focus-visible .vp-name { color: var(--ctl-blue); text-decoration: underline; }
.vp-init { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; background: var(--brand-blue); color: #fff; font-size: var(--fs-sm); font-weight: 700; letter-spacing: .02em; }
.vp-init-go { background: var(--done); }
.vp-init-fix { background: var(--vp-orange-deep); }
.vp-init-norun { background: var(--red); }
.vp-init-sent { background: var(--brand-blue); }
.vp-names { display: flex; flex-direction: column; }
.vp-name { font-weight: 650; }
.vp-place { font-size: var(--fs-sm); color: var(--ink-dim); }
.vp-pill { white-space: nowrap; }
.vp-th-act { width: 1%; }
.vp-acts { white-space: nowrap; }
.vp-actrow { display: flex; justify-content: flex-end; gap: var(--sp-2); }
.vp-actrow > * { min-height: 34px; display: inline-flex; align-items: center; }
.vp-empty { padding: var(--sp-4); color: var(--ink-dim); }

/* -- screen 2: Review & send, over the page ---------------------------------------------------------------- */
.vp-back { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 36, 64, .78); }
.vp-panel { position: absolute; inset: 20px; display: flex; flex-direction: column; overflow: hidden; background: #fff; border-radius: var(--radius-lg); box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
.vp-pbar { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: 12px 16px; background: var(--brand-navy); color: #fff; }
.vp-pbar-l { min-width: 0; }
.vp-ptitle { font-size: var(--fs-lg); font-weight: 700; }
.vp-pwho { font-size: var(--fs-sm); color: var(--on-brand-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-pbar-r { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.vp-pfull { min-height: 34px; padding: 0 12px; font: inherit; font-size: var(--fs-sm); font-weight: 600; color: #fff; background: transparent; border: 1px solid rgba(255, 255, 255, .5); border-radius: var(--ctl-radius); cursor: pointer; }
.vp-pfull:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.vp-pfull:disabled { opacity: .5; cursor: default; }
/* REPORT-1: the version line under the title, and "A newer version is ready · Reload" */
.vp-pver { margin-top: 2px; font-size: var(--fs-xs); color: var(--on-brand-dim); }
.vp-pver:empty { display: none; }
.vp-newer { font-weight: 700; color: #fde68a; }
.vp-reload { padding: 0; font: inherit; font-weight: 700; color: #fff; background: none; border: 0; text-decoration: underline; cursor: pointer; }
/* a phone: the title, client and version line get the whole width; the buttons sit on their own row under them */
@media (max-width: 600px) {
  .vp-pbar { flex-wrap: wrap; row-gap: var(--sp-2); }
  .vp-pbar-l { flex: 1 1 100%; }
  .vp-pbar-r { flex: 1 1 100%; }
  .vp-pbar-r .vp-px { margin-left: auto; }
  /* Reports sent: View · Resend · Download wrap inside the row instead of running off the phone */
  table.vp-sent-table { min-width: 0; }
  .vp-sent-table .vp-actrow { flex-direction: column; align-items: stretch; gap: 6px; }
  .vp-sent-table .vp-actrow > * { justify-content: center; }
}
.vp-px { width: 36px; height: 36px; font-size: 18px; color: #fff; background: transparent; border: 0; border-radius: var(--ctl-radius); cursor: pointer; }
.vp-px:hover, .vp-px:focus-visible { background: rgba(255, 255, 255, .12); }
.vp-pbody { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.vp-stage { display: flex; min-height: 0; background: var(--surface-alt); border-right: 1px solid var(--line); }
.vp-frame { flex: 1; width: 100%; height: 100%; border: 0; background: #fff; }
.vp-stage-wait { margin: auto; }
.vp-pside { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding: var(--sp-4); }
.vp-shead { margin-top: 4px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-dim); }
.vp-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.vp-check { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-md); }
.vp-tick { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--done); color: #fff; font-size: 12px; font-weight: 700; }
.vp-check.is-no .vp-tick { background: var(--vp-orange-deep); }
.vp-mail { display: flex; flex-direction: column; gap: 10px; }
.vp-field { display: block; }
.vp-flabel { display: flex; justify-content: space-between; gap: var(--sp-2); margin-bottom: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-dim); }
.vp-saved { font-weight: 500; color: var(--done-ink); }
.vp-to { font-size: var(--fs-md); overflow-wrap: anywhere; }
.vp-mail .field, .vp-fixmid .field { margin: 0; }
/* VISPAGE-2: the people the email goes to — To and Cc rows of people, each with a small x; "+ Add person" and its small form */
.vp-people { display: flex; flex-direction: column; gap: 8px; }
.vp-chips-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vp-person { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-height: 32px; padding: 0 2px 0 10px; font-size: var(--fs-md); font-weight: 600; color: var(--ctl-ink); background: var(--ctl-blue-wash); border: 1px solid #bfdbfe; border-radius: var(--ctl-radius); }
.vp-person-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-person.is-going { opacity: .5; }
.vp-px-x { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; font: inherit; font-size: 12px; color: var(--ctl-ink); background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
.vp-px-x:hover:not(:disabled), .vp-px-x:focus-visible { color: #fff; background: var(--ctl-red); outline: 0; }
.vp-px-x:disabled { cursor: default; }
.vp-addrow { display: flex; }
.vp-add { min-height: 34px; padding: 0 12px; }
.vp-addform { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface-alt); border: 1px solid var(--ctl-line); border-radius: var(--ctl-radius); }
.vp-addform[hidden] { display: none; }
.vp-opt { font-weight: 500; }
.vp-bad { margin-top: -4px; font-size: var(--fs-sm); font-weight: 600; color: var(--ctl-red-ink); }
.vp-bad:empty, .vp-pline:empty { display: none; }
.vp-pline { font-size: var(--fs-sm); color: var(--ctl-red-ink); }
.vp-roles { display: flex; gap: 8px; }
.vp-role { min-height: 34px; padding: 0 18px; }
.vp-f-btns { display: flex; gap: 8px; }
.vp-f-btns > button { min-height: 36px; padding: 0 16px; }
@media (max-width: 767px) {
  .vp-person { min-height: 40px; }
  .vp-px-x { width: 36px; height: 36px; }
  .vp-add, .vp-role, .vp-f-btns > button { min-height: 44px; }
  .vp-f-btns > .vp-f-go { flex: 1; }
}
.vp-body { min-height: 180px; resize: vertical; line-height: 1.45; }
.vp-sig { padding: 8px 10px; font-size: var(--fs-sm); color: var(--ink-dim); background: var(--surface-alt); border: 1px dashed var(--line-strong); border-radius: var(--ctl-radius); }
.vp-send { width: 100%; min-height: 44px; font-size: 15px; }
.vp-why { font-size: var(--fs-sm); color: var(--ink-dim); }
.vp-lock { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.vp-lock > button { min-height: 34px; }
.vp-walk { display: flex; justify-content: space-between; gap: var(--sp-2); margin-top: auto; padding-top: var(--sp-2); }
.vp-walk > button { min-height: 36px; }
.vp-chat { padding: 10px 12px; font-size: var(--fs-md); background: var(--brand-blue-pale); border-radius: var(--radius-md); }
/* REPORT-5: "Before you send" — each blocker with what clears it; the "words changed" note, small and shut until opened */
.vp-blockers { display: flex; flex-direction: column; gap: 10px; }
.vp-blocker { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--vp-orange-deep); border-radius: var(--radius-md); }
.vp-blocker.is-done { border-left-color: var(--done); }
.vp-btitle { font-weight: 700; }
.vp-btext { margin: 0; font-size: var(--fs-md); line-height: 1.45; color: var(--ink-dim); white-space: pre-line; }
.vp-blocker .field { margin: 0; }
.vp-bout:empty { display: none; }
.vp-bbtns { display: flex; justify-content: flex-end; }
.vp-bbtns > button { min-height: 40px; padding: 0 18px; }
.vp-note { font-size: var(--fs-sm); color: var(--ink-dim); }
.vp-note > summary { cursor: pointer; padding: 4px 0; font-weight: 600; color: var(--ink-dim); }
.vp-note > summary:hover, .vp-note > summary:focus-visible { color: var(--ink); }
.vp-note-lead { margin: 4px 0 6px; }
.vp-note-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; line-height: 1.45; overflow-wrap: anywhere; }
@media (max-width: 767px) { .vp-bbtns > button { flex: 1; min-height: 44px; } .vp-note > summary { padding: 10px 0; } }
@media (max-width: 900px) {
  .vp-panel { inset: 8px; }
  .vp-pbody { display: block; overflow-y: auto; }
  .vp-stage { height: 62vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .vp-pside { overflow: visible; }
  .vp-pfull { padding: 0 8px; }
}

/* -- screen 3: Fix reports ----------------------------------------------------------------------------------- */
.vp-prog { margin-top: var(--sp-3); }
.vp-prog-t { font-size: var(--fs-md); font-weight: 600; color: rgba(255, 255, 255, .9); }
.vp-prog-bar { display: flex; gap: 3px; max-width: 420px; height: 8px; margin-top: 6px; }
.vp-prog-seg { flex: 1; background: rgba(255, 255, 255, .18); border-radius: 4px; }
.vp-prog-seg.is-done { background: var(--vp-orange); }
.vp-fixgrid { display: grid; grid-template-columns: 300px 420px minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.vp-fixleft { padding: var(--sp-3); }
.vp-fixlist { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: grid; gap: 6px; }
.vp-fixrow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; font: inherit; text-align: left; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); cursor: pointer; }
.vp-fixrow:hover { border-color: var(--ctl-blue); }
.vp-fixrow.is-on { border: 2px solid var(--ctl-blue); padding: 9px; background: var(--ctl-blue-wash); }
.vp-fixrow:focus-visible { outline: 2px solid var(--ctl-blue); outline-offset: 2px; }
.vp-fixno { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-blue-pale); color: var(--brand-navy); font-size: var(--fs-sm); font-weight: 700; }
.vp-fixrow.is-done .vp-fixno { background: var(--done); color: #fff; }
.vp-fixtx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.vp-fixwho { font-weight: 650; }
.vp-fixwhat { font-size: var(--fs-sm); color: var(--ink-dim); }
.vp-fixed { font-size: var(--fs-xs); font-weight: 700; color: var(--done-ink); }
.vp-fixmid { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.vp-fixmid > .vp-pill { align-self: flex-start; }
.vp-fixof { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-dim); }
.vp-fixclient { margin: 0; font-size: var(--fs-xl); }
.vp-fixtext { margin: 0; font-size: var(--fs-md); line-height: 1.5; }
.vp-fixpage { font-size: var(--fs-sm); overflow-wrap: anywhere; color: var(--ctl-blue); }
.vp-what { padding: 10px 12px; font-size: var(--fs-md); background: var(--brand-blue-pale); border-radius: var(--radius-md); }
.vp-fixbtns { display: flex; justify-content: space-between; gap: var(--sp-2); margin-top: var(--sp-2); }
.vp-fixbtns > button { min-height: 40px; }
.vp-fixreport { display: flex; height: 78vh; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.vp-allfixed { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); max-width: 560px; }
.vp-allfixed h2 { margin: 0; }
.vp-allfixed p { margin: 0 0 var(--sp-2); color: var(--ink-dim); }
@media (max-width: 1200px) { .vp-fixgrid { grid-template-columns: 280px minmax(0, 1fr); } .vp-fixreport { grid-column: 1 / -1; } }
@media (max-width: 767px) { .vp-fixgrid { grid-template-columns: minmax(0, 1fr); } .vp-fixreport { height: 70vh; } }

/* -- screen 4: one client ----------------------------------------------------------------------------------- */
.vp-chead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-3); }
.vp-cwhere { margin-top: 2px; font-size: var(--fs-md); color: var(--on-brand-dim); }
.vp-site { color: #fff; }
.vp-pill-big { padding: 3px 12px; font-size: var(--fs-md); }
.vp-band .vp-pill-big { background-color: #fff; }
.vp-ctwo { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--sp-4); align-items: start; }
.vp-ccard { display: flex; flex-direction: column; gap: 10px; }
.vp-ctitle { font-size: 15px; color: var(--ink-dim); }
.vp-ctitle strong { color: var(--ink); }
.vp-btnrow { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.vp-btnrow > * { min-height: 36px; }
.vp-sec { margin-top: var(--sp-5); }
.vp-h2 { margin: 0 0 10px; font-size: 18px; }
.vp-stories { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-3); }
.vp-story { border-top: 4px solid var(--brand-blue); }
.vp-story-when { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-blue); }
.vp-story-t { margin-top: 2px; font-weight: 650; }
.vp-story-x { margin: 4px 0 0; font-size: var(--fs-md); color: var(--ink-dim); line-height: 1.45; }
.vp-sent-table { min-width: 420px; }
@media (max-width: 767px) {
  .vp-band { padding: 16px; }
  .vp-title { font-size: 22px; }
  .vp-searchbox { flex: 1 1 100%; }
  .vp-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vp-num-n { font-size: 26px; }
  .vp-ctwo { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) { .vp-nums { grid-template-columns: minmax(0, 1fr); } }

/* ---- SERVERHEALTH-1B: Settings › Server and the Dashboard's Server tile (tools/system/server.js, dashboard.js) ----------
   The server's three colours, as the owner asked for them: green healthy, yellow start thinking about an upgrade, red time
   to upgrade (and a failed backup). Green is DASH-2's done green, red the status red; yellow is its own, used only here. */
.sh-green  { --sh: var(--done);  --sh-wash: var(--done-wash); --sh-ink: var(--done-ink); }
.sh-yellow { --sh: #d49b00;      --sh-wash: #fff6d9;          --sh-ink: #7a5800; }
.sh-red    { --sh: var(--red);   --sh-wash: #fbeaea;          --sh-ink: var(--red-ink); }
.sh-head { display: flex; align-items: center; gap: 12px; font-size: var(--fs-xl); font-weight: 700; color: var(--sh-ink, var(--ink)); background: var(--sh-wash, var(--surface)); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 20px; margin-bottom: 14px; }
.sh-big-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; background: var(--sh, var(--waiting-bg)); }
.sh-small-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--waiting-bg); }
.sh-boxes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.sh-box { border-top: 4px solid var(--sh, var(--line)); }
.sh-box .sh-pct { font-size: 40px; color: var(--sh-ink, var(--ink-dim)); }
.sh-meter { height: 8px; border-radius: 999px; background: var(--waiting-bg); overflow: hidden; margin: 2px 0 4px; }
.sh-meter > span { display: block; height: 100%; background: var(--sh, var(--ink-dim)); }
.sh-box-line { color: var(--ink); font-size: var(--fs-md); }
.sh-chart-card { margin-bottom: 14px; }
.sh-chart { display: block; width: 100%; height: auto; max-height: 280px; }
.sh-grid { stroke: var(--line); stroke-width: 1; }
.sh-mark { stroke-width: 1.5; stroke-dasharray: 6 5; opacity: .55; }
.sh-mark-70 { stroke: #d49b00; }
.sh-mark-85 { stroke: var(--red); }
.sh-axis { font-size: 11px; fill: var(--ink-dim); font-family: var(--font); }
.sh-mark-label { font-weight: 600; }
.sh-mark-label-70 { fill: #7a5800; }
.sh-mark-label-85 { fill: var(--red-ink); }
.sh-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.sh-dot { fill: var(--accent); }
.sh-chart-none { font-size: var(--fs-md); color: var(--ink-dim); padding: 24px 0; }
.sh-legend { font-size: var(--fs-xs); color: var(--ink-dim); }
.sh-backups { display: flex; flex-wrap: wrap; gap: 10px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 20px; margin-bottom: 10px; font-size: var(--fs-md); }
.sh-backup { display: flex; align-items: center; gap: 8px; }
.sh-backup.is-ok .sh-small-dot { background: var(--done); }
.sh-backup.is-bad { color: var(--red-ink); font-weight: 600; }
.sh-backup.is-bad .sh-small-dot { background: var(--red); }
.sh-backup.is-none { color: var(--ink-dim); }
.sh-checked { font-size: var(--fs-sm); color: var(--ink-dim); }
.sh-checked.is-late { color: var(--red); font-weight: 600; }
.band-server { background: #f0f1f4; } .band-server .dash-mark { background: #5b6470; }
.sh-tile { flex-direction: row; align-items: center; gap: 12px; max-width: 560px; color: inherit; text-decoration: none; font-size: var(--fs-lg); font-weight: 600; }
a.sh-tile:hover { border-color: var(--accent); }
.sh-tile-line { flex: 1; min-width: 0; color: var(--sh-ink, var(--ink)); }
.sh-tile-go { font-size: var(--fs-sm); font-weight: var(--fw-medium); }
@media (max-width: 900px) { .sh-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .sh-head { font-size: var(--fs-lg); padding: 12px 14px; }
  .sh-box .sh-pct { font-size: 30px; }
  .sh-backups { flex-direction: column; padding: 12px 14px; }
  .sh-tile { max-width: none; }
}

/* ---- TESTIMONIAL-3: TESTIMONIALS (tools/testimonials) ------------------------------------------------------------------
   The ONE LOOK pieces (.ui-card, .ui-pill, .ui-go, .btn-action) and these few, from the tokens only. The drop area is
   dashed like .ui-dashed; the client rows are a grid of six on a wide screen and a stack on a phone. */
.tsm-page { max-width: 1200px; }
.tsm-drop-fields { display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1.2fr) minmax(140px, .9fr) minmax(120px, .8fr); gap: var(--sp-2); }
.tsm-field { margin: 0; min-height: 44px; }
.tsm-drop-area { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3); min-height: 140px; padding: var(--sp-5); border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--surface-alt); cursor: pointer; text-align: center; }
.tsm-drop-area:hover, .tsm-drop-area:focus-visible, .tsm-drop-area.is-over { border-color: var(--accent); background: var(--sales-blue-wash); outline: none; }
.tsm-drop-area.is-busy { opacity: .7; cursor: progress; }
.tsm-drop-big { font-size: var(--fs-xl); font-weight: 700; color: var(--ink); }
.tsm-drop-text { display: flex; gap: var(--sp-2); align-items: flex-end; }
.tsm-drop-words { flex: 1 1 auto; min-height: 44px; }
.tsm-drop-said { display: flex; flex-direction: column; gap: 4px; }
.tsm-said { font-size: var(--fs-sm); }
.tsm-said-ok, .tsm-ok { color: var(--done-ink); }
.tsm-said-bad, .tsm-bad { color: var(--red-ink); }
.tsm-dim { color: var(--ink-dim); font-size: var(--fs-sm); }
.tsm-flash { font-weight: var(--fw-medium); }
.tsm-cards { display: flex; flex-direction: column; gap: var(--sp-3); }
.tsm-cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--sp-4); }
.tsm-card-hd { display: flex; align-items: center; gap: var(--sp-3); }
.tsm-card-name { font-size: var(--fs-lg); font-weight: 700; color: var(--ink); text-decoration: none; }
.tsm-card-name:hover { color: var(--accent); }
.tsm-card-cycle { font-size: var(--fs-sm); color: var(--ink-dim); }
.tsm-card-body { display: flex; flex-direction: column; gap: var(--sp-3); }
.tsm-reasons { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; line-height: 1.5; }
.tsm-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.tsm-acts .btn-action, .tsm-acts .ui-btn { min-height: 44px; }
.tsm-decided { font-size: var(--fs-sm); flex-basis: 100%; }
.tsm-icon { border-radius: 8px; flex: none; }
.tsm-init { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: var(--waiting-bg); color: var(--waiting-ink); font-weight: 700; flex: none; }
.tsm-search { margin: 0; max-width: 320px; min-height: 44px; }
.tsm-rows { display: flex; flex-direction: column; }
.tsm-row { display: grid; grid-template-columns: minmax(200px, 2fr) minmax(190px, 1.6fr) 1fr .6fr 1fr .8fr; gap: var(--sp-3); align-items: center; padding: 12px 8px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; min-height: 56px; }
a.tsm-row:hover { background: var(--surface-alt); }
.tsm-row-head { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-dim); border-top: 0; min-height: 0; padding-top: 0; }
.tsm-c-who { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.tsm-name { font-weight: 600; overflow-wrap: anywhere; }
.tsm-c-praise, .tsm-c-judged, .tsm-c-gift { font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.tsm-status { white-space: normal; }
.tsm-back { display: inline-block; margin-bottom: var(--sp-2); }
.tsm-title { display: flex; align-items: center; gap: var(--sp-3); }
.tsm-head { display: flex; flex-direction: column; gap: var(--sp-2); }
.tsm-head-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.tsm-sec { gap: var(--sp-3); }
.tsm-answers { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: var(--sp-3); }
.tsm-q { font-weight: 600; }
.tsm-a { white-space: pre-wrap; overflow-wrap: anywhere; }
.tsm-fu { margin-top: var(--sp-2); padding-left: var(--sp-3); border-left: 3px solid var(--line-strong); }
.tsm-transcript { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow-y: auto; padding: var(--sp-3); background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-md); font-size: var(--fs-sm); line-height: 1.55; }
.tsm-quote { margin: 0; padding: var(--sp-2) var(--sp-3); border-left: 3px solid var(--accent); background: var(--surface-alt); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tsm-praises { display: flex; flex-direction: column; }
.tsm-praise { display: flex; gap: var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--line); align-items: flex-start; }
.tsm-praise:first-child { border-top: 0; padding-top: 0; }
.tsm-praise-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tsm-praise-who { font-size: var(--fs-sm); color: var(--ink-dim); }
.tsm-praise-who strong { color: var(--ink); }
.tsm-praise-acts { display: flex; gap: var(--sp-4); }
.tsm-thumb { flex: none; width: 96px; height: 96px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-alt); display: flex; align-items: center; justify-content: center; overflow: hidden; text-decoration: none; color: var(--ink-dim); font-size: var(--fs-sm); }
.tsm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tsm-thumb.has-img .tsm-thumb-file { display: none; }
.tsm-thumb:not(.has-img) img { display: none; }
.tsm-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-3); align-items: end; }
.tsm-form .field { margin: 0; min-height: 44px; }
.tsm-f { display: flex; flex-direction: column; gap: 6px; }
.tsm-form .tsm-acts { grid-column: 1 / -1; }
.tsm-retire-box { display: flex; flex-direction: column; gap: var(--sp-3); }
.tsm-retire-box .field { margin: 0; }
@media (max-width: 767px) {
  .tsm-drop-fields { grid-template-columns: 1fr 1fr; }
  .tsm-drop-fields .tsm-field:first-child { grid-column: 1 / -1; }
  .tsm-drop-area { min-height: 120px; padding: var(--sp-4); }
  .tsm-drop-text { flex-direction: column; align-items: stretch; }
  .tsm-cardgrid { grid-template-columns: 1fr; }
  .tsm-list .ui-card-hd { flex-direction: column; align-items: stretch; }
  .tsm-search { max-width: none; }
  .tsm-row { grid-template-columns: 1fr auto; gap: 6px var(--sp-3); padding: 12px 0; }
  .tsm-row-head { display: none; }
  .tsm-c-who { grid-column: 1 / -1; }
  .tsm-c-status { grid-column: 1 / -1; }
  .tsm-row > [data-label]:not(.tsm-c-status)::before { content: attr(data-label) ": "; color: var(--ink-dim); }
  .tsm-row > [data-label]:empty { display: none; }
  .tsm-thumb { width: 72px; height: 72px; }
}

/* ==========================================================================================================
   PAYWATCH-1 — MONTHLY PLANS (tools/billing/plans.js): the strip's first card, the section on Invoicing, and the
   "Monthly plan" block on a client's Billing tab. Status colours only through the pills (green paid, amber watching,
   red a real problem, grey nothing to do); buttons take DESIGN-1's look (.btn-quiet, .btn-save).
   Below 1024px the table is one card per account, status and actions in view with no sideways scroll.
   ========================================================================================================== */
.xw-strip.xw-strip-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1199px) { .xw-strip.xw-strip-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .xw-strip.xw-strip-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .xw-strip-5 .pw-strip { grid-column: 1 / -1; } }
.pw-strip .big { overflow-wrap: anywhere; }
.pw-strip-bad { color: var(--red-ink); font-weight: var(--fw-bold); }
table.pw-table td { vertical-align: top; }
table.pw-table td.num { text-align: right; }
.pw-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
td.num .pw-cell { align-items: flex-end; }
.pw-client .client-link, .pw-name { display: inline-flex; align-items: center; }
.pw-covers { font-size: var(--fs-xs); }
.pw-line { font-size: var(--fs-xs); color: var(--ink-dim); max-width: 260px; }
.pw-last { white-space: nowrap; }
.pw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
td.pw-act { min-width: 250px; }
.pw-nowrap { white-space: nowrap; }
.pw-btn { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 10px; font-size: var(--fs-sm); white-space: nowrap; text-decoration: none; cursor: pointer; }
.pw-arrow { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--ctl-line); border-radius: var(--ctl-radius); background: #fff; color: var(--ctl-ink); font: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.pw-chev { display: inline-block; margin-top: -3px; transition: transform .15s; }
.pw-arrow[aria-expanded="true"] .pw-chev { transform: rotate(90deg); margin-top: 0; }
.pw-arrow:hover { border-color: var(--ctl-blue); color: var(--ctl-blue); background: var(--ctl-blue-wash); }
.pw-arrow[aria-expanded="true"], .pw-arrow[aria-expanded="true"]:hover { background: var(--ctl-blue); border-color: var(--ctl-blue); color: #fff; }
.pw-arrow:focus-visible { outline: 2px solid var(--ctl-blue); outline-offset: 2px; }
tr.pw-note-row > td, tr.pw-hist-row > td { border-top: 0; padding-top: 0; }
.pw-hist-box { padding: var(--sp-2) var(--sp-3); background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pw-hist-title { margin: 0 0 6px; font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.pw-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-sm); }
.pw-step-day { font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; }
.pw-step-bad .pw-step-line { color: var(--red-ink); }
.pw-step-good .pw-step-line { color: var(--green-ink); }
.pw-step-warn .pw-step-line { color: var(--amber-ink); }
.pw-good { color: var(--green-ink); font-weight: var(--fw-medium); }
.pw-quiet { color: var(--ink-dim); }
.pw-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border: 1px solid var(--amber-line); background: var(--amber-wash); color: var(--ink); border-radius: var(--radius-sm); font-size: var(--fs-sm); }
.pw-ask-btns { display: inline-flex; gap: 8px; }
.pw-said { margin: 0; padding: 6px 10px; font-size: var(--fs-sm); text-align: left; }
.pw-link { margin-top: 4px; font-size: var(--fs-xs); }
/* a client's Billing tab */
.pw-client .pw-one + .pw-one { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.pw-one-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--sp-2); margin-bottom: var(--sp-2); }
.pw-one-head .pw-line { max-width: none; font-size: var(--fs-sm); }
.pw-client .pw-covers { display: block; margin-bottom: var(--sp-2); }
.pw-client .pw-actions { margin: var(--sp-3) 0 var(--sp-2); }
.pw-client .pw-hist-title { margin-top: var(--sp-3); }
/* phone and tablet: one card per account */
@media (max-width: 1023px) {
  table.pw-table, table.pw-table tbody, table.pw-table tr, table.pw-table td { display: block; width: 100%; }
  table.pw-table thead { display: none; }
  table.pw-table tr.pw-row { display: flex; flex-direction: column; padding: var(--sp-2) 0; border-top: 1px solid var(--line); }
  table.pw-table tr.pw-row:first-child { border-top: 0; }
  table.pw-table tr.pw-row > td { order: 3; }
  table.pw-table tr.pw-row > td.pw-client { order: 1; }
  table.pw-table tr.pw-row > td.pw-status { order: 2; }
  table.pw-table td, table.pw-table td.num { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: var(--sp-2); padding: 3px var(--sp-3); border: 0; text-align: left; white-space: normal; }
  table.pw-table tr.pw-row > td::before { content: attr(data-label); font-size: var(--fs-xs); color: var(--ink-mute); padding-top: 3px; }
  table.pw-table tr.pw-row > td.pw-client { grid-template-columns: minmax(0, 1fr); font-size: var(--fs-md); }
  table.pw-table tr.pw-row > td.pw-client::before { display: none; }
  table.pw-table td.num .pw-cell { align-items: flex-start; }
  table.pw-table tr.pw-note-row > td, table.pw-table tr.pw-hist-row > td { display: block; padding: 0 var(--sp-3) var(--sp-2); }
  td.pw-act { min-width: 0; }
  .pw-line { max-width: none; }
  .pw-last { white-space: normal; }
}
@media (max-width: 767px) { .pw-btn, .pw-arrow { min-height: 40px; } .pw-arrow { width: 40px; height: 40px; } }

/* ==========================================================================================================
   PAYWATCH-2 — BILLING (Subscriptions + Invoices tabs) and the Subscriptions screen (the owner's design, Nov 8, 2026).
   Status colours are sacred: green good, amber watching, red a real problem, grey nothing to do, purple coming up
   (the Scheduler's colour). Tabs, chips and buttons are the control layer's (--ctl-*).
   ========================================================================================================== */
.pill-purple { color: #4E2A7A; background: #F1ECFA; border-color: rgba(107, 63, 160, .3); }
.bl-tabrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 var(--sp-4); }
.bl-tabs { display: flex; flex-wrap: wrap; }
.bl-tab { gap: 8px; }
.bl-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: #FDEEDC; color: #8A3E05; font-size: 12px; font-weight: 700; line-height: 1.4; }
.bl-badge[hidden] { display: none; }
.bl-tabs-right { display: flex; align-items: center; }
#bl-said { margin-bottom: var(--sp-3); }
.sb-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the month picker */
.sb-picker { display: flex; align-items: center; gap: 8px; }
.sb-month { min-width: 132px; text-align: center; font-size: 16px; font-weight: 700; color: #0F2440; font-variant-numeric: tabular-nums; }
.sb-mbtn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 20px; line-height: 1; color: var(--ctl-ink); background: #fff; border: 1px solid var(--ctl-line); border-radius: var(--ctl-radius); cursor: pointer; }
.sb-mbtn:hover:not(:disabled) { border-color: var(--ctl-blue); color: var(--ctl-blue); background: var(--ctl-blue-wash); }
.sb-mbtn:focus-visible { outline: 2px solid var(--ctl-blue); outline-offset: 2px; }
.sb-mbtn:disabled { opacity: .4; cursor: default; }
.sb-now { min-height: 36px; padding: 0 12px; font-size: var(--fs-sm); cursor: pointer; }

/* the five tiles */
.sb-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 14px; }
.sb-tile { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.sb-tile-top { display: flex; align-items: center; gap: 10px; }
.sb-chip { flex: none; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
.sb-chip svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sb-tile-label { font-size: 13px; font-weight: 600; }
.sb-big { font-size: 30px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sb-sub { font-size: 13px; overflow-wrap: anywhere; }
.sb-navy { background: #0F2440; border-color: #0F2440; color: #fff; }
.sb-navy .sb-chip { background: #2494E0; }
.sb-navy .sb-tile-label, .sb-navy .sb-sub { color: #B9D9F5; }
.sb-green { background: #E6F4EC; border-color: rgba(26, 122, 77, .25); }
.sb-green .sb-chip { background: #1E8E4B; }
.sb-green .sb-big { color: #0F5C39; }
.sb-green .sb-tile-label, .sb-green .sb-sub { color: #146A38; }
.sb-purple { background: #F1ECFA; border-color: rgba(107, 63, 160, .25); color: #4E2A7A; }
.sb-purple .sb-chip { background: #6B3FA0; }
.sb-red { background: #FDF3F2; border-color: #F3C4C0; color: #8D1C15; }
.sb-red .sb-chip { background: #DC2626; }
.sb-white { background: #fff; border-color: var(--line); }
.sb-white .sb-chip { background: #FDEEDC; }
.sb-white .sb-chip svg { stroke: #8A3E05; }
.sb-white .sb-sub, .sb-white .sb-tile-label { color: var(--ink-dim); }
.sb-amber { background: rgba(214, 158, 0, .10); border-color: rgba(214, 158, 0, .35); color: #6D4A00; }
.sb-amber .sb-chip { background: #FDEEDC; }
.sb-amber .sb-chip svg { stroke: #8A3E05; }
.sb-bar { height: 10px; border-radius: 999px; background: #fff; overflow: hidden; }
.sb-bar-fill { display: block; height: 100%; border-radius: 999px; background: #1E8E4B; }

/* the cards */
.sb-card { background: #fff; border: 1px solid #E3E6EB; border-radius: 14px; margin-bottom: 14px; }
.sb-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 16px 20px 0; }
.sb-card-head h2 { margin: 0; font-size: 16px; }

/* at a glance */
.sb-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-dim); }
.sb-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sb-lg { display: inline-block; width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box; }
.sb-line-scroll { overflow-x: auto; padding: 0 20px 14px; }
.sb-line { position: relative; height: 138px; min-width: 560px; margin: 0 34px; }
.sb-track { position: absolute; left: 0; right: 0; top: 70px; height: 8px; border-radius: 999px; background: #EEF0F3; overflow: hidden; }
.sb-track-fill { display: block; height: 100%; background: #A7D7BC; }
.sb-today { position: absolute; top: 4px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; z-index: 1; }
.sb-today-tag { padding: 3px 8px; border-radius: 6px; background: #0F2440; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }
.sb-today-line { width: 2px; height: 46px; background: #0F2440; }
.sb-dot-btn { position: absolute; top: 74px; width: 22px; height: 22px; margin: -11px 0 0 -11px; padding: 0; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(15, 36, 64, .12); cursor: pointer; z-index: 2; box-sizing: border-box; }
.sb-dot-btn:focus-visible { outline: 2px solid var(--ctl-blue); outline-offset: 2px; }
.sb-dot-btn.is-on { box-shadow: 0 0 0 3px var(--ctl-blue); }
.sb-gdot-paid { background: #1E8E4B; }
.sb-gdot-coming { background: #fff; }
.sb-dot-btn.sb-gdot-coming { box-shadow: inset 0 0 0 4px #6B3FA0, 0 0 0 1px rgba(15, 36, 64, .12); }
.sb-dot-btn.sb-gdot-coming.is-on { box-shadow: inset 0 0 0 4px #6B3FA0, 0 0 0 3px var(--ctl-blue); }
.sb-lg.sb-gdot-coming { border: 3px solid #6B3FA0; }
.sb-gdot-retrying { background: #D69E00; }
.sb-gdot-failed { background: #DC2626; }
.sb-label { position: absolute; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font-size: 12px; line-height: 1.3; color: var(--ink-dim); white-space: nowrap; text-align: center; }
.sb-label strong { color: var(--ink); font-weight: 700; }
.sb-above { top: 28px; }
.sb-below { top: 92px; }
.sb-label.sb-edge-l { transform: translateX(-12px); align-items: flex-start; text-align: left; }
.sb-label.sb-edge-r { transform: translateX(calc(-100% + 12px)); align-items: flex-end; text-align: right; }
#sb-no-days { padding: 12px 20px 18px; }

/* the list */
.sb-list-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 16px; }
.sb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sb-fchip { min-height: 36px; padding: 0 12px; }
.sb-search { width: 240px; max-width: 100%; margin: 0; padding: 8px 12px; min-height: 36px; }
.sb-dayline { padding: 0 16px 10px; font-size: var(--fs-sm); color: var(--ink-dim); }
.sb-row { display: grid; grid-template-columns: minmax(0, 2fr) 110px 170px minmax(0, 2fr) 52px; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid #EEF0F3; }
.sb-head { background: #F9FAFC; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: #5B6470; padding-top: 9px; padding-bottom: 9px; }
.sb-head .sb-c2 { text-align: right; }
.sb-plan { cursor: pointer; }
.sb-plan:hover { background: #FAFBFD; }
.sb-plan.is-open, .sb-rowwrap.is-open { background: #F7FAFF; }
.sb-client { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sb-icon { flex: none; width: 32px; height: 32px; border-radius: 8px; object-fit: contain; }
.sb-initials { flex: none; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: #E8F3FD; color: #0B5FD9; font-size: 12px; font-weight: 700; }
.sb-namebox { display: flex; flex-direction: column; min-width: 0; }
.sb-name { font-size: 15px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.sb-namebox .pw-covers { font-size: 12px; color: var(--ink-mute); }
.sb-amt { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.sb-when { font-size: var(--fs-sm); color: var(--ink-dim); }
.sb-c5 { display: flex; justify-content: flex-end; }
.sb-arrow { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0; font: inherit; font-size: 20px; line-height: 1; color: var(--ctl-ink); background: #fff; border: 1px solid var(--ctl-line); border-radius: var(--ctl-radius); cursor: pointer; }
.sb-arrow:hover { border-color: var(--ctl-blue); color: var(--ctl-blue); background: var(--ctl-blue-wash); }
.sb-arrow:focus-visible { outline: 2px solid var(--ctl-blue); outline-offset: 2px; }
.sb-arrow[aria-expanded="true"] { background: var(--ctl-blue); border-color: var(--ctl-blue); color: #fff; }
.sb-empty { margin: 0 16px 14px; }
.sb-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 16px; background: #F9FAFC; border-top: 1px solid #EEF0F3; border-radius: 0 0 14px 14px; font-size: var(--fs-sm); color: var(--ink-dim); }

/* one plan opened (also on a client's Billing tab) */
.sb-open { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px 28px; padding: 4px 16px 18px 60px; }
.pw-client .sb-open { margin-top: var(--sp-2); padding: 14px; background: #F7FAFF; border-radius: 10px; }
.sb-open-label { margin-bottom: 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: #5B6470; }
.sb-open-cardline { font-weight: 600; }
.sb-open-bills { margin: 2px 0 12px; font-size: var(--fs-sm); color: var(--ink-dim); }
.sb-open .pw-actions { margin-bottom: 8px; }
.sb-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sb-step { display: grid; grid-template-columns: 10px 56px minmax(0, 1fr); align-items: baseline; gap: 8px; font-size: var(--fs-sm); }
.sb-dot { width: 10px; height: 10px; border-radius: 50%; transform: translateY(1px); background: #C3C8D0; }
.sb-dot-green { background: #1E8E4B; }
.sb-dot-red { background: #DC2626; }
.sb-dot-amber { background: #D69E00; }
.sb-dot-purple { background: #6B3FA0; }
.sb-step-day { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-hist-more { margin-top: 8px; }
.pw-one-amount { font-weight: 600; }
.pw-one-when { font-size: var(--fs-sm); color: var(--ink-dim); }

/* tablet and phone: one card per plan, status and the arrow in view; the timeline scrolls sideways in its card */
@media (max-width: 900px) {
  .sb-head { display: none; }
  .sb-row.sb-plan { grid-template-columns: minmax(0, 1fr) auto 44px; grid-template-areas: "c1 c2 c5" "c3 c3 c5" "c4 c4 c5"; gap: 6px 10px; }
  .sb-plan .sb-c1 { grid-area: c1; }
  .sb-plan .sb-c2 { grid-area: c2; }
  .sb-plan .sb-c3 { grid-area: c3; }
  .sb-plan .sb-c4 { grid-area: c4; }
  .sb-plan .sb-c5 { grid-area: c5; align-self: center; }
  .sb-open { grid-template-columns: minmax(0, 1fr); padding: 4px 16px 16px; }
  .sb-search { width: 100%; }
  .sb-list-top { align-items: stretch; }
}
@media (max-width: 600px) {
  .sb-picker { width: 100%; justify-content: space-between; }
  .sb-month { min-width: 0; flex: 1; }
  .bl-tabs-right { width: 100%; }
  .sb-tile { padding: 16px; }
  .sb-big { font-size: 26px; }
  .sb-line-scroll { padding: 0 12px 12px; }
}

/* NAV-2B (owner, Nov 9, 2026: "make the category words like MONEY a different color as it blends in too much", and "reduce
   some of the upper and lower spacing b/w tabs as the page is too full now"). The way Linear, Stripe and Vercel draw a dark
   sidebar: the group words in their own light accent blue (a brand blue, never a status colour), bold, full strength; the
   rows on a computer 36px tall with 1px between them, 18px icons, sections 30px. On a phone the rows keep their 44px, the
   size a thumb needs; only the labels tighten there. */
:root { --nav-group-ink: #7fb2f0; }
.nav-section { padding: 12px var(--sp-3) 3px; color: var(--nav-group-ink); font-weight: 700; opacity: 1; }
@media (max-width: 767px) { .shell-nav:is(.collapsed, .compact) .nav-section:not(.nav-rule) { padding: 12px var(--sp-3) 3px; } }
@media (min-width: 768px) {
  .shell-nav { padding-top: var(--sp-2); }
  .nav-item { min-height: 36px; margin: 1px 0; }
  .nav-item svg { width: 18px; height: 18px; }
  .nav-sub { min-height: 30px; }
  .nav-subs { margin-bottom: 4px; padding: 4px 0 6px; }
  .nav-section.nav-rule { margin: 8px var(--sp-3) 5px; }
  .shell-nav:is(.collapsed, .compact) .nav-section { margin: 5px 12px; }
}

/* ==========================================================================================================
   LEADFLOW-1 (owner, Nov 13, 2026) — THE LEADS SCREENS: the front page (due first), one lead opened up, New lead, and the
   menu's red dots. Drawn on Billing's Subscriptions pieces (.sb-tile, .sb-card, .sb-row, .sb-chips, .sb-foot) and the
   control layer's buttons (.sp-go orange, .sp-btn blue line); only what those do not have is here. Colours from the
   tokens: amber = needs you, blue = waiting, purple = scheduled, grey = new or quiet, green = won, red = late only.
   ========================================================================================================== */
.lf-tabrow .lf-tab-n { margin-left: 6px; font-size: 12px; font-weight: 700; opacity: .75; font-variant-numeric: tabular-nums; }
.lf-tabrow .lf-tab-n[hidden] { display: none; }
.lf-tests { min-height: 36px; }
.lf-new { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; }
.lf-tile-ny .sb-chip { background: var(--ctl-red); }
.lf-tile-ny .sb-chip svg { stroke: #fff; }
.lf-tile-blue { background: var(--ctl-blue-wash); border-color: rgba(37, 99, 235, .25); color: #1E3A8A; }
.lf-tile-blue .sb-chip { background: var(--ctl-blue); }

/* the pills: one shape, the owner's tones */
.lf-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.lf-pill-grey { background: var(--waiting-bg); color: var(--waiting-ink); }
.lf-pill-amber { background: var(--attention-wash); color: var(--attention-ink); }
.lf-pill-blue { background: var(--sales-blue-wash); color: var(--sales-blue); }
.lf-pill-purple { background: #F1ECFA; color: var(--scheduled-purple-ink); }
.lf-pill-green { background: var(--done-wash); color: var(--done-ink); }

/* the white card's top: the chips with their label, the search */
.lf-chips-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; }
.lf-chips-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: #5B6470; }

/* the table: scrolls sideways in its box on a narrow screen */
/* LEADFLOW-7: position: relative makes this box the anchor of the head's hidden "Buttons" label (.sb-vh, absolute), so
   it is clipped here too; before, it escaped the box and stretched a phone's page to 760px, and a pop-up opened from the
   list sat half off the screen */
.lf-scroll { position: relative; overflow-x: auto; }
.lf-table { min-width: 962px; }
/* LEADFLOW-5: six columns (Lead · How it got here · Where it stands · Next step · Came in · the buttons). Every cell may
   shrink to its track (min-width 0) and its words wrap inside it, so nothing prints over the next column at any width;
   below the table's min-width the box scrolls sideways instead. */
.lf-row { grid-template-columns: minmax(170px, 1.7fr) 128px minmax(140px, 1.25fr) minmax(140px, 1.4fr) 92px 200px; }
.lf-row > * { min-width: 0; }
.lf-table .lf-c2 .lf-pill, .lf-table .lf-c3 .lf-pill, .lf-table .lf-c4 .lf-pill { white-space: normal; max-width: 100%; overflow-wrap: anywhere; line-height: 1.35; padding: 3px 10px; border-radius: 12px; }
.lf-cin { white-space: nowrap; }
.lf-lead-row .lf-cin { font-size: var(--fs-sm); color: var(--ink); }
.lf-lead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lf-name { text-decoration: none; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lf-name:hover { color: var(--accent); text-decoration: underline; }
.lf-dim { font-size: var(--fs-sm); color: var(--ink-dim); }
.lf-missing { font-size: 12px; font-weight: 600; color: var(--attention-ink); }
.lf-state-word { font-size: 12px; color: var(--ink-mute); }
.lf-c4 { display: flex; flex-direction: column; gap: 2px; min-width: 0; align-items: flex-start; }
.lf-step-what { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.lf-due { font-size: var(--fs-sm); color: var(--ink-dim); }
.lf-due.lf-late { font-weight: 700; color: var(--ctl-red-ink); }
.lf-due.lf-today { font-weight: 700; color: var(--attention-ink); }
.lf-row-late { background: var(--ctl-red-wash); }
.lf-btns { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.lf-btns .sp-btn, .lf-btns .sp-go { min-height: 36px; padding: 0 12px; font-size: var(--fs-sm); }
.lf-icon-btn { width: 36px; padding: 0 !important; }
.lf-icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lf-open { text-decoration: none; }
.lf-calm { padding: 14px 16px 18px; color: var(--ink-dim); }
.lf-card-line { margin: 4px 20px 10px; font-size: var(--fs-sm); color: var(--ink-dim); }
.lf-parked-row { display: grid; grid-template-columns: minmax(180px, 2fr) auto auto minmax(120px, 1fr) auto; align-items: center; gap: 10px 14px; padding: 10px 16px; border-top: 1px solid #EEF0F3; }
.lf-pops { white-space: nowrap; }
.lf-parked-row > .lf-pill { justify-self: start; }
/* LEADFLOW-5: a long park reason wraps inside its own cell instead of printing over "Pops back" */
.lf-parked-row > * { min-width: 0; }
.lf-parked-row > .lf-pill { white-space: normal; max-width: 100%; overflow-wrap: anywhere; line-height: 1.35; padding: 3px 10px; border-radius: 12px; }
.lf-done-note { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--done-wash); color: var(--done-ink); font-size: var(--fs-sm); }
.lf-said:empty { display: none; }
.lf-said { margin-top: 8px; font-size: var(--fs-sm); }
.lf-good { color: var(--done-ink); }
.lf-bad { color: var(--ctl-red-ink); font-weight: 600; }

/* pop-ups (Close a lead, Run the AI check, a quick note) */
/* LEADFLOW-7: no floor on the body's width. It was min(460px, 82vw), wider than the 432px inside a 480px .modal (24px
   padding each side), so every full-width field ran 28px past the right edge and was cut off. The box sets the width;
   the one column may shrink to it, so a long choice or note never pushes it wider. */
.lf-modal-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.lf-modal-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.lf-modal-btns .sp-go, .lf-modal-btns .sp-btn { min-height: 40px; }

/* fields */
.lf-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.lf-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lf-field .field { margin: 0; }
/* LEADFLOW-7 1.3: a field never grows past its box; a long chosen line is cut with dots */
.lf-field .field, .lf-sheet-row .field { min-width: 0; max-width: 100%; }
.lf-field select.field, .lf-sheet-row select.field { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.lf-field-label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.lf-hint { font-size: 12px; color: var(--ink-mute); }
.lf-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.lf-chip { min-height: 34px; padding: 0 12px; }
.field.is-off { background: var(--surface-alt); color: var(--ink-mute); }

/* the note box */
.lf-notebox { display: grid; gap: 8px; }
.lf-note-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: #5B6470; }
.lf-note-text { margin: 0; min-height: 96px; resize: vertical; border: 1.5px solid var(--ctl-blue); border-radius: var(--ctl-radius); font-size: var(--fs-md); line-height: 1.5; }
.lf-note-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.lf-note-types { display: flex; flex-wrap: wrap; gap: 6px; }
.lf-note-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.lf-stamp { font-size: var(--fs-sm); color: var(--ink-dim); }
.lf-stamp-pick { width: auto; margin: 0; padding: 6px 8px; }
.lf-save-note { min-height: 40px; }

/* one lead: the top card */
.lf-back-row { margin: 0 0 10px; }
.lf-back { font-weight: 600; text-decoration: none; color: var(--accent); }
.lf-top { padding: 18px 20px; }
.lf-top-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 16px; }
.lf-initials-lg { width: 52px; height: 52px; border-radius: 12px; font-size: 18px; }
.lf-top-who { flex: 1 1 320px; min-width: 0; }
.lf-top-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.lf-h1 { margin: 0; font-size: 26px; overflow-wrap: anywhere; }
.lf-top-line { margin-top: 4px; }
.lf-site { color: var(--accent); }
.lf-top-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.lf-top-acts .sp-go, .lf-top-acts .sp-btn { min-height: 40px; }
.lf-top .lf-done-note, .lf-top .state-error { margin: 14px 0 0; }
.lf-stepbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 16px; padding: 12px 16px; border-radius: 12px; border: 1px solid; }
.lf-stepbar-due { background: var(--attention-wash); border-color: rgba(138, 62, 5, .25); }
.lf-stepbar-ok { background: var(--done-wash); border-color: rgba(26, 122, 77, .25); }
.lf-stepbar-grey { background: var(--surface-alt); border-color: var(--line); }
.lf-stepbar-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: #5B6470; }
.lf-stepbar-what { font-size: var(--fs-lg); margin-top: 2px; }
.lf-stepbar-who { margin-top: 2px; font-size: 12px; }
.lf-stepbar-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.lf-stepbar-btns .sp-btn { min-height: 36px; background: #fff; }
.lf-sheet { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--ctl-blue); border-radius: 12px; background: var(--ctl-blue-wash); }
.lf-sheet-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.lf-sheet-row .field { width: auto; flex: 1 1 180px; margin: 0; }
.lf-sheet-row .sp-go, .lf-sheet-row .sp-btn { min-height: 40px; }

/* the path tracker */
.lf-path { display: flex; list-style: none; margin: 18px 0 0; padding: 0; overflow-x: auto; }
.lf-path-step { position: relative; flex: 1 0 110px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 0 6px; }
.lf-path-step::before { content: ""; position: absolute; top: 12px; left: -50%; right: 50%; height: 2px; background: var(--line-strong); z-index: 0; }
.lf-path-step:first-child::before { display: none; }
.lf-path-dot { position: relative; z-index: 1; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; color: #fff; font-size: 14px; font-weight: 700; box-sizing: border-box; }
.lf-path-done .lf-path-dot { background: var(--done); border-color: var(--done); }
.lf-path-done::before, .lf-path-now::before { background: var(--done); }
.lf-path-now .lf-path-dot { background: #e8730f; border-color: #e8730f; box-shadow: 0 0 0 4px #FDEEDC; }
.lf-path-skipped .lf-path-dot { border-style: dashed; border-color: #9AA3AF; }
.lf-path-name { font-size: var(--fs-sm); font-weight: 600; }
.lf-path-line { font-size: 12px; color: var(--ink-dim); }
.lf-path-skipped .lf-path-name, .lf-path-skipped .lf-path-line { color: var(--ink-mute); }

/* two columns under it (one on a phone, notes first) */
.lf-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.lf-col-side { display: grid; gap: 0; }
.lf-notes-in { display: grid; gap: 14px; padding: 14px 20px 18px; }
.lf-history { display: grid; gap: 10px; }
.lf-hist { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.lf-hist-note { grid-template-columns: 32px minmax(0, 1fr); padding: 12px; border-radius: 12px; background: #F5F9FF; border: 1px solid #E1ECFB; }
.lf-hist-note.is-pinned { border-color: var(--ctl-blue); }
.lf-hist-icon { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: var(--ctl-blue); color: #fff; font-size: 15px; }
.lf-hist-icon-phone_call, .lf-hist-icon-zoom_transcript { background: var(--scheduled-purple); }
.lf-hist-icon-email { background: var(--written-teal); }
.lf-hist-icon-text { background: var(--brand-navy); }
.lf-hist-icon-tool { background: var(--waiting-bg); color: var(--waiting-ink); }
.lf-hist-tool { padding: 4px 12px; }
.lf-hist-tool .lf-hist-main { padding-top: 6px; font-size: var(--fs-sm); }
.lf-hist-main { min-width: 0; }
.lf-hist-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.lf-hist-at { margin-left: auto; font-size: 12px; color: var(--ink-mute); white-space: nowrap; padding-top: 6px; }
.lf-hist-top .lf-hist-at { padding-top: 0; }
.lf-pin-tag { font-size: 11px; font-weight: 700; color: var(--ctl-blue); text-transform: uppercase; letter-spacing: .04em; }
.lf-hist-text { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-md); line-height: 1.5; }
.lf-hist-long .lf-hist-text { max-height: 9.5em; overflow: hidden; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.lf-hist-long .lf-hist-text.is-open { max-height: 60vh; overflow: auto; }
.lf-hist-long-btns, .lf-hist-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; font-size: var(--fs-sm); }
.lf-hist-edit { display: grid; gap: 8px; margin-top: 6px; }
.lf-hist-none { padding: 8px 0; }

/* the right column's cards */
.lf-side-card { margin-bottom: 14px; }
.lf-side-in { padding: 10px 20px 16px; margin: 0; }
.lf-side-card .sb-card-head { padding-top: 14px; }
.lf-about.is-editing .lf-grid2 { grid-template-columns: minmax(0, 1fr); }
.lf-kv { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-bottom: 1px solid #F1F3F6; font-size: var(--fs-sm); }
.lf-kv:last-child { border-bottom: 0; }
.lf-k { color: var(--ink-dim); }
.lf-v { color: var(--ink); overflow-wrap: anywhere; }
.lf-missing-tag { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--attention-wash); color: var(--attention-ink); font-size: 12px; font-weight: 700; }
.lf-email-bad { color: var(--ctl-red-ink); font-weight: 600; }
.lf-tree-owner { font-weight: 700; }
.lf-tree { list-style: none; margin: 6px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line-strong); }
.lf-tree-site { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin: 6px 0; padding: 6px 10px; border-radius: 8px; font-size: var(--fs-sm); }
.lf-tree-site::before { content: ""; position: absolute; left: -14px; top: 50%; width: 12px; height: 2px; background: var(--line-strong); }
.lf-tree-site.is-me { border: 1.5px solid var(--ctl-blue); background: var(--ctl-blue-wash); }
.lf-this { font-size: 12px; font-weight: 700; color: var(--ctl-blue); }
.lf-paper { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #F1F3F6; }
.lf-paper:last-child { border-bottom: 0; }
.lf-paper-words { display: flex; flex-direction: column; min-width: 0; font-size: var(--fs-sm); }

/* New lead */
.lf-new-card .sb-card-head h2 { display: flex; align-items: center; gap: 10px; }
.lf-num { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand-navy); color: #fff; font-size: 13px; }
.lf-new-in { display: grid; gap: 12px; padding: 14px 20px 18px; }
.lf-src-box { padding: 12px 14px; border-radius: 10px; background: var(--ctl-blue-wash); border: 1px solid #D6E4FB; }
.lf-src-box[hidden] { display: none; }
.lf-src-note { margin: 0; }
.lf-first { display: grid; gap: 8px; }
.lf-radio-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--ctl-line); border-radius: 10px; cursor: pointer; background: #fff; }
.lf-radio-card input { margin-top: 3px; }
.lf-radio-card.is-on { border-color: var(--ctl-blue); background: var(--ctl-blue-wash); }
.lf-radio-card.is-off { cursor: not-allowed; background: var(--surface-alt); color: var(--ink-mute); }
.lf-radio-words { display: flex; flex-direction: column; gap: 2px; }
.lf-navy-card { margin-bottom: 14px; padding: 16px 20px; border-radius: 14px; background: var(--brand-navy); color: #fff; }
.lf-navy-card h2 { margin: 0 0 8px; font-size: 16px; }
.lf-navy-card ul { margin: 4px 0 8px; padding-left: 18px; font-size: var(--fs-sm); }
.lf-navy-card p { margin: 4px 0 8px; font-size: var(--fs-sm); }
.lf-navy-label { margin-top: 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--on-brand-dim); }
.lf-navy-dim { color: var(--on-brand-dim); }
.lf-navy-need { color: #FDE7C8; font-weight: 600; }
.lf-new-bottom { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 14px; }
.lf-new-bottom .sp-go, .lf-new-bottom .sp-btn, .title-actions .lf-new-cancel { min-height: 40px; }

/* the menu's red dots (like an iPhone badge); with the menu closed to icons, on the icon */
.nav-item { position: relative; }
.nav-dot { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--ctl-red); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; box-sizing: border-box; font-variant-numeric: tabular-nums; }
@media (min-width: 768px) {
  .shell-nav:is(.collapsed, .compact) .nav-dot { position: absolute; top: 3px; left: 30px; min-width: 17px; height: 17px; padding: 0 4px; font-size: 10px; margin: 0; box-shadow: 0 0 0 2px var(--brand-navy); }
}

/* LEADFLOW-2 (owner, Nov 13, 2026): the website answer, the Run the AI check button and its cost line, edits in the history,
   the Automatic emails row. Same tokens as above; grey = not built yet / greyed. */
.lf-field-wide { grid-column: 1 / -1; }
.lf-site-addr { margin-top: 6px; }
.lf-site-addr[hidden] { display: none; }
.lf-site-plain { color: var(--ink); }
.lf-site-tag { min-height: 20px; padding: 0 8px; font-size: 11px; vertical-align: middle; }
.lf-top-acts { align-items: flex-start; }
.lf-run-wrap { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; }
.lf-check-cost { font-size: 12px; color: var(--ink-mute); white-space: nowrap; }
.lf-radio-words .lf-check-cost { margin-top: 2px; }
.lf-btn.is-greyed, .lf-btn.is-greyed:hover { background: var(--surface-alt); color: var(--ink-mute); border: 1px solid var(--line); opacity: 1; filter: none; cursor: not-allowed; font-weight: var(--fw-medium); }
.lf-stepbar-park { margin-top: 2px; font-size: 12px; }
.lf-hist-edit-item { padding: 4px 12px; }
.lf-hist-edit-item .lf-hist-main { padding-top: 6px; font-size: var(--fs-sm); }
.lf-hist-icon-edit { background: var(--waiting-bg); color: var(--waiting-ink); }
.lf-changes { margin: 8px 0 0; display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.lf-change { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; }
.lf-change dt { font-weight: 600; color: var(--ink); }
.lf-change dd { margin: 0; overflow-wrap: anywhere; }
.lf-old { color: var(--ink-dim); text-decoration: line-through; }
.lf-arrow { color: var(--ink-mute); }
.lf-auto .lf-v { display: flex; flex-direction: column; gap: 2px; }
.lf-auto-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lf-auto-switch { padding: 0; }
.lf-auto-why { font-size: 12px; }

/* phone and tablet */
@media (max-width: 900px) {
  .lf-table .sb-head { display: grid; }
  .lf-cols { grid-template-columns: minmax(0, 1fr); }
  .lf-parked-row { grid-template-columns: minmax(0, 1fr) auto; }
  .lf-parked-row .lf-btns { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .lf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lf-tiles .sb-tile { padding: 12px; }
  .lf-tiles .sb-big { font-size: 24px; }
  .lf-grid2 { grid-template-columns: minmax(0, 1fr); }
  .lf-top { padding: 14px; }
  .lf-top-acts { justify-content: flex-start; }
  .lf-change { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .lf-auto-switch { min-height: 44px; }
  .lf-top-acts .sp-go, .lf-top-acts .sp-btn, .lf-stepbar-btns .sp-btn { min-height: 44px; }
  .lf-notes-in, .lf-new-in { padding: 12px 14px 14px; }
  .lf-side-in { padding: 8px 14px 14px; }
  .lf-h1 { font-size: 22px; }
}

/* LEADFLOW-3 (owner, Nov 13, 2026): a quiet history, the tracker's step menu, Skip this step, the deal facts before a
   contract, Close as Won / Lost, "Count this as the sales call?", might_match, joined forms, a lead hung under a site.
   Same tokens as above: green = done (done outside too), dashed grey = skipped, orange = now, blue = a press opens it. */
.lf-might { margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-mute); }
.lf-might a { color: var(--ink-dim); }

/* Close: a two-choice menu under the button */
.lf-menu-wrap { position: relative; display: inline-flex; }
.lf-caret { margin-left: 6px; font-size: 11px; }
.lf-pop { position: absolute; top: calc(100% + 4px); right: 0; z-index: 30; display: grid; min-width: 160px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .14); }
.lf-pop-item { display: block; width: 100%; min-height: 38px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: var(--fs-sm); font-weight: 600; text-align: left; cursor: pointer; }
.lf-pop-item:hover, .lf-pop-item:focus-visible { background: var(--ctl-blue-wash); }
.lf-pop-item.is-on { background: var(--ctl-blue-wash); color: var(--ctl-blue); box-shadow: inset 3px 0 0 var(--ctl-blue); }

/* the tracker: done outside, a step that is a button, the menu under its dot */
.lf-path-done_outside .lf-path-dot { background: var(--done); border-color: var(--done); }
.lf-path-done_outside::before { background: var(--done); }
.lf-path-done_outside .lf-path-line { color: var(--done-ink); font-weight: 600; }
.lf-path-btn { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 0 4px 4px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; cursor: pointer; }
.lf-path-btn:hover .lf-path-dot, .lf-path-btn:focus-visible .lf-path-dot, .lf-path-step.is-open .lf-path-dot { box-shadow: 0 0 0 4px var(--ctl-blue-wash); outline: 2px solid var(--ctl-blue); outline-offset: 1px; }
.lf-path-now .lf-path-btn .lf-path-dot { box-shadow: 0 0 0 4px #FDEEDC; }
.lf-path-btn:hover .lf-path-name { color: var(--ctl-blue); }
.lf-path-btn:focus-visible { outline: 2px solid var(--ctl-blue); outline-offset: 2px; }
.lf-path-hint { margin-top: 8px; font-size: 12px; color: var(--ink-mute); }
.lf-sheet-back { display: none; }
.lf-stepmenu { position: relative; width: min(300px, 100%); margin: 12px 0 0 var(--lf-menu-left, 0); padding: 10px 12px 12px; border: 1px solid var(--ctl-blue); border-radius: 12px; background: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .12); box-sizing: border-box; }
.lf-stepmenu::before { content: ""; position: absolute; top: -7px; left: calc(var(--lf-menu-arrow, 24px) - 6px); width: 12px; height: 12px; background: #fff; border-top: 1px solid var(--ctl-blue); border-left: 1px solid var(--ctl-blue); transform: rotate(45deg); }
.lf-stepmenu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: var(--fs-sm); }
.lf-stepmenu-x { min-width: 32px; min-height: 32px; color: var(--ink-mute); }
.lf-stepmenu-items { display: grid; gap: 2px; }
.lf-stepmenu-form { display: grid; gap: 8px; margin-top: 8px; }
.lf-step-note { margin: 0; min-height: 56px; resize: vertical; }

/* the history's quiet line, the call question */
.lf-hist-quiet { font-size: 12px; color: var(--ink-mute); }
.lf-hist-quiet .link-btn { font-size: 12px; }
.lf-call-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: var(--fs-sm); color: var(--ink); font-weight: 600; }
.lf-small { min-height: 32px; padding: 0 14px; font-size: var(--fs-sm); }

/* Won, the deal facts, the left-undone list */
.lf-undone { margin: 6px 0 0; padding-left: 18px; }
.lf-won-line { margin-top: 2px; font-size: 12px; }
.lf-sheet-row-top { align-items: flex-start; }
.lf-sheet-row .lf-won-how { flex: 1 1 260px; min-height: 44px; }
.lf-facts-grid { margin-top: 10px; }
.lf-facts .lf-field .field { background: #fff; }
.lf-need { font-weight: 400; color: var(--ink-mute); }
.lf-btn.sp-go.is-greyed { background: var(--surface-alt); color: var(--ink-mute); border: 1px solid var(--line); cursor: not-allowed; }

/* New lead: already a lead */
.lf-twin { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 14px; border-radius: 10px; background: var(--attention-wash); color: var(--attention-ink); }
.lf-twin .sp-btn { min-height: 40px; background: #fff; display: inline-flex; align-items: center; text-decoration: none; }

/* How it got here, Belongs to */
.lf-joined-list { display: flex; flex-direction: column; gap: 2px; }
.lf-tree-row { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.lf-tree-site.is-parent { display: block; border: 1.5px solid var(--brand-navy); }
.lf-tree-child { margin: 8px 0 2px 16px; }

/* a phone: the step menu is a sheet from the bottom (6.5) */
@media (max-width: 600px) {
  .lf-stepmenu-host .lf-sheet-back { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(15, 23, 42, .35); }
  .lf-stepmenu { position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; width: auto; max-height: 80vh; overflow: auto; margin: 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(15, 23, 42, .2); }
  .lf-stepmenu::before { display: none; }
  .lf-pop-item, .lf-stepmenu-x { min-height: 44px; }
  .lf-small { min-height: 44px; }
  .lf-stepmenu-form .sp-go, .lf-stepmenu-form .sp-btn { min-height: 44px; }
}

/* LEADFLOW-4 (owner, Nov 15, 2026; his approved mockup "One lead V2 — path on one line, press a step to open it"): the path
   on ONE line of five dots, ONE box under it for the lit step, joined by a short stem, and the Pipeline board by the path.
   Step colours on the site's tokens: done green (#1e8e4b / #e6f4ec), your move orange with a pale ring and an amber box
   (#fdeedc, an orange top edge), waiting blue (#0b5fd9 / #e8f0fd), not yet a hollow grey ring (#d5dae1), skipped a DASHED
   grey ring and grey words (never yellow or amber: on this dashboard those mean "needs attention"). Late: the due words
   bold red (#8d1c15) whatever the state. The lit dot has a 2px outline in its own colour. */
.lf-pill-red { background: var(--ctl-red-wash); color: #8d1c15; } /* stands_tone late (7.3) */
.lf-path4 { --lf-or: #e8730f; margin-top: 18px; }
.lf-line-row { display: flex; align-items: flex-start; gap: 6px; }
.lf-line-scroll { flex: 1 1 auto; min-width: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin; }
.lf-line { display: flex; flex-wrap: nowrap; list-style: none; margin: 0; padding: 0; }
.lf-line-step { position: relative; flex: 1 0 108px; min-width: 108px; }
.lf-line-step::before { content: ""; position: absolute; top: 23px; left: -50%; right: 50%; height: 3px; background: #d5dae1; z-index: 0; }
.lf-line-step:first-child::before { display: none; }
.lf-line-step[data-join="green"]::before { background: var(--done); }
.lf-line-btn { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; padding: 11px 4px 6px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: center; cursor: pointer; }
@media (hover: hover) { .lf-line-btn:hover .lf-line-name { color: var(--ctl-blue); } }
.lf-line-btn:focus-visible { outline: 2px solid var(--ctl-blue); outline-offset: 1px; }
.lf-line-dot { width: 26px; height: 26px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid #d5dae1; background: #fff; color: #fff; font-size: 14px; font-weight: 700; line-height: 1; box-sizing: border-box; }
.lf-line-name { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); white-space: nowrap; }
.lf-line-state { font-size: 12px; color: var(--ink-dim); line-height: 1.3; max-width: 150px; }
.lf-st-done .lf-line-dot, .lf-st-done_outside .lf-line-dot { background: #1e8e4b; border-color: #1e8e4b; }
.lf-st-done_outside .lf-line-state { color: var(--done-ink); font-weight: 600; }
.lf-st-your_move .lf-line-dot { background: var(--lf-or); border-color: var(--lf-or); box-shadow: 0 0 0 4px #fdeedc; }
.lf-st-waiting .lf-line-dot { background: #0b5fd9; border-color: #0b5fd9; }
.lf-st-skipped .lf-line-dot { border-style: dashed; border-color: #9aa3af; }
.lf-st-skipped .lf-line-name, .lf-st-skipped .lf-line-state { color: #8a929c; }
/* the lit dot: a 2px outline in its own colour */
.lf-line-step.is-lit .lf-line-dot { outline: 2px solid #9aa3af; outline-offset: 3px; }
.lf-line-step.is-lit.lf-st-done .lf-line-dot, .lf-line-step.is-lit.lf-st-done_outside .lf-line-dot { outline-color: #1e8e4b; }
.lf-line-step.is-lit.lf-st-your_move .lf-line-dot { outline-color: var(--lf-or); outline-offset: 6px; }
.lf-line-step.is-lit.lf-st-waiting .lf-line-dot { outline-color: #0b5fd9; }
.lf-line-step.is-lit .lf-line-name { font-weight: 800; }
.lf-line-q { flex: 0 0 auto; padding-top: 11px; }
.lf-q-wrap { position: relative; display: inline-flex; }
.lf-q { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid #d5dae1; border-radius: 50%; background: #fff; color: var(--ink-dim); font: inherit; font-size: 13px; font-weight: 700; cursor: help; }
.lf-q:focus-visible { outline: 2px solid var(--ctl-blue); outline-offset: 2px; }
.lf-q-tip { position: absolute; right: 0; top: 32px; z-index: 30; width: 260px; padding: 8px 10px; border-radius: 8px; background: var(--brand-navy, #0f2440); color: #fff; font-size: 12px; font-weight: 400; line-height: 1.45; box-shadow: 0 8px 24px rgba(15, 23, 42, .18); }
.lf-q-tip[hidden] { display: none; }

/* the step box */
.lf-box { --lf-stem: #d5dae1; position: relative; margin-top: 12px; padding: 14px 16px; border: 1px solid #d5dae1; border-radius: 12px; background: #fff; }
.lf-box-stem { position: absolute; top: -13px; left: var(--lf-stem-x, 50px); width: 2px; height: 12px; margin-left: -1px; background: var(--lf-stem); }
.lf-box[data-stem="off"] .lf-box-stem { display: none; }
.lf-box-body { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.lf-box-words { flex: 1 1 300px; min-width: 0; }
.lf-box-label { font-size: 12px; font-weight: 700; color: var(--ink-dim); }
.lf-box-what { margin-top: 2px; font-size: var(--fs-lg); color: var(--ink); overflow-wrap: anywhere; }
.lf-box-line { margin-top: 4px; font-size: var(--fs-sm); color: var(--ink); overflow-wrap: anywhere; }
.lf-box-line .lf-act-link { font-size: inherit; font-weight: 600; }
.lf-link-sep { color: var(--ink-mute); white-space: pre; } /* LEADFLOW-7: " · " between two links in a step's line */
.lf-box-note { margin-top: 4px; }
.lf-box-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.lf-box-acts .sp-go, .lf-box-acts .sp-btn, .lf-general .lf-stepbar-btns .sp-go { min-height: 38px; }
.lf-box-acts .sp-btn:not(.is-on):not([aria-expanded="true"]) { background: #fff; }
.lf-box-set { margin-top: 6px; font-size: 12px; }
.lf-act-whys { margin-top: 6px; display: grid; gap: 2px; }
.lf-act-why { font-size: 12px; }
.lf-box-done, .lf-box-done_outside { --lf-stem: #1e8e4b; background: #e6f4ec; border-color: rgba(30, 142, 75, .3); }
.lf-box-your_move { --lf-stem: #e8730f; background: #fdeedc; border-color: rgba(232, 115, 15, .35); border-top: 3px solid #e8730f; }
.lf-box-waiting { --lf-stem: #0b5fd9; background: #e8f0fd; border-color: rgba(11, 95, 217, .3); }
.lf-box-skipped { --lf-stem: #9aa3af; }
.lf-box-skipped .lf-box-words, .lf-box-skipped .lf-box-what, .lf-box-skipped .lf-box-line { color: #8a929c; }
/* late: whatever the state, the due words are bold red */
.lf-path4 .lf-due.lf-late, .lf-general .lf-due.lf-late, .lf-bcard .lf-due.lf-late { font-weight: 700; color: #8d1c15; }
.lf-box .lf-due { font-size: var(--fs-md); }
/* a form opens inside the box, under the buttons */
.lf-form { flex-basis: 100%; margin-top: 12px; padding: 12px 14px; border: 1px solid #d5dae1; border-radius: 10px; background: #fff; }
.lf-form-title { display: block; margin-bottom: 8px; }
.lf-form-says { margin: -4px 0 8px; }
.lf-form-grid { margin-bottom: 10px; }
.lf-form .field { margin: 0; }
.lf-opt { font-weight: 400; color: var(--ink-mute); }
/* LEADFLOW-6: the report email, read and changed inside the box before it goes */
.lf-mail { display: grid; gap: 10px; }
.lf-mail .lf-form-title { margin-bottom: 0; }
.lf-mail-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: var(--fs-sm); color: var(--ink); overflow-wrap: anywhere; }
.lf-mail-k { flex: 0 0 52px; font-weight: 600; color: var(--ink-dim); }
.lf-mail-v { flex: 1 1 220px; min-width: 0; }
.lf-mail-change, .lf-mail-see { font-size: var(--fs-sm); font-weight: 600; }
.lf-mail-field .field { width: 100%; box-sizing: border-box; }
.lf-mail-body { min-height: 300px; resize: vertical; font: inherit; font-size: var(--fs-md, 15px); line-height: 1.5; white-space: pre-wrap; }
.lf-mail-quiet { font-size: var(--fs-sm); }
.lf-mail-follow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink); cursor: pointer; }
.lf-mail-follow input { width: 18px; height: 18px; margin: 0; }
.lf-mail-follow.is-greyed { color: #8a929c; cursor: default; }
.lf-mail-btns { margin-top: 0; }
.lf-mail-reasons { margin: 4px 0 0; padding-left: 18px; font-weight: 400; }
/* the general next step (only when itv-core sends one): today's amber bar */
.lf-general { background: var(--attention-wash); border-color: rgba(138, 62, 5, .25); }
.lf-general .lf-stepbar-btns .sp-btn { background: #fff; }
.lf-general > .lf-form { margin-top: 0; }

/* the Pipeline board follows the path: AI report · Call · Proposal · Contract · Won · Lost */
.lf-board-card { padding: 12px; }
.lf-board { display: grid; grid-template-columns: repeat(var(--lf-cols, 6), minmax(176px, 1fr)); gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 4px; }
.lf-bcol { min-width: 0; padding: 10px; border-radius: 10px; background: var(--surface-alt); }
.lf-bcol-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: var(--fs-sm); font-weight: 700; color: var(--ink); }
.lf-bcol-n { min-width: 24px; padding: 0 8px; border-radius: 999px; background: #fff; color: var(--ink-dim); font-size: 12px; text-align: center; }
.lf-bcol-cards { display: grid; gap: 8px; }
.lf-bcol-none { padding: 8px 2px; font-size: 12px; color: var(--ink-dim); }
.lf-bcard { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); text-decoration: none; }
.lf-bcard:hover { border-color: var(--ctl-blue); }
.lf-bcard:focus-visible { outline: 2px solid var(--ctl-blue); outline-offset: 2px; }
.lf-bcard.is-late { box-shadow: inset 3px 0 0 #8d1c15; }
.lf-bcard-name { font-weight: 700; overflow-wrap: anywhere; }
.lf-bcard-line { font-size: var(--fs-sm); color: var(--ink-dim); overflow-wrap: anywhere; }
.lf-board-off { margin: 10px 2px 0; }

@media (max-width: 767px) {
  .lf-line-step { flex-basis: 96px; min-width: 96px; }
  .lf-box { padding: 12px; }
  .lf-box-acts { justify-content: flex-start; width: 100%; }
  .lf-box-acts .sp-go, .lf-box-acts .sp-btn, .lf-form .sp-go, .lf-form .sp-btn, .lf-general .lf-stepbar-btns .sp-go, .lf-general .lf-stepbar-btns .sp-btn { min-height: 44px; }
  .lf-q { width: 32px; height: 32px; }
  .lf-q-tip { width: min(260px, 70vw); }
  /* LEADFLOW-6 2.9: the same email form, full width */
  .lf-mail { padding: 10px; }
  .lf-mail-body { min-height: 260px; font-size: 16px; }
  .lf-mail-field input.field { font-size: 16px; }
  .lf-mail-btns > .lf-btn { flex: 1 1 100%; }
}

/* ==========================================================================================================
   LEADFLOW-8 (owner, Nov 16, 2026) — "Build the proposal" opens ONE sheet of choices that slides in from the right, already
   filled in; then the draft opens in the dashboard's reader with its flags, Fix the words · Change it · Send it to them.
   About 860px wide on a computer, the whole width on a phone; the lead page dims behind it; it scrolls inside itself while its
   top and bottom bar stay put. Every field stays inside the sheet at every width (LEADFLOW-7's rule): min-width 0 everywhere.
   ========================================================================================================== */
.lf-ps-wrap { position: fixed; inset: 0; z-index: 110; }
.lf-ps-back { position: absolute; inset: 0; background: rgba(4, 41, 76, .45); opacity: 0; transition: opacity .2s ease; }
.lf-ps { position: absolute; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(860px, 100%); background: var(--surface); box-shadow: -12px 0 40px rgba(16, 24, 40, .3);
  transform: translateX(100%); transition: transform .22s ease; box-sizing: border-box; }
.lf-ps-wrap.is-in .lf-ps-back { opacity: 1; }
.lf-ps-wrap.is-in .lf-ps { transform: none; }
.lf-ps-wrap.is-gone { display: none; }
@media (prefers-reduced-motion: reduce) { .lf-ps, .lf-ps-back { transition: none; } }
.lf-ps *, .lf-ps *::before, .lf-ps *::after { box-sizing: border-box; }
.lf-ps-head { flex: none; padding: 16px 24px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.lf-ps-head-row { display: flex; align-items: flex-start; gap: 12px; }
.lf-ps-head-words { flex: 1; min-width: 0; }
.lf-ps-title { margin: 0; font-size: var(--fs-xl); line-height: 1.25; }
.lf-ps-who { margin-top: 2px; overflow-wrap: anywhere; }
.lf-ps-x { flex: none; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.lf-ps-x:hover { background: var(--surface-alt); }
.lf-ps-intro { margin: 8px 0 0; font-size: var(--fs-sm); color: var(--ink-dim); }
.lf-ps-kind { margin-top: 10px; }
.lf-ps-kind-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--fs-sm); }
.lf-ps-kind-k { font-weight: 600; color: var(--ink); }
.lf-ps-kind-why { min-width: 0; overflow-wrap: anywhere; }
.lf-ps-kind-change { font-size: var(--fs-sm); font-weight: 600; }
.lf-ps-kind-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 8px; margin-top: 8px; }
.lf-ps-kind-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.lf-ps-kind-opt.is-on { border: 2px solid var(--accent); padding: 7px 11px; }
.lf-ps-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 8px 24px 20px; }
.lf-ps-part { padding: 16px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.lf-ps-h { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: var(--fs-lg); }
.lf-ps-n { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 26px; border-radius: 999px; background: var(--brand-navy); color: #fff; font-size: 13px; font-weight: 700; }
.lf-ps-pkgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 10px; }
.lf-ps-pkg { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.lf-ps-pkg:hover { border-color: var(--accent); }
.lf-ps-pkg.is-on { border: 2px solid var(--accent); padding: 11px; box-shadow: 0 0 0 3px var(--brand-blue-pale); }
.lf-ps-pkg.is-blank { border-style: dashed; justify-content: center; }
.lf-ps-pkg.is-blank.is-on { border-style: solid; }
.lf-ps-pkg-name { font-size: var(--fs-md); overflow-wrap: anywhere; }
.lf-ps-pkg-lines { margin: 0; padding-left: 16px; font-size: var(--fs-sm); color: var(--ink-dim); overflow-wrap: anywhere; }
.lf-ps-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
.lf-ps-num .field { margin: 0; }
.lf-ps-numbox.is-changed { border: 2px solid var(--action); padding: 10px 12px; }
.lf-ps-std { font-size: 12px; color: var(--ink-dim); overflow-wrap: anywhere; }
.lf-ps-std[data-changed="true"] { color: var(--action); font-weight: 600; }
.lf-ps-percluster { font-size: 12px; overflow-wrap: anywhere; }
.lf-ps-incs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.lf-ps-seg .chip-btn { min-height: 36px; padding: 4px 14px; }
.lf-ps-split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; margin-top: 12px; }
.lf-ps-split[hidden] { display: none; }
.lf-ps-split .field { margin: 0; }
.lf-ps-text { margin: 0; resize: vertical; }
#lf-ps-from_the_call { min-height: 180px; }
.lf-ps-notes { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; font-size: var(--fs-sm); color: var(--ink); cursor: pointer; }
.lf-ps-notes input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; }
.lf-ps-notes-line { margin-top: 4px; }
.lf-ps-next { margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: var(--surface-alt); font-size: var(--fs-sm); color: var(--ink-dim); line-height: 1.7; }
.lf-ps-next strong { color: var(--ink); }
.lf-ps-next-step { white-space: normal; }
.lf-ps-arrow { color: var(--ink-mute); }
.lf-ps-saved { margin-top: 8px; }
.lf-ps-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--surface); }
.lf-ps-foot-words { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); }
.lf-ps-only { color: var(--ink); font-weight: 600; }
.lf-ps-foot-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.lf-ps-foot-btns .lf-btn { min-height: 40px; }
.lf-ps-build:disabled { opacity: .8; cursor: progress; }
.lf-ps-said { flex-basis: 100%; }
.lf-ps-said:empty { display: none; }
.lf-ps-blocked .lf-modal-btns { margin-top: 8px; }

/* the reader's strip for a proposal draft: the version, Fix the words · Change it · Send it to them, itv-core's flags */
.lf-pr-bar { flex: none; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.lf-pr-bar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.lf-pr-ver { font-weight: 700; }
.lf-pr-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.lf-pr-btns .lf-btn { min-height: 38px; }
.lf-pr-flags { margin-top: 8px; }
.lf-pr-flags[hidden] { display: none; }
.lf-pr-flag-list { margin: 4px 0 0; padding-left: 18px; }
.lf-pr-edit { flex: 1; min-width: 0; overflow-y: auto; padding: 16px 20px; background: var(--surface); display: flex; flex-direction: column; gap: 12px; }
.lf-pr-edit .field { margin: 0; }
.lf-pr-part { resize: vertical; font-size: var(--fs-md); line-height: 1.5; }

@media (max-width: 767px) {
  .lf-ps { width: 100%; box-shadow: none; }
  .lf-ps-head { padding: 12px 16px 10px; }
  .lf-ps-body { padding: 4px 16px 16px; }
  .lf-ps-foot { padding: 10px 16px; }
  .lf-ps-nums, .lf-ps-incs, .lf-ps-split { grid-template-columns: minmax(0, 1fr); }
  .lf-ps-pkgs { grid-template-columns: minmax(0, 1fr); }
  .lf-ps .field { font-size: 16px; }
  .lf-ps-foot-btns { width: 100%; }
  .lf-ps-foot-btns .lf-btn { flex: 1 1 auto; min-height: 44px; }
  .lf-ps-build { flex-basis: 100% !important; }
  .lf-ps-seg .chip-btn { min-height: 40px; }
  .lf-pr-bar { padding: 8px 12px; }
  .lf-pr-btns { width: 100%; }
  .lf-pr-btns .lf-btn { flex: 1 1 auto; min-height: 44px; }
}
@media (min-width: 768px) and (max-width: 1100px) {
  .lf-ps-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================================================
   PROFIT-1 (owner, Nov 16, 2026) — FINANCIALS › JOB COSTS, in the Billing look (Billing › MRR's .sb-* pieces), the cost form,
   the cost box on an invoice and a new client checkout, and the quiet "Cost · Profit" line. Status colours as the law has
   them: Paid green, Expected amber, No cost grey.
   ========================================================================================================== */
.fin-tp-picker { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#fin-tp-month { min-width: 120px; text-align: center; font-variant-numeric: tabular-nums; }
#fin-tp-still .story-line:last-child { font-size: inherit; }
:is(#fin-tp-story, #fin-tp-still) .story-line:last-child .sub { font-size: var(--fs-sm); font-weight: var(--fw-normal, 400); }
#fin-true-profit .ui-label-row { margin-bottom: 8px; }
.jc-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 var(--sp-4); }
.jc-top .btn-primary, .jc-wait .btn-primary, .cb-box .btn-primary, .jc-form .xw-form-actions .btn-primary { width: auto; min-height: 40px; padding: 0 18px; }
dl.jc-kv dd { text-align: left; }
.jc-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.jc-wait .sb-card-head { padding-bottom: 6px; }
.jc-wait.is-ask { border-color: #F3C4C0; }
.jc-wait.is-ask .sb-card-head h2 { color: #8D1C15; }
.jc-wait-note { margin: 0; padding: 0 20px 12px; font-size: var(--fs-sm); color: var(--ink-dim); }
.jc-wait-rows { border-top: 1px solid #EEF0F3; }
.jc-wait-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 20px; border-top: 1px solid #EEF0F3; }
.jc-wait-row:first-child { border-top: 0; }
.jc-wait-words { min-width: 0; overflow-wrap: anywhere; }
.jc-wait-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.jc-act { min-height: 36px; padding: 0 12px; }
.jc-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.6fr) 100px 100px 96px 52px; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid #EEF0F3; }
.jc-row.sb-head .jc-c4 { text-align: right; }
.jc-cost { cursor: pointer; }
.jc-cost:hover { background: #FAFBFD; }
.jc-cost.is-open { background: #F7FAFF; }
.jc-for { font-size: var(--fs-sm); color: var(--ink-dim); overflow-wrap: anywhere; }
.jc-mkt { background: #F1ECFA; color: #4E2A7A; }
/* PROFIT-3: Labor (VAs and contractors) is tied to no client: a GREY initials square, never a status colour */
.jc-labor, .fin-labor { background: #F3F4F6; color: #4B5563; }
.jc-chip-amt { font-variant-numeric: tabular-nums; }
.jc-chip-amt::before { content: '· '; }
/* PROFIT-3B: a person's labor total is a cost, not money left: plain ink, never green or red */
.fin-job-left.fin-person-total { color: var(--ink); }
/* PROFIT-4: each person is ONE pressable line (name · role · "18 payments", the total bold at the right); their payments open under them */
.fin-job.fin-person { display: block; padding: 0; }
.fin-person-btn { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; width: 100%; min-height: 44px; padding: 10px 14px; margin: 0; background: none; border: 0; border-radius: 10px; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.fin-person-btn:hover { background: #F7FAFF; }
.fin-person-btn:focus-visible { outline: 2px solid var(--accent, #1F6FEB); outline-offset: -2px; }
.fin-person-count { color: #5B6470; white-space: nowrap; }
.fin-person-right { display: inline-flex; align-items: baseline; gap: 10px; margin-left: auto; }
.fin-person-caret { color: #8A93A0; font-weight: 700; width: 12px; text-align: center; }
.fin-person-pays { padding: 0 14px 12px; }
.fin-job-pays { flex-basis: 100%; font-size: 12px; color: #5B6470; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.jc-open { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; padding: 4px 16px 16px 60px; }
.jc-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0; font-size: var(--fs-sm); }
.jc-kv dt { color: #5B6470; font-weight: 600; }
.jc-kv dd { margin: 0; overflow-wrap: anywhere; }
#jc-said { margin: 0 0 12px; }
/* the cost form */
.jc-form { display: grid; gap: 12px; }
.jc-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.jc-label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--ctl-ink); }
.jc-help { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--ctl-line); color: var(--ink-dim); font-size: 11px; font-weight: 700; cursor: help; }
.jc-money-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.jc-money { font-variant-numeric: tabular-nums; }
.jc-fee { min-height: 38px; display: flex; align-items: center; font-variant-numeric: tabular-nums; color: var(--ink-dim); }
.jc-other { margin-top: 6px; }
.jc-other[hidden] { display: none; }
.jc-fixed #jc-goes-fixed { font-weight: 600; }
/* the cost box (Billing: an invoice's Send, a new client checkout) — set apart from the invoice itself */
.cb-box { margin: 14px 0; padding: 14px 16px; border: 1px dashed #B8C2D0; border-radius: 12px; background: #F9FAFC; }
.cb-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.cb-title { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.cb-choice { display: inline-flex; gap: 6px; }
.cb-choice .chip-btn { min-height: 34px; padding: 0 12px; }
.cb-rows { display: grid; gap: 10px; margin-top: 12px; }
.cb-row { display: grid; grid-template-columns: minmax(0, 1.2fr) 130px minmax(0, 1.4fr) 36px; gap: 8px; align-items: end; }
.cb-row .field { margin: 0; }
.cb-x { width: 36px; height: 38px; padding: 0; font-size: 18px; }
.cb-more { margin-top: 8px; }
.cb-said { margin-top: 8px; font-size: var(--fs-sm); }
/* the quiet line on an invoice: grey, "expected" until the cost is Paid */
.cb-line { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.cb-line[data-paid="true"] { color: var(--ink-dim); }
@media (max-width: 1100px) {
  .jc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .jc-row.sb-head { display: none; }
  .jc-row.jc-cost { grid-template-columns: minmax(0, 1fr) auto 44px; grid-template-areas: "c1 c4 c7" "c2 c5 c7" "c3 c6 c7"; gap: 6px 10px; }
  .jc-cost .jc-c1 { grid-area: c1; } .jc-cost .jc-c2 { grid-area: c2; } .jc-cost .jc-c3 { grid-area: c3; }
  .jc-cost .jc-c4 { grid-area: c4; } .jc-cost .jc-c5 { grid-area: c5; justify-self: end; } .jc-cost .jc-c6 { grid-area: c6; justify-self: end; }
  .jc-cost .jc-c7 { grid-area: c7; align-self: center; }
  .jc-open { padding: 4px 16px 16px; }
  .cb-row { grid-template-columns: minmax(0, 1fr) 120px 36px; }
  .cb-row .cb-note { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 600px) {
  .jc-tiles { grid-template-columns: minmax(0, 1fr); }
  .jc-top .btn-primary { width: 100%; }
  .jc-wait-acts { width: 100%; }
  .jc-wait-acts .jc-act { flex: 1 1 auto; min-height: 44px; }
}

/* ==========================================================================================================
   PROFIT-2 (owner, Nov 16, 2026: "built for developers, not for humans") — EVERY FINANCIALS TAB in the Billing look
   (the .sb-* pieces above): the tab row, ONE row of date buttons, Download, pressable tiles with a compare line, cards
   with a "?", "where the money went" bars, the goal bar (also on Billing › MRR), lists, the funnel and the bar charts.
   Status colours are sacred: green good, amber watching, red a real problem, grey nothing to do, purple coming up.
   ========================================================================================================== */
.fin-title-row { margin-bottom: 0; }
.fin-actions .btn-primary, .fin-actions .btn-quiet { width: auto; min-height: 40px; padding: 0 16px; }
.fin-dl { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.fin-dl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fin-tabrow { margin-bottom: 12px; }
/* the date row */
.fin-daterow { margin: 0 0 16px; }
.fin-dates { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.fin-pbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.fin-pbtn { min-height: 36px; padding: 0 14px; font-size: 14px; }
.fin-month .sb-month { min-width: 140px; }
.fin-days { margin-top: 8px; min-height: 18px; font-size: 13px; color: var(--ink-dim); }
.fin-custom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-top: 12px; padding: 12px 14px; background: #F9FAFC; border: 1px solid #E3E6EB; border-radius: 12px; }
.fin-custom[hidden] { display: none; }
.fin-custom-f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ctl-ink); }
.fin-day { margin: 0; min-height: 38px; padding: 6px 10px; }
.fin-show { min-height: 38px; padding: 0 14px; cursor: pointer; }
.fin-custom-why { font-size: 13px; font-weight: 600; color: #8D1C15; }
.fin-custom-why:empty { display: none; }
/* tiles: every tile is a button to what is behind its number */
.fin-tiles { margin-bottom: 14px; }
.fin-tile { position: relative; text-align: left; font: inherit; text-decoration: none; }
a.fin-tile, button.fin-tile { cursor: pointer; transition: box-shadow .12s; }
a.fin-tile:hover, button.fin-tile:hover { box-shadow: 0 4px 14px rgba(15, 36, 64, .12); }
a.fin-tile:focus-visible, button.fin-tile:focus-visible { outline: 2px solid var(--ctl-blue); outline-offset: 2px; }
.fin-tile-go { margin-left: auto; font-size: 20px; line-height: 1; opacity: .6; }
.fin-tile .sb-tile-label { flex: 1 1 auto; min-width: 0; }
.sb-white.fin-chip-blue .sb-chip { background: #E8F3FD; }
.sb-white.fin-chip-blue .sb-chip svg { stroke: #0B5FD9; }
.sb-white.fin-chip-amber .sb-chip { background: #FDEEDC; }
.sb-white.fin-chip-amber .sb-chip svg { stroke: #8A3E05; }
.sb-white .sb-big { color: #0F2440; }
.sb-purple .sb-big { color: #4E2A7A; }
.sb-red .sb-big { color: #8D1C15; }
.fin-compare { font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.sb-navy .fin-compare { color: #B9D9F5; }
.sb-green .fin-compare { color: #146A38; }
.sb-white .fin-compare { color: #5B6470; }
.fin-null { font-size: 13px; font-weight: 500; }
/* cards */
.fin-card { overflow: hidden; }
.fin-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; padding: 16px 20px 12px; }
.fin-card-words { min-width: 0; }
.fin-card-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; font-weight: 700; color: #0F2440; }
.fin-card-sub { margin: 4px 0 0; font-size: 13px; color: var(--ink-dim); }
.fin-card-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fin-help { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1px solid var(--ctl-line); background: #fff; color: var(--ink-dim); font: inherit; font-size: 12px; font-weight: 700; line-height: 1; cursor: help; }
.fin-help:hover, .fin-help:focus-visible { border-color: var(--ctl-blue); color: var(--ctl-blue); outline: 0; }
.fin-foot a, .fin-foot .link-btn { font-weight: 600; }
.fin-empty { padding: 4px 20px 18px; font-size: 14px; color: var(--ink-dim); }
/* where the money went */
.fin-shares { border-top: 1px solid #EEF0F3; }
.fin-share { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(80px, 2fr) 110px 56px 40px; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid #EEF0F3; }
.fin-share:first-child { border-top: 0; }
.fin-share-name { display: flex; flex-direction: column; min-width: 0; }
.fin-share-name strong { font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.fin-share-line { font-size: 12px; color: var(--ink-mute, #6B7280); overflow-wrap: anywhere; }
.fin-share-bar { height: 10px; border-radius: 999px; background: #EEF0F3; overflow: hidden; }
.fin-share-bar span { display: block; height: 100%; border-radius: 999px; }
.fin-share-amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: #0F2440; }
.fin-share-pct { text-align: right; font-size: 13px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.fin-open { width: 32px; height: 32px; text-decoration: none; }
.fin-open-none { width: 32px; }
.fin-share.is-left { background: #E6F4EC; }
.fin-share.is-left .fin-share-bar { background: #fff; }
.fin-share.is-left .fin-share-amt, .fin-share.is-left .fin-share-pct, .fin-share.is-left strong { color: #0F5C39; }
.fin-share.is-left .fin-share-line { color: #146A38; }
.fin-share.is-red { background: #FDF3F2; }
.fin-share.is-red .fin-share-amt, .fin-share.is-red strong { color: #8D1C15; }
/* pills */
.fin-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; border: 1px solid transparent; font-size: 12px; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.fin-pill-green { background: #E6F4EC; color: #0F5C39; border-color: rgba(26, 122, 77, .25); }
.fin-pill-amber { background: #FDEEDC; color: #8A3E05; border-color: rgba(214, 158, 0, .35); }
.fin-pill-red { background: #FDF3F2; color: #8D1C15; border-color: #F3C4C0; }
.fin-pill-purple { background: #F1ECFA; color: #4E2A7A; border-color: rgba(107, 63, 160, .3); }
.fin-pill-grey { background: #F3F4F6; color: #4B5563; border-color: #E3E6EB; }
/* the goal bar */
.fin-goal { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) minmax(0, 1fr); align-items: center; gap: 14px 28px; padding: 16px 20px; }
.fin-goal-label { font-size: 13px; font-weight: 600; color: #5B6470; }
.fin-goal-now { margin-top: 2px; font-size: 14px; color: var(--ink-dim); }
.fin-goal-now strong { font-size: 24px; font-weight: 700; color: #0F2440; font-variant-numeric: tabular-nums; }
.fin-goal-track { height: 14px; border-radius: 999px; background: #EEF0F3; overflow: hidden; }
.fin-goal-track span { display: block; height: 100%; border-radius: 999px; background: #2563EB; }
.fin-goal-pct { margin-top: 6px; font-size: 13px; font-weight: 600; color: #0F2440; }
.fin-goal-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fin-goal-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: #F3F4F6; color: #4B5563; font-size: 12px; font-weight: 700; }
.fin-goal-chip.is-now { background: #0F2440; color: #fff; }
.fin-goal-chip.is-done { background: #E6F4EC; color: #0F5C39; }
/* the year, month by month */
.fin-year-scroll { overflow-x: auto; padding: 4px 20px 16px; }
.fin-year { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(64px, 1fr); gap: 10px; min-width: 760px; align-items: end; }
.fin-ycol { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; font: inherit; background: none; border: 1px solid transparent; border-radius: 10px; cursor: pointer; }
.fin-ycol:hover { background: #F7FAFF; border-color: #E3E6EB; }
.fin-ycol:focus-visible { outline: 2px solid var(--ctl-blue); outline-offset: 1px; }
.fin-ycol.is-on { background: #F7FAFF; border-color: var(--ctl-blue); }
.fin-ycol:disabled { cursor: default; opacity: .55; }
.fin-ycol-in { font-size: 12px; font-weight: 700; color: #0F2440; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-ycol-bar { width: 34px; height: 150px; display: flex; align-items: flex-end; }
.fin-ycol-bar > span { position: relative; display: block; width: 100%; border-radius: 6px 6px 0 0; background: #C9D9EE; overflow: hidden; }
.fin-ycol-bar > span > i { position: absolute; left: 0; right: 0; bottom: 0; display: block; background: #1E8E4B; }
.fin-ycol-m { font-size: 12px; font-weight: 600; color: var(--ink-dim); }
.fin-ycol-p { font-size: 12px; font-weight: 700; color: #0F5C39; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-ycol-p.is-none { color: #8A93A0; font-weight: 500; }
.fin-ycol-p.is-red { color: #8D1C15; }
.fin-key { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--ink-dim); }
.fin-key span { display: inline-flex; align-items: center; gap: 6px; }
.fin-key i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
/* lists (By client, Subscriptions) */
.fin-row { display: grid; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid #EEF0F3; }
.fin-row .num, .fin-head .num { text-align: right; font-variant-numeric: tabular-nums; }
.fin-row .num { font-weight: 600; }
.fin-cl-row { grid-template-columns: minmax(0, 2.2fr) 110px 110px 110px 130px 44px; }
.fin-clickable { cursor: pointer; }
.fin-clickable:hover { background: #FAFBFD; }
.fin-row.is-open, .fin-openbox { background: #F7FAFF; }
.fin-left { font-size: 15px; font-weight: 700; color: #0F5C39; }
.fin-left.is-red { color: #8D1C15; }
.fin-left.is-none { color: #8A93A0; font-weight: 500; }
.fin-namebox { display: flex; flex-direction: column; min-width: 0; }
.fin-namebox .fin-under { font-size: 12px; color: var(--ink-mute, #6B7280); overflow-wrap: anywhere; }
.fin-openbox { padding: 4px 16px 18px 60px; }
.fin-open-label { margin: 10px 0 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: #5B6470; }
.fin-jobs { display: grid; gap: 8px; }
.fin-job { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 10px 14px; background: #fff; border: 1px solid #E3E6EB; border-radius: 10px; font-size: 14px; }
.fin-job-words { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.fin-job-left { font-weight: 700; color: #0F5C39; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fin-job-left.is-red { color: #8D1C15; }
.fin-job-left.is-none { color: #8A93A0; font-weight: 500; }
.fin-open-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fin-open-acts .btn-primary { width: auto; min-height: 38px; padding: 0 16px; }
.fin-sub-row { grid-template-columns: minmax(0, 2.2fr) 110px minmax(0, 1.3fr) 110px 160px; }
.fin-sub-acts { display: flex; justify-content: flex-end; gap: 6px; }
.fin-sub-acts .ui-btn { min-height: 34px; padding: 0 12px; }
.fin-link { padding: 0; background: none; border: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--ctl-blue); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.fin-link:hover { color: var(--ctl-blue-hover); }
.fin-chiprow { display: flex; flex-wrap: wrap; gap: 8px; }
.fin-chiprow .chip-btn { min-height: 34px; padding: 0 12px; font-size: 13px; display: inline-flex; align-items: center; }
.fin-quiet-acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px; background: #F9FAFC; border-top: 1px solid #EEF0F3; }
.fin-quiet-acts a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; }
.fin-lookups { border-top: 1px solid #EEF0F3; }
.fin-lookup { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 12px 20px; border-top: 1px solid #EEF0F3; font-size: 14px; }
.fin-lookup:first-child { border-top: 0; }
.fin-lookup strong { font-variant-numeric: tabular-nums; color: #0F2440; }
.fin-more-line { padding: 12px 20px; font-size: 14px; color: var(--ink-dim); border-top: 1px solid #EEF0F3; }
.fin-old { padding: 0 20px 16px; overflow-x: auto; }
/* Marketing: the funnel and the 12 months */
.fin-funnel { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1fr); align-items: stretch; gap: 8px; margin-bottom: 14px; }
.fin-funnel-arrow { display: flex; align-items: center; justify-content: center; font-size: 22px; color: #8A93A0; }
.fin-mbars-scroll { overflow-x: auto; padding: 8px 20px 16px; }
.fin-mbars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(48px, 1fr); gap: 10px; min-width: 640px; align-items: end; }
.fin-mcol { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fin-mcol-n { font-size: 12px; font-weight: 700; color: #0F2440; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fin-mcol-n.is-zero { color: #8A93A0; font-weight: 500; }
.fin-mcol-bar { width: 30px; height: 130px; display: flex; align-items: flex-end; }
.fin-mcol-bar span { display: block; width: 100%; border-radius: 6px 6px 0 0; background: #F08A15; }
.fin-mcol-l { font-size: 12px; color: var(--ink-dim); }
@media (max-width: 1100px) {
  .fin-goal { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fin-goal-right { grid-column: 1 / -1; }
}
/* tablet and phone: tiles wrap; list rows become one card each, pill and arrow in view; charts scroll in their card */
@media (max-width: 900px) {
  .fin-list .sb-head { display: none; }
  .fin-cl-row { grid-template-columns: minmax(0, 1fr) auto 44px; grid-template-areas: "c1 c4 c6" "c2 c5 c6" "c3 c3 c6"; gap: 6px 10px; }
  .fin-cl-row > :nth-child(1) { grid-area: c1; } .fin-cl-row > :nth-child(2) { grid-area: c2; text-align: left; }
  .fin-cl-row > :nth-child(3) { grid-area: c3; text-align: left; } .fin-cl-row > :nth-child(4) { grid-area: c4; }
  .fin-cl-row > :nth-child(5) { grid-area: c5; justify-self: end; } .fin-cl-row > :nth-child(6) { grid-area: c6; align-self: center; }
  .fin-cl-row [data-l]::before, .fin-sub-row [data-l]::before { content: attr(data-l) " "; font-weight: 500; color: var(--ink-dim); }
  .fin-sub-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "c1 c2" "c3 c4" "c5 c5"; gap: 6px 10px; }
  .fin-sub-row > :nth-child(1) { grid-area: c1; } .fin-sub-row > :nth-child(2) { grid-area: c2; }
  .fin-sub-row > :nth-child(3) { grid-area: c3; } .fin-sub-row > :nth-child(4) { grid-area: c4; justify-self: end; }
  .fin-sub-row > :nth-child(5) { grid-area: c5; } .fin-sub-acts { justify-content: flex-start; }
  .fin-openbox { padding: 4px 16px 16px; }
  .fin-share { grid-template-columns: minmax(0, 1fr) auto 40px; grid-template-areas: "n a o" "b p o"; gap: 6px 12px; }
  .fin-share-name { grid-area: n; } .fin-share-bar { grid-area: b; } .fin-share-amt { grid-area: a; }
  .fin-share-pct { grid-area: p; } .fin-share > :last-child { grid-area: o; }
  .fin-funnel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fin-funnel-arrow { display: none; }
}
@media (max-width: 767px) {
  .fin-dates { flex-direction: column; align-items: stretch; }
  .fin-month { justify-content: space-between; }
  .fin-pbtn { flex: 1 1 auto; min-height: 40px; }
  .fin-goal { grid-template-columns: minmax(0, 1fr); }
  .fin-actions { width: 100%; justify-content: flex-start; }
  .fin-funnel { grid-template-columns: minmax(0, 1fr); }
  .fin-card-head { padding: 14px 16px 10px; }
  .fin-share, .fin-lookup, .fin-more-line { padding-left: 16px; padding-right: 16px; }
}

/* ===== COLDLEAD-1 (owner, Nov 21, 2026): the Leads page's "Cold email replies" tab, off to the side of the real pipeline.
   The same table as the other tabs (Lead · City · Where it stands · What happens next · Came in · buttons); a plain line under
   the tabs; itv-core's two small tags: "Cold email reply" (quiet grey) and "Free gift report" (plain ink, no status colour:
   the row's pill keeps the status colours' meanings). ===== */
.lf-tab-line { margin: 0 0 12px; font-size: var(--fs-sm); color: var(--ink-dim); max-width: 72ch; }
.lf-cold-tag, .lf-gift-tag { margin-left: 6px; vertical-align: 1px; font-weight: 500; }
.lf-gift-tag { border-color: var(--line-strong); color: var(--ink); background: var(--surface); }
.lf-city { font-size: var(--fs-sm); color: var(--ink); overflow-wrap: anywhere; }
.lf-cold-next { overflow-wrap: anywhere; }
.lf-top-title .lf-cold-tag, .lf-top-title .lf-gift-tag { margin-left: 0; }
.ny-tag { margin-left: 6px; vertical-align: 1px; font-weight: 500; color: var(--ink); }
/* The cold tab's three row buttons (Move to Working · Close · open) on one line: a wider button track, narrower text tracks;
   the minimums add up to the same 962px, so it still fits its box at 1280 and scrolls inside it on a phone. */
.lf-table[data-tab="cold_replies"] .lf-row { grid-template-columns: minmax(150px, 1.7fr) 116px minmax(120px, 1.25fr) minmax(130px, 1.4fr) 92px 256px; }
.lf-cold-row .lf-btns { flex-wrap: nowrap; }
/* The gift email's subject is itv-core's (the cold thread's own): shown read only, greyed so it does not look like a box to type in */
.lf-mail .field[readonly] { background: #F5F7FA; color: var(--ink-dim); cursor: default; }

/* ===== COLDLEAD-2 (owner, Nov 21, 2026): cold email replies on the Leads front page. A sixth card after Parked, in a calm teal
   that is no status colour (never red, never amber: this card never means "your move"), and on Working a box of the newest
   five under the list and above Parked, built like the Parked box. ===== */
.sb-teal { background: #E8F5F5; border-color: rgba(14, 124, 134, .28); color: #0B4F56; }
.sb-teal .sb-chip { background: #0E7C86; }
.sb-teal .sb-big { color: #0B4F56; }
.sb-teal .sb-tile-label, .sb-teal .sb-sub { color: #0E6670; }
a.lf-tile-cold { text-decoration: none; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
a.lf-tile-cold:hover { border-color: #0E7C86; box-shadow: 0 1px 6px rgba(14, 124, 134, .18); }
a.lf-tile-cold:focus-visible { outline: 2px solid var(--ctl-blue); outline-offset: 2px; }
/* six cards: one row of six from 1200px of page, three and three below that, two by two on a phone */
.lf-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1200px) {
  .lf-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
  .lf-tiles .sb-tile { padding: 16px 14px; }
  .lf-tiles .sb-tile-top { gap: 8px; }
  .lf-tiles .sb-big { font-size: 28px; }
}
.lf-tiles .sb-tile-label { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
/* the box: Lead · City · Where it stands · What happens next · Came in · Move to Working; every cell wraps inside its own track */
.lf-coldbox-row { display: grid; grid-template-columns: minmax(150px, 1.7fr) 160px 150px minmax(110px, 1.2fr) 84px 140px; align-items: center; gap: 10px 14px; padding: 10px 16px; border-top: 1px solid #EEF0F3; cursor: pointer; }
.lf-coldbox-row:hover { background: #F7FAFC; }
.lf-coldbox-row > * { min-width: 0; }
.lf-coldbox-row .lf-pill { white-space: normal; max-width: 100%; overflow-wrap: anywhere; line-height: 1.35; padding: 3px 10px; border-radius: 12px; }
.lf-coldbox-row .lf-cb-next { font-size: var(--fs-sm); }
.lf-coldbox-row .lf-cb-when { font-size: var(--fs-sm); color: var(--ink); white-space: nowrap; }
.lf-coldbox-row .lf-name { overflow-wrap: anywhere; }
.lf-new-tag { margin-left: 6px; vertical-align: 1px; font-weight: 600; background: #E8F5F5; border-color: rgba(14, 124, 134, .35); color: #0B4F56; }
.lf-coldbox-rows { padding-bottom: 4px; }
/* the five-across row needs 1200px of page; narrower, each row stacks like the Parked box does */
.lf-coldbox-row > .lf-cb-city, .lf-coldbox-row > .lf-cb-stands { justify-self: start; }
@media (max-width: 1199px) {
  /* stacked: the name; the city and where it stands side by side; what happens next; when it came in and the button */
  .lf-coldbox-row { grid-template-columns: auto minmax(0, 1fr); gap: 8px 10px; }
  .lf-coldbox-row > .lf-lead, .lf-coldbox-row > .lf-cb-next { grid-column: 1 / -1; }
  .lf-coldbox-row .lf-btns { justify-content: flex-end; }
}
@media (max-width: 600px) {
  .lf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
