/* ResolveIt design system (light theme only), aligned with the approved ResolveIt website (live site and v29 files,
   assets/css/styles.css and Branding/COLOUR_GUIDELINES.md): Resolve Navy for the navigation chrome, headings and primary
   buttons; Champagne Gold, sparingly, for selection, active navigation and brand highlights (never for errors or
   warnings); white and the website's cool off-whites for surfaces. Red, amber and green only for genuine statuses.
   Gold is never used as text on white except --gold-700 (5.2:1). Every colour below is a website value; nothing else in
   this file or in the scripts sets a colour. Type follows the website (Fraunces headings, Inter text) with the same
   fallbacks it declares: the font files are not bundled yet, so Georgia and the system face are used until they are.
   Spacing is a 4px scale. No inline styles anywhere (the content security policy forbids them). */
:root {
  /* Website palette (exact values) */
  --navy-950: #050d1f; --navy-900: #081427; --navy-800: #0c1d38; --navy-700: #11264a; --navy-600: #18345f; --navy-500: #234a82; --navy-300: #7e98c2; --navy-200: #b9c7e0;
  --gold-700: #8a6620; --gold-600: #b8893a; --gold-500: #c9a45c; --gold-400: #ddc187; --gold-300: #ecd9b0; --gold-100: #f7efdd;
  --ink: #0a1326; --slate-800: #1c2740; --slate-700: #33415c; --slate-600: #4a5a78; --slate-500: #677793; --slate-400: #93a0b6; --slate-300: #c2cad9;
  --line: #e7eaf1; --line-soft: #eef1f6; --cloud: #f4f6fb; --mist: #fafbfd; --paper: #fcfcfe; --white: #ffffff;
  --font-serif: "Fraunces", "Georgia", "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ring: 0 0 0 4px rgba(201, 164, 92, 0.32);
  /* Application roles */
  --bg: var(--cloud); --surface: var(--white); --surface-2: var(--mist); --surface-3: var(--line-soft);
  --border: var(--line); --border-strong: var(--slate-300);
  --text: var(--ink); --text-2: var(--slate-700); --text-3: var(--slate-600); --heading: var(--navy-700);
  --brand: var(--navy-600); --brand-hover: var(--navy-700); --brand-soft: var(--line-soft); --brand-ink: var(--navy-700);
  --accent: var(--gold-500); --accent-ink: var(--gold-700); --accent-soft: var(--gold-100);
  --nav: var(--navy-900); --nav-2: var(--navy-800); --nav-text: var(--navy-200); --nav-active: var(--white);
  --ok: #067647; --ok-soft: #ecfdf3; --ok-line: #abefc6;
  --warn: #b54708; --warn-soft: #fffaeb; --warn-line: #fedf89;
  --bad: #b42318; --bad-soft: #fef3f2; --bad-line: #fecdca;
  --neutral: var(--slate-700); --neutral-soft: var(--line-soft);
  /* Charts: navy for the main series, gold for emphasis (cash), slate for context (spend) */
  --c1: var(--navy-600); --c2: var(--gold-600); --c3: var(--slate-300); --c4: var(--navy-300);
  --r-sm: 8px; --r: 10px; --r-lg: 16px;
  --shadow: 0 1px 2px rgba(8, 20, 39, 0.05); --shadow-lg: 0 10px 24px rgba(8, 20, 39, 0.08), 0 36px 70px rgba(8, 20, 39, 0.16);
  --side: 236px; --top: 60px;
  color-scheme: light;
}
/* Dark mode is switched off until it has been designed and checked screen by screen; the app always uses the light theme. */

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font: 14px/1.5 var(--font-sans); background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1; }
h1 { font-family: var(--font-serif); font-size: 24px; line-height: 1.2; font-weight: 500; letter-spacing: -.022em; margin: 0; color: var(--heading); }
h2 { font-size: 15px; font-weight: 600; margin: 24px 0 10px; color: var(--text); display: flex; align-items: center; gap: 8px; }
h3 { font-size: 13px; font-weight: 600; margin: 16px 0 8px; color: var(--text-2); }
a { color: var(--brand); }
.ic { flex: none; vertical-align: middle; }
.note { font-size: 12.5px; color: var(--text-3); }
.lede { font-size: 14px; color: var(--text-2); max-width: 820px; margin: 4px 0 16px; }
.empty { color: var(--text-3); font-size: 13.5px; padding: 14px 4px; }
.pos { color: var(--ok); font-weight: 600; } .neg { color: var(--bad); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- App shell ---------- */
#side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--nav); color: var(--nav-text); display: flex; flex-direction: column; z-index: 30; }
#side .brand { display: flex; align-items: center; gap: 10px; height: var(--top); padding: 0 18px; color: #fff; font-family: var(--font-serif); font-weight: 600; font-size: 19px; letter-spacing: -.03em; }
/* The website's brand mark (website .brand-mark): a navy tile with a serif "R" */
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(145deg, var(--navy-500), var(--navy-800)); color: #fff; display: grid; place-items: center; font-family: var(--font-serif); font-weight: 600; font-size: 15px; letter-spacing: 0; box-shadow: 0 4px 12px rgba(8, 20, 39, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.08); flex: none; }
.brand .bsub { display: block; font-family: var(--font-sans); font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-400); margin-top: 1px; }
nav#tabs { display: flex; flex-direction: column; gap: 2px; padding: 12px; flex: 1; }
nav#tabs[hidden] { display: none; }
nav#tabs button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: var(--r-sm); color: var(--nav-text); font-size: 14px; font-weight: 500; cursor: pointer; }
nav#tabs button[hidden] { display: none; } /* a tab behind a switch (A1 Families) */
nav#tabs button:hover { background: var(--nav-2); color: #fff; }
nav#tabs button.on { background: rgba(255, 255, 255, .07); color: var(--nav-active); box-shadow: inset 3px 0 0 var(--accent); }
nav#tabs button.on .ic { color: var(--gold-400); }
nav#tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#sideFoot { padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .07); display: flex; align-items: center; gap: 10px; font-size: 13px; }
#sideFoot:empty { display: none; }
#sideFoot .who-n { color: #fff; font-weight: 600; line-height: 1.2; } #sideFoot .who-r { font-size: 12px; color: var(--nav-text); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
#side .avatar { background: var(--nav-2); color: #fff; }

#app { margin-left: var(--side); min-height: 100vh; display: flex; flex-direction: column; }
#banner { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; color: var(--text-2); background: var(--surface-3); border-bottom: 1px solid var(--border); padding: 5px 16px; }
#banner:empty { display: none; }
body.readonly #banner { background: var(--navy-950); color: var(--gold-300); border-color: var(--navy-800); font-weight: 600; letter-spacing: .02em; }
body.readonly #banner a { color: var(--white); }
body.sbs #banner { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; font-weight: 500; }
#top { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 16px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
#top .brand { display: none; }
#crumb { font-size: 15px; font-weight: 600; white-space: nowrap; }
#find { position: relative; flex: 1; max-width: 420px; margin-left: 8px; }
#find input { height: 36px; min-height: 36px; margin: 0; padding: 0 12px 0 36px; background: var(--surface-2); border-radius: var(--r-sm); font-size: 13.5px; }
#find > .ic { position: absolute; left: 11px; top: 9px; color: var(--text-3); pointer-events: none; }
#findRes { position: absolute; left: 0; right: 0; top: 42px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); max-height: 360px; overflow: auto; z-index: 40; }
#findRes:empty { display: none; }
#findRes .row { padding: 8px 12px; min-height: 44px; }
#who { margin-left: auto; display: flex; align-items: center; gap: 4px; }
#who button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 0; background: none; color: var(--text-2); border-radius: var(--r-sm); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
#who button:hover { background: var(--surface-3); color: var(--text); }
#who .sep { width: 1px; height: 24px; background: var(--border); margin: 0 6px; }
.envtag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); white-space: nowrap; }

main { padding: 24px 32px 48px; width: 100%; max-width: 1480px; margin: 0 auto; }
main.narrow { max-width: 880px; }

/* Page header */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.ph .sub { margin: 4px 0 0; color: var(--text-2); font-size: 13.5px; }
.ph-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
h1 .mini, h1 button { vertical-align: middle; }

/* ---------- Buttons and form controls ---------- */
button { font: inherit; }
button.primary, button.secondary, .btn, .mini, a.mini, .actions button, .actions a.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-sm); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s; }
button.primary, .btn { background: var(--brand); color: #fff; border: 1px solid var(--brand); }
button.primary:hover, .btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
button.secondary:hover, .mini:hover, .actions button:hover { background: var(--surface-2); }
button.primary, button.secondary { width: 100%; margin: 6px 0; }
.inline button.primary, .inline button.secondary, .ph-actions button.primary, .ph-actions button.secondary { width: auto; margin: 0; }
.mini, a.mini { height: 32px; padding: 0 12px; font-size: 13px; font-weight: 500; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
button.danger, .mini.danger { color: var(--bad); border-color: var(--bad-line); }
button.primary.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button[disabled], .mini[disabled] { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; box-shadow: var(--ring); }
.iconbtn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; text-decoration: none; flex: none; }
.iconbtn:hover { color: var(--brand); border-color: var(--border-strong); }
.iconbtn.call { color: var(--ok); }
button.link { border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; padding: 0; cursor: pointer; text-align: left; }
button.link:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
button.back { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--text-2); font: inherit; font-weight: 500; padding: 4px 0; cursor: pointer; }
button.back:hover { color: var(--brand); }
input, select, textarea { font: inherit; font-size: 14px; width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); margin: 6px 0; background: var(--surface); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus { border-color: var(--accent-ink); outline: none; box-shadow: var(--ring); }
textarea { min-height: 72px; resize: vertical; }
label.fld { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-top: 12px; }

/* Segmented filters: they wrap rather than run off the screen */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.seg button:hover { border-color: var(--border-strong); color: var(--text); }
.seg button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--navy-700); font-weight: 600; }
.seg button[disabled] { opacity: .45; }
.seg.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 0; border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; padding: 0; background: var(--surface); }
.seg.two button { border: 0; border-radius: 0; height: 40px; justify-content: center; border-left: 1px solid var(--border); font-size: 14px; }
.seg.two button:first-child { border-left: 0; }
.seg.two button.on { background: var(--navy-800); border-color: var(--navy-800); color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
.segsep { flex-basis: 100%; height: 0; }
.seglabel { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin: 8px 0 4px; }
.pv { max-width: 420px; margin-bottom: 16px; }

/* Toolbar above tables */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 12px; }
.toolbar .search { position: relative; flex: 1 1 260px; max-width: 360px; }
.toolbar .search input { margin: 0; padding-left: 36px; }
.toolbar .search .ic { position: absolute; left: 11px; top: 11px; color: var(--text-3); }
.toolbar .seg { margin: 0; }
.filterbar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.filterbar .seg { margin: 0; }

/* ---------- Cards, lists, key-values ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 4px 16px; margin: 8px 0; box-shadow: var(--shadow); }
.card.pad { padding: 16px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.row:last-child { border-bottom: 0; }
.card > .row:hover, .list .row:hover { background: linear-gradient(90deg, transparent, var(--surface-2) 6%, var(--surface-2) 94%, transparent); }
.row .t { font-weight: 600; font-size: 14px; } .row .s { font-size: 13px; color: var(--text-2); margin-top: 1px; }
.row > div:first-child { min-width: 0; }
.row.lead { align-items: flex-start; }
/* The Data Health card's header row (owners' Dashboard): no padding, and not clickable (the CSP refuses inline styles). */
.row.health-head { padding: 0; cursor: default; } .card > .row.health-head:hover { background: none; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv:last-child { border-bottom: 0; } .kv span { color: var(--text-2); } .kv b { font-weight: 500; text-align: right; }
.card.notice { border-color: var(--warn-line); background: var(--warn-soft); padding: 12px 16px; font-size: 13.5px; box-shadow: none; }
.card.notice.row { padding: 10px 16px; }
.card.notice.info { border-color: transparent; background: var(--brand-soft); color: var(--brand-ink); }
.notice.ro { border-color: var(--bad-line); background: var(--bad-soft); }
details.card { padding: 0 16px; }
details.card summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; list-style: none; }
details.card summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(45deg); transition: transform .15s; }
details.card[open] summary::after { transform: rotate(-135deg); }
details.card[open] { padding-bottom: 12px; }
.notec { padding: 10px 0; border-bottom: 1px solid var(--border); } .notec:last-child { border-bottom: 0; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 12px 0; }
.actions button { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.minis { display: flex; gap: 6px; flex: none; }
.row2 { display: flex; gap: 8px; align-items: center; } .row2 input { flex: 1; }

/* ---------- Status badges (one style everywhere) ---------- */
.chip, .pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap;
  background: var(--neutral-soft); color: var(--neutral); margin: 2px 4px 2px 0; border: 1px solid transparent; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.chip.plain::before, .chip.person::before, .chip.dim::before { display: none; }
.chip.yes, .pill.green { background: var(--ok-soft); color: var(--ok); }
.chip.no, .pill.red { background: var(--bad-soft); color: var(--bad); }
.chip.warn, .pill.gold { background: var(--warn-soft); color: var(--warn); }
.chip.info, .chip.seq { background: var(--brand-soft); color: var(--brand-ink); }
.chip.dim { background: none; color: var(--text-3); padding: 0 2px; }
.chip.person { background: none; color: var(--text); padding: 0; font-weight: 500; gap: 6px; }
.chip.person .avatar { width: 22px; height: 22px; font-size: 10px; }
.chip.person.none { color: var(--text-3); font-style: italic; }
.pill { margin: 0; }
.chips { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 2px 0; }
a.pill, button.pill { cursor: pointer; text-decoration: none; height: 32px; padding: 0 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; }
a.pill.gold { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
button.pill.red { border-color: var(--bad-line); }

/* ---------- Metrics ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 8px 0 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi .l { font-size: 12.5px; color: var(--text-2); font-weight: 500; order: -1; }
.kpi .v { font-size: 24px; font-weight: 650; letter-spacing: -.01em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .d { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; margin-top: 6px; color: var(--text-3); }
.kpi .d.up { color: var(--ok); } .kpi .d.down { color: var(--bad); } .kpi .d.flat { color: var(--text-3); }
.kpi.tap { cursor: pointer; } .kpi.tap:hover { border-color: var(--accent); }
.kpi.tap .l::after { content: " ›"; color: var(--text-3); }
.kpi { display: flex; flex-direction: column; }

/* Attention list (Today) */
.attn { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 0 0 8px; }
.att { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: var(--r); padding: 14px 16px; cursor: pointer; text-align: left; font: inherit; color: inherit; box-shadow: var(--shadow); }
.att:hover { border-color: var(--border-strong); }
.att.bad { border-left-color: var(--bad); } .att.warn { border-left-color: var(--warn); } .att.ok { border-left-color: var(--ok); cursor: default; }
.att .n { font-size: 22px; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
.att .l { font-size: 13px; font-weight: 600; margin-top: 2px; } .att .h { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.att .ic { color: var(--text-3); margin-top: 2px; } .att.bad .ic { color: var(--bad); } .att.warn .ic { color: var(--warn); } .att.ok .ic { color: var(--ok); }
.att.kpi { flex-direction: row; }

/* Today layout */
.greet { margin-bottom: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.split > div > h2:first-child { margin-top: 8px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); margin: 8px 0 16px; }
.panel > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.panel > header h2 { margin: 0; font-size: 14px; }
.panel > .body { padding: 4px 16px; }
.panel > .foot { padding: 10px 16px; border-top: 1px solid var(--border); }
.sched .row { min-height: 48px; }
.sched .tm { font-variant-numeric: tabular-nums; font-weight: 600; width: 48px; flex: none; color: var(--text); }
.sched .row > div:first-child { display: flex; gap: 12px; align-items: baseline; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; }
.count.bad { background: var(--bad-soft); color: var(--bad); }
.secthead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.secthead h2 { margin-bottom: 8px; }

/* ---------- Data tables ---------- */
.sheetwrap { overflow: auto; max-height: calc(100vh - 260px); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.sheetwrap.flat { max-height: none; margin-bottom: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.sheet { border-collapse: separate; border-spacing: 0; width: 100%; }
table.sheet th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 12px; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.sheet tr.filters th { top: 39px; padding: 6px 8px; background: var(--surface); }
table.sheet tr.filters input, table.sheet tr.filters select { min-height: 30px; height: 30px; padding: 2px 8px; font-size: 12.5px; margin: 0; min-width: 72px; font-weight: 400; }
table.sheet th.sortable { cursor: pointer; user-select: none; } table.sheet th.sortable:hover { color: var(--text); }
table.sheet th .mark { color: var(--brand); }
table.sheet td { padding: 0 12px; height: 46px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
table.sheet tbody tr:last-child td { border-bottom: 0; }
table.sheet tbody tr:hover td { background: var(--surface-2); }
table.sheet td .chip { margin: 0; }
table.sheet .pin { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
table.sheet th.pin { z-index: 3; background: var(--surface-2); } table.sheet tr.filters th.pin { background: var(--surface); }
table.sheet tbody tr:hover td.pin { background: var(--surface-2); }
table.sheet td.n, table.sheet th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.sheet .xcol { width: 40px; text-align: center; padding: 0 4px; }
.xbtn { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-3); cursor: pointer; }
.xbtn:hover { background: var(--surface-3); color: var(--text); }
.xbtn[aria-expanded="true"] .ic { transform: rotate(90deg); }
table.sheet tr.xrow td { white-space: normal; background: var(--surface-2); height: auto; padding: 12px 16px; }
.xgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; font-size: 13px; }
.span2 { grid-column: span 2; }
.sheetfoot { font-size: 12.5px; color: var(--text-3); padding: 8px 2px; }
.cellmain { display: flex; align-items: center; gap: 10px; }
.cellmain .sub { font-size: 12px; color: var(--text-3); font-weight: 400; }
.next { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.next.due { color: var(--bad); font-weight: 500; } .next.soon { color: var(--warn); font-weight: 500; } .next.none { color: var(--text-3); }
.clip { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
td.indent { padding-left: 28px; color: var(--text-2); }
.hdrnote { color: var(--text-3); font-weight: 400; }
.tablewrap { overflow-x: auto; }
.cmp { border-collapse: collapse; width: 100%; font-size: 13px; } .cmp th, .cmp td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.cmp th { color: var(--text-2); font-size: 12px; font-weight: 600; background: var(--surface-2); }
.cmp th:first-child, .cmp td:first-child { text-align: left; }
td, th { text-align: left; } td.n, th.n { text-align: right; }

/* ---------- Drawer / sheet ---------- */
dialog#sheet { position: fixed; inset: 0 0 0 auto; margin: 0; height: 100vh; max-height: 100vh; width: min(620px, 100vw); max-width: 100vw; border: 0; border-left: 1px solid var(--border); padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog#sheet[open] { display: flex; flex-direction: column; animation: drawer .18s ease-out; }
@keyframes drawer { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
dialog::backdrop { background: rgba(8, 20, 39, .45); }
#sheetHead { display: flex; justify-content: flex-end; align-items: center; height: 52px; padding: 0 12px; border-bottom: 1px solid var(--border); flex: none; }
#sheetBody { padding: 20px 24px 32px; overflow-y: auto; flex: 1; }
#sheetBody > h1 { font-size: 20px; margin-bottom: 4px; }
#sheetBody > h1 + .note, #sheetBody > h1 + p.note { margin-top: 0; }
#sheetBody h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 24px 0 8px; font-weight: 600; }
.close { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.close:hover { background: var(--surface-3); color: var(--text); }

/* Record header and sections */
.rec-h { display: flex; gap: 14px; align-items: flex-start; }
.rec-h .avatar { width: 44px; height: 44px; font-size: 15px; }
.rec-h h1 { font-size: 20px; }
.rec-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--text-2); margin-top: 4px; }
.rec-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.rec-acts .btn, .rec-acts .mini, .rec-acts button { width: auto; margin: 0; height: 36px; }
.sect { border-top: 1px solid var(--border); padding-top: 4px; margin-top: 20px; }
.sect > h2:first-child { margin-top: 14px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.facts div > span { display: block; font-size: 12px; color: var(--text-3); } .facts div > b { font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
/* Timeline */
.tl { position: relative; margin: 4px 0 0; padding: 0; list-style: none; }
.tl li { position: relative; display: flex; gap: 12px; padding: 8px 0 12px; }
.tl li::before { content: ""; position: absolute; left: 13px; top: 36px; bottom: -4px; width: 1px; background: var(--border); }
.tl li:last-child::before { display: none; }
.tl .dotc { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.tl .dotc.in { background: var(--brand-soft); color: var(--brand-ink); } .tl .dotc.ok { background: var(--ok-soft); color: var(--ok); } .tl .dotc.bad { background: var(--bad-soft); color: var(--bad); }
.tl .what { font-weight: 600; font-size: 13.5px; } .tl .meta { font-size: 12.5px; color: var(--text-3); } .tl .body { font-size: 13.5px; color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.tl-day { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin: 12px 0 2px; }

/* Conversation */
.thread { max-height: 55vh; overflow-y: auto; padding: 8px 2px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 84%; padding: 10px 12px; border-radius: 12px; background: var(--surface-3); align-self: flex-start; overflow-wrap: anywhere; font-size: 14px; }
.msg.out { align-self: flex-end; background: var(--brand); color: #fff; } .msg.out.auto { background: var(--text-3); }
.msg .who { font-size: 11.5px; opacity: .8; margin-bottom: 2px; } .msg .body { white-space: pre-wrap; } .msg .meta { margin-top: 4px; }
.msg.out .chip { background: rgba(255, 255, 255, .2); color: #fff; }
.day { align-self: center; font-size: 11.5px; color: var(--text-3); margin: 6px 0 2px; } .day.new { color: var(--bad); font-weight: 600; }
.composer { padding-top: 8px; }

/* ---------- Charts ---------- */
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .axis { font-size: 11px; fill: var(--text-3); } svg.chart .base, svg.chart .grid { stroke: var(--border); }
svg.chart .funt { font-size: 13px; fill: var(--text); } svg.chart .funm { font-size: 12px; fill: var(--text-3); }
svg.chart .funbg { fill: var(--surface-3); } svg.chart .funfg { fill: var(--c1); }
.c-spend { fill: var(--c3); background: var(--c3); } .c-contracted { fill: var(--c1); background: var(--c1); } .c-cash { fill: var(--c2); background: var(--c2); }
.chart .b-spend { fill: var(--c3); } .chart .b-cash { fill: var(--c2); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 8px; align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; } .key.k-spend { background: var(--c3); } .key.k-cash { background: var(--c2); }
.perfgrid { display: grid; grid-template-columns: 1fr; gap: 0 20px; } @media (min-width: 1100px) { .perfgrid { grid-template-columns: 1fr 1.3fr; } }
.grp { margin: 8px 0 32px; }
.grp > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 12px; flex-wrap: wrap; }
.grp > header h2 { margin: 0; font-family: var(--font-serif); font-size: 19px; font-weight: 500; letter-spacing: -.02em; color: var(--heading); }
.grp > header .gi { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--brand-soft); color: var(--brand-ink); }
.grp h3 { font-size: 14px; color: var(--text); margin: 20px 0 8px; }
.src { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.src i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.src.synthetic i { background: var(--warn); } .src.live i { background: var(--ok); } .src.unavailable i { background: var(--text-3); } .src.estimated i { background: var(--c4); }
.srcs { display: flex; gap: 14px; flex-wrap: wrap; }
.period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 20px; box-shadow: var(--shadow); }
.period .seg { margin: 0; }
.period .when { font-size: 13px; color: var(--text-2); margin-left: auto; }

/* Advertising screen */
.adctl { display: flex; flex-wrap: wrap; gap: 0 14px; }
.flts { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 4px 0 12px; } .flt { font-size: 12px; color: var(--text-2); display: flex; flex-direction: column; min-width: 140px; font-weight: 500; }
.flt select { margin: 4px 0; min-height: 36px; padding: 4px 8px; }
.cov { display: flex; flex-direction: column; gap: 6px; }
.ins { padding: 10px 0; border-bottom: 1px solid var(--border); } .ins:last-of-type { border-bottom: 0; } .ins .t { font-weight: 600; } .ins .s { font-size: 13px; color: var(--text-2); }
.adcard { cursor: pointer; padding: 12px 16px; } .adcard .mk { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-2); margin: 6px 0; } .adcard .mk b { color: var(--text); }

/* ---------- Calendar ---------- */
.calbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 12px; }
.calbar .seg.two { width: 240px; }
.calnav { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; margin: 4px 0 10px; max-width: 420px; }
.calnav button { height: 40px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: var(--r-sm); cursor: pointer; display: grid; place-items: center; }
.calnav .calttl { font-size: 15px; font-weight: 600; border: 0; background: none; }
.calacts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; } .calacts button.primary, .calacts button.secondary { width: auto; margin: 0; }
.row.ev { border-left: 3px solid var(--c1); padding-left: 12px; margin: 6px 0; border-bottom: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--surface-2); }
.row.ev.task { border-left: 3px dashed var(--c3); } .row.ev.off { opacity: .55; }
.pill.task { background: none; border: 1px dashed var(--border-strong); color: var(--text-2); }
h2.today { color: var(--brand); }
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; } .month .mh { font-size: 11.5px; color: var(--text-3); text-align: center; padding: 4px 0; font-weight: 600; }
.month .md { min-height: 84px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 6px 8px; font: inherit; cursor: pointer; }
.month .md b { font-size: 13px; font-weight: 600; } .month .md.other { opacity: .45; } .month .md.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.dot { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; font-size: 11px; line-height: 18px; text-align: center; color: #fff; } .dot.call { background: var(--navy-600); } .dot.task { background: var(--gold-100); color: var(--navy-800); box-shadow: inset 0 0 0 1px var(--gold-500); }
.callegend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; } .callegend span { display: inline-flex; align-items: center; gap: 6px; }
.key.k-call { background: var(--navy-600); border-radius: 50%; } .key.k-task { background: var(--gold-100); border-radius: 50%; box-shadow: inset 0 0 0 1px var(--gold-500); }
.seg.days button { min-width: 52px; height: 52px; line-height: 1.2; padding: 4px 8px; flex-direction: column; border-radius: var(--r-sm); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin: 6px 0 12px; }
.slots button { height: 44px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.slots button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.hrs { display: flex; align-items: center; gap: 8px; padding: 6px 0; } .hrs label { min-width: 76px; display: flex; align-items: center; gap: 8px; min-height: 44px; }
.hrs input[type=time], .hrs input[type=date] { width: auto; flex: 1; margin: 0; } .hrs input[type=checkbox] { width: 20px; height: 20px; min-height: 20px; margin: 0; accent-color: var(--brand); }
/* A3 staff accountability: a wide table that scrolls inside its own box, never the page. */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.stafftable th { text-align: left; font-size: 12px; color: var(--text-2); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.stafftable td { padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.stafftable td:not(:first-child), .stafftable th:not(:first-child) { text-align: right; }
.stafftable tbody tr:last-child td { border-bottom: 0; } .stafftable .due { color: var(--bad); }
@media (max-width: 699px) { .stafftable button.link { min-height: 48px; } }
/* A2 Pipeline (read-only board): five columns on wide screens, one column at a time below 1100 px. */
.pfilters { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 4px; }
.pselect { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.pselect select { min-height: 36px; }
.psummary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
.pstat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pstat span { font-size: 12px; color: var(--text-2); } .pstat b { font-size: 20px; } .pstat em { font-style: normal; font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }
.pboard { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; }
.pcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 10px; min-width: 0; }
.pcol h2 { margin: 2px 2px 8px; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.pcards { display: flex; flex-direction: column; gap: 8px; }
.pboard .pcards { max-height: 70vh; overflow-y: auto; padding-right: 2px; }
.pcard { all: unset; box-sizing: border-box; display: flex; flex-direction: column; flex-shrink: 0; /* keep its height; the column scrolls */ gap: 6px; width: 100%; min-height: 48px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; cursor: pointer; box-shadow: var(--shadow); text-align: left; }
.pcard:hover { border-color: var(--border-strong); } .pcard:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pcard.gone { opacity: .85; border-style: dashed; }
.pc-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; } .pc-h .t { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.pc-m { font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; } .pc-f { font-size: 12px; color: var(--text-3); }
.pcol > button.secondary { margin-top: 8px; width: 100%; }
.pgone { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
/* A0: errors are a bar, not a pop-up; Retry only where repeating is safe (web/app.js showError). */
#errbar { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 61; display: flex; align-items: center; gap: 10px; max-width: min(640px, calc(100vw - 32px));
  background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad-line); padding: 8px 10px 8px 14px; border-radius: var(--r); font-size: 13.5px; box-shadow: var(--shadow-lg); }
#errbar[hidden] { display: none; }
#errbar span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: var(--r); font-size: 14px; z-index: 60; box-shadow: var(--shadow-lg); }

/* ---------- Sign-in ---------- */
body.auth #side, body.auth #top, body.auth #banner { display: none; }
body.auth #app { margin-left: 0; }
body.auth main { max-width: none; padding: 0; min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 80% -10%, rgba(35, 74, 130, 0.55), transparent 60%), linear-gradient(160deg, var(--navy-800), var(--navy-950)); }
body.auth { background: var(--navy-950); }
.signin { width: min(400px, calc(100vw - 32px)); }
.signin .brandrow { display: flex; align-items: center; gap: 12px; font-family: var(--font-serif); font-size: 24px; font-weight: 600; letter-spacing: -.03em; color: #fff; margin-bottom: 28px; justify-content: center; }
.signin .brandrow::after { content: "CRM"; font-family: var(--font-sans); font-size: 11px; font-weight: 600; letter-spacing: .16em; color: var(--gold-400); border: 1px solid rgba(201, 164, 92, 0.45); border-radius: 999px; padding: 3px 9px; }
.signin .logo { width: 40px; height: 40px; font-size: 19px; border-radius: 11px; }
.signin .box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow-lg); }
.signin h1 { font-size: 20px; margin-bottom: 4px; } .signin .sub { color: var(--text-2); margin: 0 0 20px; font-size: 13.5px; }
.signin button.primary { height: 46px; margin-top: 12px; border-radius: 999px; border: 0; font-weight: 600; background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: var(--navy-950); box-shadow: 0 10px 30px rgba(184, 137, 58, 0.32); }
.signin button.primary:hover { background: linear-gradient(135deg, var(--gold-300), var(--gold-500)); color: var(--navy-950); }
.signin .err { color: var(--bad); font-size: 13px; margin-top: 8px; min-height: 18px; }
.signin .foot { text-align: center; font-size: 12px; color: var(--navy-200); margin-top: 20px; display: flex; gap: 6px; justify-content: center; align-items: center; }
.signin #code { letter-spacing: .3em; font-size: 18px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- Tablet: icon rail ---------- */
@media (max-width: 1099px) {
  #side .brand { padding: 0; justify-content: center; } #side .brand .bname { display: none; }
  nav#tabs { padding: 12px 10px; }
  nav#tabs button { justify-content: center; padding: 0; height: 48px; flex-direction: column; gap: 3px; font-size: 10.5px; }
  /* Release 6c: the rail is a little wider and its labels a little smaller, so every name ("Opportunities") fits whole. */
  :root { --side: 84px; } nav#tabs { padding: 12px 4px; } nav#tabs button { height: auto; min-height: 48px; padding: 4px 0; font-size: 10px; letter-spacing: -.01em; }
  nav#tabs button span { max-width: 100%; text-align: center; line-height: 1.15; }
  nav#tabs button.on { box-shadow: none; }
  #sideFoot { justify-content: center; padding: 12px 0; } #sideFoot .who-t { display: none; }
  main { padding: 20px 24px 40px; }
  .split { grid-template-columns: 1fr; }
  #who .lbl { display: none; }
  .xgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Phone ---------- */
@media (max-width: 699px) {
  :root { --top: 56px; }
  body { font-size: 15px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  #side { inset: auto 0 0 0; width: auto; height: calc(64px + env(safe-area-inset-bottom)); flex-direction: row; border-top: 1px solid var(--border); background: var(--surface); padding-bottom: env(safe-area-inset-bottom); }
  #side .brand, #sideFoot { display: none; }
  nav#tabs { flex-direction: row; padding: 0; gap: 0; }
  nav#tabs button { flex: 1; height: 64px; border-radius: 0; color: var(--text-3); font-size: 11.5px; font-weight: 500; }
  nav#tabs button { min-width: 0; } nav#tabs button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* six tabs with switches on: labels never spill */
  nav#tabs:has(button:not([hidden]):nth-of-type(6)) button { font-size: min(10px, 2.5vw); }
  /* Release 6c: a two-word label ("Sales dashboard") wraps onto two lines instead of being cut off with an ellipsis. */
  nav#tabs button span { white-space: normal; text-align: center; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  nav#tabs button { font-size: min(10px, 2.5vw); padding: 0 1px; letter-spacing: -.01em; } /* a fifth of the phone's width holds "Conversations" whole, down to 320 pixels (review note 5) */
  nav#tabs button:hover { background: none; color: var(--text-2); }
  nav#tabs button.on { background: none; color: var(--navy-800); box-shadow: inset 0 2px 0 var(--accent); }
  nav#tabs button.on .ic { color: var(--accent-ink); }
  #app { margin-left: 0; }
  #top { padding: 0 8px 0 16px; gap: 8px; padding-top: env(safe-area-inset-top); height: calc(var(--top) + env(safe-area-inset-top)); }
  #top .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
  #crumb { display: none; }
  #find { display: none; }
  #who { gap: 0; } #who button { width: 44px; height: 44px; padding: 0; justify-content: center; } #who .sep, .envtag .lbl { display: none; }
  .envtag { padding: 0 6px; }
  main { padding: 16px 16px 32px; }
  h1 { font-size: 21px; }
  .card { padding: 2px 14px; }
  .row { min-height: 56px; }
  button.primary, button.secondary, .btn, .actions button, .actions a.btn { height: 48px; }
  .mini, a.mini, a.pill, button.pill, .iconbtn { min-height: 44px; height: 44px; }
  .iconbtn { width: 44px; }
  .seg button { height: 40px; padding: 0 14px; }
  .seg.two button { height: 48px; }
  input, select { min-height: 48px; font-size: 16px; }
  textarea { font-size: 16px; }
  .slots button { height: 48px; }
  .calnav button { height: 48px; } .calnav { grid-template-columns: 48px 1fr 48px; }
  .xbtn, button.back, .close { min-height: 44px; }
  .hrs input[type=checkbox] { width: 26px; height: 26px; }
  dialog#sheet { width: 100vw; height: 100dvh; max-height: 100dvh; border-left: 0; }
  @keyframes drawer { from { transform: translateY(16px); opacity: .6; } to { transform: none; opacity: 1; } }
  #sheetHead { height: calc(52px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  #sheetBody { padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px; } .kpi .v { font-size: 20px; }
  .attn { grid-template-columns: 1fr; gap: 8px; }
  .facts { grid-template-columns: 1fr; }
  .xgrid { grid-template-columns: 1fr; }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .period .when { margin-left: 0; }
  .month .md { min-height: 56px; padding: 4px; align-items: center; }
  .calbar .seg.two { width: 100%; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  #errbar { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .tl li { padding-bottom: 10px; }
}

/* Small additions */
.pill.info { background: var(--brand-soft); color: var(--brand-ink); }
button.primary.inline-btn, button.secondary.inline-btn { width: auto; margin-top: 12px; }
.card.notice.row { justify-content: flex-start; } .card.notice.row > .ic { color: var(--brand-ink); }
.card.notice.row > span:last-child, .card.notice.row > .mini { margin-left: auto; }
.card.notice > .ic { vertical-align: -3px; margin-right: 4px; }
#sheetClose span { display: inline; }
/* Filter fold: open and invisible on larger screens, one tappable line on phones */
details.fold > summary { display: none; }
details.fold .foldin { display: flex; flex-direction: column; gap: 8px; }
details.fold .seg { margin: 0; }
@media (max-width: 699px) {
  details.fold { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
  details.fold > summary { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; cursor: pointer; list-style: none; color: var(--text-2); font-weight: 500; }
  details.fold > summary::-webkit-details-marker { display: none; }
  details.fold > summary b { color: var(--brand-ink); font-weight: 600; margin-left: auto; }
  details.fold[open] > summary .ic:last-child { transform: rotate(180deg); }
  details.fold .foldin { padding: 4px 14px 14px; }
  .seg button { height: 48px; }
}

.close:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: 0; }
svg.chart { max-height: 340px; }
#app > main { min-width: 0; } .grp, .split > div { min-width: 0; }
.signin .err { min-height: 0; } .signin .err:empty { margin: 0; }
@media (max-width: 1099px) { .split > div:last-child { order: -1; } }
@media (max-width: 699px) { .pselect select { min-height: 48px; width: 100%; } .psummary { display: none; } /* A2: on phones the stage buttons carry the counts */
  .pfilters { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 0; } .pselect { flex-direction: column; align-items: stretch; gap: 4px; } }
.psum-line { display: none; } @media (max-width: 699px) { .psum-line { display: block; } }
@media (max-width: 699px) { .mini, a.mini, a.pill, button.pill, .iconbtn { min-height: 48px; height: 48px; } .iconbtn { width: 48px; } .rec-acts .btn, .rec-acts .mini, .rec-acts button { height: 48px; } }
@media (max-width: 699px) { .flt select { min-height: 48px; } }

/* Advertising intelligence */
.adbar { align-items: flex-end; }
.adbar .flt { min-width: 0; }
.adbar .flt select, .adbar .flt input { min-width: 150px; }
.adbar .adctl .seg { margin: 4px 0; }
.adrange { margin: -8px 0 12px; } .adrange .seg { margin: 0; }
.adrange .seg button { height: 28px; padding: 0 10px; font-size: 12.5px; }
.adfilters { margin-bottom: 8px; }
.adfilters .flts { margin: 0; }
svg.attbar { height: 14px; max-height: 14px; border-radius: 4px; overflow: hidden; margin: 12px 0 8px; }
.att-confirmed { fill: var(--ok); } .att-inferred { fill: var(--c4); } .att-conflicting { fill: var(--bad); } .att-unknown { fill: var(--warn); } .att-unverified { fill: var(--warn); opacity: .55; } .att-not_paid { fill: var(--c3); } .att-override { fill: var(--neutral); } .att-gp_campaign { fill: var(--c2, var(--c4)); opacity: .75; }
.cov > div + div { margin-top: 4px; }
.mgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; margin: 10px 0; }
.mgrid span { display: block; font-size: 12px; color: var(--text-3); } .mgrid b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mini.drill { height: 26px; padding: 0 8px; font-size: 12px; gap: 2px; margin-left: 6px; }
.adcard .mini.drill { height: 40px; margin-left: 0; }
.crumbs { margin: 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.crumbs .link { font-weight: 500; color: var(--brand); }
@media (max-width: 699px) {
  .adbar .flt { flex: 1 1 100%; } .adbar .flt select, .adbar .flt input { min-width: 0; }
  .adrange { display: none; }
  .adrange .seg button { height: 44px; }
  .adcard .mini.drill { height: 48px; width: 100%; }
}
@media (max-width: 699px) { button.link { min-height: 48px; display: inline-flex; align-items: center; } .ins button.link { display: flex; } }
.mini.inline { margin: 4px 0 8px; }
@media (max-width: 699px) {
  #who button { width: 48px; height: 48px; } .close, #sheetClose { min-height: 48px; } button.back { min-height: 48px; }
  details.card summary, details summary { min-height: 48px; } .signin button.primary { height: 48px; }
}
main.full { max-width: none; }
#sheetBody:focus { outline: none; }
.notice .mini.sandbox { margin-top: 8px; }
.perfgrid > *, .split > *, .kpis > * { min-width: 0; }
#banner a { margin-left: 8px; font-weight: 600; white-space: nowrap; }
@media (max-width: 699px) { #banner .bn-long { display: none; } #banner { justify-content: space-between; text-align: left; } #banner a { display: inline-flex; align-items: center; min-height: 48px; } }
.contact-info { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; white-space: nowrap; }
/* Pager for server-paged lists (Leads, Sales) */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 2px; font-size: 13px; color: var(--text-2); }
.pager .pgcount { flex: 1 1 220px; }
.pager .pgnav { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pager .pgat { padding: 0 4px; white-space: nowrap; }
.pager .pgsize { display: inline-flex; align-items: center; gap: 6px; }
.pager button[disabled] { opacity: .45; cursor: default; }
@media (max-width: 699px) { .pager { padding: 12px 0; } .pager .pgnav button, .pager select { min-height: 48px; min-width: 48px; } .pager .pgnav { width: 100%; justify-content: space-between; } }
/* A4 Business (owner only, behind its switch). Contracted and cash side by side; never one figure. */
.bizsrcs { margin: 4px 0 14px; gap: 4px 14px; }
.bizdates { display: inline-flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.bizdates .flt { min-width: 150px; } .bizdates input { margin: 4px 0; min-height: 36px; }
.moneysplit { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 8px 0 12px; }
.kpi.big .v { font-size: 30px; }
.pipenow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 8px 0 8px; }
.pbar { display: block; width: 100%; height: 6px; margin-top: 10px; } .pbar .funbg { fill: var(--surface-3); } .pbar .funfg { fill: var(--c1); }
.prevscreens { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
@media (max-width: 699px) {
  /* With Business on, the bottom bar keeps five tabs: Sales and Performance open from the Business screen until the owners approve it. */
  nav#tabs.biz button[data-tab="sales"], nav#tabs.biz button[data-tab="performance"] { display: none; }
  .bizdates, .bizdates .flt { width: 100%; } .bizdates input { min-height: 48px; }
  .kpi.big .v { font-size: 26px; }
}
/* A5 Operations (owner only, behind its switch): read-only views and the one kill switch. */
.opsmeta { margin: 4px 0 12px; align-items: center; }
.killswitch { margin: 4px 0 24px; border-left: 4px solid var(--ok); } .killswitch.stopped { border-left-color: var(--bad); }
.killswitch h2 { margin: 0 0 6px; font-size: 17px; } .ksrow { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.ksrow > div { flex: 1 1 320px; min-width: 0; } .ksstate { margin: 2px 0 6px; }
.kpi.provider .v { font-size: 15px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); align-self: flex-end; min-height: 36px; }
.audittable td code, .row code { font-size: 12.5px; }
#sheetBody .flt input { margin: 4px 0; min-height: 40px; }
#top #opsBtn.on { color: var(--brand); }
@media (max-width: 699px) { .ksrow button { width: 100%; justify-content: center; } .chk { min-height: 48px; } .chk input { width: 22px !important; height: 22px; } }
.chk input { width: 18px; height: 18px; min-height: 0; margin: 0; flex: none; }
.stafftable.audittable td, .stafftable.audittable th { text-align: left; } .audittable td.note { white-space: normal; min-width: 220px; }
/* A6 calendar: read-only pilot notice, Discovery Call summary and filters (phones: compact, filters folded). */
.calro { margin: 4px 0 12px; }
.calsum { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 4px 0 4px; }
.calsum .cs { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.calsum .cs b { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; } .calsum .cs span { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calsum .cs.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); } .calsum .cs:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.calsumnote { margin: 4px 0 10px; } .calfilters { margin-bottom: 10px; } .calfilters .flt input { margin: 4px 0; min-height: 36px; }
@media (max-width: 699px) { .calsum { grid-template-columns: repeat(3, minmax(0, 1fr)); } .calsum .cs { min-height: 56px; padding: 8px 10px; } .calsum .cs b { font-size: 17px; } .calfilters .flt, .calfilters .flt input, .calfilters .flt select { width: 100%; } .calfilters .flt input { min-height: 48px; } }
.calfilters .foldin.flts { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; } .calfilters .flt { flex: 0 1 220px; } .calfilters .flt input, .calfilters .flt select { width: 100%; }
@media (max-width: 699px) { .calfilters .flt { flex: 1 1 100%; } }
/* Navigation: desktop and tablet list every screen; phones keep five tabs and the rest open from More (Stage B: Today,
   Families, Calendar, Conversations; the pilot, redesign: Today, Leads, Pipeline, Performance). */
nav#tabs .navsep { margin: 12px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--nav-text); opacity: .6; }
nav#tabs button[data-tab="more"] { display: none; }
@media (max-width: 1099px) { nav#tabs .navsep { margin: 8px 0 2px; font-size: 0; height: 1px; background: var(--nav-2); opacity: 1; } }
@media (max-width: 699px) {
  nav#tabs .navsep { display: none; }
  nav#tabs button[data-more] { display: none; }
  nav#tabs button[data-tab="more"]:not([hidden]) { display: flex; }
}
.thread .callline { align-self: center; background: var(--surface-2); color: var(--text-2); font-size: 12.5px; border-radius: 999px; padding: 4px 12px; max-width: 92%; }
.row.conv { cursor: pointer; } .row.conv .s { overflow: hidden; text-overflow: ellipsis; }
.tl-src { color: var(--text-3); }
.paytable tbody tr { cursor: pointer; } .paytable tbody tr:hover td { background: var(--surface-2); }
.integ { margin-bottom: 12px; } .integ h2 { margin: 0 0 4px; font-size: 16px; } .integ .kv b { text-align: right; } .integ code, .card.notice code { font-size: 12px; }
.onbform { display: flex; flex-direction: column; gap: 10px; } .onbform .flt input, .onbform .flt select { margin: 4px 0; min-height: 40px; }
@media (max-width: 699px) { .onbform .flt input, .onbform .flt select { min-height: 48px; } }
.integ .kv { flex-wrap: wrap; gap: 4px 12px; } .integ .kv b { min-width: 0; overflow-wrap: anywhere; flex: 1 1 200px; } .integ code { display: inline-block; overflow-wrap: anywhere; max-width: 100%; }

/* W6: recovery codes shown once after turning on two-step sign-in */
.codes { list-style: none; padding: 0; margin: 8px 0 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.codes code { font-size: 14px; letter-spacing: .04em; }

/* Communications (web/comms.js): AI evidence badges, composer, handover, timeline */
.chip.ai { background: var(--white); color: var(--navy-700); box-shadow: inset 0 0 0 1px #a78bfa; } /* the website's violet, used on it for accents */
.flt.chk { display: flex; width: 100%; flex-direction: row; align-items: center; gap: 8px; padding: 10px 0; font-size: 13.5px; min-width: 0; }
.cmpbtns { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.cmpbtns button { flex: 1 1 200px; }
#hoForm { padding-bottom: 12px; } #hoForm select, #hoForm input { margin: 6px 0; width: 100%; }
.tl .row .t { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: 13.5px; }
.tl .row > div:last-child { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
@media (max-width: 600px) { .tl .row, #panelOutbox .row, #outboxList .row, #aiList .row, #callList .row { flex-wrap: wrap; } .tl .row > div:last-child { justify-content: flex-start; } }
/* Tutoring (provisional, OD17): attendance taking must work one-handed on a phone in a classroom. */
.tut-wk { align-self: center; }
.flt.grow { flex: 1 1 260px; }
.tflt input { margin: 4px 0; min-height: 36px; padding: 4px 8px; }
.row.att { cursor: default; flex-wrap: wrap; }
.att-seg { margin: 0; }
.att-seg button.on[data-mark="present"] { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.att-seg button.on[data-mark="late"] { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.att-seg button.on[data-mark="absent"] { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
tr.tot td { background: var(--surface-2); }
tr[data-enrolment] { cursor: pointer; }
@media (max-width: 699px) {
  .row.att > div:first-child { flex: 1 1 100%; }
  .att-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; gap: 6px; }
  .att-seg button { height: 48px; justify-content: center; padding: 0 4px; }
  .tflt input { min-height: 48px; }
}
@media (max-width: 699px) { .att-acts button { min-height: 48px; } }

/* ---------- Follow-ups and website enquiries (Conversations; milestone 2) ---------- */
.row.fu { cursor: default; align-items: flex-start; }
.row.fu > div:first-child { min-width: 0; flex: 1; }
.fumsg { white-space: pre-line; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 8px; margin-top: 6px; }
.fuact { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fuact input { flex: 1 1 180px; min-height: 44px; }
.lnk { color: var(--brand-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.row.fuseq { cursor: default; }
.fuon { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.fuon input { width: 20px; height: 20px; accent-color: var(--brand); }
/* Add a lead (milestone 3): two columns from tablet width, one on a phone; invalid answers outlined. */
.formgrid { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.formgrid label { font-size: 12px; color: var(--text-2); font-weight: 500; display: flex; flex-direction: column; }
@media (min-width: 560px) { .formgrid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 699px) { .formgrid input, .formgrid select { min-height: 48px; font-size: 16px; } }
#sheetBody [aria-invalid=true] { border-color: var(--bad, #b42318); }
.row.dim { opacity: .55; cursor: default; } /* a family that can't be booked here (booked in GrowthPilot) */

/* Cut-over report (owner migration screen): plain text, wrapped, scrolls within its card. */
pre.report { white-space: pre-wrap; word-break: break-word; max-height: 60vh; overflow: auto; font-size: 13px; background: var(--card, transparent); padding: 8px; border-radius: 8px; }

/* Monthly trends: "not recorded" and unrecorded counts read as secondary text */
.sheet td .dim { color: var(--text-3); }

/* ---------- Redesign: Business overview, targets, outlook, trends, data health (5 Nov 2026) ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-ink); }
.eyebrow::before { content: ""; width: 22px; height: 1.5px; background: linear-gradient(90deg, var(--accent), transparent); }
.bizhero { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px 20px 14px; margin: 4px 0 16px; position: relative; overflow: hidden; }
.bizhero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--navy-800), var(--navy-600) 60%, var(--accent)); }
.bizhero > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.bizhero > header h2 { font-family: var(--font-serif); font-size: 22px; font-weight: 500; letter-spacing: -.02em; color: var(--heading); margin: 6px 0 4px; }
.bizhero > header .note { max-width: 760px; margin: 0; }
.bkpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.kpi.bk { box-shadow: none; background: var(--surface-2); }
.kpi.bk .v { font-size: 26px; color: var(--navy-800); }
.kpi .na { font-size: 15px; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.tgt { margin-top: 10px; font-size: 12px; color: var(--text-2); }
.tgtbar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin-bottom: 4px; }
.tgtbar i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: var(--navy-600); }
.tgtbar i.on { background: linear-gradient(90deg, var(--gold-600), var(--gold-500)); }
.freshrow { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.freshrow .frl { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; margin-right: 4px; }
.fr { display: inline-flex; gap: 4px; align-items: center; padding: 3px 8px; border-radius: 999px; background: var(--surface-3); }
.fr b { font-weight: 600; color: var(--text); } .fr.unavailable { background: transparent; border: 1px dashed var(--border-strong); } .fr.unavailable b { color: var(--text-3); font-weight: 500; }
.fr.not_read b { color: var(--warn); }
.bizgrid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.bizgrid .panel { margin: 0 0 16px; }
.act { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.act:last-of-type { border-bottom: 0; } .act:hover .t { color: var(--brand); } .act:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: var(--r-sm); }
.act > b { min-width: 52px; font-size: 22px; font-weight: 650; color: var(--navy-800); text-align: right; font-variant-numeric: tabular-nums; }
.act > span { flex: 1; min-width: 0; display: flex; flex-direction: column; } .act .t { font-weight: 600; } .act .s { font-size: 12.5px; color: var(--text-3); }
.olk { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.olk > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.olk .l { font-size: 12.5px; color: var(--text-2); } .olk b { font-size: 20px; color: var(--navy-800); font-variant-numeric: tabular-nums; }
.bizsect { font-family: var(--font-serif); font-size: 20px; font-weight: 500; color: var(--heading); margin: 28px 0 8px; padding-top: 16px; border-top: 1px solid var(--border); }
details.disclose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin: 16px 0; }
details.disclose > summary { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; cursor: pointer; list-style: none; color: var(--text); font-weight: 600; }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary b { margin-left: auto; color: var(--accent-ink); font-weight: 600; font-size: 12.5px; }
details.disclose[open] > summary b { visibility: hidden; } details.disclose[open] > summary .ic:last-child { transform: rotate(180deg); }
details.disclose > .foldin { padding: 0 16px 16px; }
details.disclose.dsub { border: 0; background: none; margin: 6px 0; } details.disclose.dsub > summary { min-height: 36px; padding: 0; font-size: 13px; color: var(--accent-ink); }
details.disclose.dsub > summary::before { content: "▸"; margin-right: 2px; } details.disclose.dsub[open] > summary::before { content: "▾"; }
details.health { border-color: var(--border-strong); }
.mcharts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 12px 0; }
svg.chart path { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .l-a { stroke: var(--navy-600); } svg.chart .l-b { stroke: var(--slate-400); stroke-dasharray: 5 4; } svg.chart .l-c { stroke: var(--gold-600); }
.legend i.l-a { background: var(--navy-600); } .legend i.l-b { background: var(--slate-400); } .legend i.l-c { background: var(--gold-600); }
.tgtform { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; } .tgtform .note, .tgtform button, .tgtform .err { grid-column: 1 / -1; }
@media (max-width: 899px) { .bizgrid, .mcharts { grid-template-columns: 1fr; } }
@media (max-width: 699px) {
  .bizhero { padding: 16px 14px 12px; border-radius: var(--r); } .bizhero > header h2 { font-size: 19px; }
  .bkpis { grid-template-columns: 1fr 1fr; gap: 8px; } .kpi.bk { padding: 12px; } .kpi.bk .v { font-size: 20px; } .kpi .na { font-size: 13px; }
  .olk, .tgtform { grid-template-columns: 1fr; }
}
/* Pipeline intelligence (redesign) */
.pintel { margin: 8px 0 4px; }
button.pstat { all: unset; box-sizing: border-box; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; cursor: pointer; }
button.pstat[disabled] { cursor: default; } button.pstat:not([disabled]):hover { border-color: var(--accent); } button.pstat.on { border-color: var(--accent); background: var(--accent-soft); }
button.pstat:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.pstat.na b { font-size: 15px; color: var(--text-3); }
.na { color: var(--text-3); font-weight: 500; }
.leak { display: grid; gap: 6px; margin: 4px 0 8px; max-width: 760px; }
.lk { display: grid; grid-template-columns: 170px 1fr 56px; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.lk i { display: block; height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--navy-700), var(--navy-500)); width: var(--w, 0%); min-width: 2px; }
.lk b { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.ptable tbody tr { cursor: pointer; } .ptable tbody tr:hover td { background: var(--surface-2); } .ptable td { vertical-align: top; }
@media (max-width: 699px) { .pintel .psummary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .lk { grid-template-columns: 110px 1fr 44px; } }

.pfilters .seg.two { display: inline-flex; flex: none; margin: 0; } .pfilters .seg.two button { min-width: 76px; padding: 0 14px; }
.psum-all { margin: 0 0 10px; }
.secthead2 { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; } .secthead2 h2 { margin-bottom: 6px; }
.salesl tr[data-sale] { cursor: pointer; } .salesl tr[data-sale]:hover td { background: var(--surface-2); }
@media (max-width: 699px) { details.disclose.dsub > summary { min-height: 48px; } } /* the project's phone tap-target standard */
@media (max-width: 699px) { .pfilters .seg.two { grid-column: 1 / -1; align-self: start; } .pfilters .seg.two button { flex: 1; } }
/* Marketing (redesign) */
.mkfresh { border-top: 0; padding-top: 0; margin: 4px 0 12px; }
.journey { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 10px 0 6px; }
.js { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.js:first-child { background: var(--navy-800); border-color: var(--navy-800); color: #fff; } .js:first-child .jl, .js:first-child .note { color: var(--navy-200); } .js:first-child b { color: var(--gold-400); }
.js:last-child { background: var(--accent-soft); border-color: var(--accent); }
.js .jl { font-size: 12px; color: var(--text-2); font-weight: 500; } .js b { font-size: 20px; color: var(--navy-800); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.js em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.mkgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mkgrp { margin: 0; } .mkgrp .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 12px 0; }
.kpi.mk { box-shadow: none; background: var(--surface-2); } .kpi.mk .v { font-size: 21px; color: var(--navy-800); } .kpi.mk .d { display: block; font-size: 11.5px; line-height: 1.4; }
.kpi.mk.hl { background: var(--accent-soft); border-color: var(--accent); }
.mksect { margin: 22px 0 8px; } .mksect > h2 { font-family: var(--font-serif); font-weight: 500; font-size: 20px; color: var(--heading); }
.mcharts:has(> div:nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mktable td { white-space: nowrap; } .mktable td:first-child, .mktable td:last-child { white-space: normal; min-width: 140px; }
.mkother td { background: var(--surface-2); }
svg.chart .pt-a { fill: var(--navy-600); }
.answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ans { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ans .aq { font-weight: 600; display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; } .ans p { margin: 0; font-size: 13.5px; color: var(--text-2); }
ul.evid { display: flex; flex-direction: column; gap: 6px; padding-left: 18px; }
@media (max-width: 1099px) { .journey { grid-template-columns: repeat(4, minmax(0, 1fr)); } .mcharts:has(> div:nth-child(3)) { grid-template-columns: 1fr; } }
@media (max-width: 899px) { .mkgrid, .answers { grid-template-columns: 1fr; } }
@media (max-width: 699px) { .journey { grid-template-columns: 1fr 1fr; } .js b { font-size: 17px; } .mkgrp .kpis { grid-template-columns: 1fr 1fr; } }
/* Data completeness (operational controls) */
.dqgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin: 10px 0; }
.dqm { border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dqh { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 13px; color: var(--text-2); } .dqh b { font-size: 20px; color: var(--navy-800); font-variant-numeric: tabular-nums; }
.dqbar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; } .dqbar i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; }
.dq-ok .dqbar i { background: var(--ok); } .dq-mid .dqbar i { background: var(--warn); } .dq-low .dqbar i { background: var(--bad); } .dq-na { background: transparent; border-style: dashed; }
.dqpanel > header .mini { margin-left: auto; }

/* Growth Advisor (5 Nov 2026): recommendation cards, draft content, calendar demand bars. Website navy and gold tokens. */
.gseg { flex-wrap: wrap; margin: 4px 0 12px; }
.gbody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.gbody > * { min-width: 0; }
.grec { padding: 16px; border-left: 4px solid var(--slate-400, #9aa6bd); }
.grec.act_now { border-left-color: var(--danger, #b42318); }
.grec.investigate { border-left-color: var(--gold-500); }
.grec.monitor { border-left-color: var(--navy-500, #2a4a7f); }
.grec h3, .gdraft h3 { margin: 6px 0 4px; color: var(--heading); font-size: 1.02rem; line-height: 1.35; }
.gtitle { display: flex; flex-wrap: wrap; gap: 6px; }
.gimp { color: var(--gold-700); font-weight: 600; font-size: .9rem; }
.gimp .note { font-weight: 400; color: var(--muted); }
.gcalc { margin-top: .35rem; overflow-wrap: anywhere; }
.gf { display: grid; grid-template-columns: minmax(130px, 200px) 1fr; gap: 6px 14px; margin: 10px 0 0; }
.gf dt { color: var(--text-3); font-size: .82rem; font-weight: 600; }
.gf dd { margin: 0; font-size: .9rem; min-width: 0; overflow-wrap: anywhere; }
.gf dd ul { margin: 0; padding-left: 18px; }
.glife { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line, #e3e7ef); }
.gact { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.gact .gnote { flex: 1 1 180px; min-width: 0; padding: 6px 8px; border: 1px solid var(--line, #d5dbe6); border-radius: 6px; font: inherit; }
.gdraft { padding: 16px; }
.gun h3 { display: flex; gap: 8px; align-items: center; margin: 0 0 6px; font-size: 1rem; }
.gcal header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.gcal h3 { margin: 0; min-width: 140px; }
.gbar { width: 160px; max-width: 40vw; height: 8px; background: var(--gold-100, #f7efdf); border-radius: 4px; overflow: hidden; }
.gbar i { display: block; height: 100%; width: var(--w, 0%); background: var(--gold-500); }
.gform { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.gform label { display: grid; gap: 4px; font-size: .82rem; color: var(--text-3); }
.gform input { width: 110px; padding: 6px 8px; border: 1px solid var(--line, #d5dbe6); border-radius: 6px; font: inherit; }
@media (max-width: 640px) { .gseg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; } .gseg button { flex: 0 0 auto; } .gf { grid-template-columns: 1fr; gap: 2px; } .gf dd { margin-bottom: 8px; } .grec, .gdraft { padding: 12px; } }

.gfresh > summary { cursor: pointer; font-size: .82rem; color: var(--text-3); padding: 4px 0; }
.gfresh[open] > summary { margin-bottom: 4px; }
.gbody .sheet td.note { white-space: normal; min-width: 200px; }
.gdata li { margin-bottom: 4px; }
/* Sales conversion (Growth Advisor phase 2, workstream 1) */
.csub { margin-top: 2px; }
.gcats { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0; }
.gcat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.civ { margin: 10px 0; }
.civ h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gbrief li { margin: 6px 0; }
.sheet.cq td { vertical-align: top; }

/* Sales Dashboard (owners only): its own neutral design. Greys and white, one restrained accent; status colours only for
   meaning (favourable, unfavourable, amber exposure). Single column on phones; charts stack. */
.sd { --sd-ink: #1d2733; --sd-ink-2: #4a5666; --sd-ink-3: #6b7685; --sd-line: #e3e7ec; --sd-bg: #f7f8fa; --sd-card: #ffffff; --sd-accent: #b8893a; --sd-good: #17703f; --sd-bad: #b42318; --sd-amber: #a15c07; color: var(--sd-ink); }
.sd h1 { font-size: 22px; margin: 0; color: var(--sd-ink); font-family: inherit; }
.sd h2 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--sd-ink-3); margin: 22px 0 10px; font-weight: 600; }
.sd h3 { font-size: 14px; margin: 14px 0 6px; color: var(--sd-ink); }
.sd-top { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-end; }
.sd-sub, .sd-note, .sd-cn { color: var(--sd-ink-3); font-size: 12.5px; margin: 4px 0; line-height: 1.45; }
.sd-range { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sd-range button, .sd-custom button, .sd-close { border: 1px solid var(--sd-line); background: var(--sd-card); color: var(--sd-ink-2); border-radius: 8px; height: 32px; padding: 0 12px; font: inherit; font-size: 13px; cursor: pointer; }
.sd-range button.on { background: var(--sd-ink); color: #fff; border-color: var(--sd-ink); }
.sd-range button:focus-visible, .sd-card:focus-visible, .sd-tbl button:focus-visible, .sd-tbl tr:focus-visible, .sd-fstep:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 2px; }
.sd-custom { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sd-custom label { font-size: 12px; color: var(--sd-ink-3); display: inline-flex; gap: 4px; align-items: center; }
.sd-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.sd-headline .sd-card .sd-v { font-size: 30px; }
.sd-card { text-align: left; font: inherit; color: inherit; background: var(--sd-card); border: 1px solid var(--sd-line); border-radius: 12px; padding: 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-width: 0; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.sd-card:hover { border-color: #c9d0d8; }
.sd-card.accent { border: 2px solid var(--sd-accent); }
.sd-card.sev-amber { border-left: 4px solid var(--sd-amber); }
.sd-card.sev-red { border-left: 4px solid var(--sd-bad); }
.sd-k { font-size: 13px; color: var(--sd-ink-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sd-v { font-size: 26px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.sd-cmp { font-size: 12.5px; color: var(--sd-ink-3); }
.sd-chg.good { color: var(--sd-good); font-weight: 600; } .sd-chg.bad { color: var(--sd-bad); font-weight: 600; }
.sd-prev { color: var(--sd-ink-3); }
.sd-split { list-style: none; margin: 0; padding: 0; font-size: 12.5px; color: var(--sd-ink-2); display: grid; gap: 2px; }
.sd-amber { color: var(--sd-amber); font-weight: 600; }
/* W4 sync line: the main ink when current (13.97:1 on the page background; the note grey was 4.26:1); amber when not. */
.sd-cn.sd-sync { color: var(--sd-ink); }
.sd-cn.sd-sync.sd-amber { color: var(--sd-amber); }
/* Read by screen readers, not shown (the sync status announcement). */
.sd-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sd-badge { font-size: 10.5px; font-weight: 600; letter-spacing: .03em; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--sd-line); color: var(--sd-ink-3); background: var(--sd-bg); }
.sd-badge.ok { color: var(--sd-good); border-color: #cfe5d8; background: #f1f8f4; }
.sd-badge.warn { color: var(--sd-amber); border-color: #f1dcc0; background: #fdf7ee; }
.sd-badge.off { color: var(--sd-ink-3); }
.sd-skel { background: linear-gradient(90deg, #eef1f4, #f6f8fa, #eef1f4); background-size: 200% 100%; animation: sdpulse 1.2s ease-in-out infinite; border-radius: 12px; min-height: 120px; }
.sd-skel.h { min-height: 200px; } .sd-skel.t { min-height: 140px; }
@keyframes sdpulse { 0% { background-position: 0 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sd-skel { animation: none; } }
.sd-err { padding: 14px; border: 1px solid #f3c9c4; background: #fdf4f3; color: var(--sd-bad); border-radius: 10px; font-size: 13px; }
.sd-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
.sd-chart { margin: 0; background: var(--sd-card); border: 1px solid var(--sd-line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.sd-chart.wide { grid-column: 1 / -1; }
.sd-chart figcaption { font-size: 13px; font-weight: 600; color: var(--sd-ink-2); margin-bottom: 8px; }
.sd-chart svg { width: 100%; height: auto; display: block; }
.sd-t { font-size: 13px; fill: var(--sd-ink-2); } .sd-t.b { font-weight: 600; fill: var(--sd-ink); } .sd-t.s { font-size: 11px; fill: var(--sd-ink-3); }
.sd-bar { fill: #4b5d73; } .sd-line { fill: none; stroke: var(--sd-accent); stroke-width: 2.5; }
.sd-fstep { cursor: pointer; } .sd-fstep:hover .sd-bar { fill: #2f3f52; }
.sd-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; padding: 0; margin: 6px 0 0; font-size: 12px; color: var(--sd-ink-2); }
.sd-tablewrap { overflow-x: auto; background: var(--sd-card); border: 1px solid var(--sd-line); border-radius: 12px; }
.sd-tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.sd-tbl th, .sd-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--sd-line); text-align: left; white-space: nowrap; }
.sd-tbl th.num, .sd-tbl td.num { text-align: right; }
.sd-tbl th button { border: 0; background: none; font: inherit; font-weight: 600; color: var(--sd-ink-2); cursor: pointer; padding: 0; }
.sd-tbl tbody tr[data-sdrow] { cursor: pointer; } .sd-tbl tbody tr[data-sdrow]:hover { background: var(--sd-bg); }
.sd-act { list-style: none; padding: 0; margin: 0; background: var(--sd-card); border: 1px solid var(--sd-line); border-radius: 12px; }
.sd-act li { padding: 9px 12px; border-bottom: 1px solid var(--sd-line); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.sd-act time { color: var(--sd-ink-3); font-size: 12px; min-width: 150px; }
.sd-ev { font-weight: 600; } .sd-ev.payment { color: var(--sd-good); } .sd-ev.cancellation { color: var(--sd-amber); }
.sd-detail { margin-top: 12px; background: var(--sd-card); border: 1px solid var(--sd-line); border-radius: 12px; padding: 12px 14px; }
.sd-drill code { font-size: 11.5px; color: var(--sd-ink-3); }
@media (max-width: 640px) { .sd-cards, .sd-charts { grid-template-columns: 1fr; } .sd-v { font-size: 24px; } .sd-headline .sd-card .sd-v { font-size: 26px; } .sd-act time { min-width: 0; width: 100%; } }
.sd-chart .sd-tbl th, .sd-chart .sd-tbl td { padding: 7px 8px; }
.sd-chart.wide svg { max-height: 300px; }
.sd-custom[hidden] { display: none; }
.sd-legend li { display: inline-flex; align-items: center; gap: 6px; }

/* Sales Dashboard cards (usability pass): a container with a full-card drill button and a "How calculated" disclosure */
.sd-card { cursor: default; } .sd-card:has(.sd-hit:hover) { border-color: #c9d0d8; }
.sd-hit { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
.sd-hit:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 4px; border-radius: 6px; }
.sd-warn { margin-top: 2px; }
.sd-how { margin-top: 8px; border-top: 1px solid var(--sd-line); padding-top: 6px; }
.sd-how summary { font-size: 12px; color: var(--sd-ink-2); cursor: pointer; list-style-position: inside; }
.sd-how summary:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 2px; }
.sd-how ul { margin: 6px 0 0; padding-left: 16px; font-size: 12px; line-height: 1.45; color: var(--sd-ink-2); }
@media (min-width: 340px) and (max-width: 640px) {
  .sd-cards.sd-headline { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sd-headline .sd-card { padding: 10px 12px; } .sd-headline .sd-card .sd-v { font-size: 20px; }
  .sd-headline .sd-k, .sd-headline .sd-cmp, .sd-headline .sd-split li, .sd-headline .sd-how summary { font-size: 11.5px; }
  .sd-headline .sd-badge { font-size: 10px; }
}

.sd-na { font-size: .62em; font-weight: 600; color: var(--sd-ink-3); letter-spacing: 0; }
/* Sales Dashboard Overview (W5): sd-ov* class names; text uses --sd-ink (#1d2733) and --sd-ink-2 (#4a5666),
   both ≥4.5:1 on --sd-card (#fff) and --sd-bg (#f7f8fa). */
/* Section h3s inside .sd-sec match the former h2 style so the Detailed reporting sections look unchanged. */
.sd-sec .sd-sec h3 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--sd-ink-3); margin: 22px 0 10px; font-weight: 600; }
/* Overview controls row */
.sd-ov-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; position: relative; }
.sd-ov-srclabel { font-size: 13px; color: var(--sd-ink-2); }
.sd-ov-select { font: inherit; font-size: 13px; color: var(--sd-ink); border: 1px solid var(--sd-line); border-radius: 8px; background: var(--sd-card); padding: 6px 10px; cursor: pointer; }
.sd-ov-select:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 2px; }
.sd-ov-metbtn { border: 1px solid var(--sd-line); background: var(--sd-card); color: var(--sd-ink-2); border-radius: 8px; height: 32px; padding: 0 12px; font: inherit; font-size: 13px; cursor: pointer; }
.sd-ov-metbtn:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 2px; }
.sd-ov-metpanel { position: absolute; top: 38px; left: 0; z-index: 10; background: var(--sd-card); border: 1px solid var(--sd-line); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 4px 12px rgba(16,24,40,.10); min-width: 180px; }
.sd-ov-metitem { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--sd-ink); cursor: pointer; }
.sd-ov-metitem input { accent-color: var(--sd-accent); }
.sd-ov-filtered { font-size: 13px; color: var(--sd-ink-2); margin: 0 0 10px; }
/* Overview panels grid */
.sd-ov-panels { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; } /* (review) panels stacked full width, so every column of the Unreconciled and By source tables is visible on desktop */
.sd-ov-panel, .sd-ov-panels > * { min-width: 0; } /* (review) a wide table scrolls in its own box instead of widening the page */
.sd-ov-panel { background: var(--sd-card); border: 1px solid var(--sd-line); border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.sd-ov-panel > h3 { margin-top: 0; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--sd-ink-3); font-weight: 600; margin-bottom: 12px; }
/* Whole business: 8 small cards in a grid */
.sd-ov-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.sd-ov-card { background: var(--sd-card); border: 1px solid var(--sd-line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.sd-ov-card .sd-k { font-size: 12px; color: var(--sd-ink-2); display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.sd-ov-card .sd-v { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; color: var(--sd-ink); }
.sd-ov-card .sd-na { font-size: .7em; font-weight: 600; color: var(--sd-ink-2); }
.sd-ov-basis { font-size: 11px; color: var(--sd-ink-2); }
.sd-ov-rate { font-size: .55em; font-weight: 400; color: var(--sd-ink-2); margin-left: 4px; }
/* Cash collection panel */
.sd-ov-cashline { margin: 0 0 12px; font-size: 14px; color: var(--sd-ink); display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.sd-ov-cashlabel { color: var(--sd-ink-2); font-size: 13px; }
.sd-ov-cashval { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; color: var(--sd-ink); }
/* Unreconciled block: left border and neutral background to visually separate from cash */
.sd-ov-unrec { border-left: 3px solid var(--sd-amber); background: var(--sd-bg); border-radius: 0 8px 8px 0; padding: 10px 14px; margin-top: 4px; }
.sd-ov-unrec-head { font-weight: 600; font-size: 13px; color: var(--sd-ink); margin: 0 0 6px; }
.sd-ov-settled { font-size: 13px; color: var(--sd-ink); margin: 4px 0 8px; }
.sd-ov-flagged { margin-top: 10px; }
.sd-ov-fglabel { font-size: 12px; font-weight: 600; color: var(--sd-ink-2); margin: 0 0 4px; }
.sd-ov-fgnote { font-size: 12px; color: var(--sd-ink-2); margin: 6px 0 0; }
.sd-ov-totalopen { font-size: 12.5px; color: var(--sd-ink-2); margin: 10px 0 4px; border-top: 1px solid var(--sd-line); padding-top: 8px; }
.sd-ov-note { font-size: 12px; color: var(--sd-ink-2); margin: 6px 0 0; font-style: italic; }
.sd-ov-chnote { font-size: 12px; margin: 4px 0 0; }
.sd-ov-unknown { color: var(--sd-ink-2); font-style: italic; }
.sd-ov-unrec-err { color: var(--sd-bad); font-size: 13px; padding: 8px 0; }
/* Drill buttons inside overview tables: look like text, underline on hover */
.sd-ov-drbtn { background: none; border: 0; padding: 0; font: inherit; font-size: inherit; color: var(--sd-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: transparent; }
.sd-ov-drbtn:hover { text-decoration-color: var(--sd-ink-2); }
.sd-ov-drbtn:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 2px; border-radius: 3px; text-decoration: none; }
/* By source panel */
.sd-ov-switch { display: inline-flex; border: 1px solid var(--sd-line); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.sd-ov-sw { border: 0; background: var(--sd-card); color: var(--sd-ink-2); padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.sd-ov-sw + .sd-ov-sw { border-left: 1px solid var(--sd-line); }
.sd-ov-sw.on, .sd-ov-sw[aria-pressed="true"] { background: var(--sd-ink); color: #fff; }
.sd-ov-sw:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: -2px; }
.sd-ov-classes { font-size: 11px; color: var(--sd-ink-2); font-weight: 400; }
.sd-ov-srcnote { font-size: 12px; color: var(--sd-ink-2); margin: 8px 0 0; }
/* Total row in source/channel tables */
.sd-ov-total th, .sd-ov-total td { font-weight: 600; border-top: 1px solid var(--sd-line); }
@media (max-width: 640px) { .sd-ov-panels { grid-template-columns: minmax(0, 1fr); } .sd-ov-cards { grid-template-columns: repeat(2, 1fr); } }
/* (review) The two new page headings, Overview and Detailed reporting: same look as the section headings, in --sd-ink-2 (7:1) because --sd-ink-3 is 4.26–4.34:1 on the page. */
.sd > .sd-sec > h2#sdOvH, .sd > .sd-sec > h2#sdDrH { color: var(--sd-ink-2); }
.sd-ov-card .sd-badge.off { color: var(--sd-ink-2); } /* (review) the shared grey badge is 4.34:1 on its own background; 7:1 here */
/* (review) The Metrics panel: [hidden] must win over display:flex; checkboxes at their normal size; the Source select sized to its content. */
.sd-ov-metpanel[hidden] { display: none; }
.sd-ov-metitem input[type=checkbox] { width: 20px; height: 20px; min-height: 20px; padding: 0; margin: 0; flex: none; } /* as .hrs checkboxes; the whole label is the tap target */
.sd-ov-select { width: auto; }
/* (review) On phones, Overview row labels wrap so the Unreconciled tables fit at 390 px; the By source table still scrolls in its box. */
@media (max-width: 640px) { .sd-ov-unrec .sd-tbl th, .sd-ov-unrec .sd-tbl td { white-space: normal; } .sd-ov-unrec .sd-tbl th[scope=row] { min-width: 6em; } .sd-ov-unrec .sd-tbl th, .sd-ov-unrec .sd-tbl td { padding: 6px 5px; } .sd-ov-unrec .sd-tbl { font-size: 12px; } .sd-ov-panel { padding: 12px; } .sd-ov-unrec { padding: 8px 8px; } }

/* Owners' contact directory in Families (C1–C6, FEATURE_FAMILIES_DIRECTORY) */
.famdir { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; margin: 0 0 12px; display: grid; gap: 8px; min-width: 0; }
.famdir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 12px; }
.famdir-grid label { display: grid; gap: 4px; font-size: 12px; color: var(--text-3); margin: 0; min-width: 0; }
.famdir-grid select, .famdir-grid input { width: 100%; min-width: 0; }
.famdir-foot { display: flex; gap: 8px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.famdir-foot .note { flex: 1 1 260px; }
.famdir-err { margin: 0; color: var(--bad); font-size: 13px; font-weight: 600; }
@media (max-width: 640px) { .famdir-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .famdir-grid select, .famdir-grid input { font-size: 14px; } }

/* Release 4: Calendar "Whose calendar" (people assigned to calls) and "Open in GrowthPilot" links */
.calstaff { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 4px 0 10px; min-width: 0; }
.calstaff .flt { min-width: 0; max-width: 100%; } .calstaff select { max-width: 100%; }
.row.ev[role=button] { cursor: pointer; }
a.gplink { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; width: auto; }
.gpacts { margin: 10px 0 4px; }
/* Release 4: Contacts area (Families directory and Leads side by side) */
.contactsnav { margin: 0 0 10px; }
/* Release 4: Pipeline lost-reason report */
.lostr { margin-top: 16px; } .lostr .flts { align-items: flex-end; } .lostr .flt input[type=date] { min-height: 36px; max-width: 100%; }
.lostt td:first-child { white-space: normal; }

/* Monthly Reporting (owners only; behind features.monthlyReporting) */
.mr-top { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 12px; }
.mr-controls { display: flex; flex-wrap: wrap; gap: 12px; } .mr-controls label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.mr-table td, .mr-table th[scope="row"] { height: auto; padding: 8px 12px; vertical-align: top; white-space: normal; }
.mr-table td.n { min-width: 150px; } .mr-table th[scope="row"] { position: sticky; left: 0; background: var(--surface); z-index: 1; text-align: left; font-weight: 500; min-width: 180px; }
.mr-sec th { background: var(--surface-2); color: var(--text); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; position: static; }
.mr-part th, .mr-part td { color: var(--text-2); font-size: 12.5px; } .mr-part th.indent { padding-left: 28px; }
.mr-def { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.mr-def:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.mr-badge { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 999px; margin-left: 4px; vertical-align: middle; border: 1px solid var(--border); color: var(--text-2); }
.mr-badge.warn { border-color: #c9a45c; color: #7a5b1e; } .mr-chg { display: block; font-size: 11.5px; color: var(--text-2); margin-top: 2px; }
.mr-chg.good { color: #2f7d4f; } .mr-chg.bad { color: #b4433a; }
.mr-more { margin: 12px 0; } .mr-more summary { cursor: pointer; font-weight: 600; padding: 6px 0; } .mr-defs td { white-space: normal; height: auto; padding: 8px 12px; vertical-align: top; }
.mr-defs code { font-size: 11.5px; word-break: break-word; } .mr-open { padding-left: 18px; line-height: 1.5; max-width: 72ch; }
@media (max-width: 700px) { .mr-table td.n { min-width: 120px; } .mr-table th[scope="row"] { min-width: 130px; } }
@media (prefers-reduced-motion: reduce) { .mr * { transition: none !important; } }

/* Monthly Reporting: basis line, headline row, drill-down cells */
.mr-basis { font-size: 11.5px; color: var(--text-2); font-weight: 400; margin-top: 2px; } .mr-head th, .mr-head td { background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.mr-tap { cursor: pointer; } .mr-tap:hover b { text-decoration: underline; } .mr-tap:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; } .mr-calc { margin: 0 0 8px; }


.mr-table .mr-head th[scope="row"] { background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }

/* Monthly Reporting v1 (Kiaan brief): channel toggle, sticky section headings, frozen metric column, states */
.mr-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; align-self: flex-end; }
.mr-seg button { border: 0; background: var(--surface); padding: 8px 14px; font: inherit; cursor: pointer; color: var(--text-2); } .mr-seg button + button { border-left: 1px solid var(--border); }
.mr-seg button.on { background: var(--brand); color: #fff; } .mr-seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.mr-wrap { max-height: calc(100vh - 230px); }
.mr-table thead th { position: sticky; top: 0; z-index: 4; }
.mr-table .mr-sec th { position: sticky; top: 39px; z-index: 3; background: var(--surface-2); }
.mr-table .mr-sec th > span:first-child { position: sticky; left: 12px; }
.mr-table th.mr-label, .mr-table th[scope="row"] { position: sticky; left: 0; z-index: 2; background: var(--surface); min-width: 220px; max-width: 280px; white-space: normal; }
.mr-table thead th.mr-label { z-index: 5; background: var(--surface-2); }
.mr-table td.n { min-width: 108px; white-space: nowrap; } .mr-table td.mr-all, .mr-table th.mr-all { background: color-mix(in srgb, var(--brand) 5%, var(--surface)); font-weight: 600; }
.mr-secnote { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-2); font-size: 11.5px; margin-left: 8px; }
.mr-na, .mr-nr { color: var(--text-2); font-style: italic; } .mr-dash { color: var(--text-2); } .mr-part::after { content: ' *'; color: #7a5b1e; }
.mr-amber { background: #fdf3dc !important; color: #7a5b1e; } .mr-red { color: #b4433a; font-weight: 600; }
.mr-skel { display: inline-block; width: 56px; height: 12px; border-radius: 4px; background: var(--surface-2); animation: mrpulse 1.2s ease-in-out infinite; }
@keyframes mrpulse { 50% { opacity: .5; } } @media (prefers-reduced-motion: reduce) { .mr-skel { animation: none; } }
@media (max-width: 700px) { .mr-table th.mr-label, .mr-table th[scope="row"] { min-width: 140px; max-width: 160px; } .mr-wrap { max-height: none; } }
.mr-controls { align-items: flex-end; }

/* Monthly Reporting: compact key below the grid; headings and metric column stay visible while scrolling, phones included */
.mr-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--text-2); margin: 8px 0 4px; }
.mr-legend i { font-style: italic; } .mr-amberkey { background: #fdf3dc; color: #7a5b1e; padding: 0 4px; border-radius: 3px; font-weight: 600; }
@media (max-width: 700px) { .mr-wrap { max-height: calc(100vh - 210px); } }
/* Release 5: Tracking sub-navigation (Monthly Reporting, Performance, KPI registry, data completeness); trk-* class names */
.trk-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; min-width: 0; }
.trk-link { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; text-decoration: none; width: auto; min-height: 32px; }
.trk-link.on { background: var(--brand); border-color: var(--brand); color: #fff; cursor: default; }
.trk-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.card.notice.famgroups p { margin: 6px 0 10px; }
.lostt .lsrc, .pc-f .lsrc { display: block; font-size: 12px; color: var(--text-3); font-weight: 400; } .lostr .lostdate { color: var(--text-2); }
.famdir[hidden] { display: none; }
/* ---------- Release 6: unified navigation (owners, features.unifiedNav) and Conversations (metadata only) ---------- */
/* Desktop and tablet: the seven screens, then More (Today, Sales, Growth, Business, Health, Compare, Operations). Phones:
   Dashboard, Contacts, Calendars, Conversations and More; Opportunities, Tracking and Campaigns open from More there. */
nav#tabs.unified button[data-more] { display: none; }
nav#tabs.unified button[data-tab="more"]:not([hidden]) { display: flex; }
@media (max-width: 699px) { nav#tabs.unified button[data-phone-more] { display: none; } }
.cmp-spend { display: flex; align-items: flex-start; gap: 8px; border-left: 3px solid var(--accent); }
.cmp-spend b { color: var(--heading); }
.cm-tiles .kpi .v .cm-ch { display: inline-block; font-size: 14px; font-weight: 500; margin: 2px 10px 2px 0; white-space: nowrap; }
.cm-tiles .kpi .v .cm-ch b { font-weight: 650; }
.cm-fam { cursor: pointer; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.cm-fam:hover { text-decoration-color: currentColor; } .cm-fam:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }
.cm-filters .toolbar { flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.cm-table td .gplink { white-space: nowrap; } .cm-only { margin-left: 6px; }
.cm-row { align-items: flex-start; } .cm-row .gplink { margin-top: 6px; display: inline-flex; }
.cm-links .row { align-items: center; gap: 8px; } .cm-links .row > div { min-width: 0; }
@media (max-width: 699px) { .cm-only { display: none; } .cm-filters .pselect, .cm-filters .pselect select { width: 100%; } }

/* Trackers (web/trackers.js): the page's security policy allows no inline styles, so they live here. Editable cells keep a readable width. */
.tk table.sheet select,.tk select{font:inherit;width:auto;min-width:8.5em;max-width:13em}
.tk input{font:inherit;max-width:13em}
.tk input[type=text]{min-width:10em}
.tk-src{font-size:11px;color:var(--text-2)}
.tk-bad{color:var(--danger,#b00020);font-weight:600}
.tk-ok{color:var(--text-2)}
.tk-c th{font-weight:700}
.tk-i1{padding-left:24px!important}
.tk-i2{padding-left:44px!important}
