/* Tiber River Business Data Platform prototype: the v2 design system (docs/DESIGN-v2.md
   section 6). Owner: visual builder.

   It shares the website's language (tiberriverconsulting.com): the navy family (the
   first :root block below repeats the website's own :root), the navy gradient band (here
   the hero), a 3px blue rule under the header, uppercase letter-spaced kickers,
   Metropolis and navy buttons. It adds what an owner-facing product needs: rounder
   cards, one big number, calm tone chips (copper for "Worth acting on", never red) and
   space.

   Rules this file keeps:
   - Phones first. The base rules are for a 375px screen; min-width breakpoints at
     640px and 960px add columns (and 1024px only widens the gutters). Nothing makes the
     page scroll sideways: grids use minmax(0, 1fr), long words wrap, wide tables scroll
     inside .table-wrap and the navigation scrolls inside itself.
   - Every transition sits inside @media (prefers-reduced-motion: no-preference).
   - @media (forced-colors: active) keeps marks, chips and focus visible with system colors.
   - Metropolis 400 and 600 only, served from /static/fonts, so the app works offline.
   - Text meets 4.5:1 on its background and marks and field edges 3:1, except the two
     recessive chart roles (prior, muted), which always carry a label or a table twin.
   - The content security policy is style-src 'self': no style attributes anywhere, so
     charts carry role classes (chart-accent, chart-prior, chart-muted, chart-target)
     and this file gives them their colors.

   Page layout classes for the page templates: .page-head, .snap-head, .section,
   .section-head, .actions-grid (and .options-grid), .charts-grid, .kpi-grid, .stack.
   The "page pieces" block further down styles the pages' own parts: the consultant's
   tools on the Snapshot, the Ask conversation, Your files, Setup and Review. */

@font-face {
  font-family: "Metropolis";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/demo/static/fonts/Metropolis-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Metropolis";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/demo/static/fonts/Metropolis-SemiBold.ttf") format("truetype");
}

:root {
  /* The website's palette, unchanged. */
  --navy: #044F7D;
  --navy-deep: #033C5F;
  --navy-mid: #12659B;
  --blue: #1C85C7;
  --gray: #9E9E9E;
  --ink: #1a2b38;
  --body: #3d4d59;
  --tint: #D8EAF7;
  --tint-soft: #EDF5FB;
  --paper: #ffffff;

  /* Roles built on it (the consultant pages and the brand checks read these). */
  --canvas: #f6f9fc;
  --line: #dce8f2;
  --line-strong: #c9d6e1;
  --field-line: #7d8e9b;
  --muted: #5b6b77;
  --link: #12659B;
  --kicker: #12659B;
  --blue-soft: #7DB7DD;
  --footer: #04314d;
  --footer-text: #9fb8c9;
  --footer-notice: #dcecf7;
  --footer-fine: #8fabbf;
  --amber-bg: #fff4d6;
  --amber-line: #f0d48a;
  --amber-ink: #6b4e00;
  --green-bg: #e3f4ea;
  --green-line: #bfe3cc;
  --green-ink: #1e6b3a;
  --red-bg: #fbe7e6;
  --red-line: #f1c4c0;
  --red-ink: #9b2c24;
  --violet-bg: #efeafb;
  --violet-ink: #4b3a8c;
  --dropped-bg: #eef1f4;
  --dropped-ink: #4f5b64;
  --code-bg: #0f2536;
  --code-ink: #dcecf7;
  --radius: 2px;

  /* v2 surfaces (DESIGN-v2 6.1). */
  --surface-page: #F4F7FA;
  --surface-card: #FFFFFF;
  --surface-sunken: #EAF0F5;
  --hero-from: #033C5F;
  --hero-via: #044F7D;
  --hero-to: #12659B;
  --text-inverse: #FFFFFF;
  --text-inverse-soft: #CFE4F4;

  /* Tones: always an icon and words, never color alone. "act" is warm copper, never red. */
  --good-ink: #136C47;
  --good-bg: #E2F3EA;
  --good-line: #BFE3CC;
  --good-mark: #23915F;
  --good-inverse: #7FE0B0;
  --watch-ink: #7A5100;
  --watch-bg: #FFF3D6;
  --watch-line: #F0D48A;
  --watch-mark: #B97800;
  --watch-inverse: #FFD27A;
  --act-ink: #9A4212;
  --act-bg: #FCEADB;
  --act-line: #F2C6A6;
  --act-mark: #C9571D;
  --act-inverse: #FFB48A;

  /* Chart roles (DESIGN-v2 7.2). Prior and muted are recessive on purpose. */
  --chart-accent: #1C85C7;
  --chart-accent-strong: #12659B;
  --chart-prior: #7DB7DD;
  --chart-muted: #B7C6D3;
  --chart-target: #1A2B38;
  --chart-grid: #E3EBF2;
  --chart-axis: #C9D6E1;
  --chart-inverse-accent: #FFFFFF;
  --chart-inverse-muted: #9FD0F2;
  --chart-inverse-grid: rgba(255, 255, 255, 0.18);

  /* Space, shape and elevation (DESIGN-v2 6.3). */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(3, 60, 95, 0.06), 0 1px 1px rgba(3, 60, 95, 0.04);
  --shadow-2: 0 4px 16px rgba(3, 60, 95, 0.08);
  --shadow-hero: 0 16px 40px rgba(3, 60, 95, 0.22);
  --gutter: 16px;
  --container: 1120px;
  --section-gap: 32px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: "Metropolis", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.625;
  color: var(--body);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0 0 0.5em; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
h1 { font-size: 26px; line-height: 32px; letter-spacing: -0.01em; }
h2 { font-size: 22px; line-height: 28px; }
h3 { font-size: 18px; line-height: 24px; }
h4 { font-size: 16px; line-height: 24px; }
p { margin: 0 0 0.8em; }
strong, b { font-weight: 600; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.86em; }
code { padding: 1px 5px; border-radius: 4px; background: var(--tint-soft); color: var(--navy-deep); overflow-wrap: anywhere; }
ul, ol { margin: 0 0 0.8em; padding-left: 1.3em; }
ul.plain { list-style: none; padding-left: 0; }
ul.plain li { margin-bottom: 4px; }
blockquote { margin: 0; }
figure { margin: 0; }

/* Text links in page content are underlined, so they never rely on color alone.
   :where keeps this rule weak, so components with their own look win. */
:where(.main) a:where(:not([class])), :where(.main) a.small, :where(.main) a.text-link {
  text-decoration: underline;
  text-decoration-color: rgba(18, 101, 155, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
:where(.main) a:where(:not([class])):hover { text-decoration-color: currentColor; }

/* Keyboard focus is always visible. */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--navy-mid); }
.main:focus { outline: none; }
.hero :focus-visible, .site-footer :focus-visible, .preview-bar :focus-visible { outline-color: var(--paper); }
/* The navigation row scrolls, so its clip box would cut a ring drawn outside the link. */
.nav-link:focus-visible { outline-offset: -3px; }
.site-footer :focus-visible { outline-color: var(--blue-soft); }

.wrap { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.main { flex: 1 0 auto; padding-top: var(--space-5); padding-bottom: var(--space-7); }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 20px; }
.wrap-any { word-break: break-all; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.warn-text { color: var(--watch-ink); }
.stack > * + * { margin-top: var(--space-3); }
.stack > label + * { margin-top: 4px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--navy); color: #fff; font-weight: 600; }
.skip-link:focus { top: 8px; }

/* ---------- icons: inline SVG symbols from base.html ---------- */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: inline-block; flex: none; width: 16px; height: 16px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- the fictional-data bar and the preview bar ---------- */
.banner { background: var(--amber-bg); border-bottom: 1px solid var(--amber-line); color: var(--amber-ink); }
.banner-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; min-height: 32px; padding-top: 5px; padding-bottom: 5px; font-size: 13px; line-height: 18px; }
.banner-text { font-weight: 600; letter-spacing: 0.01em; }
.banner-sub { color: var(--amber-ink); }
.banner-badge { text-decoration: none; }
.preview-bar { background: var(--navy-deep); color: var(--text-inverse); }
.preview-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 44px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; line-height: 20px; }
.preview-text { display: inline-flex; align-items: center; gap: 8px; }
.preview-long { display: none; }
.preview-short { display: inline; }
.preview-stop { margin: 0; }

/* ---------- header: the wordmark, the product name, companies and the person ---------- */
.site-header { background: var(--paper); border-bottom: 3px solid var(--blue); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 10px; padding-bottom: 8px; }
.brand { display: flex; flex-direction: row; align-items: center; color: var(--ink); }
.brand:hover { text-decoration: none; }
/* The mark keeps its own proportions and colors: width is set, height follows. */
.brand-mark { display: block; flex: none; width: 145px; min-width: 140px; height: auto; object-fit: contain; }
/* Phones: the product name and the stage badge stack beside the mark, behind a hairline. */
.brand-product { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin: 0 0 0 10px; padding-left: 10px; border-left: 1px solid var(--line-strong); }
.brand-name { color: var(--navy); font-size: 14px; font-weight: 600; letter-spacing: 0.01em; line-height: 1.2; white-space: nowrap; }
.header-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; width: 100%; font-size: 14px; }
/* The name and Sign out share one row; a long name wraps inside its own box. */
.who { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px 12px; margin-left: auto; min-width: 0; }
.who-name { min-width: 0; color: var(--ink); font-weight: 600; line-height: 20px; }
.who-name .badge { margin-left: 2px; }
.who form { flex: none; }
.who-name .muted { font-weight: 400; }
form.inline { display: inline; margin: 0; }

.switcher { position: relative; }
.switcher > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--paper); color: var(--ink); font-weight: 600; cursor: pointer; list-style: none; }
.switcher > summary::-webkit-details-marker { display: none; }
.switcher > summary:hover { border-color: var(--navy-mid); }
.switcher-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.switcher-menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: max-content; min-width: 240px; max-width: calc(100vw - 2 * var(--gutter)); margin: 0; padding: 6px; list-style: none; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); box-shadow: var(--shadow-2); }
.switcher-menu a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 8px; color: var(--ink); }
.switcher-menu a:hover { background: var(--tint-soft); text-decoration: none; }
.switcher-menu a[aria-current] { background: var(--tint-soft); font-weight: 600; }
.company-name { display: none; align-items: center; min-height: 36px; padding: 4px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); color: var(--ink); font-weight: 600; }

/* ---------- navigation: one row that scrolls inside itself on phones ---------- */
.nav { border-top: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; gap: 8px; }
/* position: relative keeps visually hidden text inside the scrolling row, so it never widens the page. */
.nav-links { position: relative; display: flex; flex: 1 1 auto; min-width: 0; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-link { display: inline-flex; flex: none; align-items: center; gap: 6px; min-height: 48px; padding: 12px 8px 9px; border-bottom: 3px solid transparent; color: var(--ink); font-size: 15px; font-weight: 600; white-space: nowrap; }
.nav-label-long { display: none; }
.nav-label-short { display: inline; }
/* static/app.js marks a row that scrolls: its edge fades, so a cut item never looks broken. */
.nav-links.is-scrollable { scroll-padding-inline: 24px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.nav-links.is-scrollable.at-end { -webkit-mask-image: none; mask-image: none; }
.nav-link:hover { color: var(--navy-mid); text-decoration: none; }
.nav-link.on { color: var(--navy); border-bottom-color: var(--navy); }
.nav-link .icon { color: var(--navy-mid); }
.nav-divider { flex: none; width: 1px; height: 24px; margin: 0 6px; background: var(--line-strong); }
.nav-count { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: var(--radius-pill); background: var(--watch-bg); color: var(--watch-ink); font-size: 12px; line-height: 20px; text-align: center; }
.nav-inner { flex-wrap: wrap; }
.preview-switch { flex: none; margin: 0 0 8px auto; }
.switch { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.switch:hover { border-color: var(--navy-mid); color: var(--navy); }
.switch[aria-pressed="true"] { background: var(--navy-deep); border-color: var(--navy-deep); color: var(--text-inverse); }

/* ---------- page heads and sections ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; margin-bottom: var(--space-5); }
.page-head > div { flex: 1 1 280px; min-width: 0; }
.page-head h1, .page-head h2 { margin-bottom: 4px; }
.snap-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; margin-bottom: var(--space-4); }
.snap-head > div { min-width: 0; }
/* docs/OWNER-UX-v3-SPEC.md 1e: the freshness line with the one comparison line under it. */
.snap-meta { display: flex; flex-direction: column; gap: 2px; }
.snap-compare { margin: 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.snap-company { margin: 0; font-size: 22px; line-height: 28px; }
.snap-greeting { margin: 2px 0 0; color: var(--body); }
.snap-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: var(--space-3); }
.section { margin-top: var(--section-gap); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: var(--space-3); }
.section-head h2, .section-title { margin: 0; color: var(--kicker); font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.section-note { margin: 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.kicker { margin-bottom: 8px; color: var(--kicker); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.kicker .badge { margin-left: 6px; letter-spacing: 0.02em; text-transform: none; }
.lede { max-width: 760px; font-size: 18px; line-height: 28px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
h1.question { max-width: 900px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: var(--space-3); font-weight: 600; }

/* ---------- cards (the consultant pages use these too) ---------- */
.card { min-width: 0; margin-bottom: var(--space-4); padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-1); }
.card h2 { color: var(--ink); }
.card.ok { border-left: 4px solid var(--good-mark); }
.card.warn, .card.waiting { border-left: 4px solid var(--watch-mark); }
.card.refusal { border-left: 4px solid var(--gray); }
.card.answer-card { border-left: 4px solid var(--blue); }
.card.error-card { max-width: 720px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 20px; }
.count { display: inline-block; min-width: 1.6em; padding: 0 6px; border-radius: var(--radius-pill); background: var(--tint); color: var(--navy-deep); font-size: 13px; text-align: center; vertical-align: middle; }

/* ---------- flash messages ---------- */
.flash { margin-bottom: var(--space-4); padding: 12px 16px; border: 1px solid var(--line); border-left: 4px solid var(--navy-mid); border-radius: var(--radius-sm); background: var(--tint-soft); color: var(--navy-deep); }
.flash-ok { border-color: var(--good-line); border-left-color: var(--good-mark); background: var(--good-bg); color: var(--good-ink); }
.flash-error { border-color: var(--act-line); border-left-color: var(--act-mark); background: var(--act-bg); color: var(--act-ink); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: var(--radius-sm); font: inherit; font-size: 15px; font-weight: 600; line-height: 20px; letter-spacing: 0.01em; text-align: center; cursor: pointer; }
.btn:hover { text-decoration: none; }
.btn-primary { background: linear-gradient(90deg, var(--navy-deep), var(--navy-mid)); color: #fff; }
.btn-primary:hover { background: linear-gradient(90deg, var(--navy), var(--blue)); }
.btn-secondary { border-color: var(--navy-mid); background: var(--paper); color: var(--navy); }
.btn-secondary:hover { background: var(--tint-soft); }
.btn-danger { border-color: var(--red-ink); background: var(--paper); color: var(--red-ink); }
.btn-danger:hover { background: var(--red-bg); }
.btn-quiet { border-color: var(--line-strong); background: transparent; color: var(--ink); }
.btn-quiet:hover { border-color: var(--navy-mid); color: var(--navy); }
.btn-inverse { background: var(--paper); color: var(--navy-deep); }
.btn-inverse:hover { background: var(--tint); }
.btn-small { min-height: 44px; padding: 6px 12px; font-size: 14px; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.link-button { padding: 0; border: 0; background: none; font: inherit; color: var(--link); text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(18, 101, 155, 0.45); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.link-button:hover { text-decoration-color: currentColor; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }

/* ---------- forms ---------- */
label { display: block; margin: 12px 0 4px; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 20px; }
input, select, textarea { max-width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--field-line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); font: inherit; font-size: 16px; line-height: 24px; }
input[type="file"] { padding: 8px; }
textarea { width: 100%; resize: vertical; }
.stack input:not([type="file"]):not([type="hidden"]), .stack select { width: 100%; }
.stack > label { margin-bottom: 0; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 16px; }
.inline-form label { margin: 0; }
.suggestion { display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.suggestion:last-of-type { border-bottom: 0; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; line-height: 20px; text-align: left; cursor: pointer; }
.chip:hover { border-color: var(--navy-mid); color: var(--navy); text-decoration: none; }
.chip-quiet { color: var(--muted); }
.chip-on, .chip-on:hover { border-color: var(--navy); background: var(--navy); color: #fff; }
.chip-form { display: inline-flex; max-width: 100%; margin: 0; }
.chip-question { max-width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--space-3); }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 2px 10px; border: 1px solid transparent; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; line-height: 18px; letter-spacing: 0.02em; vertical-align: middle; white-space: nowrap; }
.badge-stage { padding: 1px 8px; border-color: var(--tint); background: var(--tint-soft); color: var(--navy-mid); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.badge-neutral, .badge-ready, .badge-open, .badge-decision-open, .badge-approved { background: var(--tint); color: var(--navy-deep); }
.badge-draft, .badge-waiting, .badge-warn, .badge-watch { border-color: var(--watch-line); background: var(--watch-bg); color: var(--watch-ink); }
.badge-published, .badge-done, .badge-ok, .badge-decision-done { background: var(--good-bg); color: var(--good-ink); }
.badge-dropped, .badge-decision-dropped, .badge-missing, .badge-not_answered { background: var(--dropped-bg); color: var(--dropped-ink); }
.badge-rejected, .badge-refused, .badge-real { background: var(--red-bg); color: var(--red-ink); }
.badge-mock { background: var(--violet-bg); color: var(--violet-ink); }
.badge-fiction { border-color: var(--amber-line); background: var(--amber-bg); color: var(--amber-ink); letter-spacing: 0.04em; text-transform: none; }
.badge-judge { border-color: var(--line); background: var(--tint-soft); color: var(--navy-mid); }
.badge-custom { border-color: var(--tint); background: var(--tint-soft); color: var(--navy-mid); }

/* ---------- tone and change chips: an icon plus words, never color alone ---------- */
.tone { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px 4px 10px; border: 1px solid; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.tone-good { border-color: var(--good-line); background: var(--good-bg); color: var(--good-ink); }
.tone-good .icon { color: var(--good-mark); }
.tone-watch { border-color: var(--watch-line); background: var(--watch-bg); color: var(--watch-ink); }
.tone-watch .icon { color: var(--watch-mark); }
.tone-act { border-color: var(--act-line); background: var(--act-bg); color: var(--act-ink); }
.tone-act .icon { color: var(--act-mark); }
.tone-neutral { border-color: var(--line-strong); background: var(--paper); color: var(--body); }
.tone-inverse { background: var(--navy-deep); }
.tone-inverse .icon { color: currentColor; }
.tone-inverse.tone-good { border-color: var(--good-inverse); color: var(--good-inverse); }
.tone-inverse.tone-watch { border-color: var(--watch-inverse); color: var(--watch-inverse); }
.tone-inverse.tone-act { border-color: var(--act-inverse); color: var(--act-inverse); }
.tone-inverse.tone-neutral { border-color: var(--text-inverse-soft); color: var(--text-inverse-soft); }
/* Under 640px a change chip is text: the arrow and the words in the tone's ink. */
.delta { display: inline-flex; align-items: flex-start; gap: 4px; max-width: 100%; font-size: 14px; font-weight: 600; line-height: 20px; }
.delta .icon { margin-top: 2px; }
.delta-good { color: var(--good-ink); }
.delta-watch { color: var(--watch-ink); }
.delta-act { color: var(--act-ink); }
.delta-neutral { color: var(--body); }
.delta-inverse.delta-good { color: var(--good-inverse); }
.delta-inverse.delta-watch { color: var(--watch-inverse); }
.delta-inverse.delta-act { color: var(--act-inverse); }
.delta-inverse.delta-neutral { color: var(--text-inverse-soft); }

/* ---------- the hero: the owner's question, answered ---------- */
.hero { position: relative; min-width: 0; padding: 20px 16px 20px; border-bottom: 3px solid var(--blue); border-radius: var(--radius-lg); background: var(--hero-via); background-image: linear-gradient(105deg, var(--hero-from) 0%, var(--hero-via) 55%, var(--hero-to) 100%); box-shadow: var(--shadow-hero); color: var(--text-inverse); }
.hero a:not(.btn) { color: var(--text-inverse); }
.hero-status { margin: 0 0 12px; }
.hero-question { margin: 0 0 12px; color: var(--text-inverse-soft); font-size: 12px; font-weight: 600; line-height: 16px; letter-spacing: 0.12em; text-transform: uppercase; }
.hero-answer { display: flex; flex-direction: column; gap: 6px; }
.hero-figures { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 28px; min-width: 0; }
.hero-number { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; }
.hero-value { color: var(--text-inverse); font-size: 56px; font-weight: 600; line-height: 54px; letter-spacing: -0.02em; }
.hero-unit { color: var(--text-inverse-soft); font-size: 18px; font-weight: 600; line-height: 22px; }
/* Owner ruling 2026-09-29 (R4, DESIGN-v2 18.2): two figures side by side, each over its small
   label ("4" over "contracts", "$2,205" over "of labor"); on a phone the pair wraps to two
   rows when it has to, and a label never runs under the other figure. "about" is small
   type before an estimate (R2). */
.hero-answer-two .hero-number { flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
/* Owner review OQA-06: on a phone the labels keep clear of the headline under them. */
.hero-answer-two .hero-figures { margin-bottom: 16px; }
.hero-money-figure { display: inline-flex; flex-wrap: nowrap; align-items: baseline; gap: 6px; }
.hero-money-value { color: var(--text-inverse); font-size: 56px; font-weight: 600; line-height: 54px; letter-spacing: -0.02em; white-space: nowrap; }
.hero-about { color: var(--text-inverse-soft); font-size: 18px; font-weight: 600; line-height: 22px; }
.hero-money-label { max-width: 22ch; color: var(--text-inverse-soft); font-size: 18px; font-weight: 600; line-height: 22px; }
.hero-headline { margin: 0; color: var(--text-inverse); font-size: 26px; line-height: 32px; }
.hero-context { max-width: 62ch; margin: 12px 0 0; color: var(--text-inverse-soft); font-size: 18px; line-height: 28px; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 0 0; }
.hero-period { color: var(--text-inverse-soft); font-size: 14px; line-height: 20px; }
.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0; }
.hero-links-wide { display: none; }
.hero-links-narrow { margin-top: 20px; }
.hero-how { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.5); text-underline-offset: 0.2em; }
/* Phones: "What you can do (4)" on the chip row, the way to the first card. */
.hero-jump { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 14px; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.5); text-underline-offset: 0.2em; }
.hero-how:hover { text-decoration-color: currentColor; }
.hero-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 20px; }
.hero-visual { min-width: 0; }
.hero-visual-head { margin: 0 0 8px; color: var(--text-inverse); font-size: 14px; font-weight: 600; line-height: 20px; }
.hero-visual-head .chart-subtitle { color: var(--text-inverse-soft); font-weight: 400; }
.hero-callouts { display: grid; gap: 12px; min-width: 0; }
.hero-aside { min-width: 0; }
.hero-aside-kicker { margin: 0; color: var(--text-inverse-soft); font-size: 12px; font-weight: 600; line-height: 16px; letter-spacing: 0.12em; text-transform: uppercase; }
.hero-aside .hero-related { flex-direction: column; align-items: flex-start; margin-top: 8px; }
.hero-related { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.hero-related .chip { border-color: rgba(255, 255, 255, 0.45); background: var(--navy-deep); color: var(--text-inverse); }
.hero-related .chip:hover { border-color: var(--text-inverse); }
.hero-related .chip .icon { color: currentColor; }
.hero-related .chip-watch { border-color: var(--watch-inverse); color: var(--watch-inverse); }
.hero-related .chip-act { border-color: var(--act-inverse); color: var(--act-inverse); }
.hero-related .chip-good { border-color: var(--good-inverse); color: var(--good-inverse); }
.hero .disclosure-table > summary { color: var(--text-inverse); }
.hero .disclosure-table { margin-top: 0; }
.hero .disclosure-table .disclosure-body { color: var(--ink); }
/* The table twin sits on a light card inside the navy hero, so its rows stay readable. */
.hero .disclosure-table .table-wrap { margin-top: 4px; padding: 0 8px; border-radius: var(--radius-sm); background: var(--surface-card); }
.hero .chart-caption { color: var(--text-inverse-soft); }

/* ---------- "Also worth a look": one sentence under the hero ---------- */
.also { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--watch-mark); border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-1); }
.also > .icon { color: var(--watch-mark); }
.also-good { border-left-color: var(--good-mark); }
.also-good > .icon { color: var(--good-mark); }
.also-kicker { color: var(--kicker); font-size: 12px; font-weight: 600; line-height: 16px; letter-spacing: 0.12em; text-transform: uppercase; }
.also-text { color: var(--ink); font-weight: 600; }
.also-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(18, 101, 155, 0.45); text-underline-offset: 0.18em; }

/* ---------- the freshness line ---------- */
.freshness { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.freshness .icon { color: var(--navy-mid); }
.freshness-refreshed { color: var(--muted); }

/* ---------- "Found in your notes" callouts ---------- */
.callout { margin: 0; padding: 14px 16px; border-left: 3px solid var(--blue); border-radius: 0 var(--radius-md) var(--radius-md) 0; background: var(--tint-soft); }
.callout-kicker { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; color: var(--kicker); font-size: 12px; font-weight: 600; line-height: 16px; letter-spacing: 0.12em; text-transform: uppercase; }
.callout-quote p { margin: 0; color: var(--ink); font-size: 17px; line-height: 26px; }
.callout-quote p::before { content: "\201C"; }
.callout-quote p::after { content: "\201D"; }
.callout-source { display: block; margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.callout-finding { display: block; margin: 6px 0 0; color: var(--ink); font-weight: 600; }
.callout-inverse { border-left-color: var(--chart-inverse-muted); background: rgba(3, 40, 66, 0.5); }
.callout-inverse .callout-kicker, .callout-inverse .callout-source { color: var(--text-inverse-soft); }
.callout-inverse .callout-quote p, .callout-inverse .callout-finding { color: var(--text-inverse); }
.callout-inverse a { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.5); text-underline-offset: 0.2em; }

/* ---------- stat tiles ---------- */
.kpis { margin-top: var(--section-gap); }
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 14px 14px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-1); }
.tile-label { margin: 0; color: var(--body); font-size: 14px; font-weight: 600; line-height: 20px; }
/* A number never breaks across lines; a long one scales to its tile (see @supports). */
.tile-value { margin: 0; color: var(--ink); font-size: 28px; font-weight: 600; line-height: 32px; letter-spacing: -0.01em; white-space: nowrap; }
.tile-value-long { font-size: 20px; }
.tile-prior { margin: 0; color: var(--muted); font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }
.tile-value-missing { color: var(--muted); font-size: 18px; line-height: 24px; }
.tile-trend { margin: 0; line-height: 0; }
.tile-trend .sparkline { width: 96px; }
.tile-help { display: none; margin: 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.tile-link { margin-top: auto; padding-top: 4px; font-size: 14px; font-weight: 600; line-height: 20px; }
.tile-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-md); }
.tile-draft { border-style: dashed; border-color: var(--watch-line); }
.tile .delta { position: relative; z-index: 1; align-self: flex-start; }
.delta > span { text-wrap: balance; }
/* docs/OWNER-UX-v3-PHASE2-SPEC.md 2a: a tile's goal line, between the value and the change chip. The status
   is words plus an icon, in the tone's ink (copper for "Off track", never red); the goal and the gap follow
   on the same line and wrap with it. */
.goal-line { margin: 0; color: var(--body); font-size: 13px; line-height: 18px; }
.goal-status { display: flex; align-items: center; gap: 4px; font-weight: 600; white-space: nowrap; }
/* A phone's tile is narrow, so the status has its line and the goal text starts the next one; from 640px
   they share a line, with a full stop between so they read as two short sentences. */
@media (min-width: 640px) {
  .goal-status { display: inline-flex; }
  .goal-status > span::after { content: "."; }
}
.goal-status .icon, .band-goal .icon { width: 14px; height: 14px; flex: none; }
.goal-good { color: var(--good-ink); }
.goal-good .icon { color: var(--good-mark); }
.goal-watch { color: var(--watch-ink); }
.goal-watch .icon { color: var(--watch-mark); }
.goal-act { color: var(--act-ink); }
.goal-act .icon { color: var(--act-mark); }
.goal-neutral { color: var(--body); }
.goal-line .goal-text, .money-goal .goal-text { color: var(--body); }
.money-goal { display: block; margin: 0; font-size: 13px; line-height: 18px; }
/* An odd last tile takes the rest of its row, so the grid never ends in a hole (OWN-15). */
.kpi-grid > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
[data-count-to] { display: inline-block; }
.sparkline { display: block; width: 120px; max-width: 100%; height: auto; }

/* ---------- chart cards and the charts inside ---------- */
.charts-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
/* Owner ruling 2026-09-29 (R9, OWN-F9): cards in one row share its height, and their links
   sit at the foot, so "What this means" lines up across the row. */
.chart-card { display: flex; flex-direction: column; min-width: 0; margin: 0; padding: 14px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-1); }
.chart-card-foot { display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding-top: 8px; }
.chart-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.chart-title { color: var(--ink); font-size: 18px; font-weight: 600; line-height: 24px; }
.chart-subtitle { color: var(--muted); font-size: 14px; line-height: 20px; }
.chart-link { margin: 0; font-weight: 600; }
.chart-caption { margin: -4px 0 10px; color: var(--body); font-size: 14px; line-height: 20px; }
.hero-visual .chart-caption { margin: 6px 0 0; }
.chart-link a { text-decoration: underline; text-decoration-color: rgba(18, 101, 155, 0.45); text-underline-offset: 0.18em; }
.chart { position: relative; min-width: 0; }
.chart-svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.chart-md { display: none; }
.chart-empty-text, .chart-empty { margin: 0; color: var(--muted); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; padding: 0; list-style: none; color: var(--body); font-size: 14px; line-height: 20px; }
.chart-legend li { display: inline-flex; align-items: center; gap: 8px; }
.chart-key { display: inline-block; flex: none; }
.chart-key-bar { width: 14px; height: 10px; border-radius: 0 3px 3px 0; }
.chart-key-dot { width: 10px; height: 10px; border-radius: 50%; }
.chart-key-line { width: 16px; height: 2px; border-radius: 1px; }
.chart-key-tick { width: 2px; height: 14px; }
.chart-key.chart-accent { background-color: var(--chart-accent); }
.chart-key.chart-prior { background-color: var(--chart-prior); }
.chart-key.chart-muted { background-color: var(--chart-muted); }
.chart-key.chart-target { background-color: var(--chart-target); }
.chart-key-split.chart-accent { background-image: linear-gradient(90deg, var(--chart-accent) 50%, var(--chart-muted) 50%); }

/* Marks: fills for bars, columns and dots; strokes for lines; text wears text colors. */
.chart-mark.chart-accent { fill: var(--chart-accent); }
.chart-mark.chart-prior { fill: var(--chart-prior); }
.chart-mark.chart-muted { fill: var(--chart-muted); }
.chart-mark.chart-target { fill: var(--chart-target); }
.chart-marker { stroke: var(--surface-card); stroke-width: 2px; }
.chart-stroke { fill: none; stroke-width: 2px; stroke-linecap: round; stroke-linejoin: round; }
.chart-stroke.chart-accent { stroke: var(--chart-accent); }
.chart-stroke.chart-prior { stroke: var(--chart-prior); }
.chart-stroke.chart-muted { stroke: var(--chart-muted); }
.chart-stroke.chart-target { stroke: var(--chart-target); }
.chart-ref { stroke-width: 1.5px; stroke-linecap: butt; }
.chart-grid { fill: none; stroke: var(--chart-grid); stroke-width: 1px; }
.chart-axis { fill: none; stroke: var(--chart-axis); stroke-width: 1px; }
.chart-track { fill: none; stroke: var(--chart-grid); stroke-width: 1px; }
.chart-text { fill: var(--body); }
.chart-label { fill: var(--body); }
.chart-value { fill: var(--ink); }
.chart-tick { fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart-ref-label { fill: var(--ink); }
.chart-value, .chart-ref-label, .chart-label { paint-order: stroke; stroke: var(--surface-card); stroke-width: 3px; stroke-linejoin: round; }
.chart-note { fill: none; stroke: var(--ink); stroke-width: 1.3px; stroke-linejoin: round; }
.chart-leader { fill: none; stroke: var(--muted); stroke-width: 1px; }
.chart-hit { fill: transparent; pointer-events: none; }
.js .chart-hit { pointer-events: auto; cursor: default; }
.chart-row:hover .chart-mark:not(.chart-target) { fill: var(--chart-accent-strong); }
.chart-row:hover .chart-stroke.chart-muted { stroke: var(--chart-accent-strong); }
.spark-line { stroke-width: 2px; }

/* The inverse chart on the navy hero. */
.chart-hero .chart-mark.chart-accent { fill: var(--chart-inverse-accent); }
.chart-hero .chart-mark.chart-prior, .chart-hero .chart-mark.chart-muted { fill: var(--chart-inverse-muted); }
.chart-hero .chart-mark.chart-target { fill: var(--chart-inverse-accent); }
.chart-hero .chart-marker { stroke: var(--hero-via); }
.chart-hero .chart-stroke.chart-accent, .chart-hero .chart-stroke.chart-target { stroke: var(--chart-inverse-accent); }
.chart-hero .chart-stroke.chart-prior, .chart-hero .chart-stroke.chart-muted { stroke: var(--chart-inverse-muted); }
.chart-hero .chart-grid, .chart-hero .chart-track { stroke: var(--chart-inverse-grid); }
.chart-hero .chart-axis { stroke: var(--chart-inverse-muted); }
.chart-hero .chart-text, .chart-hero .chart-label, .chart-hero .chart-tick { fill: var(--text-inverse-soft); }
.chart-hero .chart-value, .chart-hero .chart-ref-label { fill: var(--text-inverse); stroke: var(--hero-via); }
.chart-hero .chart-label { stroke: var(--hero-via); }
/* A plan tick on the navy hero is navy with a white ring, so it shows on a white bar and on
   a light one alike (VIS-03). */
.chart-hero .chart-mark.chart-plan { fill: var(--hero-from); stroke: var(--text-inverse); stroke-width: 1px; }
.chart-hero .chart-key-tick.chart-target { background-color: var(--hero-from); box-shadow: 0 0 0 1px var(--text-inverse); }
.chart-hero .chart-note { stroke: var(--text-inverse); }
.chart-hero .chart-leader { stroke: var(--text-inverse-soft); }
.chart-hero .chart-legend { color: var(--text-inverse-soft); }
.chart-hero .chart-key.chart-accent { background-color: var(--chart-inverse-accent); }
.chart-hero .chart-key.chart-prior, .chart-hero .chart-key.chart-muted { background-color: var(--chart-inverse-muted); }
.chart-hero .chart-key.chart-target { background-color: var(--chart-inverse-accent); }
.chart-hero .chart-key-split.chart-accent { background-image: linear-gradient(90deg, var(--chart-inverse-accent) 50%, var(--chart-inverse-muted) 50%); }
.chart-hero .chart-row:hover .chart-mark:not(.chart-target) { fill: var(--chart-inverse-accent); }
.chart-hero .chart-empty-text { color: var(--text-inverse-soft); }

/* The route map (web/charts.py draw_route_map, docs/FLEET-COMPANY-SPEC.md 6.4). Its paths,
   dots and yard square wear the role classes above; the runs around the story are a
   thinner line; every label keeps the surface halo, so it reads over any line. Ordinary
   zone names recede to the muted text color. Each drawing places them only where they
   clear every mark and label (the same collision rules on a phone as on a laptop), so the
   phone's drawing shows the ones that fit too (owner ruling 2026-09-29, OWN-F10). With
   scripts on, each stop's hit area (the part of its 24px square nearest to it) takes the
   pointer, so dots and labels let it through, and the hovered stop's dot turns the strong
   accent. */
.chart-stroke.chart-map-thin { stroke-width: 1.5px; }
/* Owner review OWN-F9 (2026-09-29): the map's other runs, their stops and their legend key
   use the field line token, about 3.4:1 on the card, still 1.5px, so they read on a laptop
   while the story runs draw on top in the accent and target (before the hover rule, which
   must still win). */
.chart-stroke.chart-muted.chart-map-path { stroke: var(--field-line); }
.chart-map-point .chart-mark.chart-muted { fill: var(--field-line); }
.chart-key-map.chart-muted { background-color: var(--field-line); }
.chart-map-zone { fill: var(--muted); }
.chart-map-text { pointer-events: none; }
/* Owner review OQA-10: map words keep a halo in the card's own color, so a line that
   crosses a zone name never runs through its letters. */
.chart-card .chart-map-text { paint-order: stroke; stroke: var(--surface-card); stroke-width: 3px; stroke-linejoin: round; }
.js .chart-map-point .chart-mark { pointer-events: none; }
.chart-map-point:hover .chart-mark { fill: var(--chart-accent-strong); }
.chart-map-scale { fill: none; stroke: var(--muted); stroke-width: 1.5px; stroke-linecap: butt; }
.chart-hero .chart-map-point:hover .chart-mark { fill: var(--chart-inverse-accent); }
.chart-hero .chart-map-scale { stroke: var(--text-inverse-soft); }

/* The small tooltip (static/app.js): the value first, the label second. */
.chart-tip { position: fixed; z-index: 50; max-width: 260px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: var(--shadow-2); color: var(--body); font-size: 13px; line-height: 18px; pointer-events: none; }
.chart-tip[hidden] { display: none; }
.chart-tip-value { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; font-weight: 600; }
.chart-tip-key { display: inline-block; flex: none; width: 12px; height: 3px; border-radius: 2px; background-color: var(--chart-accent); }
.chart-tip-key-prior { background-color: var(--chart-prior); }
.chart-tip-key-muted { background-color: var(--chart-muted); }
.chart-tip-key-target { background-color: var(--chart-target); }
/* On the hero the marks wear the inverse colors, and the tooltip's key follows (VIS-20). */
.chart-tip-hero .chart-tip-key-accent { background-color: var(--paper); box-shadow: 0 0 0 1px var(--line-strong); }
.chart-tip-hero .chart-tip-key-prior, .chart-tip-hero .chart-tip-key-muted { background-color: var(--chart-inverse-muted); }
.chart-tip-hero .chart-tip-key-target { background-color: var(--hero-from); }
.chart-key-note { width: 12px; height: 12px; }
.chart-tip-label, .chart-tip-more { display: block; }
.chart-tip-line { display: inline; }
.chart-tip-more { color: var(--muted); }

/* ---------- "What you can do": action cards ---------- */
.actions-grid, .options-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.action-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-1); }
.action-title { margin: 0; color: var(--ink); font-size: 17px; line-height: 24px; }
.action-why { margin: 0; color: var(--body); font-size: 15px; line-height: 22px; }
.action-who, .action-suggested { display: flex; align-items: flex-start; gap: 6px; margin: 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.action-who .icon, .action-suggested .icon { margin-top: 2px; color: var(--navy-mid); }
.action-planned { display: inline-flex; align-items: center; gap: 6px; margin: auto 0 0; padding-top: 4px; color: var(--good-ink); font-size: 14px; font-weight: 600; }
.action-planned .icon { color: var(--good-mark); }
.action-card > .disclosure { margin-top: auto; }
/* "Add to my plan" comes back here: the card's top, clear of the page head. */
.card-anchor { display: block; height: 0; scroll-margin-top: 16px; }
.action-more { margin: 0; font-size: 14px; font-weight: 600; line-height: 20px; }
.action-more a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-decoration-color: rgba(18, 101, 155, 0.45); text-underline-offset: 0.18em; }
.options { margin-top: var(--section-gap); }
.options > h2 { margin-bottom: var(--space-3); color: var(--kicker); font-size: 13px; line-height: 18px; letter-spacing: 0.12em; text-transform: uppercase; }

/* ---------- ask ---------- */
.ask-box { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-1); }
.ask-box > h2 { margin-bottom: var(--space-3); color: var(--kicker); font-size: 13px; line-height: 18px; letter-spacing: 0.12em; text-transform: uppercase; }
.ask-form { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 0; }
.ask-form textarea { flex: 1 1 260px; min-height: 52px; }
.ask-form .btn { flex: none; }

/* ---------- disclosures ---------- */
.disclosure > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--link); font-weight: 600; cursor: pointer; list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.disclosure[open] > summary .icon-chevron { transform: rotate(180deg); }
.disclosure-body { padding: 4px 0 8px; }
.disclosure-how { margin-top: var(--section-gap); padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-1); }
.disclosure-how > summary { width: 100%; min-height: 56px; color: var(--ink); font-size: 18px; }
.disclosure-how > .disclosure-body { padding-bottom: 16px; border-top: 1px solid var(--line); }
.disclosure-table { margin-top: 4px; }
.disclosure-table > summary { font-size: 14px; }
.disclosure-plan > summary { justify-content: center; width: 100%; padding: 8px 14px; border: 1px solid var(--navy-mid); border-radius: var(--radius-sm); color: var(--navy); }
.disclosure-plan > summary:hover { background: var(--tint-soft); text-decoration: none; }
.disclosure-plan[open] > summary { border-color: var(--line-strong); color: var(--muted); }
.disclosure-plan .btn { width: 100%; margin-top: 12px; }
.disclosure-checkin > summary, .disclosure-update > summary { font-size: 15px; }

/* Phone length (owner ruling 2026-10-10): "More options (N)" and "See the charts (N)" on the Snapshot.
   Native <details> written OPEN by the server; app.js closes them under 640px (data-fold-narrow).
   From 640px the summary is hidden and the cards and charts sit where they always did. */
.disclosure-fold > summary { justify-content: center; width: 100%; padding: 8px 14px; border: 1px solid var(--navy-mid); border-radius: var(--radius-sm); background: var(--surface-card); color: var(--navy); }
.disclosure-fold > summary:hover { background: var(--tint-soft); text-decoration: none; }
.fold-actions > .actions-grid-more { margin-top: 12px; }
.fold-charts { margin-top: var(--section-gap); }
.fold-charts > .charts-section { margin-top: 12px; }

/* ---------- the insight page ---------- */
.insight-head { margin-bottom: var(--space-5); }
.insight-question { margin: 0 0 8px; color: var(--kicker); font-size: 15px; font-weight: 600; line-height: 22px; }
.insight-status { margin: 0 0 12px; }
.insight-number { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 8px 0 8px; }
.insight-value { color: var(--navy-deep); font-size: 56px; font-weight: 600; line-height: 54px; letter-spacing: -0.02em; }
.insight-unit { color: var(--body); font-size: 18px; font-weight: 600; }
.insight-headline { max-width: 34ch; margin: 0; }
.insight-context { max-width: 62ch; margin: 10px 0 0; font-size: 18px; line-height: 28px; }
.insight-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 0 0; }
.insight-period { color: var(--muted); font-size: 14px; }
.insight-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.section + .insight-body { margin-top: var(--section-gap); }
.meaning { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-card); }
.meaning h2 { margin-bottom: 8px; color: var(--kicker); font-size: 13px; line-height: 18px; letter-spacing: 0.12em; text-transform: uppercase; }
.message-card { max-width: 760px; padding: 20px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-1); }
.message-not_answered, .message-missing { border-left-color: var(--gray); }
.message-question { margin: 0 0 10px; color: var(--kicker); font-size: 15px; font-weight: 600; line-height: 22px; }
.message-next { margin: 10px 0 0 30px; color: var(--muted); font-size: 15px; line-height: 22px; }
.message-text { display: flex; align-items: flex-start; gap: 10px; margin: 0; color: var(--ink); font-size: 18px; line-height: 28px; }
.message-text .icon { width: 20px; height: 20px; margin-top: 4px; color: var(--navy-mid); }

/* "How we know this" */
.how-section { margin-top: 20px; }
.how-section > h3 { margin: 0 0 8px; color: var(--kicker); font-size: 12px; line-height: 16px; letter-spacing: 0.12em; text-transform: uppercase; }
.how-period { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.how-math { margin: 0; padding-left: 1.2em; }
.how-math li { margin-bottom: 6px; }
.how-notes, .how-records { margin: 0; padding: 0; list-style: none; }
.how-notes > li { padding: 12px 0; border-top: 1px solid var(--line); }
.how-notes > li:first-child { border-top: 0; padding-top: 4px; }
.note-label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 6px; color: var(--ink); font-weight: 600; }
.how-notes blockquote { margin: 0 0 6px; padding: 8px 12px; border-left: 3px solid var(--line-strong); border-radius: 0 8px 8px 0; background: var(--surface-sunken); color: var(--ink); }
.how-notes blockquote p { margin: 0; }
.note-findings { margin: 0; padding-left: 1.2em; color: var(--body); font-size: 14px; }
.how-group { margin: 12px 0 4px; color: var(--ink); font-size: 15px; }
.how-records li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 20px; }
.record-source { color: var(--muted); }
.how-technical { margin-top: 20px; padding: 12px 14px; border-radius: 8px; background: var(--surface-sunken); }
.how-technical h3 { color: var(--ink); }
dl.defs dt { margin-top: 10px; color: var(--ink); font-weight: 600; }
dl.defs dd { margin: 2px 0 0; font-size: 15px; }

/* ---------- the action plan ---------- */
.plan-list { display: grid; gap: 12px; }
.plan-item { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-1); }
.plan-next { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; color: var(--kicker); font-size: 14px; font-weight: 600; line-height: 20px; }
.add-action-form, .checkin-form { max-width: 560px; }
.plan-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; }
.plan-what { margin: 0; flex: 1 1 240px; font-size: 18px; line-height: 24px; }
.plan-facts { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 12px 0 0; }
.plan-facts > div { min-width: 0; }
.plan-facts dt { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 16px; letter-spacing: 0.08em; text-transform: uppercase; }
.plan-facts dd { margin: 2px 0 0; color: var(--ink); }
.plan-facts .badge { margin-left: 4px; }
.plan-from { margin: 12px 0 0; font-size: 14px; }
.plan-changed { margin: 10px 0 0; }
.plan-controls { display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 4px; }
.plan-controls > .disclosure { flex: 1 1 100%; }
.plan-done .plan-what, .plan-dropped .plan-what { color: var(--body); }
.plan-dropped { background: var(--surface-page); box-shadow: none; }
.change { display: grid; gap: 4px; margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--surface-sunken); font-size: 15px; line-height: 22px; }
.change-then, .change-now { display: block; }
.change-now { color: var(--ink); font-weight: 600; }
.change-now.muted { color: var(--muted); font-weight: 400; }
.change-direction { justify-self: start; margin-top: 4px; }

/* ---------- parts (consultant) and empty states ---------- */
.parts { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.part { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.part:first-child { border-top: 0; }
.part-title { color: var(--ink); font-weight: 600; }
.ribbon { display: inline-flex; align-items: center; gap: 6px; }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 24px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--surface-card); }
.empty > .icon { width: 24px; height: 24px; color: var(--navy-mid); }
.empty-title { margin: 0; color: var(--ink); font-size: 18px; font-weight: 600; line-height: 24px; }
.empty-text { max-width: 60ch; margin: 0; }

/* ---------- tables: wide ones scroll inside their card ---------- */
/* position: relative keeps visually hidden header text inside the scroll box too, so it
   never widens the page. */
.table-wrap { position: relative; max-width: 100%; margin-bottom: 12px; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data thead th { border-bottom-color: var(--line-strong); background: var(--surface-sunken); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tbody tr:hover { background: #fafcfe; }
table.data tbody tr:target, table.data tbody:target tr { background: var(--watch-bg); }
table.data.compact th, table.data.compact td { padding: 6px 8px; }
table.data code { white-space: nowrap; }
table.evidence tbody { border-top: 2px solid var(--line); }
table.kv-table th { width: 32%; background: var(--surface-sunken); color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
table.kv-table td { overflow-wrap: anywhere; }
tr.needs-look td { background: #fffaf0; }
.mapping-table select, .mapping-table input { width: 100%; min-width: 150px; }
.mapping-table tr.mapped td { background: #f7fbff; }

dl.kv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px 16px; margin: 0 0 12px; }
dl.kv dt { color: var(--ink); font-weight: 600; }
dl.kv dd { margin: 0 0 8px; min-width: 0; }

/* ---------- the consultant's answer and review pieces ---------- */
.answer-text { max-width: 900px; color: var(--ink); font-size: 17px; white-space: pre-line; }
a.figure { padding: 0 2px; border-bottom: 2px solid var(--blue); border-radius: 2px; background: var(--tint-soft); color: var(--navy-deep); font-weight: 600; }
a.figure:hover { background: var(--tint); text-decoration: none; }
.caveats { margin-top: 12px; color: var(--body); font-size: 15px; }
details.how > summary { cursor: pointer; list-style: none; }
details.how > summary::-webkit-details-marker { display: none; }
details.how > summary h2 { display: inline-block; margin: 0; }
details.how > summary::before { content: "+"; display: inline-block; width: 1.1em; color: var(--navy-mid); font-weight: 600; }
details.how[open] > summary::before { content: "\2212"; }
details.how[open] > summary { margin-bottom: 12px; }
pre.sql { margin: 0 0 12px; padding: 14px 16px; overflow-x: auto; border-radius: 8px; background: var(--code-bg); color: var(--code-ink); line-height: 1.45; }
pre.sql code { padding: 0; background: none; color: inherit; }
details.sub { margin-top: 12px; }
details.sub > summary { color: var(--link); font-size: 15px; font-weight: 600; cursor: pointer; }
details.mapping { margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fcfdfe; }
details.mapping > summary { cursor: pointer; }
details.mapping[open] > summary { margin-bottom: 8px; }
.answer-list { margin: 0 0 10px; padding: 0; list-style: none; }
.answer-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.answer-list li:last-child { border-bottom: 0; }
.answer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.queue-item { padding: 14px 0 6px; border-top: 1px solid var(--line); }
.queue-item:first-of-type { padding-top: 4px; border-top: 0; }
.queue-item h3 { margin: 0 0 4px; font-size: 16px; }
.excerpt { padding: 8px 10px; border-radius: 8px; background: var(--tint-soft); color: var(--body); font-size: 15px; }
.review-form textarea { max-width: 720px; }
.history { font-size: 14px; }
.checks { margin: 0 0 10px; padding: 0; list-style: none; }
.checks li { display: flex; align-items: baseline; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.checks li:last-child { border-bottom: 0; }
.check-count { min-width: 2.4em; padding: 0 6px; border-radius: 4px; font-weight: 600; text-align: center; }
.check-ok .check-count { background: var(--good-bg); color: var(--good-ink); }
.check-warn .check-count { background: var(--watch-bg); color: var(--watch-ink); }
.steps li { margin-bottom: 6px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.person { display: flex; flex-direction: column; margin: 0; }
.person h2 { font-size: 17px; }
.person ul { flex: 1; }

/* ---------- footer: the gray wordmark on navy ---------- */
.site-footer { padding: 28px 0 32px; background: var(--footer); color: var(--footer-text); font-size: 14px; }
.footer-inner { display: flex; flex-direction: column; align-items: flex-start; gap: 16px 40px; }
.footer-mark { display: block; flex: none; width: 145px; min-width: 140px; height: auto; object-fit: contain; }
.footer-text { max-width: 640px; }
.site-footer .notice { margin-bottom: 4px; color: var(--footer-notice); font-weight: 600; }
.site-footer .fine { margin: 0; color: var(--footer-fine); font-size: 13px; }

/* ---------- page pieces (the page templates' own parts) ---------- */
/* Radios and checkboxes keep their own size: the field rule above is for text boxes. */
input[type="radio"], input[type="checkbox"] { flex: none; width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0; border-radius: 0; accent-color: var(--navy); }
fieldset.choices { min-width: 0; margin: 16px 0 4px; padding: 0; border: 0; }
.choices > legend { margin: 0 0 6px; padding: 0; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 20px; }
label.choice { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); font-size: 16px; font-weight: 400; line-height: 22px; cursor: pointer; }
label.choice + label.choice { margin-top: 8px; }
label.choice:has(input:checked) { border-color: var(--navy-mid); background: var(--tint-soft); }
label.choice.small { min-height: 32px; margin-top: 6px; padding: 4px 0; border: 0; background: none; font-size: 14px; }

/* The consultant's tools above the snapshot: publish, refresh and where each part stands. */
.consultant-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; margin: 0 0 var(--space-5); padding: 8px 16px; border: 1px dashed var(--watch-line); border-radius: var(--radius-md); background: var(--surface-card); }
.consultant-tools .snap-tools { margin: 4px 0; }
.consultant-tools > .disclosure { flex: 1 1 260px; min-width: 0; }
.consultant-tools .parts { margin-top: 4px; }

/* The insight page: the consultant's review panel, callouts, details and "keep checking". */
.review-panel { margin: var(--space-5) 0; border-left: 4px solid var(--watch-mark); }
.review-panel > h2 { margin-bottom: 8px; }
.review-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.insight-callouts { display: grid; gap: 12px; }
.insight-details .table-wrap { padding: 4px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-card); }
.keep-checking { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.keep-checking p { margin: 0; }

/* Ask: the owner's questions on the right, the answers on the left. */
.card.turn { margin: 0 0 var(--space-5); padding: 0; border: 0; background: transparent; box-shadow: none; }
.turn-question { max-width: min(560px, 90%); margin: 0 0 10px auto; padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: var(--navy-deep); color: var(--text-inverse); }
.turn-question strong { color: var(--text-inverse); }
.turn-question .muted { display: block; margin-top: 2px; color: var(--text-inverse-soft); text-align: right; }
.turn-question .turn-opened { display: block; font-size: 0.8125rem; color: var(--text-inverse-soft); }
.turn-answer { max-width: min(640px, 96%); padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; background: var(--surface-card); box-shadow: var(--shadow-1); }
.turn-waiting, .turn-not_answered, .turn-missing, .turn-unavailable { border-left: 4px solid var(--blue); }
.turn-not_answered, .turn-missing, .turn-unavailable { border-left-color: var(--gray); }
.turn-badge { margin: 0 0 6px; }
.turn-number { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0; }
.turn-value { color: var(--navy-deep); font-size: 32px; font-weight: 600; line-height: 36px; letter-spacing: -0.01em; }
.turn-unit { color: var(--body); font-weight: 600; }
.turn-headline { margin: 4px 0 12px; color: var(--ink); font-size: 17px; font-weight: 600; line-height: 24px; }
.turn-answer .message-text { font-size: 16px; line-height: 24px; }
.turn-answer .message-text .icon { width: 18px; height: 18px; margin-top: 3px; }
.turn-answer > a.small { display: inline-block; margin-top: 8px; }
.saved .answer-list, .file-list { margin: 0; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-1); }

/* Your files: each file in their words, with a count in the same words. */
.file-list { margin-top: var(--space-4); }
.file-list > .file-item { align-items: center; padding: 14px 0; }
.file-main { display: flex; flex: 1 1 280px; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-width: 0; }
.file-main > .icon { color: var(--navy-mid); }
.file-name { color: var(--ink); font-size: 17px; font-weight: 600; line-height: 24px; overflow-wrap: anywhere; }
.file-main > .small { flex: 1 1 100%; padding-left: 26px; }
/* Delete or replace a file (production workstream B): the consultant's controls, on a row of their own. */
.file-lifecycle { flex: 1 1 100%; }
.file-lifecycle .stack + .stack { margin-top: var(--space-4); }
.file-count { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.column-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.column-list li { padding: 4px 12px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-sunken); color: var(--ink); font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.upload-form { max-width: 560px; }
.file-card h2 { margin-top: var(--space-5); }
/* docs/QUICKBOOKS-SPEC.md 3.10: a report file's totals. "Matches the totals in your file."
   in the good ink with its check; the consultant's warning in the watch ink, never red. */
.file-totals { display: inline-flex; flex: 1 1 100%; align-items: flex-start; gap: 6px; margin: 2px 0 0; padding-left: 26px; font-size: 14px; line-height: 20px; }
.file-totals .icon { flex: none; margin-top: 2px; }
p.file-totals { padding-left: 0; }
.file-totals-ok { color: var(--good-ink); }
.file-totals-warn { color: var(--watch-ink); }
.file-totals-warn a { color: inherit; font-weight: 600; }
.upload-guide { max-width: 72ch; }
.report-card { border-left: 4px solid var(--good-mark); }
.report-card-warn { border-left-color: var(--watch-mark); }
.totals-ok { display: flex; align-items: flex-start; gap: 6px; color: var(--good-ink); }
.totals-ok .icon { flex: none; margin-top: 3px; }
.totals-warning { margin: 12px 0; padding: 12px 16px; border: 1px solid var(--watch-line); border-radius: var(--radius-sm); background: var(--watch-bg); color: var(--watch-ink); }
.totals-warning > p { margin: 0; }
.totals-warning > p + p { margin-top: 8px; }
.totals-warning-head { display: flex; align-items: flex-start; gap: 8px; font-weight: 600; }
.totals-warning-head .icon { flex: none; margin-top: 3px; }
.totals-warning a { color: inherit; font-weight: 600; }
.set-aside-checks { margin: 8px 0 0; padding-left: 20px; }
.money-checks-form { margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid var(--line); }

/* Setup and Review (the consultant's pages). */
.setup-section { margin-bottom: var(--space-5); }
.setup-section > h2 { display: flex; align-items: center; gap: 12px; }
.setup-step { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: var(--text-inverse); font-size: 15px; line-height: 1; }
.setup-form > .stack { margin-top: 4px; }
/* Owner review OQA-17: the yard's two short fields side by side, each sized for a decimal. */
.yard-row { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.yard-field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.yard-field input { width: 12rem; max-width: 100%; }
.words-table input:not([type="checkbox"]):not([type="radio"]) { width: 100%; min-width: 120px; }
.words-table textarea { min-height: 44px; }
.words-table tr.word-words > th { min-width: 150px; color: var(--ink); font-weight: 600; }
.words-table tr.word-words > td { padding-bottom: 4px; border-bottom: 0; }
.words-table tr.word-meaning > td { padding-top: 0; }
.definition-form { padding: 12px 0 16px; border-top: 1px solid var(--line); }
.definition-form:first-of-type { border-top: 0; }
.definition-form > label { margin-top: 0; }
/* Owner review OWN-P0-20 (2026-10-02): a long settings line (a list of line items with no
   spaces) wraps inside a phone's card instead of widening the Setup page. */
.definition-form .small { overflow-wrap: anywhere; }
.setup-files { margin: 0 0 12px; padding: 0; list-style: none; }
.setup-files li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.setup-files li:first-child { border-top: 0; }
.file-filename { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.snapshot-group { border-top: 3px solid var(--blue); }
.snapshot-group .parts { margin-top: 8px; }
.disclosure-add { margin-bottom: var(--space-4); padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-1); }
.behind .disclosure-behind { padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-card); }
.behind .disclosure-behind + .disclosure-behind { margin-top: 8px; }
.behind .disclosure-behind > summary { width: 100%; color: var(--ink); }
.behind .disclosure-behind > .disclosure-body { padding-bottom: 12px; border-top: 1px solid var(--line); }
.page-head-actions { margin: 0; }
.disclosure-add > .disclosure-body { padding-bottom: 16px; }
.disclosure-upload > .disclosure-body { padding-top: 8px; }

/* ---------- 640px and up ---------- */
@media (min-width: 640px) {
  :root { --gutter: 24px; }
  h1 { font-size: 30px; line-height: 36px; }
  .main { padding-top: var(--space-5); }
  .card { padding: 20px 24px; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dl.kv { grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; }
  dl.kv dd { margin-bottom: 0; }
  .header-inner { padding-top: 16px; padding-bottom: 14px; }
  .brand-mark { width: 161px; }
  .brand-product { flex-direction: row; align-items: center; gap: 6px 10px; min-height: 32px; margin: 0 0 0 18px; padding-left: 18px; }
  .brand-name { font-size: 17px; }
  .header-tools { justify-content: flex-end; width: auto; margin-left: auto; }
  .who { margin-left: 0; }
  .switcher-label { max-width: 30vw; }
  .switcher-menu { left: auto; right: 0; }
  .company-name { display: inline-flex; }
  .btn-small, .chip { min-height: 36px; }
  .switch { min-height: 36px; }
  .hero-how, .hero-jump, .also-link, .action-more a { min-height: 36px; }
  .nav-link { min-height: 48px; gap: 8px; padding-left: 12px; padding-right: 12px; }
  .nav-label-long { display: inline; }
  .nav-label-short { display: none; }
  .preview-long { display: inline; }
  .preview-short { display: none; }
  /* Owner review OQA-04: while previewing, the bar is one slim row and the page starts a
     little higher, so the fold holds in Preview as owner as it does for the owner. */
  .preview-inner { min-height: 32px; padding-top: 2px; padding-bottom: 2px; }
  .preview-bar .btn-small { min-height: 28px; padding-top: 2px; padding-bottom: 2px; }
  .preview-bar ~ .main { padding-top: var(--space-2); }
  .kpi-grid { gap: 16px; }
  .tile { padding: 16px 18px 14px; }
  .tile-value { font-size: 32px; line-height: 36px; }
  .tile-help { display: block; }
  .delta { align-items: center; padding: 3px 10px 3px 8px; border: 1px solid; border-radius: var(--radius-pill); white-space: nowrap; }
  .delta .icon { margin-top: 0; }
  .delta-good { border-color: var(--good-line); background: var(--good-bg); }
  .delta-watch { border-color: var(--watch-line); background: var(--watch-bg); }
  .delta-act { border-color: var(--act-line); background: var(--act-bg); }
  .delta-neutral { border-color: var(--line-strong); background: var(--paper); }
  .delta-inverse { background: var(--navy-deep); }
  .delta-inverse.delta-good { border-color: var(--good-inverse); background: var(--navy-deep); }
  .delta-inverse.delta-watch { border-color: var(--watch-inverse); background: var(--navy-deep); }
  .delta-inverse.delta-act { border-color: var(--act-inverse); background: var(--navy-deep); }
  .delta-inverse.delta-neutral { border-color: var(--text-inverse-soft); background: var(--navy-deep); }
  .hero { padding: 24px 28px 22px; }
  .hero .btn-inverse { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
  .hero .disclosure-table > summary { min-height: 32px; }
  .hero-answer { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 28px; }
  .hero-number { flex-direction: column; align-items: flex-start; gap: 0; }
  .hero-value { font-size: 72px; line-height: 68px; }
  /* Two figures (R4): on one row with their labels under them, the headline under the pair
     until the hero is wide enough to hold all three side by side (container query below). */
  .hero-answer.hero-answer-two { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero-figures { flex-wrap: nowrap; gap: 12px 40px; }
  .hero-answer-two .hero-figures { margin-bottom: 0; }
  .hero-money-value { font-size: 72px; line-height: 68px; }
  .hero-headline { font-size: 30px; line-height: 36px; }
  .hero-links-wide { display: flex; margin-left: auto; }
  .hero-links-narrow { display: none; }
  .hero-jump { display: none; }
  .actions-grid, .options-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-sm { display: none; }
  .chart-md { display: block; }
  .chart-card { padding: 20px 16px; }
  .insight-value { font-size: 72px; line-height: 68px; }
  .footer-inner { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .footer-text { flex: 1 1 320px; }
  .plan-controls > .disclosure { flex: 0 1 auto; }
  .plan-controls > .disclosure[open] { flex-basis: 100%; }
  /* The folds are for phones: no summary, and the cards and charts in their old cells. */
  .disclosure-fold > summary { display: none; }
  .fold-actions { grid-column: 1 / -1; }
  .fold-actions > .actions-grid-more { margin-top: 0; }
  .fold-charts { margin-top: 0; }
  .fold-charts > .charts-section { margin-top: var(--section-gap); }
}

/* ---------- 960px and up ---------- */
@media (min-width: 960px) {
  .header-inner { flex-wrap: nowrap; }
  .nav-inner { flex-wrap: nowrap; }
  .preview-switch { margin: 0; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid > .tile:last-child:nth-child(odd) { grid-column: auto; }
  .kpi-grid > .tile:last-child:nth-child(3n + 2) { grid-column: span 2; }
  .kpi-grid > .tile:last-child:nth-child(3n + 1) { grid-column: 1 / -1; }
  /* A card takes the whole chart row when components/snapshot.html charts_section marks it
     chart-card-full: a tall chart (VIS-13), the route map (the story chart, owner review
     OWN-F9), or a card left with no partner in its row. Its drawing grows to at most 720px;
     the map's is centered (found by its paths, never by the chart kind class). */
  .charts-grid > .chart-card-full { grid-column: 1 / -1; }
  .charts-grid > .chart-card-full .chart-md { width: min(100%, 720px); }
  .charts-grid > .chart-card:has(.chart-map-path) .chart-md { margin: 0 auto; }
  /* Owner review OQA-05: a whole-row card other than the map keeps its drawing at the
     drawing's own 560px and sets its title, caption, table and links beside it, so the row
     never ends in an empty half. */
  .charts-grid > .chart-card-full:not(:has(.chart-map-path)) { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; column-gap: 32px; align-items: start; }
  .charts-grid > .chart-card-full:not(:has(.chart-map-path)) > * { grid-column: 2; }
  .charts-grid > .chart-card-full:not(:has(.chart-map-path)) > .chart { grid-column: 1; grid-row: 1 / -1; }
  .charts-grid > .chart-card-full:not(:has(.chart-map-path)) .chart-md { width: 100%; }
  .charts-grid > .chart-card-full:not(:has(.chart-map-path)) > .chart-card-foot { align-self: end; }
  /* Owner ruling 2026-09-29 (the fold, DESIGN-v2 18.5): every company's whole hero and the
     "What you can do" heading fit the first 1280 by 800 screen, so the hero's own spacing
     is a step tighter on wide screens. */
  .hero { padding: 20px 36px 16px; }
  .hero-question { margin-bottom: 8px; }
  .hero-context { margin-top: 8px; }
  .hero-meta { margin-top: 10px; }
  .hero-body { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 10px; }
  .hero-visual-head { margin-bottom: 4px; }
  .hero .chart-legend { margin-bottom: 4px; }
  /* The caption and the table toggle share one row under the chart, so the whole hero
     and "What you can do" fit the first 1280 by 800 screen (DESIGN-v2 1.1). An open
     table takes the full width under them. */
  .hero-visual { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 16px; }
  .hero-visual > * { flex: 1 1 100%; min-width: 0; }
  .hero-visual > .chart-caption { flex: 1 1 240px; margin: 0; }
  .hero-visual > .disclosure-table { flex: 0 0 auto; }
  .hero-visual > .disclosure-table[open] { flex-basis: 100%; }
  /* Beside the related chips (no note callout), a chart with no caption line puts "Show as
     a table" beside its short title instead of on a row of its own (the fold, owner ruling
     2026-09-29); open, the table shows under the title. */
  .hero-body-aside .hero-visual > .hero-visual-head { order: -2; flex: 1 1 auto; }
  .hero-body-aside .hero-visual > .chart + .disclosure-table { order: -1; }
  .hero-body-solo { grid-template-columns: minmax(0, 1fr); }
  .actions-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fold-actions { grid-column: span 2; }
  .actions-grid-more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Cards three and four fill the row's height like cards one and two (the fold is a grid
     cell; its content stretches to it). */
  .fold-actions { display: flex; }
  .fold-actions::details-content { display: block; flex: 1 1 auto; min-width: 0; }
  .fold-actions > .actions-grid-more { flex: 1 1 auto; min-width: 0; height: 100%; }
  .options-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .charts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-body { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
  /* Owner review OQA-07: with no chart, "What this means" takes the row. */
  .insight-body.insight-body-solo { grid-template-columns: minmax(0, 1fr); }
  .insight-body-solo .meaning p { max-width: 72ch; }
  .disclosure-how { padding: 0 24px; }
}

@media (min-width: 1024px) {
  :root { --gutter: 32px; }
}

/* ---------- which drawing a chart shows ---------- */
/* Each chart is drawn at 360 and at 560 (web/charts.py). Text stays 11px or more only when
   the 560 drawing has 514px or more to itself, so where container queries work the chart
   picks its drawing by its own width (a hero column at 960px is narrower than a phone in
   landscape); elsewhere the 640px rule above decides. */
@supports (container-type: inline-size) {
  .tile { container-type: inline-size; }
  .tile-value-long { font-size: clamp(18px, 16cqi, 32px); line-height: 1.15; }
  .chart { container-type: inline-size; }
  .chart .chart-sm { display: block; width: 100%; max-width: 450px; }
  .chart .chart-md { display: none; }
  @container (min-width: 514px) {
    .chart .chart-sm { display: none; }
    .chart .chart-md { display: block; }
  }
  /* Owner ruling 2026-09-29 (R4): the hero's two figures and its headline share one row
     only where the hero holds all three (from 1000px inside it: at 1280 by 800), so the
     headline never squeezes into a narrow column; otherwise the headline sits under the
     figures. */
  .hero { container: hero / inline-size; }
  @container hero (min-width: 1000px) {
    .hero-answer.hero-answer-two { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 36px; }
  }
}

/* ---------- motion: only when the reader has not asked for less ---------- */
@media (prefers-reduced-motion: no-preference) {
  .action-card, .tile, .chart-card, .plan-item { transition: box-shadow 150ms ease, transform 150ms ease; }
  .action-card:hover, .tile:hover, .chart-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
  .disclosure > summary .icon-chevron { transition: transform 150ms ease; }
  .chart-mark, .chart-stroke { transition: fill 150ms ease, stroke 150ms ease; }
  .btn, .chip, .switch, .nav-link { transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
}

/* ---------- forced colors (Windows high contrast): system colors, outlines ---------- */
@media (forced-colors: active) {
  .hero { border: 2px solid CanvasText; background: Canvas; color: CanvasText; }
  .tone, .delta, .badge, .chip, .switch, .nav-count, .callout, .tile, .action-card, .chart-card, .plan-item, .message-card { border: 1px solid CanvasText; }
  .nav-link.on { border-bottom-color: Highlight; }
  .chart-svg, .chart-key, .sparkline, .chart-tip-key { forced-color-adjust: none; }
  .chart .chart-mark, .sparkline .chart-mark { fill: GrayText; }
  .chart .chart-mark.chart-accent, .sparkline .chart-mark.chart-accent, .chart .chart-row:hover .chart-mark:not(.chart-target) { fill: Highlight; }
  .chart .chart-mark.chart-target { fill: CanvasText; }
  .chart .chart-marker, .sparkline .chart-marker { stroke: Canvas; }
  .chart .chart-stroke, .sparkline .chart-stroke { stroke: CanvasText; }
  .chart .chart-stroke.chart-accent, .sparkline .chart-stroke.chart-accent { stroke: Highlight; }
  .chart .chart-grid, .chart .chart-axis, .chart .chart-track { stroke: GrayText; }
  .chart .chart-text, .chart .chart-label, .chart .chart-value, .chart .chart-tick, .chart .chart-ref-label { fill: CanvasText; stroke: Canvas; }
  .chart .chart-note, .chart .chart-leader, .chart .chart-map-scale { stroke: CanvasText; }
  .chart .chart-stroke.chart-map-thin { stroke: GrayText; }
  .chart .chart-map-point:hover .chart-mark { fill: Highlight; }
  .chart .chart-key, .chart-tip-key { border: 1px solid CanvasText; background: GrayText; }
  .chart .chart-key.chart-accent, .chart-tip-key { background: Highlight; }
  .chart .chart-hit { fill: transparent; }
  .chart-tip { border: 1px solid CanvasText; }
}

/* ---------- Owner rulings of 2026-09-29 (docs/DESIGN-v2.md 18) ---------- */

/* D2: the route map's day picker, a plain GET form: the label on its own line on a phone,
   the list of days and "Show" sharing the next, every target 44px. */
.map-day-form { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 12px; }
.map-day-form > label { margin: 0; }
.map-day-controls { display: flex; flex: 1 1 260px; align-items: center; gap: 8px; min-width: 0; }
.map-day-controls select { flex: 1 1 auto; min-width: 0; max-width: 20rem; min-height: 44px; }
.map-day-controls .btn { flex: none; min-height: 44px; }

/* OWN-F13: the one option a chart card names under its chart. */
.chart-card-action { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
.chart-card-action .icon { color: var(--navy-mid); }
.chart-card-action a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-decoration-color: rgba(18, 101, 155, 0.45); text-underline-offset: 0.18em; }
.chart-link a { display: inline-flex; align-items: center; min-height: 44px; }

/* OWN-F10: a chart's table twin fits a phone's card: headers wrap instead of widening the
   table (the route map's was 482px wide in a 343px column). */
.disclosure-table table.data thead th { white-space: normal; }
.disclosure-table table.data.compact th, .disclosure-table table.data.compact td { padding: 6px; }

/* OWN-23: a small comparison, short bars with their values (web/charts.py render_mini). */
.insight-aside { display: grid; align-content: start; gap: 16px; min-width: 0; }
.mini { min-width: 0; margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-card); }
.mini-title { display: block; margin: 0 0 8px; color: var(--kicker); font-size: 13px; font-weight: 600; line-height: 18px; letter-spacing: 0.12em; text-transform: uppercase; }
.mini-drawing { max-width: 320px; }
.mini-svg { display: block; width: 100%; max-width: 100%; height: auto; }
.mini-list { margin: 0; padding-left: 1.2em; }
/* On the hero it sits under the related chips beside the chart, from 960px only, where it
   adds no height to the card (the fold, DESIGN-v2 1.1); the insight page always shows it. */
.mini-inverse { display: none; margin-top: 16px; padding: 0; border: 0; background: none; }
.mini-inverse .mini-title { color: var(--text-inverse-soft); font-size: 12px; line-height: 16px; }

/* D5: a list insight's own table (the after-hours trips worth a look). On a phone or a
   tablet each row reads as "heading: value" lines, so nothing scrolls sideways; from 960px
   it is a table (below). */
.insight-list .list-table, .insight-list .list-table tbody, .insight-list .list-table tr,
.insight-list .list-table td { display: block; width: 100%; }
.insight-list .list-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Owner review OQA-07: on a phone each row reads as one short paragraph of "heading: value"
   pairs, so a list of trips stays short and still says what each value is. */
.insight-list .list-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 22px; }
.insight-list table.list-table td { display: inline; width: auto; padding: 0; border: 0; text-align: left; overflow-wrap: anywhere; }
.insight-list .list-table td::before { content: attr(data-label) ": "; color: var(--muted); font-weight: 600; }
.insight-list .list-table td:not(:last-child)::after { content: " \00B7  "; color: var(--muted); }
/* A blank cell on a phone would read "First number: \00B7"; it is left out (visual QA). */
.insight-list .list-table td:empty { display: none; }
/* Owner review OWN-P0-01 (2026-10-02): a number cell wraps on a phone like any other cell
   (table.data .num keeps numbers on one line in a table), so a long row breaks between its
   "heading: value" pairs and inside a long heading instead of running past the card. */
.insight-list table.list-table td.num { white-space: normal; }

/* R2: an estimate on a stat tile reads "about" in small type (the flooring store's margin
   lost to price increases after quoting, docs/FLOORING-COMPANY-SPEC.md 3.2). */
.tile-about { color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: 0; }
/* The consultant's list of the figures rounded for the owner, with the exact ones. */
.rounded-list { margin: 8px 0 0; }
.rounded-list p { margin: 0 0 4px; }
.rounded-list ul { margin: 0; }

/* The insight page's two figures (R4), as on the hero. */
.insight-figures { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 28px; margin: 8px 0; }
.insight-figures .insight-number { margin: 0; }
.insight-figures-two .insight-number { flex-direction: column; align-items: flex-start; gap: 2px; }
.insight-money-figure { display: inline-flex; flex-wrap: nowrap; align-items: baseline; gap: 6px; }
.insight-money-value { color: var(--navy-deep); font-size: 56px; font-weight: 600; line-height: 54px; letter-spacing: -0.02em; white-space: nowrap; }
.insight-about { color: var(--body); font-size: 18px; font-weight: 600; line-height: 22px; }
.insight-money-label { max-width: 24ch; color: var(--body); font-size: 18px; font-weight: 600; line-height: 22px; }

@media (min-width: 640px) {
  .insight-money-value { font-size: 72px; line-height: 68px; }
  .chart-link a, .chart-card-action a { min-height: 36px; }
}

@media (min-width: 960px) {
  .hero-aside .mini-inverse { display: block; }
  /* D5: from 960px the list is a table again, its headers wrapping so it fits the page. */
  .insight-list .list-table { display: table; width: 100%; }
  .insight-list .list-table thead { position: static; display: table-header-group; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal; }
  .insight-list .list-table thead th { white-space: normal; }
  .insight-list .list-table tbody { display: table-row-group; }
  .insight-list .list-table tr { display: table-row; padding: 0; border: 0; }
  .insight-list table.list-table td { display: table-cell; width: auto; padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: normal; }
  .insight-list .list-table td:not(:last-child)::after { content: none; }
  .insight-list .list-table td.num { text-align: right; }
  .insight-list table.list-table td.num { white-space: nowrap; }
  .insight-list .list-table td::before { content: none; }
  .insight-list table.list-table td:empty { display: table-cell; }
}

/* "Money worth a look" (docs/FLOORING-COMPANY-SPEC.md 8.2): the money checks' tiles as their
   own section below the pack's tiles. It is .kpis with .kpi-grid, so it stacks exactly as
   the tiles do on a phone; only the way to the money tiles' own page is new. */
.money-more { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-weight: 600; }
.money-more .icon { color: var(--navy-mid); }
.money-more a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-decoration-color: rgba(18, 101, 155, 0.45); text-underline-offset: 0.18em; }
@media (min-width: 640px) {
  .money-more a { min-height: 36px; }
}

/* ---------- docs/FLOORING-P0-SPEC.md (approved by Josh 2026-10-01) ---------- */
/* The line right below the hero (2.4 and 10.1): body text with no card, 8px under the hero
   and 24px above "What you can do", so the fold of 10.1 holds at 1280 by 800. Each link stays
   whole: the sentence and its first link share a line at 1280 wide, the second may wrap. */
.strip { margin: 8px 0 0; color: var(--ink); font-size: 16px; line-height: 24px; }
.strip .badge { margin-right: 6px; }
.strip-text strong { font-weight: 600; }  /* owner review OWN-P0-13: its two dollar figures */
/* Owner review OWN-P0-13 (2026-10-02): the links are one group that starts its own line when it
   does not fit after the sentence, with gaps instead of a left margin, so a wrapped link never
   starts with a ragged indent; on a phone each link is a 44px tap target (phones first: from
   640px a link is one line of text again, so the fold of 10.1 holds). */
.strip-links { display: inline-flex; flex-wrap: wrap; column-gap: 12px; max-width: 100%; vertical-align: top; }
.strip-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; white-space: nowrap; text-decoration: underline; text-decoration-color: rgba(18, 101, 155, 0.45); text-underline-offset: 0.18em; }
.strip + .section { margin-top: 24px; }
@media (min-width: 640px) {
  .strip-link { display: inline; min-height: 0; }
}

/* ---------- docs/OWNER-UX-v3-SPEC.md 1a: "How the business did" ---------- */
/* One slim row between the freshness line and the hero: no cards, no help sentences. On a phone
   each measure is one line (label, value, change) at least 44px tall, so four fit in about 180px;
   from 640px they sit side by side, the label over the value over the change. The values are far
   smaller than the hero's number, which stays the page's loudest element. Each entry links to its
   tile. */
.band { margin: 0 0 var(--space-4); }
.band-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.band-entry { border-bottom: 1px solid var(--line); }
.band-link { display: grid; grid-template-columns: minmax(0, 1fr) 7rem minmax(0, 1.2fr); align-items: center; gap: 2px 12px; min-height: 44px; padding: 4px 0; color: var(--ink); text-decoration: none; }
.band-link:hover .band-label { text-decoration: underline; }
.band-label { min-width: 0; color: var(--body); font-size: 14px; font-weight: 600; line-height: 18px; }
.band-value { color: var(--ink); font-size: 20px; font-weight: 600; line-height: 24px; white-space: nowrap; }
.band-about { color: var(--muted); font-size: 14px; font-weight: 600; }
.band-link .delta { font-size: 13px; line-height: 18px; }
/* The band's goal line: the status word and the gap in short form ("Off track, 2.4 pts under goal"), under the
   change on its own row (a phone) or last in the column (from 640px). */
.band-goal { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; line-height: 18px; }
/* docs/OWNER-UX-v3-PHASE2-SPEC.md 2d: the entry's monthly trend line, small and quiet (the hidden words
   beside it say what it is). On a phone it shares the goal row's line, under the change; from 640px it sits
   beside the value, so it adds no height. */
.band-trend { grid-column: 3; grid-row: 2; justify-self: start; display: block; line-height: 0; }
.band-trend .sparkline { width: 72px; }
.band-has-trend .band-goal { grid-column: 1 / 3; grid-row: 2; }
.band-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 var(--space-2); color: var(--muted); font-size: 14px; line-height: 20px; }
.band-is-suggested .band-list { border-top-style: dashed; border-top-color: var(--watch-line); }
@media (min-width: 640px) {
  .band-list { display: flex; border-bottom: 1px solid var(--line); }
  .band-entry { flex: 1 1 0; min-width: 0; border-bottom: 0; border-left: 1px solid var(--line); }
  .band-entry:first-child { border-left: 0; }
  .band-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; justify-items: start; align-content: start; gap: 2px 8px; height: 100%; padding: 10px 16px; }
  .band-link > * { grid-column: 1 / -1; }
  .band-has-trend .band-value { grid-column: 1; }
  .band-has-trend .band-trend { grid-column: 2; grid-row: 2; justify-self: end; align-self: center; }
  .band-has-trend .band-goal { grid-column: 1 / -1; grid-row: auto; }
  .band-entry:first-child .band-link { padding-left: 0; }
  .band-value { font-size: 26px; line-height: 32px; }
}

/* ---------- docs/OWNER-UX-v3-SPEC.md 1b: "Needs attention this week" ---------- */
/* Up to three open items of Worth a look, after the hero and strip. Plain rows, not cards: the
   dollars over the title (a link to its card there), then who (and the day, when the item has
   one). There are no forms here; adding to the plan stays on Worth a look. */
.attn-list { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.attn-item { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 0 10px 12px; border-bottom: 1px solid var(--line); border-left: 4px solid var(--watch-mark); }
.attn-money { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; margin: 0; }
.attn-figure { color: var(--navy-deep); font-size: 20px; font-weight: 600; line-height: 26px; letter-spacing: -0.01em; white-space: nowrap; }
.attn-about, .attn-label { color: var(--body); font-size: 14px; font-weight: 600; line-height: 20px; }
.attn-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 22px; }
.attn-title a { display: inline-block; padding: 2px 0; }
/* The whole row opens the card (a 44px target on a phone); the link itself stays the one stop. */
.attn-title a::after { content: ""; position: absolute; inset: 0; }
.attn-meta { display: flex; flex-wrap: wrap; gap: 0 16px; margin: 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.attn-who, .attn-due { display: inline-flex; align-items: flex-start; gap: 6px; min-width: 0; }
.attn-who .icon, .attn-due .icon { margin-top: 2px; color: var(--navy-mid); }
.attn-empty { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--body); }
.attn-empty .icon { flex: none; margin-top: 3px; color: var(--navy-mid); }
.attn-more { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-weight: 600; }
.attn-more .icon { color: var(--navy-mid); }
.attn-more a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-decoration-color: rgba(18, 101, 155, 0.45); text-underline-offset: 0.18em; }
@media (min-width: 640px) {
  .attn-more a { min-height: 36px; }
}
@media (min-width: 960px) {
  .attn-item { display: grid; grid-template-columns: 17rem minmax(0, 1fr) auto; align-items: center; gap: 0 24px; }
  .attn-money { grid-column: 1; }
  .attn-title { grid-column: 2; }
  .attn-meta { grid-column: 3; justify-content: flex-end; }
}

/* ---------- docs/OWNER-UX-v3-SPEC.md 1c: the money checks as a list ---------- */
.kpis > .disclosure { margin-top: var(--space-3); }
/* "Money checks": one row each, the name and value over the change and the link on a phone;
   one line from 640px. Folded rows ("N more checks, nothing changed") use the same rows. */
.money-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.money-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 0 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.money-label { min-width: 0; }
.money-name { display: block; color: var(--body); font-size: 14px; font-weight: 600; line-height: 26px; }
.money-help { display: block; margin: 0; color: var(--muted); font-size: 13px; line-height: 18px; }
.money-value { color: var(--ink); font-size: 20px; font-weight: 600; line-height: 26px; white-space: nowrap; text-align: right; }
.money-missing { color: var(--muted); font-size: 16px; }
.money-sub { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 12px; min-width: 0; }
.money-change { position: relative; z-index: 1; min-width: 0; }
.money-link { margin-left: auto; font-size: 14px; font-weight: 600; line-height: 24px; text-align: right; }
.money-link::after { content: ""; position: absolute; inset: 0; }
@media (min-width: 640px) {
  .money-row { grid-template-columns: minmax(0, 1.2fr) 7rem minmax(0, 2.6fr); gap: 0 16px; }
  .money-sub { grid-column: auto; flex-wrap: nowrap; align-items: baseline; }
}

/* Owner review of the P0 build (2026-10-02), the flooring pack's P0 lists only: a list split
   by a column has a small heading over each table (OWN-P0-18) and may end with one plain line
   (OWN-P0-05); from 960px a "keep" cell (a name, a job or purchase order number, a short date)
   stays on one line (OWN-P0-15, OWN-P0-16). On a phone every cell wraps as before. */
.insight-list .list-title { margin: 16px 0 8px; color: var(--ink); font-size: 16px; line-height: 22px; }
.insight-list .section-head + .list-title { margin-top: 0; }
.insight-list .list-note { margin: 4px 0 0; }
@media (min-width: 960px) {
  .insight-list table.list-table td.keep { white-space: nowrap; }
  /* OWN-P0-15: a list of more than 12 columns (results by salesperson) fits a 1280px page. */
  .insight-list table.list-table-wide th, .insight-list table.list-table-wide td { padding-left: 5px; padding-right: 5px; }
}

/* 6.1: with "Worth a look" the owner row has five pages; on a phone it shows their short
   words without icons, so the row still fits a 375px screen. From 640px the icons return. */
.nav-links-week .nav-link > .icon { display: none; }

/* Worth a look this week (6.5): one full-width card per item, dollars first; on a phone the
   two buttons stack, each 44px tall, and the records stay closed. */
.worth-list { display: grid; gap: 12px; }
.worth-item { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--watch-mark); border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-1); }
.worth-item.worth-planned { border-left-color: var(--navy-mid); }
.worth-item.worth-handled { border-left-color: var(--good-mark); background: var(--surface-page); box-shadow: none; }
.worth-money { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0; }
.worth-figure { color: var(--navy-deep); font-size: 28px; font-weight: 600; line-height: 32px; letter-spacing: -0.01em; white-space: nowrap; }
.worth-about { color: var(--body); font-size: 15px; font-weight: 600; letter-spacing: 0; }
.worth-label { color: var(--body); font-size: 15px; font-weight: 600; line-height: 20px; }
.worth-title { margin: 0; color: var(--ink); font-size: 18px; line-height: 24px; }
.worth-why { margin: 0; color: var(--body); font-size: 15px; line-height: 22px; }
.worth-who, .worth-suggested { display: flex; align-items: flex-start; gap: 6px; margin: 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.worth-who .icon, .worth-suggested .icon { margin-top: 2px; color: var(--navy-mid); }
.worth-due { display: flex; align-items: flex-start; gap: 6px; margin: 0; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 22px; }
.worth-due .icon { margin-top: 3px; color: var(--navy-mid); }
.worth-section { margin: 0 0 var(--space-4); }
.worth-section-title { margin: 0 0 12px; color: var(--ink); font-size: 20px; line-height: 28px; }
.worth-plan-note { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--good-ink); font-size: 14px; font-weight: 600; line-height: 20px; }
.worth-plan-note .icon { color: var(--good-mark); }
.worth-actions { display: flex; flex-direction: column; gap: 8px; }
.worth-handled-form { margin: 0; }
.worth-handled-form .btn { width: 100%; }
.worth-link { margin: 0; font-size: 14px; font-weight: 600; line-height: 20px; }
.worth-link a { display: inline-flex; align-items: center; min-height: 44px; }
.worth-more { margin: 16px 0 0; color: var(--muted); }
.worth-missing { margin-bottom: var(--space-4); }
/* Owner review OWN-P0-09 (2026-10-02): who and the two buttons share one row from 960px (the
   footer), and the records and the answer link share the next, so a card stays short. */
.worth-foot { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.worth-people { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.worth-more-links { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 24px; min-width: 0; }
.worth-more-links > .disclosure[open] { flex: 1 1 100%; }
/* OWN-P0-10: the lines the list always carries (the installs still waiting on material). */
.worth-note { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-card); color: var(--ink); font-weight: 600; }
.worth-note .icon { flex: none; margin-top: 3px; color: var(--navy-mid); }
.worth-note a { white-space: nowrap; }
.worth-more a { color: var(--link); }

/* The owner's brief (7): the page shows it as it would read in an email. */
.brief-card { max-width: 72ch; }
.brief-subject { margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.brief-items { margin: 0 0 12px; padding-left: 24px; }
.brief-items li + li { margin-top: 12px; }
.brief-item-title { margin: 0; font-weight: 600; }
.brief-item-money { color: var(--navy-deep); }
.brief-item-who { margin: 2px 0 0; color: var(--body); }
.brief-sending { margin: 4px 0 0; }
.brief-dated { margin: 0 0 12px; }

/* Owner review OWN-P0-08 and OWN-P0-14 (2026-10-02): an insight page's links to the insights
   it leads to, under its headline; each a 44px tap target on a phone. */
.see-also { display: flex; flex-wrap: wrap; column-gap: 20px; margin: -8px 0 16px; }
.see-also-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(18, 101, 155, 0.45); text-underline-offset: 0.18em; }
@media (min-width: 640px) {
  .see-also-link { min-height: 32px; }
}

/* docs/OWNER-UX-v3-PHASE3-SPEC.md 3a and 3b: "What moved it since Q2" and "Ask a follow-up" on an
   insight page. The chart is the ordinary chart card; the list under it gives every part a link to
   its records; each row reads part, before and after in words, and the change in words. */
.moved-period { margin: 0 0 var(--space-3); color: var(--muted); font-size: 14px; line-height: 20px; }
.moved-lead { max-width: 62ch; margin: 0 0 var(--space-2); color: var(--ink); font-size: 18px; line-height: 28px; }
.moved .chart-card { margin-top: var(--space-3); }
.moved-parts { margin: var(--space-4) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.moved-part { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 22px; }
.moved-name { grid-column: 1 / -1; min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.moved-change { text-align: right; }
.moved-top .moved-name { font-weight: 600; }
.moved-name a { display: inline-block; min-height: 24px; }
.moved-values, .moved-change { color: var(--body); }
.moved-top .moved-change { color: var(--navy-deep); font-weight: 600; }
.moved-few { margin: var(--space-3) 0 0; color: var(--body); font-size: 15px; line-height: 22px; }
.moved-note { max-width: 62ch; margin: var(--space-3) 0 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.moved-all { margin: var(--space-2) 0 0; font-size: 15px; font-weight: 600; }
.follow-up .chips { margin-top: 0; }
@media (min-width: 640px) {
  .moved-part { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); align-items: baseline; padding: 10px 0; }
  .moved-name { grid-column: auto; }
}

/* Your own reports (8.3) on Your files, and Setup's controls (10.2). */
.own-reports-summary { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 8px; color: var(--watch-ink); font-weight: 600; }
.own-reports-summary .icon { flex: none; margin-top: 5px; }
.own-reports-summary.own-reports-ok { color: var(--good-ink); }
.own-reports-list { margin: 0; padding-left: 20px; }
.own-reports-list li + li { margin-top: 4px; }
/* Owner review OWN-P0-19 (2026-10-02): the consultant's line on why a total differs, under it. */
.own-reports-note, .control-note { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; line-height: 20px; }
.people-form, .brief-form { margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.control-summary { color: var(--ink); font-weight: 600; }
.control-total-form { max-width: 28rem; margin-top: var(--space-4); }
.control-help { margin: 12px 0 0; padding-left: 20px; }

@media (min-width: 640px) {
  .nav-links-week .nav-link > .icon { display: inline-block; }
  .worth-actions { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .worth-actions > .disclosure { flex: 1 1 260px; }
  .worth-handled-form .btn { width: auto; }
  .worth-link a { min-height: 36px; }
}

@media (min-width: 960px) {
  /* OWN-P0-09: one row for who and the buttons, each button as wide as its words. */
  .worth-foot { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
  .worth-people { flex: 1 1 auto; padding-top: 12px; }
  .worth-actions { flex: 0 1 auto; flex-wrap: nowrap; justify-content: flex-end; }
  .worth-actions > .disclosure { flex: 0 0 auto; }
  .worth-actions .disclosure-plan > summary { width: auto; }
  .worth-actions > .disclosure-plan[open] { min-width: 320px; }
}

/* docs/OWNER-UX-v3-PHASE3-SPEC.md 3c: "Check your files" on a number whose source file has a caution. Text and an
   icon, never colour alone; the note under it is always visible. The link sits above the tile's stretched link. */
.data-caution { display: block; margin: 4px 0 0; }
.data-caution-link { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 4px; min-height: 24px; color: var(--watch-ink); font-size: 13px; font-weight: 600; line-height: 18px; }
.data-caution-link .icon { width: 14px; height: 14px; flex: none; }
.data-caution-note { display: block; margin: 0; color: var(--muted); font-size: 13px; line-height: 18px; }
.band-caution { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 0 16px 6px; color: var(--watch-ink); font-size: 13px; font-weight: 600; line-height: 18px; }
.band-entry:first-child .band-caution { padding-left: 0; }
.band-caution .icon { width: 14px; height: 14px; flex: none; }
