/* Add Benefits | Data Intelligence. One stylesheet, design tokens as custom properties.
   Brand pass (Phase 4 unit U48a, spec P4-D28 and Section 12; decisions/2026-11-02_U48a-brand.md): the Add Benefits
   brand kit replaces the tool flow v2 look (indigo, Inter, 16 px radii). The token names are unchanged; their values
   are the kit's: navy headings and ink, charcoal body text, blue links and structure, button orange for the primary
   button, the orange accent for small marks only (never text, never the focus ring), the pale background for sunk
   surfaces and alternate rows, the subtle rule for hairlines. Arial throughout (a system font: nothing to load). Light
   only, as before (the kit has no dark theme). No shadows; 4 px buttons and controls, 8 px cards. Every text and
   background pair defined here passes WCAG AA (tests/web/visual-system.test.ts and tests/web/brand.test.ts check
   them). Phone first; every interactive element has a visible focus ring; motion respects prefers-reduced-motion. */

:root {
  color-scheme: light;
  /* brand (assets/brand/brand_tokens.json) */
  --navy: #142D4E;
  --on-navy: #ffffff;
  --brand-blue: #1559B7;
  --brand-orange: #F28A2E;
  --button: #B94F0C;
  --button-hover: #9A420A;
  --on-button: #ffffff;
  /* surfaces */
  --bg: #ffffff;
  --surface: #ffffff;
  --sunk: #F0F4FA;
  --info-soft: #E8F0FB;
  /* text: navy ink for headings, labels and emphasis; charcoal (--ink-2) for body text; --muted is secondary text and
     passes on white and on every pale fill; --muted-strong stays the darker secondary grey inside pale fills (C18) */
  --ink: #142D4E;
  --ink-2: #303942;
  --muted: #5C6675;
  --muted-strong: #4A5361;
  --faint: #5C6675;
  /* lines: --rule is the kit's subtle hairline (decorative); --rule-strong outlines form controls and option cards and
     stands out from white by 3:1 (WCAG 1.4.11) */
  --rule: #D9E2EE;
  --rule-strong: #7D8CA1;
  /* container edges (Scott 2026-11-03: tiles, cards, columns and tables must stand apart on white at a glance):
     about 2.4:1 against white, between the decorative hairline and the 3:1 control outline. --rule-row divides table rows. */
  --edge: #9AAABF;
  --rule-row: #C5D0DE;
  --rule-hover: #5C6675;
  --track: #D9E2EE;
  /* accent (brand blue: links, structure, selection) */
  --accent: #1559B7;
  --accent-hover: #10468F;
  --accent-soft: #E8F0FB;
  --accent-line: #B9CDEA;
  --on-accent: #ffffff;
  --on-ink: #ffffff;
  --selected: #142D4E;
  /* states: never colour alone (each comes with a label or an icon) */
  --ok: #1D6B46;
  --ok-soft: #E5F3EB;
  --warn: #7A4B05;
  --warn-soft: #FCF0DB;
  --bad: #A3291B;
  --bad-soft: #FBE8E5;
  --info: #124C9C;
  --focus: #142D4E;
  /* no shadows; kept as tokens so older rules resolve to nothing */
  --shadow-1: none;
  --shadow-2: none;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-xs: 4px;
  --radius-pill: 999px;
  --sans: Arial, Helvetica, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --header-h: 64px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;
}

/* Pale fills: secondary text inside them switches to the darker grey, so .muted, .hint and notes stay AA (C18). */
.notice, .info-box, .continue-card, .cp-result, .fit-label, .stage[data-state="done"], .choice-card:has(input:checked), .choice-card.is-selected, .badge-accent, .badge-high {
  --muted: var(--muted-strong);
  --faint: var(--muted-strong);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; overflow-wrap: break-word; }
/* Words break only when one cannot fit its line (U55: `anywhere` split ordinary words mid-word in narrow cells, and
   its zero min-content let table columns shrink to a few letters). Machine strings (ids, emails, URLs, hashes) carry
   .machine and may break at any character, so a long one never widens the page. */
td, dd, .kv dd, .choice-label { overflow-wrap: break-word; word-break: normal; }
.machine, code { overflow-wrap: anywhere; word-break: normal; }
/* In a data table a key or a code keeps one line; the table scrolls inside its .table-wrap. */
table.data td code { overflow-wrap: normal; white-space: nowrap; }
/* Headings in navy; Arial needs no negative tracking (the old values were tuned for Inter). */
h1, h2, h3, h4 { line-height: 1.22; margin: 0 0 var(--space-3); color: var(--ink); letter-spacing: 0; }
h1 { font-size: clamp(1.65rem, 4.6vw, 2.25rem); font-weight: 700; }
h2 { font-size: clamp(1.25rem, 3vw, 1.5rem); font-weight: 700; }
h3 { font-size: 1.0625rem; font-weight: 700; }
p { margin: 0 0 var(--space-4); }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
small, .small { font-size: 0.875rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--space-6) 0; }
code, .mono { font-family: var(--mono); font-size: 0.9em; }
/* U55: preformatted text (template bodies and samples) wraps inside its box instead of widening the page. */
pre { white-space: pre-wrap; overflow-wrap: break-word; max-width: 100%; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* Focus: a 2 px navy outline with a 2 px offset on every control (never orange: the accent fails 3:1 on white). */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-xs); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: var(--radius-xs); z-index: 100; }
.skip-link:focus { left: 8px; color: var(--on-accent); }

/* Inline line icons (src/web/icons.ts, Lucide): sized by the surrounding text, coloured by currentColor. */
.icon { display: inline-block; width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.22em; }

/* ---------------------------------------------------------------- header and footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--rule); }
.site-header .bar { max-width: 1200px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
/* The header brand (DataLot, 2026-12-03; src/brand.ts LOGO): the DataLot cube and word (assets/brand/datalot/logo.webp,
   258 by 72, served from /assets/brand/) at 30 CSS px tall, never stretched (width follows the artwork's ratio); clear
   space around it is the 12 px gap and the header padding. Staff and broker pages set their area as text beside it,
   after a blue rule. The Add Benefits kit logo (U48a) is now only the company logo of an email preview (.company-logo),
   at 180 CSS px wide, the kit manual's proposed digital minimum, height following its 1999 by 416 ratio. */
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 700; letter-spacing: 0; }
.brand:hover { color: var(--ink); }
.brand-logo { display: block; height: 30px; width: auto; aspect-ratio: 258 / 72; flex: none; }
.company-logo { display: block; width: 180px; height: auto; aspect-ratio: 1999 / 416; flex: none; }
.brand-sub { display: inline-flex; align-items: center; color: var(--ink); font-weight: 700; font-size: 1.0625rem; line-height: 1.2; padding-left: 12px; border-left: 2px solid var(--brand-blue); }
.site-nav { display: flex; gap: 4px 18px; flex-wrap: wrap; align-items: center; font-size: 0.9375rem; }
.site-nav a { color: var(--muted-strong); text-decoration: none; padding: 6px 2px; border-bottom: 2px solid transparent; font-weight: 400; }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
/* The current page: navy bold text (the label, not the colour, carries the state) over a small orange accent. */
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--brand-orange); }
.site-nav form { display: inline; }
.site-nav .btn-link { color: var(--muted-strong); text-decoration: none; font-weight: 500; }
.site-nav .btn-link:hover { color: var(--ink); text-decoration: underline; }
.site-footer { margin-top: var(--space-7); border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.85rem; }
.site-footer .bar { max-width: 1200px; margin: 0 auto; padding: 18px 24px; display: flex; gap: 8px 20px; flex-wrap: wrap; justify-content: space-between; }
/* The staff header: the same light header as the client side (it was dark before tool flow v2). */
.internal-header { background: var(--surface); border-bottom: 1px solid var(--rule); }
.env-flag { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; background: var(--warn-soft); color: var(--warn); padding: 3px 8px; border-radius: var(--radius-pill); }
/* The open test preview's banner (src/worker.ts, PREVIEW_BANNER): on every page, never dismissible. */
.preview-banner { background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 0.875rem; text-align: center; padding: 8px 16px; border-bottom: 1px solid var(--warn); }

/* The journey header (clientJourneyShell): frosted, sticky, the wordmark left and "Saved", "Save and exit", the
   account controls right. */
.journey-header { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, 0.86); -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .journey-header { background: var(--surface); } }
.journey-header .bar { padding-top: 12px; padding-bottom: 12px; min-height: var(--header-h); }
.journey-actions { display: flex; align-items: center; gap: 10px 16px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.journey-account { display: flex; align-items: center; gap: 12px; }
.journey-account form { display: inline; }
.journey-account .btn-link { color: var(--muted-strong); text-decoration: none; font-size: 0.875rem; font-weight: 500; }
.journey-account .btn-link:hover { color: var(--ink); text-decoration: underline; }
.saved-indicator { display: inline-flex; align-items: center; min-height: 1.5em; font-size: 0.875rem; font-weight: 500; color: var(--ok); }
.saved-indicator .saved-done { display: inline-flex; align-items: center; gap: 6px; }
.saved-indicator .icon { width: 16px; height: 16px; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 0.8rem; font-weight: 600; flex: none; letter-spacing: 0; }
@media (max-width: 560px) {
  .site-header .bar { padding: 10px 16px; }
  .journey-header .bar { min-height: 0; }
  .avatar { display: none; }
}
/* The narrowest phones: the logo steps down to 26 px tall so the logo and an area label keep one line. */
@media (max-width: 380px) {
  .brand { gap: 10px; }
  .brand-logo { height: 26px; }
  .brand-sub { font-size: 0.9375rem; padding-left: 10px; }
}

/* ---------------------------------------------------------------- layout */
.container { max-width: 1120px; margin: 0 auto; padding: var(--space-6) 20px; }
.narrow { max-width: 680px; margin: 0 auto; padding: var(--space-6) 20px var(--space-8); }
/* Journey layouts (clientJourneyShell `layout`): narrow keeps .narrow; wide is the centred picker column; split is the
   two-column question page (left: eyebrow, heading, helper; right: the form), one column under 1024 px. */
.journey { margin: 0 auto; padding: var(--space-6) 20px var(--space-7); }
.journey-wide { max-width: 860px; }
.journey-split { max-width: 680px; }
.journey-intro { margin-bottom: var(--space-5); }
.journey-intro .eyebrow { margin-bottom: var(--space-3); }
.journey-title { font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 700; line-height: 1.15; letter-spacing: 0; margin: 0 0 var(--space-3); }
.journey-helper { color: var(--muted); font-size: 1.0625rem; max-width: 46ch; margin: 0; }
.journey-main { min-width: 0; }
@media (min-width: 1024px) {
  .journey-split { max-width: 1200px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 0 72px; align-items: start; padding: 56px 40px var(--space-7); }
  .journey-split > .journey-top { grid-column: 1 / -1; }
  .journey-split .journey-intro { position: sticky; top: calc(var(--header-h) + 32px); margin-bottom: 0; }
}
.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-6); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
/* minmax(0, 1fr), never bare 1fr: a bare 1fr column is at least as wide as its widest table, and that widened the page
   at phone widths (U55); a table scrolls inside its own .table-wrap instead. */
.grid-2 { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.grid-3 { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Small grey label above a heading. */
.eyebrow { font-size: 0.875rem; font-weight: 600; color: var(--muted); margin: 0 0 var(--space-2); letter-spacing: 0; }
.lede { font-size: 1.0625rem; color: var(--muted); max-width: 60ch; }

/* ---------------------------------------------------------------- cards and surfaces */
.card { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: var(--space-5); }
.card > :last-child { margin-bottom: 0; }
.card-quiet { background: var(--sunk); border-color: transparent; }
.card h2, .card h3 { margin-bottom: var(--space-2); }
a.card { display: block; color: inherit; text-decoration: none; transition: border-color 0.15s var(--ease); }
a.card:hover { border-color: var(--rule-hover); }

/* ---------------------------------------------------------------- buttons */
/* The kit's button: 44 px minimum height, 4 px radius, 16 px Arial Bold. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--radius-sm); border: 1px solid transparent; font: 700 1rem/1 var(--sans); cursor: pointer; text-decoration: none; transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease); white-space: nowrap; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
/* One primary style: the kit's button orange with white text; .btn-accent is the same button (kept as a class so
   templates and tests need no change). */
.btn-primary, .btn-accent { background: var(--button); border-color: var(--button); color: var(--on-button); }
.btn-primary:hover, .btn-accent:hover { background: var(--button-hover); border-color: var(--button-hover); color: var(--on-button); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--rule-strong); }
.btn-secondary:hover { border-color: var(--rule-hover); background: var(--sunk); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunk); color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: var(--bad); }
/* Smaller text and padding, the same 44 px minimum height (the kit sets one minimum for every button). */
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 0.875rem; border-radius: var(--radius-sm); }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 0; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- notices, badges, tags */
.notice { border-radius: var(--radius-sm); padding: 14px 16px; background: var(--info-soft); color: var(--ink); border: 1px solid transparent; }
.notice-ok { background: var(--ok-soft); }
.notice-warn { background: var(--warn-soft); }
.notice-bad { background: var(--bad-soft); }
.notice > :last-child { margin-bottom: 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; line-height: 1.4; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--sunk); color: var(--ink-2); border: 1px solid var(--rule); white-space: nowrap; }
.badge-accent, .badge-high { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge-demo { background: var(--warn-soft); color: var(--warn); border-color: transparent; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.7rem; }
.tag-verified { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag-unverified { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag-unknown { background: var(--sunk); color: var(--muted); }

/* ---------------------------------------------------------------- forms */
.field { display: block; margin: 0 0 var(--space-4); }
.field > label, .field-label { display: block; font-weight: 600; margin-bottom: 6px; }
.hint { display: block; color: var(--muted); font-size: 0.875rem; margin-top: 4px; }
input[type="text"], input[type="email"], input[type="search"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="tel"], input[type="month"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); padding: 10px 14px; min-height: 44px;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
/* U62 C23: a text box is as tall as its rows (2 rows is about 68px); the old 120px floor made every box tall. */
textarea { min-height: 68px; resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--accent); }
.error-text { color: var(--bad); font-size: 0.9rem; margin-top: 6px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
.checkline { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; }
.checkline input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.free-text-hint { display: block; width: fit-content; max-width: 100%; font-size: 0.85rem; color: var(--muted); background: var(--sunk); border: 1px solid var(--edge); border-radius: var(--radius-xs); padding: 6px 10px; margin-top: 8px; }
/* A search box with the search icon inside it (the picker). */
.search-field { position: relative; margin: 0 0 var(--space-3); }
.search-field .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 42px; }
/* Joined two-cell fields: count + counted on, From + To, employees today + at peak. One bordered box, a divider
   between the cells, each cell its own label and control. Stacks under 360 px. */
.joined-field { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--surface); }
.joined-field:focus-within { border-color: var(--accent); }
.joined-cell { display: flex; flex-direction: column; min-width: 0; }
.joined-cell + .joined-cell { border-left: 1px solid var(--rule-strong); }
.joined-cell > label, .joined-cell > .joined-label { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--muted); padding: 10px 14px 0; margin: 0; }
.joined-field input, .joined-field select { border: 0; border-radius: 0; background: transparent; min-height: 40px; padding: 2px 14px 10px; }
.joined-cell:first-child input, .joined-cell:first-child select { border-bottom-left-radius: var(--radius-sm); }
.joined-cell:last-child input, .joined-cell:last-child select { border-bottom-right-radius: var(--radius-sm); }
@media (max-width: 359px) {
  .joined-field { grid-template-columns: 1fr; }
  .joined-cell + .joined-cell { border-left: 0; border-top: 1px solid var(--rule-strong); }
}

/* ---------------------------------------------------------------- journey */
.journey-top { margin-bottom: var(--space-5); }
.step-label { display: flex; justify-content: space-between; gap: 12px; font-size: 0.875rem; color: var(--muted); margin-bottom: 8px; }
/* Native <progress>: the CSP forbids inline style attributes, and the element is announced by screen readers. */
progress.bar { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: var(--radius-pill); background: var(--track); overflow: hidden; color: var(--accent); }
progress.bar::-webkit-progress-bar { background: var(--track); border-radius: var(--radius-pill); }
progress.bar::-webkit-progress-value { background: var(--accent); border-radius: var(--radius-pill); }
progress.bar::-moz-progress-bar { background: var(--accent); border-radius: var(--radius-pill); }
.question-title { font-size: clamp(1.45rem, 4.4vw, 2rem); font-weight: 700; margin-bottom: var(--space-2); }
.question-lede { color: var(--muted); margin-bottom: var(--space-5); }

/* Option cards. Unselected: white, grey border. Selected: blue border, pale blue fill, blue text and a check mark (the
   mark, not the colour alone, shows the selection). */
.choice-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0 0 var(--space-5); }
@media (min-width: 560px) { .choice-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 720px) { .choice-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Two-up answer rows (Exact / Best estimate, Yes / No): two columns at every width above 320 px. */
.choice-grid.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 320px) { .choice-grid.two-up { grid-template-columns: 1fr; } }
.choice-card { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 14px 16px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease); }
.choice-card:hover { border-color: var(--rule-hover); }
.choice-card input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.choice-card .choice-check { flex: none; width: 20px; height: 20px; border: 1.5px solid var(--rule-strong); border-radius: 50%; display: grid; place-items: center; background: var(--surface); transition: background 0.15s var(--ease), border-color 0.15s var(--ease); }
.choice-card.is-multi .choice-check { border-radius: 6px; }
.choice-card .choice-check::after { content: ""; width: 9px; height: 5px; border-left: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent); transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.choice-card .choice-text { display: flex; flex-direction: column; gap: 2px; }
.choice-card .choice-label { font-weight: 500; color: var(--ink); }
.choice-card .choice-note { font-size: 0.875rem; color: var(--muted); }
.choice-card:has(input:checked), .choice-card.is-selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.choice-card:has(input:checked) .choice-label, .choice-card.is-selected .choice-label { color: var(--accent); font-weight: 600; }
.choice-card:has(input:checked) .choice-check, .choice-card.is-selected .choice-check { background: var(--accent); border-color: var(--accent); }
.choice-card:has(input:checked) .choice-check::after, .choice-card.is-selected .choice-check::after { opacity: 1; }
.choice-card:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice-card:active { transform: scale(0.995); }
.choice-card.is-quiet { border-style: dashed; }
.other-field { margin: -4px 0 var(--space-5); }

details.disclosure summary { cursor: pointer; color: var(--ink-2); font-weight: 600; list-style: none; display: inline-flex; gap: 8px; align-items: center; min-height: 44px; }
details.disclosure summary::-webkit-details-marker { display: none; }
details.disclosure summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--sunk); border: 1px solid var(--rule); font-weight: 600; }
details.disclosure[open] summary::before { content: "\2212"; }
/* Quiet disclosures under a question (unit U9): "Why we're asking" and the folded escape routes ("Not sure?") read as
   small underlined text links, not blocks; the panel opens under its link. */
.why { margin: var(--space-3) 0 0; }
.why summary, .routes-fold > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; min-height: 32px; color: var(--muted-strong); font-size: 0.875rem; font-weight: 500; text-decoration: underline; text-decoration-color: var(--rule-hover); text-underline-offset: 3px; }
.why summary:hover, .routes-fold > summary:hover { color: var(--ink); text-decoration-color: currentColor; }
.why summary::-webkit-details-marker, .routes-fold > summary::-webkit-details-marker { display: none; }
.why .why-body { color: var(--muted); font-size: 0.9375rem; padding: 2px 0 var(--space-2); }
.why .why-body p { margin: 0; }
.routes-panel { padding: 4px 0 var(--space-2); }
.routes-panel .escape-routes { margin-top: 4px; gap: 6px; }
.routes-panel .escape-routes .chip { min-height: 32px; padding: 0 12px; font-size: 0.8125rem; }
.routes-for + .routes-for { margin-top: var(--space-3); }
/* "(optional)" after an optional question's label: quieter than the label, never bold. */
.q-optional { color: var(--muted); font-weight: 400; }
/* The line under a question: "Not sure?" and "Why we're asking" side by side while closed; an open one takes the
   whole line, with its panel under it. */
.q-aids { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 20px; margin-top: var(--space-2); }
.q-aids > details { min-width: 0; }
.q-aids > details[open] { flex-basis: 100%; }
.q-aids > .why { margin: 0; }

/* The in-form action bar of the pages that do not use journeyFooter yet: the same frosted bar, Back as a bold
   underlined text link. */
.actionbar { position: sticky; bottom: 0; z-index: 5; margin: var(--space-6) -20px 0; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, 0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--rule); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.actionbar > .btn-ghost:first-child { padding: 0 6px; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.actionbar > .btn-ghost:first-child:hover { background: transparent; color: var(--accent); }
.actionbar .grow { flex: 1; }
.autosave { font-size: 0.85rem; color: var(--muted); min-height: 1.2em; }
.autosave[data-state="saved"] { color: var(--ok); }
.autosave[data-state="error"] { color: var(--bad); }
.autosave[data-state="conflict"] { color: var(--warn); }

/* Journey footer (journeyFooter in src/web/templates/ui.ts): full width and sticky; a thin cumulative bar on its top
   edge; Back left; "<Section> · n of N · n of M answered" centre; "N left here" and the primary button right. */
.journey-footer { position: sticky; bottom: 0; z-index: 25; margin-top: var(--space-6); background: rgba(255, 255, 255, 0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--rule); }
.journey-footer progress.bar, .journey-footer progress.bar::-webkit-progress-bar, .journey-footer progress.bar::-webkit-progress-value, .journey-footer progress.bar::-moz-progress-bar { border-radius: 0; }
.journey-footer progress.bar { height: 3px; }
.jf-row { max-width: 1200px; margin: 0 auto; padding: 12px 24px calc(12px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px 16px; }
.jf-left { justify-self: start; display: flex; align-items: center; gap: 12px; }
.jf-back { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; background: none; border: 0; font: 700 0.9375rem/1.2 var(--sans); color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.jf-back:hover { color: var(--accent); }
.jf-centre { margin: 0; color: var(--muted); font-size: 0.875rem; text-align: center; }
.jf-right { justify-self: end; display: flex; align-items: center; gap: 16px; }
.jf-left-here { color: var(--muted); font-size: 0.875rem; white-space: nowrap; }
@media (max-width: 719px) {
  .jf-row { grid-template-columns: auto minmax(0, 1fr); padding-left: 16px; padding-right: 16px; }
  .jf-centre { grid-column: 1 / -1; grid-row: 1; text-align: left; }
  .jf-right { gap: 12px; }
  .jf-right .btn { padding: 0 16px; }
}

.escape-routes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.escape-routes button, .escape-routes .chip { min-height: 36px; border-radius: var(--radius-pill); border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink-2); font: 500 0.875rem/1 var(--sans); padding: 0 14px; cursor: pointer; }
.escape-routes button:hover { border-color: var(--rule-hover); }
.escape-routes button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.escape-routes .chip { display: inline-flex; align-items: center; gap: 6px; }
.escape-routes .chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.escape-routes .chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.escape-routes .chip:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.escape-routes legend { padding: 0; }

/* ---------------------------------------------------------------- tool flow v2 components (src/web/templates/ui.ts) */
/* Info box: pale blue-grey fill, circled "i", a dark first line and a grey second line. */
.info-box { display: flex; gap: 12px; align-items: flex-start; background: var(--info-soft); border-radius: var(--radius-sm); padding: 14px 16px; color: var(--ink); }
.info-box > .icon { width: 20px; height: 20px; margin-top: 1px; color: var(--muted-strong); }
.info-box .info-text { min-width: 0; }
.info-box .info-first { margin: 0; font-weight: 500; color: var(--ink); }
.info-box .info-second { margin: 2px 0 0; color: var(--muted-strong); font-size: 0.9375rem; }
.info-box .info-extra { margin: 8px 0 0; font-size: 0.9375rem; }
/* Section title with a small grey line icon. */
.section-title { display: flex; align-items: center; gap: 10px; font-size: 1.125rem; font-weight: 600; margin: var(--space-6) 0 var(--space-4); }
.section-title:first-child { margin-top: 0; }
.section-title > .icon { width: 20px; height: 20px; color: var(--muted); }
/* Filter pills: white with a grey border; selected solid navy with white text. */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--space-4); }
.pill { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink-2); font: 500 0.875rem/1 var(--sans); cursor: pointer; white-space: nowrap; transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease); }
.pill:hover { border-color: var(--rule-hover); }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pill[aria-pressed="true"], .pill.is-selected, .pill:has(input:checked) { background: var(--selected); border-color: var(--selected); color: var(--on-ink); }
.pill:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
/* A logo on a white rounded tile (logoTile in ui.ts). */
.logo-tile { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-xs); background: var(--surface); border: 1px solid var(--edge); flex: none; }
.logo-tile img { display: block; width: 24px; height: 24px; object-fit: contain; }
.logo-tile.logo-monogram { background: var(--sunk); color: var(--muted-strong); font-size: 0.95rem; font-weight: 600; }
/* Picker cards: logo top-left on a white tile, name bottom-left, badge top-right; selected = 2 px navy border,
   very pale grey fill and a small check (the check helps people who cannot see the border change). */
.picker-group-title { font-size: 0.9375rem; font-weight: 600; color: var(--muted-strong); margin: var(--space-6) 0 var(--space-3); }
.picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 var(--space-5); }
@media (min-width: 720px) { .picker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 320px) { .picker-grid { grid-template-columns: 1fr; } }
.picker-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; gap: 14px 8px; min-height: 108px; padding: 14px; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color 0.15s var(--ease), background 0.15s var(--ease); }
.picker-card:hover { border-color: var(--rule-hover); }
.picker-card input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.picker-card .logo-tile { grid-column: 1; grid-row: 1; width: 36px; height: 36px; border-radius: var(--radius-xs); border-color: transparent; justify-self: start; }
.picker-card .logo-tile img { width: 28px; height: 28px; }
.picker-card .badge { grid-column: 2; grid-row: 1; align-self: start; justify-self: end; }
.picker-card .picker-name { grid-column: 1 / -1; grid-row: 2; align-self: end; font-weight: 500; font-size: 0.9375rem; line-height: 1.3; color: var(--ink); padding-right: 24px; }
.picker-card .picker-check { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--selected); color: var(--on-ink); opacity: 0; transform: scale(0.6); transition: opacity 0.15s var(--ease), transform 0.15s var(--ease); }
.picker-card .picker-check .icon { width: 12px; height: 12px; }
.picker-card:has(input:checked), .picker-card.is-selected { border-color: var(--selected); box-shadow: inset 0 0 0 1px var(--selected); background: var(--sunk); }
.picker-card:has(input:checked) .logo-tile, .picker-card.is-selected .logo-tile { border-color: var(--rule); }
.picker-card:has(input:checked) .picker-check, .picker-card.is-selected .picker-check { opacity: 1; transform: none; }
.picker-card:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
/* ---- wave 2 U4 (picker page): add picker rules here, nowhere else in this file ---- */
/* The tool picker page (src/web/templates/picker.ts): the heading and helper centred, the search box and the group
   pills centred under them (both shown by tool-picker.js), the "N selected" counter right-aligned above the first
   group, then the groups. */
.picker-head { text-align: center; margin: 0 0 var(--space-5); }
.picker-head .journey-helper { margin: 0 auto; max-width: 52ch; }
.picker-tools { margin: 0 0 var(--space-4); }
.picker-search { max-width: 740px; margin: 0 auto var(--space-2); }
.picker-search-status { text-align: center; min-height: 1.4em; margin: 0 0 var(--space-2); }
.picker-pills { justify-content: center; margin-bottom: 0; }
form[data-picker] > .selected-count { justify-content: flex-end; flex-wrap: wrap; }
.picker > .picker-section:first-child .picker-group-title { margin-top: var(--space-3); }
/* The "High value" badge sits in the card's top-right cell (the wrapper carries the id the checkbox points to). */
.picker-card .picker-badge { grid-column: 2; grid-row: 1; align-self: start; justify-self: end; display: inline-flex; }
/* Focus: the card draws the ring for its visually hidden checkbox. :focus-within for every browser; where :has() is
   supported the ring is kept for keyboard focus only (the :has(input:focus-visible) rule above draws it). */
.picker-card:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
@supports selector(:has(*)) {
  .picker-card:focus-within:not(:has(input:focus-visible)) { outline: none; }
}
.picker-empty { text-align: center; color: var(--muted); margin: var(--space-5) 0 0; }
/* Every quick-discovery form (the picker included): a notice keeps its distance from the options under it. */
.quick-form > .notice { margin-bottom: var(--space-4); }
.picker-other-field { max-width: 520px; margin-top: 0; }
/* Unit U9: on a quick-discovery question, the privacy hint under an "Other" text field is a quiet grey line. */
.quick-form .free-text-hint { background: none; border: 0; padding: 0; margin-top: 4px; font-size: 0.8125rem; }
@media (max-width: 400px) {
  .picker-card { padding: 12px; gap: 12px 6px; }
  .picker-card .badge { font-size: 0.7rem; padding: 2px 8px; }
}

/* "N selected" with the selected tools' logos as overlapping round avatars. */
.selected-count { display: flex; align-items: center; gap: 10px; min-height: 32px; margin: 0 0 var(--space-3); font-size: 0.9375rem; font-weight: 500; color: var(--ink-2); }
.logo-stack { display: inline-flex; align-items: center; }
.logo-avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 1px solid var(--edge); box-shadow: 0 0 0 2px var(--surface); overflow: hidden; flex: none; }
.logo-avatar img { display: block; width: 16px; height: 16px; object-fit: contain; }
.logo-avatar + .logo-avatar { margin-left: -8px; }
.logo-avatar.is-more { background: var(--sunk); color: var(--ink-2); font-size: 0.7rem; font-weight: 600; }
/* Accordion tool cards: white, 1 px border, 18 px radius; a header row with the logo tile, title, grey subtitle, the
   status ("4 to answer" grey, "Done" green) and a chevron. Use <details name="tools"> for one open at a time. */
.tool-cards { display: grid; gap: 12px; margin: 0 0 var(--space-5); }
.tool-card { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); }
.tool-card[open] { border-color: var(--rule-strong); }
.tool-card > summary { list-style: none; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 14px 18px; cursor: pointer; border-radius: var(--radius); }
.tool-card > summary::-webkit-details-marker { display: none; }
.tool-card-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tool-card-title { font-weight: 600; color: var(--ink); }
.tool-card-sub { font-size: 0.875rem; color: var(--muted); }
.tool-card-status { display: inline-flex; align-items: center; gap: 4px; font-size: 0.875rem; color: var(--muted); white-space: nowrap; }
.tool-card-status[data-state="done"] { color: var(--ok); font-weight: 600; }
.tool-card-status .icon { width: 16px; height: 16px; }
.tool-card-chevron { display: inline-grid; color: var(--muted); transition: transform 0.2s var(--ease); }
.tool-card[open] .tool-card-chevron { transform: rotate(180deg); }
.tool-card-body { display: grid; gap: var(--space-5); padding: var(--space-2) 18px 20px; }
.tool-card-foot { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
@media (max-width: 480px) {
  .tool-card > summary { flex-wrap: wrap; gap: 10px 12px; padding: 14px; }
  .tool-card-body { padding: var(--space-2) 14px 16px; }
}

/* ---- wave 2 U5 (tool cards page): add tool-card rules here, nowhere else in this file ---- */
/* The "Your tools" page (src/web/app/tool-cards.ts, templates/tool-card.ts): the cards stack in one column; the sticky
   header never covers a card that "Next tool" scrolls to. The summary's title is the card's heading (role heading). */
.tool-card { scroll-margin-top: calc(var(--header-h) + 16px); }
.tool-card-title { font-size: 1.0625rem; line-height: 1.3; margin: 0; }
.tool-card-flag { font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.tool-card-status .tc-done-icon { display: none; }
.tool-card-status[data-state="done"] .tc-done-icon { display: inline-grid; }
.tool-card-body .field, .tool-card-body .choice-grid, .tool-card-body p { margin: 0; }
.tool-card-nopath { color: var(--muted); }
.tool-card-team { display: grid; gap: 6px; }
/* Each question in a card: a medium-weight line over its answers. */
.tool-q { display: grid; gap: 12px; }
.tool-q > legend { font-weight: 500; font-size: 1.0625rem; color: var(--ink); margin: 0 0 12px; }
.tool-card .choice-card { min-height: 52px; padding: 12px 16px; }
/* Count and counted-on, From and To: the U1 joined field; one bordered box for the optional scope line. */
.tool-count { display: grid; gap: 12px; }
.joined-field.is-single { grid-template-columns: 1fr; }
.ym-pair { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.ym-pair select { padding-right: 6px; }
.joined-cell[data-off] { background: var(--sunk); }
.joined-cell[data-off] .joined-label { color: var(--muted); }
/* "Estimate" shows the high end of a range; "Yes, something is left out" shows what is left out. Without :has() both
   stay visible, which is still correct. */
.tool-count:has(input[data-estimate]:not(:checked)) .count-max-field { display: none; }
.tool-left-out:not(:has(input[value="yes"]:checked)) .left-out-note { display: none; }
.tool-purpose textarea { min-height: 88px; }
.tool-card-foot { justify-content: space-between; align-items: center; }
.tool-card-save { font-size: 0.85rem; color: var(--muted); min-height: 1.2em; }
.tool-card-save[data-state="saved"] { color: var(--ok); }
.tool-card-save[data-state="error"] { color: var(--bad); }
.tool-card-save[data-state="conflict"] { color: var(--warn); }
.tool-cards-more { margin: 0 0 var(--space-6); }
/* Unit U9: the card's one free-text privacy hint, a quiet grey line under its last free-text box. */
.tool-card-body .tool-card-privacy { margin: 6px 0 0; }
.tool-card-privacy .free-text-hint { background: none; border: 0; padding: 0; margin: 0; font-size: 0.8125rem; }
/* Unit U9: the questions about every tool, one collapsed section after the cards (closed by default), drawn like a
   card: its title row with a chevron, the questions inside. */
.cross-tool { border: 1px solid var(--edge); border-radius: var(--radius); background: var(--surface); scroll-margin-top: calc(var(--header-h) + 16px); }
.cross-tool[open] { border-color: var(--rule-strong); }
.cross-tool > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 64px; padding: 14px 18px; cursor: pointer; border-radius: var(--radius); }
.cross-tool > summary::-webkit-details-marker { display: none; }
.cross-tool-title { font-weight: 600; font-size: 1.0625rem; line-height: 1.3; color: var(--ink); }
.cross-tool[open] .tool-card-chevron { transform: rotate(180deg); }
.cross-tool-body { padding: var(--space-2) 18px 20px; }
.cross-tool-body .deep-q-v2 { margin-bottom: var(--space-5); }
.cross-tool-body .deep-q-v2:last-child { margin-bottom: 0; }
@media (max-width: 480px) {
  .cross-tool > summary { padding: 14px; }
  .cross-tool-body { padding: var(--space-2) 14px 16px; }
}
/* Phones: the summary keeps the name on one line with the status under it; joined fields and the two-up answers
   stack so no label breaks inside a word. */
@media (max-width: 479px) {
  .tool-card > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; }
  .tool-card > summary > .logo-tile { grid-row: 1 / span 2; }
  .tool-card > summary > .tool-card-titles { grid-column: 2; grid-row: 1; }
  .tool-card > summary > .tool-card-status { grid-column: 2; grid-row: 2; justify-self: start; }
  .tool-card > summary > .tool-card-chevron { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
  .tool-card .joined-field { grid-template-columns: 1fr; }
  .tool-card .joined-cell + .joined-cell { border-left: 0; border-top: 1px solid var(--rule-strong); }
}
@media (max-width: 419px) {
  .tool-card .choice-grid.two-up { grid-template-columns: 1fr; gap: 8px; }
}

/* deep discovery */
.section-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.section-list a { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 16px 18px; border: 1px solid var(--edge); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); }
.section-list a:hover { border-color: var(--rule-hover); }
.meter { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--muted); }
.meter progress.bar { width: 96px; }
.deep-q { padding: var(--space-5) 0; border-bottom: 1px solid var(--rule); }
.deep-q:last-of-type { border-bottom: 0; }
.deep-q .q-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.deep-q .q-label { font-weight: 600; font-size: 1.05rem; margin-bottom: 6px; display: block; }
.deep-q .choice-grid { margin-bottom: 8px; }
.deep-q .choice-card { min-height: 52px; padding: 10px 14px; }
.deep-q-status { font-size: 0.8rem; color: var(--muted); }
.system-group { margin-top: var(--space-6); }
.system-group > h3 { display: flex; gap: 10px; align-items: center; }

/* ---- wave 2 U6 (company, rights, listing, review pages): add question-page rules here, nowhere else in this file ---- */
/* The detailed-assessment question pages (src/web/app/deep-discovery.ts, deepQuestion and deepPair in
   src/web/templates/questions.ts): titled groups with line icons, questions spaced without rules between them. */
form[data-deep] > .notice, form[data-deep] > section.notice, form[data-deep] > .card { margin-bottom: var(--space-5); }
.deep-fields { margin: 0; }
.q-group + .q-group { margin-top: var(--space-7); }
.q-group > .section-title { margin-bottom: var(--space-4); }
.deep-q-v2 { padding: 0; border-bottom: 0; margin: 0 0 var(--space-6); scroll-margin-top: calc(var(--header-h) + 24px); }
.deep-q-v2:last-child { margin-bottom: 0; }
.deep-q-v2 .q-label { font-size: 1rem; }
.deep-q-v2 > fieldset > .hint { margin: 0 0 var(--space-3); }
.deep-q-v2 .choice-grid { margin-bottom: 0; }
/* Unit U9: the save status is empty in the steady state (no "Answered"); the autosave writes Saving, Saved or the
   problem into it. */
.deep-q-v2 .deep-q-status { display: block; margin-top: 6px; }
.deep-q-v2 .deep-q-status:empty { display: none; }
.deep-q-status[data-state="saved"] { color: var(--ok); }
.deep-q-status[data-state="error"] { color: var(--bad); }
.deep-q-status[data-state="conflict"] { color: var(--warn); }
/* The free-text privacy hint under a text answer: a quiet grey line, not a box (unit U9). */
.deep-q-v2 .free-text-hint { background: none; border: 0; padding: 0; margin-top: 4px; font-size: 0.8125rem; }
.affirm-hint { margin: 4px 0 0 32px; }
/* A pair: two questions in one joined field; under it, each question's help and save status in its own column, then
   one "Not sure?" for the pair (one group of chips per question, each named by its legend). */
.deep-pair .joined-field { margin-bottom: var(--space-2); }
.deep-pair .joined-cell { scroll-margin-top: calc(var(--header-h) + 24px); }
.pair-extras { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px var(--space-4); }
@media (min-width: 720px) { .pair-extras { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px var(--space-5); } }
.pair-extra > .hint { margin: 0; }
.pair-extra:empty { display: none; }
.escape-routes .routes-legend { float: left; width: 100%; font-size: 0.8125rem; font-weight: 600; color: var(--muted); margin: 0 0 2px; }
/* A number with its unit inside the box, on the right ("USD"). */
.unit-field { position: relative; }
.unit-field.has-unit input { padding-right: 72px; }
.unit-label { position: absolute; right: 14px; top: 0; bottom: 0; display: flex; align-items: center; color: var(--muted); font-size: 0.9375rem; font-weight: 500; pointer-events: none; }
/* A quick-discovery answer shown read-only (the industry) with its "Change" link. */
.readonly-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--sunk); padding: 10px 14px; margin: 0 0 var(--space-6); }
.readonly-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.readonly-label { font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.readonly-value { font-weight: 500; color: var(--ink); }
.readonly-text .hint { margin-top: 2px; }
.readonly-change { font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; }
/* "Not sure? Ask us" under a question with a Not sure choice (C12). */
.ask-us { margin: 10px 0 0; font-size: 0.875rem; color: var(--muted); }
/* Follow-up fields in place (C10): a pale panel under the choices. The "If you chose" line shows only without script. */
.follow-up { margin: var(--space-4) 0 0; padding: var(--space-4); border: 1px solid var(--edge); border-radius: var(--radius-sm); background: var(--sunk); }
.follow-up > .field:last-child, .follow-up > .country-picker:last-child { margin-bottom: 0; }
.follow-up input[type="text"], .follow-up input[type="email"], .follow-up textarea { background: var(--surface); }
.follow-note { font-size: 0.875rem; font-weight: 600; color: var(--muted); margin: 0 0 var(--space-3); }
.follow-missing { margin-top: var(--space-3); padding: 10px 14px; border-radius: var(--radius-xs); background: var(--warn-soft); color: var(--warn); font-size: 0.875rem; }
.follow-missing p { margin: 0 0 4px; font-weight: 600; }
.follow-missing ul { margin: 0; padding-left: 18px; }
/* The countries list: a scrolling box of checkboxes; the search narrows it (ticked countries stay in view). */
.country-picker { margin: 0 0 var(--space-4); }
.country-picker .search-field { margin: 6px 0 0; }
.country-status { margin: 6px 0 0; }
.country-status:empty { display: none; }
.country-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; max-height: 264px; overflow-y: auto; margin-top: 8px; padding: 6px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--surface); }
.country-option { align-items: center; padding: 8px 10px; border-radius: var(--radius-xs); cursor: pointer; }
.country-option input { margin-top: 0; }
.country-option:hover { background: var(--sunk); }
.country-option:has(input:checked) { background: var(--accent-soft); }
.country-chosen { margin-top: 8px; }
/* Review and send: the green "Everything is answered." line or the open answers, then every answer by section. */
.all-answered { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 600; margin: 0 0 var(--space-6); }
.all-answered .icon { width: 20px; height: 20px; }
.review-gaps { border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: var(--space-4) var(--space-5); margin: 0 0 var(--space-6); }
.review-gaps h3 { margin-bottom: 4px; }
.gap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gap-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.gap-section { font-size: 0.8125rem; color: var(--muted); }
.review-answers-title { margin-top: var(--space-6); }
.review-section { border-top: 1px solid var(--rule); padding: var(--space-4) 0; }
.review-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: var(--space-3); }
.review-head h3 { margin: 0; }
.review-head a { font-weight: 600; font-size: 0.9375rem; white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; }
.review-list dd { white-space: pre-line; }
.review-open { display: block; margin-top: 2px; font-size: 0.875rem; font-weight: 500; color: var(--warn); }
.review-confirm { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--rule); }

/* ---------------------------------------------------------------- checkpoint
   One screen: the stages (status line, one bar, a compact list), then the result. checkpoint.js reveals a fresh run a
   stage at a time (data-play="sequence", data-phase="playing"); the bar's width follows data-done, the stages
   completed on screen, never more than the server reports. */
.checkpoint { text-align: left; }
.checkpoint-hero { display: flex; gap: 18px; align-items: flex-start; margin-bottom: var(--space-5); }
.checkpoint-mark { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 1.1s linear infinite; }
.checkpoint[data-state="completed"]:not([data-phase="playing"]) .checkpoint-mark { animation: none; border-color: var(--ok); background: var(--ok-soft); }
.checkpoint[data-state="failed"] .checkpoint-mark { animation: none; border-color: var(--bad); }
@keyframes spin { to { transform: rotate(360deg); } }
.cp-progress { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: var(--space-5); margin-bottom: var(--space-5); }
.cp-status { display: grid; margin: 0 0 var(--space-3); min-height: 1.6em; font-size: 1.12rem; font-weight: 600; color: var(--ink); }
.cp-status > span { grid-area: 1 / 1; }
.cp-status .is-entering { animation: cp-in 0.32s var(--ease) both; }
.cp-status .is-leaving { animation: cp-out 0.32s var(--ease) both; }
@keyframes cp-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes cp-out { from { opacity: 1; } to { opacity: 0; transform: translateY(-6px); } }
.cp-bar { position: relative; height: 14px; border-radius: var(--radius-pill); background: var(--track); overflow: hidden; margin: 0 0 var(--space-5); }
/* The fill is full width and slides in from the left (transform only, no layout work per frame); the track's
   overflow clip keeps both ends rounded. */
.cp-bar-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--accent); transform: translateX(-100%); transition: transform 0.7s var(--ease); }
.cp-bar[data-done="1"] .cp-bar-fill { transform: translateX(-75%); }
.cp-bar[data-done="2"] .cp-bar-fill { transform: translateX(-50%); }
.cp-bar[data-done="3"] .cp-bar-fill { transform: translateX(-25%); }
.cp-bar[data-done="4"] .cp-bar-fill { transform: none; }
.cp-stages { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.cp-stage { display: flex; gap: 12px; align-items: center; font-size: 0.95rem; color: var(--muted); transition: color 0.3s var(--ease); }
.cp-dot { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--rule-strong); display: grid; place-items: center; font-size: 0.7rem; font-weight: 700; line-height: 1; transition: background 0.3s var(--ease), border-color 0.3s var(--ease); }
.cp-stage[data-state="active"] { color: var(--ink); font-weight: 600; }
.cp-stage[data-state="active"] .cp-dot { border-color: var(--accent); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.cp-stage[data-state="done"] { color: var(--ink-2); }
.cp-stage[data-state="done"] .cp-dot { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.cp-stage[data-state="done"] .cp-dot::after { content: "\2713"; }
.cp-stage[data-state="failed"] { color: var(--bad); }
.cp-stage[data-state="failed"] .cp-dot { border-color: var(--bad); color: var(--bad); }
.cp-stage[data-state="failed"] .cp-dot::after { content: "!"; }
.cp-result { padding: var(--space-5); border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--accent-line); margin-bottom: var(--space-5); }
.cp-result .badge { background: var(--surface); }
.cp-result h2 { font-size: clamp(1.45rem, 4vw, 1.85rem); margin: 10px 0 6px; }
/* Focus lands on the heading by script (so screen readers start at the result); it is not a Tab stop, so no ring. */
.cp-result h2[tabindex="-1"]:focus-visible { outline: none; }
.cp-result-line { font-size: 1.08rem; color: var(--ink-2); }
.cp-actions { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); align-items: center; margin: var(--space-5) 0; }
.cp-primary { min-height: 54px; padding: 0 28px; font-size: 1.05rem; }
@media (max-width: 480px) {
  .cp-progress, .cp-result { padding: var(--space-4); }
  .cp-primary { width: 100%; white-space: normal; line-height: 1.25; padding: 10px 18px; text-align: center; }
}
.cp-checked { margin: var(--space-4) 0 0; }
.cp-checked .why-body { padding-left: 30px; }
/* A fresh run with JavaScript: keep the stages and result out of sight until checkpoint.js takes over (it sets
   data-play at once), so the final state does not flash before the reveal. If the script never runs, they appear
   after three seconds anyway. */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .checkpoint[data-state="completed"][data-fresh="1"]:not([data-play]) :is(.cp-progress, .cp-result, .checkpoint-mark) { visibility: hidden; animation: cp-failsafe 0s linear 3s forwards; }
}
@keyframes cp-failsafe { to { visibility: visible; } }

/* ---------------------------------------------------------------- snapshot, profile */
.fit-label { display: flex; gap: 14px; align-items: flex-start; padding: var(--space-5); border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.fit-label .badge { margin-bottom: 6px; }
.fact-list { margin: 0; display: grid; grid-template-columns: 1fr; gap: 10px 20px; }
@media (min-width: 640px) { .fact-list { grid-template-columns: minmax(160px, 220px) 1fr; } }
.fact-list dt { color: var(--muted); font-size: 0.9rem; }
.fact-list dd { margin: 0; font-weight: 500; }
.hypothesis { position: relative; padding: 4px 0 4px 22px; }
.hypothesis::before { content: ""; position: absolute; left: 4px; top: 0.85em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-line); }
.list-plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list-check li { padding-left: 26px; position: relative; }
.list-check li::before { content: ""; position: absolute; left: 4px; top: 0.6em; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--rule-strong); }

.doc { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: clamp(20px, 4vw, 40px); }
.doc h2 { font-weight: 600; margin-top: var(--space-6); }
.doc h2:first-child { margin-top: 0; }
.claim { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; }
.claim .badge { flex: none; }
.kind-verified { background: var(--ok-soft); color: var(--ok); }
.kind-assertion { background: var(--info-soft); color: var(--ink-2); }
.kind-inference { background: var(--accent-soft); color: var(--accent); }
.kind-unknown { background: var(--sunk); color: var(--muted); }
.diff del { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }
.diff ins { background: var(--ok-soft); color: var(--ok); text-decoration: none; }
.legal-text { max-height: 420px; overflow: auto; background: var(--sunk); border-radius: var(--radius-sm); padding: 16px 18px; font-size: 0.95rem; }
.legal-text p { margin-bottom: 10px; }
.draft-stamp { display: inline-block; border: 2px solid var(--warn); color: var(--warn); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.8rem; padding: 3px 10px; border-radius: var(--radius-xs); }

/* ---------------------------------------------------------------- dashboard */
.stage-track { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .stage-track { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.stage { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius-sm); padding: 14px; }
.stage .stage-name { font-weight: 600; font-size: 0.95rem; }
.stage .stage-state { font-size: 0.85rem; color: var(--muted); }
.stage[data-state="done"] { border-color: transparent; background: var(--ok-soft); }
.stage[data-state="current"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
/* U62 C29: the stage row reads as a sequence: a numbered marker (a check once done) and a line to the next step,
   green up to where the company is, grey after. Down the left on a phone, across on a wide screen. */
.stage-track { gap: 18px; }
.stage { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: start; }
.stage .stage-name, .stage .stage-state { grid-column: 2; }
.stage-marker { grid-row: 1 / span 2; width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 0.8rem; border: 2px solid var(--edge); background: var(--surface); color: var(--muted); }
.stage-marker .icon { width: 14px; height: 14px; }
.stage[data-state="done"] .stage-marker { background: var(--ok); border-color: var(--ok); color: #fff; }
.stage[data-state="current"] .stage-marker { border-color: var(--accent); color: var(--accent); }
.stage:not(:last-child)::after { content: ""; position: absolute; left: 26px; top: 100%; width: 2px; height: 18px; background: var(--edge); }
.stage[data-state="done"]:not(:last-child)::after { background: var(--ok); }
@media (min-width: 860px) {
  .stage-track { gap: 28px; }
  .stage:not(:last-child)::after { left: 100%; top: 27px; width: 28px; height: 2px; }
  .stage:not(:last-child)::before { content: ""; position: absolute; left: calc(100% + 17px); top: 23px; width: 8px; height: 8px; border-top: 2px solid var(--edge); border-right: 2px solid var(--edge); transform: rotate(45deg); }
  .stage[data-state="done"]:not(:last-child)::before { border-color: var(--ok); }
}
/* The name of a step the client can open links to it (Scott 2026-12-03): link blue, underlined on hover and on keyboard
   focus, with the global :focus-visible ring. A step that is not open yet stays plain text. */
.stage .stage-link { text-decoration: none; }
.stage .stage-link:hover, .stage .stage-link:focus-visible { text-decoration: underline; }
/* U62 C30: "You remain in control": a green check on each thing Add Benefits may do, a red cross on each it may not. */
.control-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.control-list li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.control-mark { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; margin-top: 1px; }
.control-mark .icon { width: 14px; height: 14px; }
.control-can { background: var(--ok-soft); border-radius: var(--radius-sm); padding: 14px; border: 1px solid var(--ok); }
.control-can .control-mark { background: var(--ok); color: #fff; }
.control-cannot { background: var(--bad-soft); border-radius: var(--radius-sm); padding: 14px; border: 1px solid var(--bad); }
.control-cannot .control-mark { background: var(--bad); color: #fff; }
/* The continue card: a pale blue panel (it was a dark panel before tool flow v2). */
.continue-card { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; background: var(--accent-soft); color: var(--ink); border: 1px solid var(--accent-line); border-radius: var(--radius); padding: var(--space-5); }
.continue-card h2 { color: var(--ink); margin: 0; }
.continue-card .btn-accent { align-self: flex-start; }
.continue-card p { color: var(--muted-strong); margin: 0; }
.continue-card p strong { color: var(--ink); }

/* ---------------------------------------------------------------- landing */
.hero { padding: clamp(40px, 8vw, 96px) 0 var(--space-6); }
.hero h1 { font-size: clamp(1.75rem, 6vw, 3rem); max-width: 18ch; letter-spacing: 0; }
.steps { list-style: none; padding: 0; margin: var(--space-6) 0; display: grid; gap: 14px; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: 20px; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.privacy-note { display: flex; gap: 14px; align-items: flex-start; background: var(--sunk); border: 1px solid var(--edge); border-radius: var(--radius); padding: 18px 20px; max-width: 760px; }
.privacy-note .icon { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--rule-strong); position: relative; vertical-align: baseline; }
.privacy-note .icon::after { content: ""; position: absolute; left: 9px; top: 6px; width: 7px; height: 11px; border-style: solid; border-color: var(--ok); border-width: 0 2px 2px 0; transform: rotate(40deg); }
/* The FAQ (src/web/templates/faq.ts) at the bottom of the landing and help pages, once Roy's text is in. */
.faq { margin-top: var(--space-6); max-width: 760px; }

/* ---------------------------------------------------------------- internal workspace */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: var(--space-5); }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--rule); margin-bottom: var(--space-5); scrollbar-width: thin; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
/* position: relative makes the wrap the containing block of the .sr-only text inside its cells, so its own overflow
   clips them (as the board does, U53); otherwise they escaped and widened the page (U55, the Action needed view). */
.table-wrap { position: relative; max-width: 100%; overflow-x: auto; border: 1px solid var(--edge); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
/* The kit's table: a navy header row with white text, white and pale rows, horizontal rules only. Header labels are
   sentence case as the templates write them. */
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--rule-row); vertical-align: top; }
table.data th { font-size: 0.875rem; color: var(--ink); font-weight: 700; white-space: nowrap; }
table.data thead th { color: var(--on-navy); background: var(--navy); border-bottom-color: var(--navy); }
table.data th button { all: unset; cursor: pointer; }
table.data thead th a, table.data thead th button { color: var(--on-navy); }
table.data th button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* On the navy row the ring is white: navy on navy would not show. */
table.data thead th :focus-visible, table.data thead th button:focus-visible { outline-color: var(--on-navy); }
table.data tbody tr:nth-child(even) > td { background: var(--sunk); }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.row-link { cursor: pointer; }
table.data tr.row-link:hover > td { background: var(--accent-soft); }
table.data td a.row-anchor { color: var(--ink); font-weight: 600; text-decoration: none; }
table.data td a.row-anchor:hover { text-decoration: underline; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: var(--space-4); }
.filters .field { margin: 0; min-width: 180px; flex: 1; }
.kv { display: grid; grid-template-columns: minmax(130px, 200px) minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 0.9rem; }
.kv dd { margin: 0; min-width: 0; }
/* Phones: the label above its value, so neither column is squeezed to a few letters (U55). */
@media (max-width: 480px) {
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd + dt { margin-top: 10px; }
}
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--rule); }
.timeline li { position: relative; padding: 0 0 16px 18px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline .t-when { font-size: 0.8rem; color: var(--faint); }
.inline-form { display: inline; }
.split { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.split > *, .grid-2 > *, .grid-3 > *, .card { min-width: 0; }
.empty { text-align: center; padding: var(--space-6) var(--space-4); color: var(--muted); border: 1px dashed var(--rule-strong); border-radius: var(--radius); }
pre.packet { white-space: pre-wrap; word-break: break-word; background: var(--sunk); padding: 16px; border-radius: var(--radius-sm); font-family: var(--mono); font-size: 0.85rem; }
/* Company 360 Tools tab (tool flow v2, U7): one details row per tool; the summary is the row, the body its answers. */
.tool-group-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: var(--space-5) 0 var(--space-3); }
.tool-group-head h3 { margin: 0; }
.tool-review-list { display: grid; gap: 8px; }
.tool-review { border: 1px solid var(--edge); border-radius: var(--radius-sm); background: var(--surface); }
.tool-review[open] { border-color: var(--rule-strong); }
.tool-review > summary { list-style: none; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-height: 56px; padding: 8px 14px; cursor: pointer; border-radius: var(--radius-sm); }
.tool-review > summary::-webkit-details-marker { display: none; }
.tool-review > summary:hover { background: var(--sunk); }
.tool-review > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tool-review-name { font-weight: 600; color: var(--ink); }
.tool-review-count { color: var(--ink-2); font-size: 0.93rem; }
.tool-review-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.tool-review-body { border-top: 1px solid var(--rule); padding: 14px; }

/* ---------------------------------------------------------------- deal desk (Phase 4 U42, spec 5.2 and 12)
   The board reads without colour: every status and stage shows its label; the tone is a 4 px stripe only. Orange is a
   stripe, never text or a fill. Cards are quiet (the Pipeline rule): one small attention marker, a paused badge. */
.deal-headline { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); padding: var(--space-4) 0; margin-bottom: var(--space-3); }
/* Each count is a link to the deals it counts (Scott 2026-11-03: every tile opens). */
.deal-stat { display: flex; flex-direction: column; gap: 2px; min-height: 44px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); color: inherit; text-decoration: none; }
.deal-stat:hover { border-color: var(--rule-hover); background: var(--sunk); }
.deal-stat[aria-current="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.deal-stat-n { font-size: 1.5rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.deal-stat-l { font-size: 0.875rem; color: var(--muted); }
.deal-stat-l::after { content: " \203A"; }
.deal-results { scroll-margin-top: calc(var(--header-h, 64px) + 16px); }
.deal-results-title { margin: 0; }
.deal-headline-note { flex-basis: 100%; margin: 0; }
.deal-filters .field { min-width: 150px; }
.deal-attn-toggle { align-self: center; }
/* U55: the toggle's label keeps one line (it wrapped "only" alone at phone width). */
.deal-attn-toggle .checkline > span { white-space: nowrap; }
/* U55: the view tabs wrap at phone width instead of clipping the last one ("Lis"). */
@media (max-width: 480px) { .tabs.deal-views { flex-wrap: wrap; overflow-x: visible; } }
.deal-filters { margin-bottom: var(--space-3); }
.deal-filters-more { flex-basis: 100%; min-width: 0; }
.deal-filters-more > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; color: var(--ink-2); font-weight: 600; font-size: 0.9rem; }
.deal-filters-more > summary::-webkit-details-marker { display: none; }
.deal-filters-more > summary::before { content: "+"; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--sunk); border: 1px solid var(--rule); font-weight: 600; }
.deal-filters-more[open] > summary::before { content: "\2212"; }
.deal-filters-more > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.deal-filters-more-grid { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding-top: var(--space-2); }
.deal-filters-more-grid .field { margin: 0; min-width: 150px; flex: 1; }
/* position: relative makes the board the containing block of its absolutely positioned descendants (the .sr-only
   counts), so its own overflow-x clips them; without it they escaped to the page and widened it (U53). */
.deal-board { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-3); align-items: start; }
.deal-col { background: var(--sunk); border: 1px solid var(--edge); border-top: 4px solid var(--rule-strong); border-radius: var(--radius); padding: var(--space-3); min-height: 120px; }
.deal-col.is-terminal { background: var(--surface); }
.deal-col.is-drop-target { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.deal-col-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 calc(-1 * var(--space-3)) var(--space-3); padding: 0 var(--space-3) var(--space-2); border-bottom: 2px solid var(--edge); }
.deal-col-eyebrow { flex-basis: 100%; font-size: 0.8rem; color: var(--muted); }
.deal-col-name { font-size: 1rem; margin: 0; color: var(--ink); }
.deal-col-count { font-size: 0.875rem; color: var(--muted); font-weight: 400; }
.deal-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.deal-card { background: var(--surface); border: 1px solid var(--edge); border-left: 4px solid var(--rule-strong); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.93rem; }
.deal-card.is-draggable { cursor: grab; user-select: none; }
.deal-card.is-dragging { opacity: 0.5; cursor: grabbing; }
body.deal-dragging { user-select: none; cursor: grabbing; }
.deal-card p { margin: 4px 0 0; }
.deal-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.deal-card-name { font-weight: 700; color: var(--ink); text-decoration: none; }
.deal-card-name:hover { text-decoration: underline; }
.deal-card-stage, .deal-card-meta { color: var(--ink-2); }
/* The stage a card is in, readable at a glance (Scott 2026-11-03). */
.deal-card-stage-name { display: inline-block; padding: 1px 8px; border-radius: var(--radius-xs); background: var(--sunk); border: 1px solid var(--edge); color: var(--ink); font-weight: 700; }
.deal-card-next { color: var(--muted); font-size: 0.875rem; }
.deal-owner { text-decoration: none; display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 4px; border-radius: 50%; background: var(--accent-soft); color: var(--ink); font-size: 0.78rem; font-weight: 700; }
.deal-attn { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: 0.8rem; }
.deal-move { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.deal-move select { min-height: 44px; max-width: 100%; }
.deal-status { display: inline-block; padding: 2px 8px 2px 10px; border-left: 4px solid var(--rule-strong); background: var(--sunk); color: var(--ink); font-size: 0.875rem; font-weight: 600; border-radius: var(--radius-xs); }
.tone-navy { border-left-color: var(--navy); border-top-color: var(--navy); }
.tone-blue { border-left-color: var(--brand-blue); border-top-color: var(--brand-blue); }
.tone-orange { border-left-color: var(--brand-orange); border-top-color: var(--brand-orange); }
.tone-charcoal { border-left-color: var(--ink-2); border-top-color: var(--ink-2); }
.tone-green { border-left-color: var(--ok); border-top-color: var(--ok); }
.tone-teal { border-left-color: var(--info); border-top-color: var(--info); }
.tone-grey, .tone-neutral { border-left-color: var(--rule-strong); border-top-color: var(--rule-strong); }
.deal-col[class*="tone-"] { border-left-color: var(--edge); }
.deal-card[class*="tone-"] { border-top-color: var(--edge); }
.deal-drop-note { margin-bottom: var(--space-3); }
.deal-pager { margin-top: var(--space-4); }
.deal-action-group { margin-top: var(--space-5); }
.deal-detail-title { margin: 0 0 4px; }
.deal-detail-title a { color: var(--ink); }
.deal-client-text { background: var(--sunk); border-radius: var(--radius-sm); padding: 8px 12px; }
.deal-reason { color: var(--ink-2); }
.deal-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: var(--space-5); color: var(--ink-2); background: var(--surface); }
.deal-dialog::backdrop { background: rgba(20, 45, 78, 0.45); }
.deal-scrim { position: fixed; inset: 0; background: rgba(20, 45, 78, 0.35); z-index: 40; }
.deal-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--surface); border-left: 1px solid var(--rule-strong); z-index: 41; overflow-y: auto; padding: var(--space-4) var(--space-5) var(--space-7); transform: translateX(24px); opacity: 0; transition: transform 0.2s var(--ease), opacity 0.2s var(--ease); }
.deal-panel.is-open { transform: none; opacity: 1; }
.deal-panel:focus { outline: none; }
.deal-panel-bar { display: flex; gap: var(--space-2); justify-content: space-between; margin-bottom: var(--space-4); }
.deal-panel .split { grid-template-columns: minmax(0, 1fr); }
/* U55: the broker's invitation preview shows the email's logo header above the body, as the email does. */
.invite-preview-mail { border: 1px solid var(--edge); border-radius: var(--radius-sm); overflow: hidden; }
.invite-preview-head { padding: 16px 18px; border-bottom: 1px solid var(--rule); background: var(--surface); }
.invite-preview-mail .legal-text { border-radius: 0; }
/* U55: the inventory tree's Edit, Add inside, Move and Remove links are 44 px touch targets (the kit's minimum). */
.inv-actions { gap: 0 var(--space-4); }
.inv-actions .btn-link { display: inline-flex; align-items: center; min-height: 44px; }
/* U55: the conflicts table's resolve form keeps its select readable (the table scrolls in its wrap). */
.conflict-resolve { min-width: 240px; }
.wf-num { max-width: 90px; }
.wf-days { max-width: 120px; }
#wf-statuses input, #wf-stages input, #wf-stages textarea, #wf-stages select, #wf-statuses select { min-width: 120px; }
@media (max-width: 560px) {
  .deal-board { grid-auto-columns: minmax(240px, 86vw); }
  .deal-panel { padding: var(--space-3) var(--space-4) var(--space-6); }
}

/* ---------------------------------------------------------------- motion */
.fade-in { animation: fade-in 0.35s var(--ease) both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .checkpoint-mark { animation: none; }
}

/* ---------------------------------------------------------------- print (spec D17: the profile prints; no PDF export) */
@media print {
  .site-header, .site-footer, .actionbar, .journey-footer, .no-print, nav, form { display: none !important; }
  body { background: #fff; color: #000; }
  .doc { border: 0; padding: 0; }
  .container, .narrow, .journey { max-width: none; padding: 0; }
  a { color: #000; text-decoration: none; }
}
/* U62 C26: the example inventory in the empty state. */
.inv-example { margin: 16px auto 0; max-width: 520px; text-align: left; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius-sm); padding: 14px 16px; }
.inv-example figcaption { font-weight: 600; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.inv-example-tree, .inv-example-tree ul { list-style: none; margin: 0; padding: 0; }
/* impeccable-disable-next-line side-tab -- a neutral indent guide on a nested list (a tree), not an accent on a card */
.inv-example-tree ul { padding-left: 20px; border-left: 2px solid var(--rule-row); margin: 4px 0 4px 6px; }
.inv-example-tree li { padding: 3px 0; }
.inv-example-name { font-weight: 600; }

/* U62 A: company inputs */
/* Money (C9): the currency choice, then the sign inside the amount box. */
.money-field { display: grid; grid-template-columns: minmax(96px, 128px) minmax(0, 1fr); gap: 8px; align-items: stretch; }
.money-field .unit-field.has-prefix { position: relative; }
.money-field .money-symbol { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-strong); font-weight: 600; pointer-events: none; }
.money-field .has-prefix input { padding-left: 44px; }
/* The phone number (C10): the country code, then the number. */
.phone-field { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 8px; }
/* Web addresses (C15): "No longer available" under the box; the box greyed while it is ticked. */
.unavailable-line { margin-top: 8px; }
input[data-web-address]:disabled { background: var(--sunk); color: var(--muted); }
.q-former { font-weight: 400; color: var(--muted); }
/* Countries completing as you type (C8). */
.typeahead { position: relative; }
.typeahead-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px 0; list-style: none; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); max-height: 18rem; overflow-y: auto; }
.typeahead-list li { padding: 8px 14px; cursor: pointer; }
.typeahead-list li[aria-selected="true"], .typeahead-list li:hover { background: var(--accent-soft); color: var(--ink); }
.typeahead-list .typeahead-none { color: var(--muted); cursor: default; }
/* Headcount by location (C4): one row per location; four fields side by side from 720 px, stacked below. */
.locations .loc-rows { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 10px; }
.loc-row fieldset { border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 12px; margin: 0; display: grid; gap: 10px; background: var(--surface); }
.loc-row .field { margin: 0; }
.loc-row .loc-remove { justify-self: start; }
@media (min-width: 720px) {
  .loc-row fieldset { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(0, 0.8fr) minmax(0, 0.8fr) auto; align-items: end; }
  .loc-row .loc-remove { align-self: end; min-height: 44px; }
}
.loc-total { font-weight: 600; color: var(--ink); margin: 8px 0 0; }
.derived-totals { border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--sunk); padding: 12px 16px; margin: 4px 0 16px; }
.derived-title { margin: 0 0 6px; font-size: 0.875rem; color: var(--muted-strong); }
.derived-list { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.derived-item dt { font-size: 0.8rem; color: var(--muted-strong); }
.derived-item dd { margin: 0; font-weight: 600; color: var(--ink); }
/* U62 B: tool parts (C17, C25, D5). A tool card holds one or more parts; every later part sits under a dashed rule
   with its own title and "Remove this part"; the "other" unit box shows only while "Other" is chosen; the data types
   are a wrapping grid of checkbox cards; the media share is three answers across. */
.tc-parts { display: grid; gap: var(--space-4); }
.tc-parts-hint { margin: 0; }
.tc-part { display: grid; gap: var(--space-4); }
.tc-part + .tc-part { border-top: 1px dashed var(--rule-strong); padding-top: var(--space-4); }
.tc-part-extra[hidden], .tc-media[hidden] { display: none; }
.tc-part-extra { display: grid; gap: var(--space-3); }
.tc-part-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.tc-part-title { font-weight: 600; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.link-button:hover { color: var(--ink); }
.link-button[hidden] { display: none; }
.joined-field.tc-unit { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.tc-unit .tc-unit-other { display: none; }
.joined-field.tc-unit:has(option[value="other"]:checked) { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) minmax(0, 2fr); }
.tc-unit:has(option[value="other"]:checked) .tc-unit-other { display: block; }
.tc-part-new > summary { cursor: pointer; color: var(--accent); font-weight: 600; text-decoration: underline; padding: var(--space-2) 0; }
.tc-part-new[open] > summary { margin-bottom: var(--space-3); }
.tc-part-add { justify-self: start; }
.tc-part-add[hidden] { display: none; }
.tool-card-body .choice-grid.tc-type-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tool-card-body .choice-grid.tc-three-up { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tc-line-parts { margin: 4px 0 0; padding-left: 20px; }
@media (max-width: 560px) {
  .joined-field.tc-unit, .joined-field.tc-unit:has(option[value="other"]:checked) { grid-template-columns: 1fr; }
  .tool-card-body .choice-grid.tc-three-up { grid-template-columns: 1fr; }
}
/* U62 C: screenshot check (C21). The section inside each tool card, its upload page, and "Validated" with the green
   check in the card's header (summary), drawn from the section's state with :has() until the merge places a badge in
   the summary itself (toolShotBadge in src/web/app/tool-validation.ts; drop the ::after rule then). */
.tool-shot { margin-top: var(--space-4, 16px); padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--radius-sm, 6px); background: var(--sunk); }
.tool-shot-title { font-size: 1rem; font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.tool-shot .hint { margin: 4px 0 8px; }
.tool-shot p { margin: 0; }
.tool-shot-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--ink-2); }
.tool-shot-status.is-validated strong { color: var(--ok); }
.tool-shot-status.is-not-accurate strong, .tool-shot-status.is-refused strong { color: var(--bad); }
.tool-shot-check { display: inline-flex; align-items: center; justify-content: center; width: 1.5em; height: 1.5em; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.tool-shot[data-shot-state="validated"] { border-color: var(--ok); background: var(--ok-soft); }
.tool-shot-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; color: var(--ok); background: var(--ok-soft); white-space: nowrap; }
.tool-shot-badge .icon { width: 14px; height: 14px; }
.tool-shot-steps { margin: 0; padding-left: 20px; }
.tool-shot-steps li { margin: 4px 0; }
.tool-shot-form input[type="file"] { max-width: 100%; }
.tool-check-override { margin-top: 6px; }
.tool-check-override summary { cursor: pointer; color: var(--brand-blue); }
