/* Document intelligence: one token system (UI-UX-PLAN §3).
   Every value below is a token or derives from one. Nothing loads from the internet: Inter is self-hosted
   (static/fonts, OFL) and icons are inline SVG, so it works offline.

   Colour budget (§2.10): neutrals + one blue accent (the one action, the current thing) + four status
   colours, each with one meaning everywhere (§2.4):
     good = verified by a check · warn = needs review (a named problem) · bad = failed · na = not applicable.
   Status is always icon + word, never colour alone. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/static/fonts/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/InstrumentSerif-Regular.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/static/fonts/InstrumentSerif-Italic.woff2") format("woff2"); }

/* ---------------------------------------------------------------- tokens: light (default) */
:root {
  --c-bg: #f4f2ec;
  --c-side: #f8f6f0;
  --c-surface: #fffefb;
  --c-surface-2: #f1eee6;
  --c-surface-3: #e6e2d8;
  --c-border: #e3dfd4;
  --c-border-strong: #8d877b;
  --c-text: #1b1a17;
  --c-text-2: #46433c;
  --c-text-3: #6a665d;
  --c-accent: #1f5bd8;
  --c-accent-hover: #1a4dba;
  --c-accent-ink: #1b51c4;
  --c-accent-soft: #eaf0fd;
  --c-on-accent: #ffffff;
  --c-good: #146c35;
  --c-good-bg: #e6f4eb;
  --c-good-border: #a9d6b8;
  --c-good-mark: #1f8a47;
  --c-warn: #8a5100;
  --c-warn-bg: #fdf1da;
  --c-warn-border: #ecc982;
  --c-warn-mark: #b86e00;
  --c-bad: #b3261e;
  --c-bad-bg: #fdecea;
  --c-bad-border: #f1bdb7;
  --c-bad-mark: #d0352b;
  --c-na: #545c6a;
  --c-na-bg: #eef0f3;
  --c-na-border: #d3d8df;
  --c-na-mark: #7b8494;
  --c-info: #3d5a80;          /* blue-grey: stored, nothing printed to check (FIX-PLAN 3.3); not green */
  --c-info-bg: #eaf0f6;
  --c-info-border: #bccbdc;
  --c-info-mark: #5b7aa3;
  --c-hl: #fbefc4;
  --c-page-paper: #ffffff;
  --shadow: 0 1px 2px rgba(40, 32, 16, .06), 0 2px 8px rgba(40, 32, 16, .06);
  --focus: 0 0 0 2px var(--c-surface), 0 0 0 4px var(--c-accent);

  /* type (TYPE-SYSTEM 2026-10-20): Inter everywhere; Instrument Serif only for page titles (h1, .home-title,
     .about-title) and the wordmark. Each role is size / line-height / weight; nothing is smaller than 12 px.
     Weights: 400 body, 500 labels and nav, 600 headings and numbers. */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "SF Mono", Menlo, monospace;
  --w-body: 400; --w-label: 500; --w-head: 600;
  --t-display-size: 2.5rem;    --t-display-lh: 48px;    /* page hero, serif */
  --t-title-size: 2rem;        --t-title-lh: 40px;      /* h1, serif */
  --t-section-size: 1.25rem;   --t-section-lh: 28px;    /* section titles, 600 */
  --t-card-size: 1rem;         --t-card-lh: 24px;       /* card / panel titles, 600 */
  --t-body-size: .875rem;      --t-body-lh: 22px;       /* body, 400 */
  --t-small-size: .8125rem;    --t-small-lh: 20px;      /* table cells, secondary text */
  --t-label-size: .75rem;      --t-label-lh: 16px;      --t-label-ls: .02em;   /* labels, 500 */
  --t-caption-size: .75rem;    --t-caption-lh: 16px;    /* captions, timestamps, counts */
  --t-number-size: 2rem;       --t-number-lh: 40px;     /* numbers, Inter 600 tabular */
  --t-number-lg-size: 2.5rem;  --t-number-lg-lh: 48px;
  --t-display: 400 var(--t-display-size)/var(--t-display-lh) var(--font-display);
  --t-title: 400 var(--t-title-size)/var(--t-title-lh) var(--font-display);
  --t-section: 600 var(--t-section-size)/var(--t-section-lh) var(--font);
  --t-card: 600 var(--t-card-size)/var(--t-card-lh) var(--font);
  --t-body: 400 var(--t-body-size)/var(--t-body-lh) var(--font);
  --t-small: 400 var(--t-small-size)/var(--t-small-lh) var(--font);
  --t-label: 500 var(--t-label-size)/var(--t-label-lh) var(--font);
  --t-caption: 400 var(--t-caption-size)/var(--t-caption-lh) var(--font);
  --t-number: 600 var(--t-number-size)/var(--t-number-lh) var(--font);
  --t-number-lg: 600 var(--t-number-lg-size)/var(--t-number-lg-lh) var(--font);
  /* old scale names, kept as aliases onto the roles so older markup keeps working */
  --fs-12: var(--t-caption-size); --fs-13: var(--t-small-size); --fs-14: var(--t-body-size);
  --fs-16: var(--t-card-size); --fs-20: var(--t-section-size); --fs-24: var(--t-section-size);
  --fs-28: var(--t-number-size); --fs-32: var(--t-title-size); --fs-40: var(--t-display-size);
  --fs-56: var(--t-number-lg-size);

  /* space: an 8 px grid; 4 px only inside tight table cells and chips */
  --s-half: 4px; --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s6: 48px;
  --radius: 8px;
  --side-w: 208px;
  --top-h: 56px;
  --t-change: 180ms ease-out;   /* motion only to show change (§2.9) */

  /* aliases for the names the older templates use (form_print.html) */
  --page: var(--c-bg); --surface: var(--c-surface); --surface-2: var(--c-surface-2); --ink: var(--c-text);
  --ink-2: var(--c-text-2); --ink-3: var(--c-text-3); --rule: var(--c-border); --accent: var(--c-accent-ink);
  --brand: var(--c-accent); --link: var(--c-accent-ink); --good: var(--c-good-mark); --good-ink: var(--c-good);
  --warn: var(--c-warn-mark); --warn-ink: var(--c-warn); --bad: var(--c-bad-mark); --bad-ink: var(--c-bad);
  --hl: var(--c-hl);
  color-scheme: light;
}

/* ---------------------------------------------------------------- tokens: dark (same names) */
:root[data-theme="dark"] {
  --c-bg: #0e1116;
  --c-side: #12161c;
  --c-surface: #161b22;
  --c-surface-2: #1c222b;
  --c-surface-3: #262d38;
  --c-border: #2b323d;
  --c-border-strong: #6b7484;
  --c-text: #e7eaef;
  --c-text-2: #b6bdc8;
  --c-text-3: #959eac;
  --c-accent: #2f6ae0;
  --c-accent-hover: #2a60cf;
  --c-accent-ink: #86adff;
  --c-accent-soft: #1b2944;
  --c-on-accent: #ffffff;
  --c-good: #6fd394;
  --c-good-bg: #11281b;
  --c-good-border: #255a3a;
  --c-good-mark: #4cc27a;
  --c-warn: #f0bd5e;
  --c-warn-bg: #2b2111;
  --c-warn-border: #5e4519;
  --c-warn-mark: #e0a63c;
  --c-bad: #ff958c;
  --c-bad-bg: #2f1715;
  --c-bad-border: #6b2b26;
  --c-bad-mark: #f0675c;
  --c-na: #a6aebb;
  --c-na-bg: #1f252e;
  --c-na-border: #3a424e;
  --c-na-mark: #8a93a2;
  --c-info: #a9c1e0;
  --c-info-bg: #18222f;
  --c-info-border: #34465c;
  --c-info-mark: #7f9cc2;
  --c-hl: #3a3215;
  --c-page-paper: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg: #0e1116; --c-side: #12161c; --c-surface: #161b22; --c-surface-2: #1c222b; --c-surface-3: #262d38;
    --c-border: #2b323d; --c-border-strong: #6b7484; --c-text: #e7eaef; --c-text-2: #b6bdc8; --c-text-3: #959eac;
    --c-accent: #2f6ae0; --c-accent-hover: #2a60cf; --c-accent-ink: #86adff; --c-accent-soft: #1b2944;
    --c-good: #6fd394; --c-good-bg: #11281b; --c-good-border: #255a3a; --c-good-mark: #4cc27a;
    --c-warn: #f0bd5e; --c-warn-bg: #2b2111; --c-warn-border: #5e4519; --c-warn-mark: #e0a63c;
    --c-bad: #ff958c; --c-bad-bg: #2f1715; --c-bad-border: #6b2b26; --c-bad-mark: #f0675c;
    --c-na: #a6aebb; --c-na-bg: #1f252e; --c-na-border: #3a424e; --c-na-mark: #8a93a2;
    --c-info: #a9c1e0; --c-info-bg: #18222f; --c-info-border: #34465c; --c-info-mark: #7f9cc2;
    --c-hl: #3a3215; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--c-bg); color: var(--c-text);
  font: var(--t-body);
  font-feature-settings: "cv11";   /* Inter: single-storey a; reads calmer in dense tables */
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c-accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font: var(--t-title); letter-spacing: 0; }
h2 { font-size: var(--t-card-size); line-height: var(--t-card-lh); }
h3 { font-size: var(--t-body-size); line-height: var(--t-body-lh); }
h4 { font-size: var(--t-label-size); line-height: var(--t-label-lh); color: var(--c-text-3); margin: var(--s2) 0 var(--s1); font-weight: 500; letter-spacing: var(--t-label-ls); }
p { margin: 0 0 var(--s1); }
code, kbd, .mono { font-family: var(--mono); font-size: .92em; }
/* numbers line up in columns everywhere (§2.8) */
.num, .tnum, time, .price, .tile-n, table, .step-time, td.money, .t-amt, .fsize, .kf-v { font-variant-numeric: tabular-nums; }
/* numeric table columns: right-aligned, figures in columns (the .num class is on every numeric th/td) */
td.money, th.money, td.c-rate, .file-list .fsize { text-align: right; }
.num { text-align: right !important; white-space: nowrap; }
.sub, .muted-text { color: var(--c-text-3); font-size: var(--t-small-size); line-height: var(--t-small-lh); font-weight: 400; }
.note { color: var(--c-text-3); font-size: var(--t-small-size); line-height: var(--t-small-lh); margin: var(--s1) 0 0; }
.lede { color: var(--c-text-2); margin: var(--s1) 0 0; max-width: 60ch; font-size: var(--t-card-size); line-height: var(--t-card-lh); }
.hint { color: var(--c-text-2); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.skip { position: absolute; left: var(--s2); top: -48px; z-index: 50; background: var(--c-surface); padding: var(--s1) var(--s2);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.skip:focus { top: var(--s1); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- shell: sidebar + top bar */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--c-side);
  border-right: 1px solid var(--c-border); display: flex; flex-direction: column; padding: var(--s2) var(--s1); }
.brand { display: flex; align-items: center; padding: var(--s1) 10px var(--s3); color: var(--c-text); }
.brand:hover { text-decoration: none; }
.brand-word { font-family: var(--font-display); font-size: var(--t-section-size); line-height: var(--t-section-lh); letter-spacing: 0; white-space: nowrap; display: block; }
.brand-word em { font-style: italic; color: var(--c-text-2); display: block; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius);
  color: var(--c-text-2); font-weight: 500; transition: background-color 120ms ease-out, color 120ms ease-out; }
.side nav a[data-key]::after { content: attr(data-key); margin-left: auto; font-size: var(--t-label-size); line-height: var(--t-label-lh); min-width: 16px;
  text-align: center; border-radius: 4px; color: var(--c-text-3); border: 1px solid var(--c-border); opacity: 0; transition: opacity 120ms; letter-spacing: var(--t-label-ls); font-weight: 500; }
.side:hover nav a[data-key]::after, .side:focus-within nav a[data-key]::after { opacity: .8; }
.side nav a .i { width: 18px; height: 18px; color: var(--c-text-3); }
.side nav a:hover { background: var(--c-surface-2); color: var(--c-text); text-decoration: none; }
.side nav a.on { background: var(--c-accent-soft); color: var(--c-accent-ink); }
.side nav a.on .i { color: var(--c-accent-ink); }
.side-health { display: flex; align-items: center; gap: var(--s1); margin: var(--s1) 0 0; padding: 0 12px; font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--c-text-3); }
.side-health .sys-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-warn-mark); flex: none; }
.side-health .sys-words { color: inherit; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center;
  gap: var(--s2); padding: 0 var(--s4); background: var(--c-bg); border-bottom: 1px solid var(--c-border); }
/* the one search box (UI-DESIGN-PLAN §3): "/" focuses it; Ask and Documents have their own, so it hides there */
.gsearch { display: flex; align-items: center; gap: var(--s1); height: 36px; width: 320px; margin: 0; padding: 0 12px;
  border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-surface);
  transition: border-color var(--t-change), box-shadow var(--t-change); }
.gsearch:focus-within { border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.gsearch > .i { color: var(--c-text-3); }
.gsearch input { flex: 1; height: 32px; border: 0; background: transparent; padding: 0; font-size: var(--t-body-size); line-height: var(--t-body-lh); }
.gsearch input:focus-visible { box-shadow: none; }
.gsearch kbd { font: var(--t-label); color: var(--c-text-3); border: 1px solid var(--c-border); border-radius: 4px; padding: 0 4px; letter-spacing: var(--t-label-ls); }
.gsearch:focus-within kbd { display: none; }
body.page-ask .gsearch, body.page-prices .gsearch, body.page-documents .gsearch { display: none; }
.crumbs { display: flex; align-items: center; gap: var(--s1); min-width: 0; color: var(--c-text-3); font-size: var(--t-body-size); line-height: var(--t-body-lh); margin: 0; }
.crumbs a { color: var(--c-text-2); white-space: nowrap; }
.crumbs .sep { color: var(--c-border-strong); }
.crumbs .here { color: var(--c-text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--s1); }
.topbar-right form { margin: 0; }

/* status pills: one per service, refreshed every 30 s from /api/health */
.pills { display: flex; gap: var(--s1); margin-right: var(--s1); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text-2); font-size: var(--t-label-size); line-height: var(--t-label-lh);
  white-space: nowrap; transition: background-color var(--t-change), border-color var(--t-change), color var(--t-change); letter-spacing: var(--t-label-ls); font-weight: 500; }
.pill:hover { text-decoration: none; background: var(--c-surface-2); }
.pill .svc { color: var(--c-text-2); }
.pill .state { font-weight: 500; color: var(--c-text); }
.pill .i { width: 14px; height: 14px; vertical-align: 0; }
.pill.tone-good { border-color: var(--c-good-border); background: var(--c-good-bg); } .pill.tone-good .state, .pill.tone-good .i { color: var(--c-good); }
.pill.tone-warn { border-color: var(--c-warn-border); background: var(--c-warn-bg); } .pill.tone-warn .state, .pill.tone-warn .i { color: var(--c-warn); }
.pill.tone-bad { border-color: var(--c-bad-border); background: var(--c-bad-bg); } .pill.tone-bad .state, .pill.tone-bad .i { color: var(--c-bad); }
.pill.tone-na .state, .pill.tone-na .i { color: var(--c-na); }
.pill.is-checking .state { color: var(--c-text-3); font-weight: 400; }

.banner { display: flex; align-items: center; gap: var(--s1); padding: var(--s1) var(--s4); font-size: var(--t-small-size); line-height: var(--t-small-lh);
  color: var(--c-text-2); background: var(--c-surface-2); border-bottom: 1px solid var(--c-border); }
.banner strong { color: var(--c-text); font-weight: 600; }
.content { padding: var(--s4) var(--s4) var(--s6); width: 100%; max-width: 1280px; }
/* reading pages: one column of text, not a dashboard (UI-DESIGN-PLAN §2) */
body.page-dashboard .content, body.page-ask .content, body.page-upload .content, body.page-job .content { max-width: 1040px; }

/* ---------------------------------------------------------------- buttons, inputs */
button, input, select, textarea { font: inherit; color: var(--c-text); }
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); height: 36px;
  padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--c-border-strong); background: var(--c-surface);
  color: var(--c-text); font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color var(--t-change), border-color var(--t-change); }
.btn:hover, button:hover { background: var(--c-surface-2); text-decoration: none; }
.btn-primary, button.btn-primary { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-on-accent); }
.btn-primary:hover, button.btn-primary:hover { background: var(--c-accent-hover); border-color: var(--c-accent-hover); }
.btn-ghost, button.btn-ghost { border-color: transparent; background: transparent; color: var(--c-text-2); }
.btn-ghost:hover, button.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-text); }
.btn-sm { height: 28px; padding: 0 12px; font-size: var(--t-label-size); line-height: var(--t-label-lh); letter-spacing: var(--t-label-ls); font-weight: 500; }
.btn-lg { height: 44px; padding: 0 20px; font-size: var(--t-card-size); line-height: var(--t-card-lh); }
.btn[disabled], button[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 36px; padding: 0; }
.icon-btn .i { width: 18px; height: 18px; vertical-align: 0; }
.btn .i { width: 16px; height: 16px; vertical-align: 0; }
input[type=search], input[type=text], input[type=password], select, textarea {
  height: 36px; padding: 0 10px; border: 1px solid var(--c-border-strong); border-radius: var(--radius);
  background: var(--c-surface); min-width: 0; }
textarea { height: auto; padding: var(--s1) 12px; line-height: var(--t-body-lh); }
input::placeholder, textarea::placeholder { color: var(--c-text-3); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.inline-form { display: inline; margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: flex-end; margin: 0 0 var(--s3);
  padding: var(--s2); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); }
.filters label { display: grid; gap: var(--s-half); font-size: var(--t-label-size); line-height: var(--t-label-lh); color: var(--c-text-2); font-weight: 500; letter-spacing: var(--t-label-ls); }
.filters label.grow { flex: 1 1 320px; }
.filters input[type=search] { width: 100%; min-width: 220px; }
.filters .reset { align-self: center; }

/* ---------------------------------------------------------------- page header (one primary action, §2.7) */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin: 0 0 var(--s3); flex-wrap: wrap; }
.page-head .ph-text { min-width: 0; max-width: 90ch; }
.page-head .ph-actions { display: flex; gap: var(--s1); align-items: center; flex-wrap: wrap; }
.kicker { font-size: var(--t-label-size); line-height: var(--t-label-lh); color: var(--c-text-3); letter-spacing: var(--t-label-ls); text-transform: uppercase; font-weight: 500; margin-bottom: var(--s-half); }
.section-h { display: flex; align-items: baseline; gap: var(--s1); margin: var(--s4) 0 var(--s2); font-size: var(--t-card-size); line-height: var(--t-card-lh); }
.section-h:first-child { margin-top: 0; }
.content > h1 + .lede { margin-bottom: var(--s3); }
.content > h1 + .lede + .note { margin: calc(-1 * var(--s2)) 0 var(--s3); }
.section-h .sub { font-size: var(--t-small-size); line-height: var(--t-small-lh); }

/* ---------------------------------------------------------------- panels, KPIs, grids */
.panel { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: none;
  padding: var(--s2); margin-bottom: var(--s3); min-width: 0; }
.panel > h2 { margin-bottom: var(--s2); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s1) var(--s2); flex-wrap: wrap; margin-bottom: var(--s2); }
.panel-head h2 { margin: 0; }
.panel-head .sub { font-size: var(--t-small-size); line-height: var(--t-small-lh); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
.grid2 > .panel { margin-bottom: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s2); margin-bottom: var(--s3); }
.tile { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: none;
  padding: var(--s2); display: flex; flex-direction: column; min-width: 0; color: var(--c-text); }
.tile-n { font-size: var(--t-number-lg-size); line-height: var(--t-number-lg-lh); font-weight: 600; font-variant-numeric: tabular-nums; }
.tile-l { color: var(--c-text-2); font-size: var(--t-body-size); line-height: var(--t-body-lh); }
.tile-sub { margin-top: var(--s-half); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--c-text-3); display: flex; align-items: center; gap: var(--s-half); }
.tile.tone-warn .tile-n { color: var(--c-warn); }
.tile.tone-good .tile-n { color: var(--c-good); }
.tile.tone-bad .tile-n { color: var(--c-bad); }
a.tile:hover { text-decoration: none; border-color: var(--c-border-strong); }

/* bar lists */
table.bars { width: 100%; border-collapse: collapse; }
table.bars th { text-align: left; font-weight: 500; padding: 6px var(--s2) 6px 0; white-space: nowrap; width: 1%; color: var(--c-text); }
table.bars td { padding: 6px 0; }
table.bars td.num { width: 1%; padding-left: var(--s2); color: var(--c-text-2); }
.bar-cell { width: 100%; }
.bar { display: block; height: 8px; background: var(--c-border-strong); border-radius: 0 3px 3px 0; min-width: 2px; }
.bar.tone-bad { background: var(--c-bad-mark); }
.bar.tone-warn { background: var(--c-warn-mark); }
.stack { display: flex; height: 8px; gap: 2px; width: 100%; }
.seg { display: block; height: 100%; min-width: 3px; }
.seg:last-child { border-radius: 0 3px 3px 0; }
.seg-pass, .sw-pass { background: var(--c-good-mark); }
.seg-warn, .sw-warn { background: var(--c-warn-mark); }
.seg-fail, .sw-fail { background: var(--c-bad-mark); }
.legend { display: flex; gap: var(--s2); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--c-text-2); margin-bottom: var(--s1); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s1); }
.chips a { display: inline-flex; gap: var(--s1); align-items: center; height: 28px; padding: 0 10px; border: 1px solid var(--c-border);
  border-radius: var(--radius); color: var(--c-text); background: var(--c-surface); }
.chip-n { font-weight: 600; }

/* ---------------------------------------------------------------- status chips (icon + word, §2.4) */
.chip, .badge { display: inline-flex; align-items: center; gap: var(--s-half); height: 22px; padding: 0 var(--s1);
  border-radius: var(--radius); border: 1px solid var(--c-border); background: var(--c-surface-2); color: var(--c-text-2);
  font-size: var(--t-label-size); font-weight: 500; line-height: var(--t-label-lh); white-space: nowrap; vertical-align: middle; letter-spacing: var(--t-label-ls); }
.chip .i, .badge .i { width: 14px; height: 14px; vertical-align: 0; }
.chip-good, .check-pass { color: var(--c-good); background: var(--c-good-bg); border-color: var(--c-good-border); }
.chip-warn, .check-warn, .warnish { color: var(--c-warn); background: var(--c-warn-bg); border-color: var(--c-warn-border); }
.chip-bad, .check-fail { color: var(--c-bad); background: var(--c-bad-bg); border-color: var(--c-bad-border); }
.chip-na, .check-na, .check-none { color: var(--c-na); background: var(--c-na-bg); border-color: var(--c-na-border); }
.chip-info { color: var(--c-info); background: var(--c-info-bg); border-color: var(--c-info-border); }
.chip-done { color: var(--c-text); background: var(--c-surface); border-color: var(--c-border-strong); }
.chip-busy { color: var(--c-accent-ink); background: var(--c-accent-soft); border-color: transparent; }
.chip-pending { color: var(--c-text-3); background: var(--c-surface); border-style: dashed; border-color: var(--c-border-strong); }
.chip-lg { height: 28px; padding: 0 12px; font-size: var(--t-body-size); line-height: var(--t-body-lh); }
.chip-lg .i { width: 16px; height: 16px; }
.tag { display: inline-flex; align-items: center; gap: var(--s-half); color: var(--c-text-3); font-size: var(--t-label-size); line-height: var(--t-label-lh); white-space: nowrap; letter-spacing: var(--t-label-ls); font-weight: 500; }
.tag .i { width: 14px; height: 14px; vertical-align: 0; }
.badge.role { background: transparent; border-color: transparent; padding: 0; height: auto; color: var(--c-text-3); font-weight: 400; }
.badge.role-section_header { color: var(--c-text-2); font-weight: 600; }
.badge.role-note, .badge.role-client_scope { font-style: italic; }
.badge.scope { color: var(--c-text-3); background: transparent; border-color: transparent; padding: 0; height: auto; font-weight: 400; }
.badge.scope.scope-not_priced, .badge.scope.scope-included { color: var(--c-text-3); font-style: italic; }
.scope-unknown { color: var(--c-bad) !important; }

/* ---------------------------------------------------------------- price: value + currency + unit + scope (§2.3) */
.price { white-space: normal; }
.price .amt { font-weight: 600; color: var(--c-text); }
.price .cur, .price .per { color: var(--c-text-2); }
.price .scope { display: inline; margin-left: 4px; padding: 0; border: 0; background: transparent; color: var(--c-text-2);
  font-size: var(--t-small-size); line-height: var(--t-small-lh); font-weight: 400; white-space: nowrap; }
.price .scope::before { content: "·"; margin-right: 4px; color: var(--c-text-3); }
.price.pw .scope::before { content: none; }
.price.big .amt { font-size: var(--t-number-size); line-height: var(--t-number-lh); font-weight: 600; font-variant-numeric: tabular-nums; }
.price.big .cur, .price.big .per { font-size: var(--t-body-size); line-height: var(--t-body-lh); }

/* source chip: doc · line, opens the page with the row selected (§2.2) */
a.cite { display: inline-flex; align-items: center; gap: 3px; margin: 0 var(--s1) 0 0; color: var(--c-accent-ink);
  font-size: var(--t-small-size); line-height: var(--t-small-lh); white-space: nowrap; vertical-align: baseline; text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--c-border-strong); }
a.cite:hover { text-decoration-color: currentColor; }
a.cite .i { width: 12px; height: 12px; vertical-align: 0; }
a.cite .ref { font-family: var(--mono); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); }

/* ---------------------------------------------------------------- empty, loading, error states */
.empty-state { display: grid; justify-items: center; gap: var(--s1); text-align: center; padding: var(--s4) var(--s2); color: var(--c-text-2); }
.empty-state > .i { width: 24px; height: 24px; color: var(--c-text-3); }
.empty-state .es-title { font-weight: 600; color: var(--c-text); margin: 0; }
.empty-state p { margin: 0; max-width: 60ch; }
.empty-state .btn { margin-top: var(--s1); }
.empty { color: var(--c-text-3); margin: var(--s1) 0; }
.empty-state p.empty { color: var(--c-text-2); margin: 0; }
.alert { display: flex; gap: var(--s1); align-items: flex-start; padding: 12px var(--s2); border-radius: var(--radius); margin: 0 0 var(--s3);
  border: 1px solid var(--c-border); background: var(--c-surface); }
.alert > .i { margin-top: 2px; }
.alert h2 { font-size: var(--t-body-size); line-height: var(--t-body-lh); margin-bottom: var(--s-half); }
.alert ul { margin: 0; padding-left: 18px; }
.alert p { margin: 0; }
.alert.tone-bad { border-color: var(--c-bad-border); background: var(--c-bad-bg); color: var(--c-bad); }
.alert.tone-bad h2, .alert.tone-bad li { color: var(--c-bad); }
.alert.tone-warn { border-color: var(--c-warn-border); background: var(--c-warn-bg); color: var(--c-warn); }
.alert.tone-good { border-color: var(--c-good-border); background: var(--c-good-bg); color: var(--c-good); }
.alert.tone-good a { color: var(--c-good); }
.alert.tone-info { background: var(--c-surface-2); color: var(--c-text-2); }
.alert a { text-decoration: underline; }
.skel { display: block; background: var(--c-surface-3); border-radius: var(--radius); height: 12px; margin: var(--s1) 0; }
.skel.w-40 { width: 40%; } .skel.w-60 { width: 60%; } .skel.w-80 { width: 80%; } .skel.w-100 { width: 100%; }
.skel.h-120 { height: 120px; }
.loading-note { display: flex; align-items: center; gap: var(--s1); color: var(--c-text-2); margin-bottom: var(--s1); }

/* ---------------------------------------------------------------- tables: data looks like data (§2.8) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.list, table.tree, table.kvt, table.comp { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: var(--s1) 12px; border-bottom: 1px solid var(--c-border); text-align: left; vertical-align: top; }
table.list thead th, table.tree thead th { position: sticky; top: 0; z-index: 1; background: var(--c-surface-2); color: var(--c-text-2);
  font-size: var(--t-label-size); line-height: var(--t-label-lh); font-weight: 500; white-space: nowrap; letter-spacing: var(--t-label-ls); }
table.list td { transition: background-color 120ms ease-out; }
table.list tbody tr:hover td { background: var(--c-surface-2); }
table.list tbody tr:last-child td, table.list tbody tr:last-child th { border-bottom: 0; }
.panel > .table-wrap { margin: 0 calc(-1 * var(--s2)); border-top: 1px solid var(--c-border); }
.panel > .table-wrap:first-child { border-top: 0; margin-top: calc(-1 * var(--s2)); }
.panel > .table-wrap:last-child { margin-bottom: calc(-1 * var(--s2)); }
.panel > .table-wrap table th:first-child, .panel > .table-wrap table td:first-child { padding-left: var(--s2); }
.panel > .table-wrap table th:last-child, .panel > .table-wrap table td:last-child { padding-right: var(--s2); }
.panel > .table-wrap:first-child thead th:first-child { border-top-left-radius: var(--radius); }
.panel > .table-wrap:first-child thead th:last-child { border-top-right-radius: var(--radius); }
td .sub { display: block; }
.id { font-family: var(--mono); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--c-text-3); }
table.kvt th, table.kvt td { padding: var(--s1) var(--s2) var(--s1) 0; border-bottom: 1px solid var(--c-border); text-align: left; vertical-align: top; }
table.kvt td:last-child { padding-right: 0; }
table.kvt th { font-weight: 500; white-space: nowrap; }
table.kvt tr:last-child th, table.kvt tr:last-child td { border-bottom: 0; }
table.kvt tr.grand th, table.kvt tr.grand td { font-weight: 600; }
dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px var(--s2); margin: 0; }
dl.kv dt { color: var(--c-text-3); font-size: var(--t-label-size); line-height: var(--t-label-lh); padding-top: 4px; letter-spacing: var(--t-label-ls); font-weight: 500; }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
ul.excl, ul.incl, ul.flags { margin: var(--s-half) 0; padding-left: 18px; }
ul.excl li::marker { content: "− "; color: var(--c-text-3); }
ul.incl li::marker { content: "+ "; color: var(--c-text-3); }
ul.flags li { color: var(--c-warn); }
.count { color: var(--c-text-3); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); margin: 0 0 var(--s1); }

/* ---------------------------------------------------------------- document view: original next to extraction (§2.1) */
.docview { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s3); align-items: start; }
@media (max-width: 1600px) { .docview { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } }
dl.kv-2 { grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); }
td.desc { min-width: 200px; }
td.desc .desc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-half) var(--s1); margin-top: var(--s-half); }
td.desc .desc-meta .sub { display: inline; }
table.tree td.num, table.tree th.num { padding-left: var(--s-half); padding-right: var(--s-half); }
table.tree th .sub { font-weight: 400; }
table.tree td.num { white-space: nowrap; }
.unit { color: var(--c-text-3); }
table time { white-space: nowrap; }
.viewer { position: sticky; top: calc(var(--top-h) + var(--s2)); display: flex; flex-direction: column;
  height: calc(100vh - var(--top-h) - var(--s4)); background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.viewer-bar { display: flex; align-items: center; gap: var(--s1); padding: var(--s1); border-bottom: 1px solid var(--c-border); flex-wrap: wrap; }
.viewer-bar .grow { flex: 1; }
.page-tabs { display: flex; flex-wrap: wrap; gap: var(--s-half); }
.page-tab { height: 28px; padding: 0 var(--s1); font-size: var(--t-label-size); line-height: var(--t-label-lh); border-color: var(--c-border); gap: 6px; letter-spacing: var(--t-label-ls); font-weight: 500; }
.page-tab .lane { color: var(--c-text-3); font-weight: 400; margin: 0; }
.page-tab.on { background: var(--c-accent-soft); border-color: transparent; color: var(--c-accent-ink); }
.page-tab.on .lane { color: var(--c-accent-ink); }
.seg-ctl { display: inline-flex; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.seg-ctl button { height: 28px; border: 0; border-radius: 0; padding: 0 12px; font-size: var(--t-label-size); line-height: var(--t-label-lh); background: var(--c-surface); letter-spacing: var(--t-label-ls); font-weight: 500; }
.seg-ctl button + button { border-left: 1px solid var(--c-border); }
.seg-ctl button[aria-pressed="true"] { background: var(--c-surface-3); }
.viewer-body { flex: 1; overflow: auto; background: var(--c-surface-2); padding: var(--s2); }
figure.page { display: none; margin: 0; }
figure.page.on { display: block; }
figure.page img { display: block; width: 100%; height: auto; background: var(--c-page-paper); border: 1px solid var(--c-border); box-shadow: var(--shadow); }
.viewer.zoom-100 figure.page img { width: auto; max-width: none; }
figure.page figcaption { color: var(--c-text-3); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); margin-top: var(--s1); }
.noimg { display: grid; place-items: center; gap: var(--s1); min-height: 240px; border: 1px dashed var(--c-border-strong);
  color: var(--c-text-3); padding: var(--s3); text-align: center; border-radius: var(--radius); background: var(--c-surface); }
.noimg .i { width: 24px; height: 24px; }
.details { min-width: 0; }
.doc-head .head-top { display: flex; justify-content: space-between; gap: var(--s2); align-items: flex-start; flex-wrap: wrap; margin-bottom: var(--s2); }
.doc-head h1 { font-size: var(--t-title-size); line-height: var(--t-title-lh); }
.doc-title { color: var(--c-text-2); }
.status-box { display: flex; gap: var(--s1); align-items: center; flex-wrap: wrap; }
.summary { margin: var(--s2) 0 0; color: var(--c-text-2); max-width: 80ch; }
.doc-actions { display: flex; gap: var(--s1); flex-wrap: wrap; margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--c-border); }

/* tabs: progressive enhancement; without JS every panel shows with its heading */
.tabset { padding: 0; }
.tabs { display: flex; gap: var(--s3); border-bottom: 1px solid var(--c-border); padding: 0 var(--s2); overflow-x: auto; }
.no-js .tabs { display: none; }
.tab { height: 44px; border: 0; border-radius: 0; background: none; padding: 0; color: var(--c-text-2); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; gap: 6px; }
.tab:hover { background: none; color: var(--c-text); }
.tab[aria-selected="true"] { color: var(--c-text); border-bottom-color: var(--c-accent); }
.tab .tab-n { font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--c-text-3); font-weight: 400; }
.tab .i { width: 14px; height: 14px; vertical-align: 0; }
.tab .tab-flag-bad { color: var(--c-bad); } .tab .tab-flag-warn { color: var(--c-warn); }
.tabpanel { padding: var(--s2); }
.js .tabpanel:not(.on) { display: none; }
.tabpanel > .tp-h { display: none; }
.no-js .tabpanel > .tp-h { display: block; margin-bottom: var(--s1); }
.tabpanel h3 { margin: var(--s3) 0 var(--s1); }
.tabpanel h3:first-child, .tabpanel .tp-h + h3 { margin-top: 0; }
.tabpanel > .table-wrap { margin: calc(-1 * var(--s2)) calc(-1 * var(--s2)) 0; }
.tabpanel > .tp-h + .table-wrap { margin-top: 0; }
.tabpanel .tab-note { color: var(--c-text-3); font-size: var(--t-small-size); line-height: var(--t-small-lh); margin: var(--s2) 0 0; }

table.tree th { padding: var(--s1); text-align: left; border-bottom: 1px solid var(--c-border); }
table.tree th.grp { text-align: center; border-left: 1px solid var(--c-border); }
table.tree th:first-child, table.tree td:first-child { padding-left: var(--s2); }
table.tree th:last-child, table.tree td:last-child { padding-right: var(--s2); }
table.tree td { padding: 6px var(--s1); border-bottom: 1px solid var(--c-border); vertical-align: top; }
table.tree tr.ln { cursor: pointer; transition: background-color var(--t-change); }
table.tree tr.ln:hover td { background: var(--c-surface-2); }
tr.role-section_header td { font-weight: 600; }
tr.role-note td.desc, tr.role-client_scope td.desc { color: var(--c-text-2); font-style: italic; }
tr.eff td { font-size: var(--t-small-size); line-height: var(--t-small-lh); color: var(--c-text-2); padding-top: 0; }
tr[data-problem="bad"] td:first-child { box-shadow: inset 3px 0 0 var(--c-bad-mark); }
tr[data-problem="warn"] td:first-child { box-shadow: inset 3px 0 0 var(--c-warn-mark); }
tr.row-problem td { padding-top: 0; font-size: var(--t-small-size); line-height: var(--t-small-lh); color: var(--c-bad); }
tr.row-problem.tone-warn td { color: var(--c-warn); }
tr.hl td, .ln.hl > * { background: var(--c-accent-soft) !important; }
tr.hl td:first-child { box-shadow: inset 3px 0 0 var(--c-accent); }
.tree-mark { color: var(--c-border-strong); margin-right: var(--s-half); }
td.desc .sub { display: block; }
.ln-no { white-space: nowrap; font-family: var(--mono); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--c-text-2); }
button.pg { height: 22px; padding: 0 8px; font-size: var(--t-label-size); line-height: var(--t-label-lh); border-color: var(--c-border); color: var(--c-accent-ink); font-family: var(--mono); letter-spacing: var(--t-label-ls); font-weight: 500; }
.totals-list { display: grid; gap: var(--s1); }
.total-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-half) var(--s2); padding: 12px var(--s2); border: 1px solid var(--c-border);
  border-radius: var(--radius); cursor: pointer; transition: background-color var(--t-change); }
.total-row:hover { background: var(--c-surface-2); }
.total-row.grand { border-color: var(--c-border-strong); }
.total-row .t-label { font-weight: 600; display: flex; align-items: center; gap: var(--s1); flex-wrap: wrap; }
.total-row .t-amt { font-weight: 600; text-align: right; white-space: nowrap; }
.total-row .t-comp { grid-column: 1 / -1; color: var(--c-text-2); font-size: var(--t-small-size); line-height: var(--t-small-lh); }
.total-row .t-comp.tone-bad { color: var(--c-bad); }
.total-row.hl { background: var(--c-accent-soft); }
.charge-list td.num { width: 1%; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 2px var(--s2); align-items: start; padding: 12px 0;
  border-bottom: 1px solid var(--c-border); }
.checklist li:first-child { padding-top: 0; }
.checklist li:last-child { border-bottom: 0; padding-bottom: 0; }
.checklist .ck-name { font-weight: 600; }
.ck-detail { grid-column: 2; color: var(--c-text-2); font-size: var(--t-small-size); line-height: var(--t-small-lh); overflow-wrap: anywhere; }
:target { scroll-margin-top: calc(var(--top-h) + var(--s2)); }

/* ---------------------------------------------------------------- costing cards (search, ask) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: var(--s3); align-items: start; }
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: none; padding: var(--s2); min-width: 0; }
.card header { display: flex; justify-content: space-between; gap: var(--s1); flex-wrap: wrap; align-items: baseline; }
.card .vendor { font-weight: 600; font-size: var(--t-card-size); line-height: var(--t-card-lh); }
.card .meta { color: var(--c-text-3); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); display: flex; gap: var(--s1); align-items: center; flex-wrap: wrap; }
.card.muted { background: var(--c-surface-2); box-shadow: none; }
.card.muted .vendor, .card.muted .price .amt { color: var(--c-text-2); }
.card.muted .price .scope { color: var(--c-text-3); }
.headline { margin: 12px 0 0; padding-bottom: 12px; }
.basis { color: var(--c-text-2); font-size: var(--t-small-size); line-height: var(--t-small-lh); margin-top: var(--s-half); }
.anchor-desc { color: var(--c-text-2); font-size: var(--t-small-size); line-height: var(--t-small-lh); margin-top: var(--s-half); }
.nc-reason { display: flex; gap: 6px; align-items: flex-start; margin: 12px 0 0; padding: var(--s1) 12px; border-radius: var(--radius);
  background: var(--c-surface); border: 1px solid var(--c-border); color: var(--c-text-2); font-size: var(--t-small-size); line-height: var(--t-small-lh); }
.nc-reason .i { color: var(--c-na); margin-top: 1px; vertical-align: 0; }
.nc-reason strong { color: var(--c-text); font-weight: 600; }
.card h4 { margin: 12px 0 var(--s-half); }
details.more > summary { cursor: pointer; color: var(--c-accent-ink); font-size: var(--t-label-size); line-height: var(--t-label-lh); font-weight: 500; list-style: none;
  display: inline-flex; align-items: center; gap: var(--s-half); padding: var(--s1) 0 0; letter-spacing: var(--t-label-ls); }
summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
/* one disclosure mark everywhere: a small chevron that turns when the section opens */
details:not(.more) > summary::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 12px 4px 4px;
  border-right: 1.5px solid var(--c-text-3); border-bottom: 1.5px solid var(--c-text-3); transform: rotate(-45deg);
  transition: transform var(--t-change); }
details[open]:not(.more) > summary::before { transform: rotate(45deg); }
details > summary .i { transition: transform var(--t-change); width: 14px; height: 14px; vertical-align: 0; }
details[open] > summary .i { transform: rotate(180deg); }
table.comp td { padding: 8px var(--s-half); border-bottom: 1px solid var(--c-border); vertical-align: top; font-size: var(--t-small-size); line-height: var(--t-small-lh); }
table.comp td:first-child { padding-left: 0; }
table.comp td:last-child { padding-right: 0; }
table.comp tr:last-child td { border-bottom: 0; }
table.comp td.ln { width: 1%; white-space: nowrap; }
table.comp td.num { width: 1%; }
table.comp .price .amt { font-weight: 500; }
table.comp .price .scope { font-size: var(--t-caption-size); line-height: var(--t-caption-lh); }
table.comp .price { white-space: nowrap; }
.qpp { color: var(--c-text-3); }
.checks-inline { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: 12px; font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--c-text-2); align-items: center; }
.checks-inline > span { display: inline-flex; gap: 6px; align-items: center; }
.cited { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--c-border); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--c-text-3);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-half); }
.noprice { color: var(--c-text-3); }
.search-box { display: flex; gap: var(--s1); align-items: flex-end; flex-wrap: wrap; margin-bottom: var(--s2); }
.search-box label { display: grid; gap: var(--s-half); font-size: var(--t-label-size); line-height: var(--t-label-lh); color: var(--c-text-2); font-weight: 500; letter-spacing: var(--t-label-ls); }
.search-box label.grow { flex: 1 1 360px; }
.search-box input[type=search] { height: 48px; font-size: var(--t-card-size); line-height: var(--t-card-lh); padding: 0 var(--s2); width: 100%; border-width: 1.5px; }
.search-box select { height: 48px; }
.search-box .btn-lg { height: 48px; }
.example-row { display: flex; gap: var(--s1); flex-wrap: wrap; align-items: center; margin: 0 0 var(--s3); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--c-text-3); }
.example-row a { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--c-surface-2); color: var(--c-text-2); font-size: var(--t-small-size); line-height: var(--t-small-lh); transition: background-color 120ms, color 120ms; }
.example-row a:hover { background: var(--c-surface-3); color: var(--c-text); text-decoration: none; }
.group-note { color: var(--c-text-3); font-size: var(--t-small-size); line-height: var(--t-small-lh); margin: calc(-1 * var(--s1)) 0 var(--s2); }

/* ---------------------------------------------------------------- ask */
.answer { padding: var(--s3); }
.answer.abstain { background: var(--c-surface-2); }
.answer-mode { display: flex; align-items: center; gap: 6px; font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--c-text-3); margin-bottom: 12px; }
.abstain-msg { font-size: var(--t-card-size); line-height: var(--t-card-lh); margin: 0; display: flex; gap: var(--s1); align-items: flex-start; }
.abstain-msg .i { margin-top: 3px; color: var(--c-na); }
.sentences { margin: 0; padding-left: 20px; display: grid; gap: 12px; font-size: var(--t-card-size); line-height: var(--t-card-lh); }
.sentences li::marker { color: var(--c-text-3); font-size: var(--t-body-size); line-height: var(--t-body-lh); }
.dropped { margin-top: var(--s2); color: var(--c-text-2); font-size: var(--t-small-size); line-height: var(--t-small-lh); }
.dropped summary { cursor: pointer; }

/* ---------------------------------------------------------------- upload */
.upload-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: var(--s3); align-items: start; margin-bottom: var(--s3); }
.upload-grid > .panel { margin: 0; }
.drop { position: relative; display: grid; justify-items: center; gap: var(--s1); text-align: center; padding: var(--s6) var(--s3) var(--s4);
  border: 1.5px dashed var(--c-border-strong); border-radius: var(--radius); background: var(--c-surface-2);
  transition: background-color var(--t-change), border-color var(--t-change); }
.drop > .i { width: 32px; height: 32px; color: var(--c-text-3); }
.drop .drop-title { font-size: var(--t-card-size); line-height: var(--t-card-lh); font-weight: 600; margin: 0; }
.drop .drop-sub { color: var(--c-text-2); margin: 0; }
.drop .drop-limits { color: var(--c-text-3); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); margin: 0; }
.drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop.is-over { border-color: var(--c-accent); background: var(--c-accent-soft); }
.drop.is-over > .i { color: var(--c-accent-ink); }
.drop:focus-within { border-color: var(--c-accent); }
.no-js .drop input[type=file] { position: static; opacity: 1; height: auto; width: auto; }
.kinds { list-style: none; padding: 0; margin: var(--s2) 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s1); position: relative; z-index: 1; pointer-events: none; }
.file-list { margin: var(--s2) 0 0; }
.file-list table { width: 100%; border-collapse: collapse; }
.file-list td { padding: var(--s1) 0; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.file-list td.fi { width: 28px; color: var(--c-text-3); }
.file-list .fname { overflow-wrap: anywhere; }
.file-list .fsize { text-align: right; color: var(--c-text-2); white-space: nowrap; padding-left: var(--s2); }
.file-list .ftotal td { border-bottom: 0; color: var(--c-text-2); font-size: var(--t-small-size); line-height: var(--t-small-lh); }
.upload-actions { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); flex-wrap: wrap; }
.upload-actions .sub { font-size: var(--t-small-size); line-height: var(--t-small-lh); }
.samples { display: grid; gap: var(--s1); }
.samples form { margin: 0; }
button.sample { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; width: 100%;
  height: auto; padding: 12px; text-align: left; white-space: normal; justify-content: stretch; border-color: var(--c-border); }
button.sample:hover { border-color: var(--c-border-strong); }
.sample > .i { grid-row: 1 / 4; width: 24px; height: 24px; color: var(--c-text-2); align-self: start; }
.sample .s-label { font-weight: 600; }
.sample .s-size { color: var(--c-text-3); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); font-weight: 400; text-align: right; }
.sample .s-what { grid-column: 2 / 4; color: var(--c-text-2); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); font-weight: 400; }
.sample .s-file { grid-column: 2 / 4; color: var(--c-text-3); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); font-weight: 400; overflow-wrap: anywhere; }
button.sample[disabled] { opacity: 1; background: var(--c-surface-2); border-style: dashed; }
button.sample[disabled] > .i, button.sample[disabled] .s-label { color: var(--c-text-3); }
.sample .s-reason { grid-column: 2 / 4; color: var(--c-na); font-size: var(--t-label-size); line-height: var(--t-label-lh); font-weight: 500; display: inline-flex; gap: 4px; align-items: center; letter-spacing: var(--t-label-ls); }
.sample .s-reason .i { width: 14px; height: 14px; vertical-align: 0; }

/* ---------------------------------------------------------------- job: honest progress (§2.5) */
.doc-run { padding: 0; overflow: hidden; }
.doc-run-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s2); flex-wrap: wrap; }
.doc-run-head h2 { display: flex; align-items: center; gap: var(--s1); min-width: 0; }
.doc-run-head h2 .i { color: var(--c-text-3); width: 18px; height: 18px; }
.doc-run-head .dname { overflow-wrap: anywhere; }
.doc-run-head .dmeta { display: flex; gap: var(--s1); align-items: center; flex-wrap: wrap; color: var(--c-text-3); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); }
.stepper { list-style: none; margin: 0; padding: var(--s1) var(--s2) var(--s2); display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.step { position: relative; padding-right: var(--s1); min-width: 0; }
.step::before { content: ""; position: absolute; top: 11px; left: 30px; right: 6px; height: 2px; border-radius: 1px; background: var(--c-border); }
.step:last-child::before { display: none; }
.step.is-done::before { background: var(--c-text-3); }
.step-mark { position: relative; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--c-surface); color: var(--c-text-3); transition: color var(--t-change); }
.step-mark .i { width: 24px; height: 24px; vertical-align: 0; }
.step-label { display: block; margin-top: var(--s1); font-weight: 600; }
.step-time { display: block; color: var(--c-text); }
.step-detail { display: block; font-size: var(--t-small-size); line-height: var(--t-small-lh); color: var(--c-text-3); padding-right: var(--s1); overflow-wrap: anywhere; }
.step.is-pending .step-label, .step.is-pending .step-time { color: var(--c-text-3); font-weight: 500; }
.step.is-done .step-mark { color: var(--c-text); }
.step.is-current .step-mark, .step.is-current .step-label, .step.is-current .step-time { color: var(--c-accent-ink); }
.step.is-failed .step-mark, .step.is-failed .step-label { color: var(--c-bad); }
.step.is-na .step-mark, .step.is-na .step-label { color: var(--c-na); font-weight: 500; }
.step.is-na .step-time { color: var(--c-text-3); }
.step.tone-good .step-mark, .step.tone-good .step-time { color: var(--c-good); }
.step.tone-warn .step-mark, .step.tone-warn .step-time { color: var(--c-warn); }
.step.just-changed .step-mark { animation: step-in 200ms ease-out; }
@keyframes step-in { from { transform: scale(.6); opacity: .3; } to { transform: scale(1); opacity: 1; } }
.meter { height: 6px; background: var(--c-surface-3); border-radius: 3px; overflow: hidden; margin: var(--s1) 0; }
.meter > span { display: block; height: 100%; background: var(--c-accent); transition: width var(--t-change); }
.content-note { display: flex; align-items: center; gap: var(--s1); margin: 0 var(--s2) var(--s2); padding: var(--s1) 12px; border-radius: var(--radius);
  border: 1px solid var(--c-border); color: var(--c-text-2); font-size: var(--t-small-size); line-height: var(--t-small-lh); }
.content-note strong { color: var(--c-text); font-weight: 600; }
.thumbs { display: flex; flex-wrap: wrap; gap: var(--s1); padding: 0 var(--s2) var(--s2); }
.thumb { position: relative; display: block; width: 72px; border-radius: 3px; border: 1px solid var(--c-border); background: var(--c-page-paper); }
.thumb img { display: block; width: 100%; height: 96px; object-fit: cover; object-position: top; border-radius: 3px; }
.thumb .t-no { position: absolute; left: 4px; bottom: 4px; background: var(--c-surface); color: var(--c-text-2); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); padding: 0 4px; border-radius: 3px; border: 1px solid var(--c-border); }
.thumb .t-mark { position: absolute; right: 3px; top: 3px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--c-surface); color: var(--c-text); }
.thumb .t-mark .i { width: 18px; height: 18px; vertical-align: 0; }
.thumb.is-current { outline: 2px solid var(--c-accent); outline-offset: 1px; }
.thumb.is-current .t-mark { color: var(--c-accent-ink); }
.thumb.is-waiting img { opacity: .5; }
.verdict { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; margin: 0 var(--s2) var(--s2);
  padding: 12px var(--s2); border-radius: var(--radius); border: 1px solid var(--c-border); }
.verdict > .i { width: 24px; height: 24px; grid-row: 1 / 4; align-self: start; }
.verdict .v-head { font-weight: 600; font-size: var(--t-card-size); line-height: var(--t-card-lh); }
.verdict .v-text { color: var(--c-text-2); }
.verdict .v-facts { display: flex; flex-wrap: wrap; gap: var(--s-half) var(--s3); color: var(--c-text-2); font-size: var(--t-small-size); line-height: var(--t-small-lh); margin-top: var(--s-half); }
.verdict .v-facts b { color: var(--c-text); font-weight: 600; font-size: var(--t-body-size); line-height: var(--t-body-lh); }
.verdict .v-act { grid-row: 1 / 4; grid-column: 3; }
.verdict.tone-good { border-color: var(--c-good-border); } .verdict.tone-good > .i, .verdict.tone-good .v-head { color: var(--c-good); }
.verdict.tone-warn { border-color: var(--c-warn-border); } .verdict.tone-warn > .i, .verdict.tone-warn .v-head { color: var(--c-warn); }
.verdict.tone-bad { border-color: var(--c-bad-border); } .verdict.tone-bad > .i, .verdict.tone-bad .v-head { color: var(--c-bad); }
.verdict.tone-na > .i, .verdict.tone-na .v-head { color: var(--c-na); }
ol.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
ol.timeline li { display: grid; grid-template-columns: 72px 96px minmax(0, 1fr); gap: var(--s2); padding: 8px 0; border-bottom: 1px solid var(--c-border); font-size: var(--t-small-size); line-height: var(--t-small-lh); }
ol.timeline li:last-child { border-bottom: 0; }
ol.timeline time { color: var(--c-text-3); }
ol.timeline .ev-stage { font-weight: 600; text-transform: capitalize; }
ol.timeline li.ev-error .ev-stage, ol.timeline li.ev-failed .ev-stage { color: var(--c-bad); }
ol.timeline li > span:last-child { overflow-wrap: anywhere; color: var(--c-text-2); }

/* ---------------------------------------------------------------- health, login, error */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: var(--s2); margin-bottom: var(--s3); }
.svc-grid > .panel { margin: 0; display: grid; gap: var(--s1); align-content: start; }
.svc-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s1); }
.svc-name { display: flex; align-items: center; gap: var(--s1); font-weight: 600; }
.svc-name .i { width: 18px; height: 18px; color: var(--c-text-3); }
.svc-detail { color: var(--c-text-2); font-size: var(--t-small-size); line-height: var(--t-small-lh); overflow-wrap: anywhere; }
.svc-num { font-size: var(--t-section-size); line-height: var(--t-section-lh); font-weight: 600; font-variant-numeric: tabular-nums; }
.state-up { color: var(--c-good); font-weight: 600; }
.state-down { color: var(--c-bad); font-weight: 600; }
.state-off { color: var(--c-na); font-weight: 600; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: var(--s3); }
.login-card { width: min(100%, 380px); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: var(--s4) var(--s3) var(--s3); }
.login-brand { display: flex; align-items: center; gap: 12px; padding: 0 0 var(--s3); margin: 0 0 var(--s3); border-bottom: 1px solid var(--c-border); }
.login-mark { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: var(--c-accent); color: #fff; font-size: var(--t-section-size); line-height: var(--t-section-lh); font-weight: 600; }
.login-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.login-name strong { font-size: var(--t-card-size); line-height: var(--t-card-lh); font-weight: 600; color: var(--c-text); }
.login-name span { font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--c-text-3); }
.login-lede { margin: var(--s1) 0 0; font-size: var(--t-body-size); line-height: var(--t-body-lh); color: var(--c-text-2); }
.login-card h1 { font-size: var(--t-section-size); line-height: var(--t-section-lh); }
.login-card form { display: grid; gap: var(--s1); margin-top: var(--s3); }
.login-card form .btn-primary { margin-top: var(--s1); }
.login-card label { display: grid; gap: var(--s-half); font-weight: 500; font-size: var(--t-label-size); line-height: var(--t-label-lh); color: var(--c-text-2); letter-spacing: var(--t-label-ls); }
.login-card input[type=password] { height: 40px; width: 100%; }
.login-card .btn-primary { height: 40px; width: 100%; }
.login-card .err { color: var(--c-bad); display: flex; gap: 6px; align-items: center; margin: var(--s2) 0 0; }
.err-card { max-width: 640px; padding: var(--s3); }
.err-card .err-code { font-family: var(--mono); color: var(--c-text-3); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); }
.err-card h1 { margin: var(--s-half) 0 var(--s1); }
.err-card .err-actions { display: flex; gap: var(--s1); margin-top: var(--s2); flex-wrap: wrap; }

/* ---------------------------------------------------------------- forms (builder C) */
.fk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--s3); align-items: stretch; }
.fk-grid > .panel { margin: 0; }
.fk { display: flex; flex-direction: column; gap: 12px; }
.fk .fk-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--radius); background: var(--c-surface-2); color: var(--c-text-2); }
.fk .fk-icon .i { width: 20px; height: 20px; vertical-align: 0; }
.fk p { margin: 0; color: var(--c-text-2); }
.panel.fk > h2 { margin: 0; }
.fk form { display: flex; flex-direction: column; gap: 12px; margin-top: auto; padding-top: var(--s1); }
.fk label { display: grid; gap: var(--s-half); font-size: var(--t-label-size); line-height: var(--t-label-lh); color: var(--c-text-2); font-weight: 500; letter-spacing: var(--t-label-ls); }
.fk select, .fk input[type=search] { width: 100%; }
.fk button { align-self: flex-start; }
.fk .json { font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--c-text-3); }
.fk.err { border-color: var(--c-bad-border); box-shadow: 0 0 0 1px var(--c-bad-border); }
.sup-note { display: flex; gap: 6px; align-items: center; color: var(--c-text-2); font-size: var(--t-small-size); line-height: var(--t-small-lh); margin: 0 0 var(--s3); }
.ff-head { display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; align-items: flex-end; margin-bottom: var(--s2); }
.ff-counts { display: flex; gap: var(--s1); flex-wrap: wrap; }
.fst { text-transform: lowercase; }
.fst-filled { color: var(--c-text); background: var(--c-surface); border-color: var(--c-border-strong); }
.fst-derived { color: var(--c-text-2); background: var(--c-surface-2); border-color: var(--c-border); }
.fst-empty { color: var(--c-na); background: var(--c-surface); border-style: dashed; border-color: var(--c-border-strong); }
.fst-edited { color: var(--c-accent-ink); background: var(--c-accent-soft); border-color: transparent; }
.ff-banner { display: flex; gap: var(--s1); align-items: flex-start; border: 1px solid var(--c-warn-border); background: var(--c-warn-bg); color: var(--c-warn);
  padding: 12px var(--s2); border-radius: var(--radius); margin: 0 0 var(--s2); }
.ff-banner.error { border-color: var(--c-bad-border); background: var(--c-bad-bg); color: var(--c-bad); }
.ff-banner.info { border-color: var(--c-border); background: var(--c-surface-2); color: var(--c-text-2); }
.ff-grid { display: grid; grid-template-columns: minmax(10rem, max-content) minmax(0, 1fr) auto; gap: 12px var(--s2); align-items: start; }
.ff-grid > .lbl { color: var(--c-text-2); padding-top: var(--s1); font-weight: 500; }
.ff-grid > .meta { display: flex; gap: var(--s-half); align-items: center; flex-wrap: wrap; padding-top: 6px; justify-content: flex-end; }
.ff-grid .hint { display: block; color: var(--c-text-3); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); margin-top: var(--s-half); }
.ff input[type=text], .ff textarea { width: 100%; }
.ff textarea { resize: vertical; }
.ff .num-in { text-align: right; font-variant-numeric: tabular-nums; }
.ro { display: inline-block; padding-top: var(--s1); }
.ro-empty { color: var(--c-text-3); font-style: italic; }
table.fft { width: 100%; border-collapse: collapse; }
table.fft th { font-size: var(--t-label-size); line-height: var(--t-label-lh); font-weight: 500; color: var(--c-text-2); background: var(--c-surface-2); padding: var(--s1); text-align: left;
  border-bottom: 1px solid var(--c-border); white-space: nowrap; letter-spacing: var(--t-label-ls); }
table.fft td { padding: var(--s1); border-bottom: 1px solid var(--c-border); vertical-align: top; min-width: 5.5rem; }
table.fft td.c-description, table.fft td.c-item { min-width: 16rem; }
table.fft td .price { display: block; margin-bottom: var(--s-half); white-space: nowrap; }
table.fft td .cellmeta { display: flex; gap: var(--s-half); flex-wrap: wrap; margin-top: var(--s-half); }
table.fft td input[type=text] { height: 30px; font-size: var(--t-small-size); line-height: var(--t-small-lh); }
table.fft ul.flags { font-size: var(--t-caption-size); line-height: var(--t-caption-lh); margin: 0; }
tr.g-not_comparable td { background: var(--c-surface-2); color: var(--c-text-2); }
.rowflags { color: var(--c-warn); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); margin-top: var(--s-half); }
.ff-actions { position: sticky; bottom: 0; z-index: 2; display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin: var(--s2) 0 0;
  padding: 12px 0; background: var(--c-bg); border-top: 1px solid var(--c-border); }
.legend-st { display: flex; gap: var(--s2); flex-wrap: wrap; font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--c-text-2); margin: var(--s1) 0 var(--s3); }
.legend-st > span { display: inline-flex; gap: 6px; align-items: center; }
.sec-note { color: var(--c-text-3); font-size: var(--t-small-size); line-height: var(--t-small-lh); margin: calc(-1 * var(--s1)) 0 12px; }

/* ---------------------------------------------------------------- supervisor review (builder B) */
.rv-verdict { display: inline-flex; align-items: center; gap: var(--s-half); height: 22px; padding: 0 var(--s1); border-radius: var(--radius);
  font-size: var(--t-label-size); line-height: var(--t-label-lh); font-weight: 500; border: 1px solid var(--c-na-border); background: var(--c-na-bg); color: var(--c-na); letter-spacing: var(--t-label-ls); }
.rv-misread { color: var(--c-warn); background: var(--c-warn-bg); border-color: var(--c-warn-border); }
.rv-document_error { color: var(--c-bad); background: var(--c-bad-bg); border-color: var(--c-bad-border); }
table.rv td.sug { font-weight: 600; background: var(--c-accent-soft); }
table.rv td.orig, .rv-note { color: var(--c-text-2); }
.rv-check h2 { display: flex; align-items: center; gap: var(--s1); flex-wrap: wrap; }
.rv-check .msg { margin: var(--s1) 0 12px; color: var(--c-text-2); }
.rv-check details { margin-top: 12px; }
.rv-check details > summary { cursor: pointer; color: var(--c-accent-ink); font-size: var(--t-label-size); line-height: var(--t-label-lh); font-weight: 500; letter-spacing: var(--t-label-ls); }
.rv-note { font-size: var(--t-small-size); line-height: var(--t-small-lh); }
.rv-status { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.rv-status > span { display: inline-flex; align-items: center; gap: var(--s1); color: var(--c-text-2); }
form.rv-run { display: inline; margin-left: auto; }
td.err { color: var(--c-bad); font-size: var(--t-small-size); line-height: var(--t-small-lh); }

/* ---------------------------------------------------------------- responsive: optimised 1280–1920, stacks below 1024 */
@media (max-width: 1180px) {
  .docview { grid-template-columns: minmax(0, 1fr); }
  .viewer { position: static; height: 70vh; }
  .upload-grid { grid-template-columns: minmax(0, 1fr); }
  .stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: var(--s2); }
  .step:nth-child(3)::before { display: none; }
}
@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: var(--s1); padding: var(--s1) var(--s2);
    border-right: 0; border-bottom: 1px solid var(--c-border); }
  .brand { padding: 0; }
  .brand-text span { display: none; }
  .side nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .side-foot { display: none; }
  .topbar { padding: 0 var(--s2); position: static; }
  .pills .svc { display: none; }
  .content { padding: var(--s2) var(--s2) var(--s4); }
  .banner, .foot { padding-left: var(--s2); padding-right: var(--s2); }
}
@media (max-width: 640px) {
  .pills { display: none; }
  .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step::before { display: none; }
  .ff-grid { grid-template-columns: minmax(0, 1fr); }
  .ff-grid > .meta { justify-content: flex-start; padding-top: 0; }
  ol.timeline li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .verdict { grid-template-columns: auto minmax(0, 1fr); }
  .verdict .v-act { grid-row: auto; grid-column: 1 / -1; }
  .tile-n { font-size: var(--t-section-size); line-height: var(--t-section-lh); }
  .price.big .amt { font-size: var(--t-section-size); line-height: var(--t-section-lh); }
  .card { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .side, .topbar, .foot, .banner, .skip { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; color: #111; }
}

/* ---------------------------------------------------------------- FIX-PLAN 3.3 / 3.6 / 3.7: honest states, restricted, purge */
.bar.tone-good { background: var(--c-good-mark); }
.bar.tone-info { background: var(--c-info-mark); }
.bar.tone-na, .bar.tone-pending { background: var(--c-na-mark); }
.verdict.tone-info { border-color: var(--c-info-border); } .verdict.tone-info > .i, .verdict.tone-info .v-head { color: var(--c-info); }
.step.tone-info .step-mark, .step.tone-info .step-time { color: var(--c-info); }
.badge.lock { color: var(--c-text); background: var(--c-surface); border-color: var(--c-border-strong); }
.alert.tone-restricted { border-color: var(--c-border-strong); background: var(--c-surface-2); color: var(--c-text); }
.state-note { display: flex; gap: var(--s1); align-items: flex-start; margin: var(--s2) 0 0; color: var(--c-info); }
.state-note .i { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.restricted-pages a { font-weight: 600; }
.doc-actions .btn-ghost { margin-left: auto; }
.doc-actions .btn-ghost ~ .btn-ghost { margin-left: 0; }
.danger-zone { margin-top: var(--s3); }
.danger-zone summary { cursor: pointer; }
.danger-zone .purge-form { margin-top: var(--s2); display: grid; gap: var(--s2); justify-items: start; max-width: 64ch; }
.danger-zone .confirm { display: inline-flex; gap: var(--s1); align-items: center; }
.btn-danger { color: var(--c-bad); border-color: var(--c-bad-border); background: var(--c-bad-bg); }
.btn-danger:hover { background: var(--c-bad-bg); border-color: var(--c-bad); }
.svc-age { margin-top: var(--s-half); }
.purge-kept { display: flex; gap: var(--s1); align-items: flex-start; margin: 0; color: var(--c-text-2); }
.purge-kept .i { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* ---------------------------------------------------------------- UI-UX-PLAN-2026-10-19: frame, Home, status words, document result */
/* System: a small link at the bottom of the sidebar (§3) */
.side-system { display: grid; margin-top: var(--s1); padding-top: var(--s1); border-top: 1px solid var(--c-border); }
.side-system a { display: flex; align-items: center; gap: var(--s1); padding: 4px var(--s1); border-radius: var(--radius);
  color: var(--c-text-3); font-size: var(--t-label-size); line-height: var(--t-label-lh); font-weight: 500; letter-spacing: var(--t-label-ls); }
.side-system a .i { width: 16px; height: 16px; }
.side-system a:hover { background: var(--c-surface-2); color: var(--c-text); text-decoration: none; }
.side-system a.on { background: var(--c-accent-soft); color: var(--c-accent-ink); }
.sys-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--s2); margin: 0 0 var(--s3); }
.sys-link { display: flex; gap: 12px; align-items: flex-start; padding: 12px var(--s2); background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--radius); color: var(--c-text); }
.sys-link:hover { text-decoration: none; border-color: var(--c-border-strong); }
.sys-link > .i { width: 20px; height: 20px; color: var(--c-accent-ink); flex: none; margin-top: 2px; }
.sys-link > span { display: grid; gap: 2px; }
.lane-key { display: inline; }

/* status words (§4): Private (slate, lock) and Could not read (grey outline); green stays for Totals checked */
.chip-restricted { color: var(--c-text); background: var(--c-surface-2); border-color: var(--c-border-strong); }
.chip-unread { color: var(--c-na); background: transparent; border-color: var(--c-border-strong); }
.bar.tone-restricted { background: var(--c-text-3); }
.bar.tone-unread { background: var(--c-border); }
a > .badge.status { cursor: pointer; }

/* Home: start here, numbers, recently added (§6 "Home") */
.start-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: var(--s2); margin: 0 0 var(--s3); }
.start-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-half) 12px; padding: var(--s2) var(--s3) var(--s2) var(--s2);
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); color: var(--c-text);
  transition: border-color var(--t-change), background-color var(--t-change); }
.start-card:hover { text-decoration: none; border-color: var(--c-accent); background: var(--c-accent-soft); }
.start-ic { grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius);
  background: var(--c-accent-soft); color: var(--c-accent-ink); }
.start-ic .i { width: 22px; height: 22px; }
.start-t { font-size: var(--t-card-size); font-weight: 600; line-height: var(--t-card-lh); }
.start-d { color: var(--c-text-2); }
.home-tiles { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--s1) var(--s2); padding: 12px 0;
  border-bottom: 1px solid var(--c-border); flex-wrap: wrap; }
.recent-list li:first-child { padding-top: 0; }
.recent-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.recent-main { display: grid; min-width: 0; }
.recent-name { font-weight: 600; overflow-wrap: anywhere; }

/* Documents: Name, Date, Total, Status, and the status always in view at 1366 px (§6 "Documents") */
table.doc-list td.doc-name { width: 100%; min-width: 220px; }
table.doc-list td.doc-name a { font-weight: 500; }
table.doc-list td.doc-name .sub { overflow-wrap: anywhere; }
table.doc-list td.doc-name .badge { margin-left: var(--s-half); vertical-align: 0; }
.nowrap { white-space: nowrap; }

/* Document result: the answer in one line, the next steps, details folded (§6 "Document result") */
.doc-line { margin: 0 0 var(--s2); font-size: var(--t-card-size); line-height: var(--t-card-lh); color: var(--c-text); max-width: 80ch; }
.doc-line strong { font-weight: 600; }
.doc-line-state { font-weight: 600; white-space: nowrap; }
.doc-line-state.tone-good { color: var(--c-good); }
.doc-line-state.tone-warn { color: var(--c-warn); }
.doc-line-state.tone-na, .doc-line-state.tone-unread, .doc-line-state.tone-pending { color: var(--c-na); }
.alert.needs-look { margin: 0 0 var(--s2); }
.alert.needs-look a { color: inherit; }
.doc-actions.next-steps { margin: 0 0 var(--s2); padding: 0 0 var(--s2); border-top: 0; border-bottom: 1px solid var(--c-border); }
.doc-facts { margin-top: var(--s2); }
.sub-inline { color: var(--c-text-3); font-size: var(--t-small-size); line-height: var(--t-small-lh); }
.row-problem .i { width: 14px; height: 14px; vertical-align: -2px; }
details.tech { padding: 0; }
details.tech > summary { padding: 12px var(--s2); display: flex; align-items: baseline; gap: var(--s1); flex-wrap: wrap; }
details.tech > summary .sub { font-size: var(--t-small-size); line-height: var(--t-small-lh); }
details.tech[open] > summary { border-bottom: 1px solid var(--c-border); }
details.tech > :not(summary) { margin-left: var(--s2); margin-right: var(--s2); }
details.tech > h3 { margin-top: var(--s2); margin-bottom: var(--s1); }
details.tech > .tech-dl { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s2); margin-bottom: var(--s2); }
details.tech .kv { margin-bottom: var(--s1); }
.next-steps .btn-ghost { margin-left: 0; }
.badge.ftype { color: var(--c-text-3); background: transparent; border-color: transparent; padding: 0; height: auto; font-weight: 400; }
.recent-name .i { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------------------------------------------------------------- UI-DESIGN-PLAN-2026-10-20 §4: the document page.
   The page image is the hero: half the width, a thumbnail strip, one click to the full page, and the original
   file itself in the same pane. Facts in sections with a page link on every row; numbers stacked (amount over
   qty x rate) so the description keeps its width. */
body.page-document .content { max-width: none; }
.docview { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (min-width: 1700px) { .docview { grid-template-columns: minmax(0, 6fr) minmax(0, 7fr); } }
.viewer-bar .viewer-tabs { display: inline-flex; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.viewer-bar .viewer-tabs button { height: 28px; border: 0; border-radius: 0; padding: 0 12px; font-size: var(--t-label-size); line-height: var(--t-label-lh); background: var(--c-surface); letter-spacing: var(--t-label-ls); font-weight: 500; }
.viewer-bar .viewer-tabs button + button { border-left: 1px solid var(--c-border); }
.viewer-bar .viewer-tabs button[aria-pressed="true"] { background: var(--c-surface-3); font-weight: 600; }
.viewer-bar .page-count { color: var(--c-text-3); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); }
.viewer-main { display: flex; flex: 1; min-height: 0; }
.viewer-strip { width: 68px; flex: none; overflow-y: auto; border-right: 1px solid var(--c-border); padding: var(--s1);
  display: grid; gap: var(--s1); align-content: start; background: var(--c-surface-2); }
.viewer-strip .page-tab { height: auto; padding: 2px; border: 2px solid transparent; border-radius: 4px; background: transparent;
  display: grid; gap: 2px; justify-items: center; color: var(--c-text-3); }
.viewer-strip .page-tab:hover { background: var(--c-surface-3); }
.viewer-strip .page-tab img { width: 44px; height: 58px; object-fit: cover; object-position: top; background: #fff;
  border: 1px solid var(--c-border); border-radius: 2px; display: block; }
.viewer-strip .page-tab .pt-no { font-size: var(--t-caption-size); line-height: var(--t-caption-lh); }
.viewer-strip .page-tab.on { border-color: var(--c-accent); background: transparent; color: var(--c-accent-ink); }
.viewer-strip .page-tab.on .pt-no { font-weight: 600; }
figure.page img { cursor: zoom-in; }
.viewer-original { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--c-surface-2); }
.orig-frame { flex: 1; width: 100%; border: 0; background: #fff; }
.viewer-original .orig-scroll { flex: 1; overflow: auto; padding: var(--s2); }
.orig-img { display: block; max-width: 100%; margin: 0 auto; background: #fff; box-shadow: var(--shadow); }
.viewer-original .noimg { margin: var(--s2); flex: 1; }
.viewer-original .noimg .btn { margin-top: var(--s1); }
.viewer-original .noimg .orig-name { font-weight: 600; color: var(--c-text); overflow-wrap: anywhere; }

/* the full page, as big as the screen allows */
.fullpage { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-rows: auto minmax(0, 1fr); background: rgba(22, 20, 14, .94); }
.fullpage-bar { display: flex; gap: var(--s1); align-items: center; padding: var(--s1) var(--s2); color: #fff; }
.fullpage-bar .fp-title { flex: 1; font-weight: 600; }
.fullpage-bar .btn { background: rgba(255, 255, 255, .12); border-color: transparent; color: #fff; }
.fullpage-bar .btn:hover { background: rgba(255, 255, 255, .22); }
.fullpage-body { overflow: auto; overscroll-behavior: contain; padding: 0 var(--s2) var(--s2); }
.fullpage-body:focus { outline: none; }
.fullpage-body img { display: block; width: min(100%, 1400px); margin: 0 auto; background: #fff; box-shadow: var(--shadow); }
body.fp-open { overflow: hidden; }
/* "Fit page": the whole page inside the overlay, no scrolling; the default fits the width and scrolls */
.fullpage.fit-page .fullpage-body img { width: auto; max-width: 100%; max-height: 100%; }

/* header: the title in the display face, one sentence, one chip; the facts of the document itself, compact */
.doc-head .head-top { margin-bottom: var(--s1); }
.doc-head .doc-line { font-size: var(--t-card-size); line-height: var(--t-card-lh); }
.doc-facts { margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--c-border); }
.doc-facts dt { font-size: var(--t-small-size); line-height: var(--t-small-lh); }
.doc-facts dd { overflow-wrap: anywhere; }
details.summary-fold { margin-top: var(--s2); color: var(--c-text-2); }
details.summary-fold > summary { font-weight: 600; color: var(--c-text); }
details.summary-fold p { margin: var(--s1) 0 0; max-width: 80ch; }

/* lines: amount over "qty x rate"; scope and make as one quiet line */
table.tree td.money { white-space: nowrap; }
table.tree td.money .amt { display: block; font-weight: 600; }
table.tree td.money .calc { display: block; font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--c-text-3); }
table.tree td.money .rate-only { display: block; }
td.desc .desc-meta { color: var(--c-text-3); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); }
td.desc .desc-meta .sub { font-size: inherit; }
tr.eff td { color: var(--c-text-2); }
tr.eff td .price .amt { font-weight: 600; color: var(--c-text); }

/* facts in sections: label, value, the page it was read from */
table.facts { width: 100%; border-collapse: collapse; }
table.facts th { width: 12rem; padding: var(--s1) var(--s2) var(--s1) 0; text-align: left; vertical-align: top; font-weight: 500; color: var(--c-text-2); border-bottom: 1px solid var(--c-border); }
table.facts td { padding: var(--s1) 0; vertical-align: top; border-bottom: 1px solid var(--c-border); overflow-wrap: anywhere; }
table.facts td.pg { width: 1%; padding-left: var(--s2); white-space: nowrap; }
table.facts tr:last-child th, table.facts tr:last-child td { border-bottom: 0; }
table.facts tr.ln { cursor: pointer; }
table.facts tr.ln:hover th, table.facts tr.ln:hover td { background: var(--c-surface-2); }
.facts-party { margin: var(--s2) 0 var(--s-half); font-size: var(--t-small-size); line-height: var(--t-small-lh); color: var(--c-text-3); text-transform: uppercase; letter-spacing: var(--t-label-ls); font-weight: 600; }
.facts-party:first-child { margin-top: 0; }
.tabpanel h3.sec-title { font-weight: 600; font-size: var(--t-section-size); line-height: var(--t-section-lh); margin: var(--s3) 0 var(--s1); }
.tabpanel h3.sec-title:first-child, .tabpanel .tp-h + h3.sec-title { margin-top: 0; }
.total-row .t-sub { color: var(--c-text-3); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); font-weight: 400; }

/* ---------------------------------------------------------------- UI-DESIGN-PLAN-2026-10-20 §4: Home, Documents, Job */
.home-head { margin-bottom: var(--s4); }
.home-title { font: var(--t-display); max-width: 22ch; }
.home-head .lede { margin-top: var(--s2); }
.start-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.start-card { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ic t go" "ic d go"; align-items: center; padding: var(--s2); }
.start-card .start-ic { grid-area: ic; }
.start-card .start-t { grid-area: t; }
.start-card .start-d { grid-area: d; }
.start-card .start-go { grid-area: go; }
.start-card .start-t { font-size: var(--t-card-size); line-height: var(--t-card-lh); }
.start-card .start-d { font-size: var(--t-small-size); line-height: var(--t-small-lh); color: var(--c-text-3); }
.start-card .start-go { color: var(--c-text-3); transition: transform 120ms ease-out, color 120ms; }
.start-card:hover .start-go { color: var(--c-accent-ink); transform: translateX(2px); }
.home-tiles { display: flex; flex-wrap: wrap; gap: var(--s-half) var(--s3); margin: var(--s3) 0; padding: 0; }
.home-tiles .tile { display: inline-flex; flex-direction: row; align-items: baseline; gap: 6px; padding: 0; border: 0; background: transparent; }
.home-tiles .tile-n { font-size: var(--t-number-size); line-height: var(--t-number-lh); font-variant-numeric: tabular-nums; font-weight: 600; }
.home-tiles .tile-l { font-size: var(--t-body-size); line-height: var(--t-body-lh); color: var(--c-text-2); }
.home-tiles .tile-sub { display: none; }
.home-tiles a.tile:hover .tile-l { text-decoration: underline; text-underline-offset: 3px; }
.recent-list li { padding: 10px 0; }
.recent-name.is-file, table.doc-list td.doc-name.is-file a { font-weight: 400; }
table.doc-list td.doc-name { width: auto; min-width: 280px; }
table.doc-list td.doc-kind { color: var(--c-text-2); text-transform: capitalize; }
table.doc-list .sub { color: var(--c-text-3); }
.doc-run-head.is-same h2 { display: none; }
.verdict { border: 0; padding: var(--s1) var(--s2) var(--s2); }

/* ---------------------------------------------------------------- UI-DESIGN-PLAN-2026-10-20 §4: form outputs as paper.
   The filled form is a document: labels left, values as text, a field becomes an input only under the pointer;
   sources are small marks; the four status chips are gone. */
body.page-form .content { max-width: 1180px; }
.ff-head { align-items: flex-start; }
.ff-lede { max-width: 70ch; }
.ff { background: var(--c-page-paper); color: #1b1a17; border: 1px solid var(--c-border); border-radius: 2px; box-shadow: var(--shadow);
  padding: var(--s4) var(--s4) var(--s3); }
.ff .panel { border: 0; border-radius: 0; padding: 0; margin: 0 0 var(--s4); background: transparent; }
.ff .panel > h2 { font-weight: 600; font-size: var(--t-section-size); line-height: var(--t-section-lh); padding-bottom: var(--s-half);
  border-bottom: 1px solid #c9c4b8; margin-bottom: var(--s2); }
.ff .sec-note { margin: calc(-1 * var(--s1)) 0 var(--s2); }
.ff-grid { grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr) auto; gap: 6px var(--s2); }
.ff-grid > .lbl { color: var(--c-text-3); padding-top: 8px; font-weight: 400; font-size: var(--t-small-size); line-height: var(--t-small-lh); }
.ff-grid > .meta { padding-top: 7px; gap: var(--s1); }
.ff input[type=text], .ff textarea { border-color: transparent; background: transparent; padding-left: 6px; margin-left: -6px; width: calc(100% + 6px);
  transition: border-color 120ms, background-color 120ms; }
.ff input[type=text]:hover, .ff textarea:hover { border-color: var(--c-border); background: var(--c-surface-2); }
.ff input[type=text]:focus-visible, .ff textarea:focus-visible { border-color: var(--c-accent); background: var(--c-surface); }
.ff .ro { padding-top: 7px; }
.ff .ro-empty { color: var(--c-text-3); }
.ff .fst { font-size: var(--t-label-size); line-height: var(--t-label-lh); color: var(--c-text-3); font-style: italic; letter-spacing: var(--t-label-ls); font-weight: 500; }
.ff .fst-edited { color: var(--c-accent-ink); font-style: normal; }
.ff a.src-mark { font-size: var(--t-caption-size); vertical-align: super; line-height: var(--t-caption-lh); margin: 0; text-decoration: none; color: var(--c-text-3);
  border: 1px solid var(--c-border); border-radius: 3px; padding: 0 4px; }
.ff a.src-mark:hover { color: var(--c-accent-ink); border-color: var(--c-accent-ink); }
.ff .rowflags { color: var(--c-text-2); font-style: italic; }
.ff table.fft th { background: transparent; border-bottom: 1.5px solid #1b1a17; color: var(--c-text-2); text-transform: uppercase; letter-spacing: var(--t-label-ls); font-size: var(--t-label-size); line-height: var(--t-label-lh); font-weight: 500; }
.ff table.fft td { border-bottom: 1px solid #e3dfd4; }
.ff table.fft td input[type=text] { height: 28px; }
.ff table.fft td .price .amt { font-weight: 600; }
.ff tr.g-not_comparable td { background: transparent; color: var(--c-text-2); }
.ff tr.g-not_comparable td.c-rank .ro-empty { font-size: var(--t-caption-size); line-height: var(--t-caption-lh); }
.ff table.fft ul.flags li { color: var(--c-text-2); font-style: italic; }
.ff-actions { background: var(--c-bg); border-top: 0; padding: var(--s2) 0; }
.ff-more { color: var(--c-text-3); font-size: var(--t-small-size); line-height: var(--t-small-lh); margin-left: auto; }
.ff-more a { color: var(--c-text-2); }
.ff-empty > summary { color: var(--c-text-3); }
/* comparison table: a money cell shows its value once; the edit box appears under the pointer */
.ff table.fft td .price + input[type=text]:not(:placeholder-shown) { display: none; }
.ff table.fft td:hover .price + input[type=text], .ff table.fft td:focus-within .price + input[type=text] { display: block; }
.ff table.fft td .price { margin-bottom: 0; }
.ff table.fft td.c-rank { white-space: nowrap; }
.ff table.fft td.c-rank .fst, .ff table.fft td.c-rank .cellmeta { display: none; }
.ff table.fft td input[type=text] { padding-left: 4px; margin-left: -4px; width: calc(100% + 4px); min-width: 6rem; }
.ff table.fft td.c-vendor input[type=text], .ff table.fft td.c-document input[type=text] { min-width: 9rem; }
details.fk-custom { display: block; margin-top: var(--s3); }
details.fk-custom > summary { padding: var(--s-half) 0; }
details.fk-custom > summary .sub { margin-left: var(--s1); }
details.fk-custom > p { margin-top: var(--s2); }
details.fk-custom form { max-width: 560px; }

/* === milestone (2026-10-20) === */
/* UPGRADE-PLAN-2026-10-20 A1 / N4 / A8: the name, Home as the state of the system, the milestone page, the key-facts
   strip, and a short page-to-page fade. Appended as one block; the rules above are untouched. */

/* the wordmark on two lines, with the About line under it */
.side-about { display: block; margin: calc(-1 * var(--s2)) 12px var(--s2); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--c-text-3); }
.side-about:hover, .side-about[aria-current="page"] { color: var(--c-text); text-decoration: none; }

/* page-to-page fade: short, and off for readers who asked for reduced motion */
@keyframes page-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
/* fill `backwards`, not `both`: a transform kept after the fade makes .content the containing block of every
   position:fixed overlay inside it (the full page, the form zoom and busy panels grew to the page's height and
   could not scroll, 2026-10-21) */
.content { animation: page-in 160ms ease-out backwards; }
@media (prefers-reduced-motion: reduce) { .content { animation: none; } }

/* Home: six numbers in display type; the kpi markup stays, the look is a row of hero numbers */
.hero-numbers { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: start; gap: var(--s3) var(--s2); margin: var(--s4) 0 var(--s2); padding: var(--s3) 0; border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.hero-numbers .tile { display: flex; flex-direction: column; gap: var(--s-half); padding: 0; border: 0; background: transparent; border-radius: 0; }
.hero-numbers .tile-n { font-size: var(--t-number-lg-size); line-height: var(--t-number-lg-lh); font-variant-numeric: tabular-nums; min-height: 1em; font-weight: 600; }
.hero-numbers .tile-l { font-size: var(--t-small-size); line-height: var(--t-small-lh); color: var(--c-text-2); }
.hero-numbers a.tile:hover { text-decoration: none; }
.hero-numbers a.tile:hover .tile-l { text-decoration: underline; text-underline-offset: 3px; }
.home-more { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s2); margin: 0 0 var(--s4); }
.home-more .tile { display: inline-flex; flex-direction: row; align-items: baseline; gap: 6px; padding: 0; border: 0; background: transparent; }
.home-more .tile-n { font-size: var(--t-section-size); line-height: var(--t-section-lh); }
.home-more .tile-l { font-size: var(--t-body-size); line-height: var(--t-body-lh); color: var(--c-text-2); }
.home-more .tile-sub { display: none; }
.home-more > .sub { color: var(--c-text-3); font-size: var(--t-small-size); line-height: var(--t-small-lh); }
.home-more a.tile:hover .tile-l { text-decoration: underline; text-underline-offset: 3px; }

/* Home: the activity feed, three columns that collapse to one */
.activity { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--s3); align-items: start; }
.activity .act-col { min-width: 0; }
.activity .act-list { list-style: none; margin: 0; padding: 0; }
.activity .act-list li { display: flex; justify-content: space-between; gap: var(--s2); padding: 12px 0; border-bottom: 1px solid var(--c-border); font-size: var(--t-body-size); line-height: var(--t-body-lh); }
.activity .act-list li:last-child { border-bottom: 0; }
.activity .act-main { min-width: 0; overflow-wrap: anywhere; }
.activity .act-when { color: var(--c-text-3); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); white-space: nowrap; font-variant-numeric: tabular-nums; }
.activity .recent-list li { padding: 10px 0; }
@media (max-width: 1100px) { .hero-numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .hero-numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .hero-numbers .tile-n { font-size: var(--t-number-size); line-height: var(--t-number-lh); } }

/* Document: the key-facts strip above the tabs */
.key-facts { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s2) var(--s4); list-style: none; margin: var(--s2) 0 0; padding: var(--s2) 0; border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.key-facts .kf { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: baseline; column-gap: var(--s1); row-gap: 4px; min-width: 0; }
.key-facts .kf-l, .key-facts .kf-note { grid-column: 1 / -1; }
.key-facts .kf-l { font-size: var(--t-label-size); line-height: var(--t-label-lh); color: var(--c-text-3); letter-spacing: var(--t-label-ls); font-weight: 500; }
.key-facts .kf-v { font-size: var(--t-card-size); line-height: var(--t-card-lh); overflow-wrap: anywhere; }
.key-facts .kf-v.mono { font-family: var(--mono); font-size: var(--t-body-size); line-height: var(--t-body-lh); }
.key-facts .kf-big .kf-v { font-size: var(--t-number-size); line-height: var(--t-number-lh); font-variant-numeric: tabular-nums; font-weight: 600; }
.key-facts .kf-note { font-size: var(--t-small-size); line-height: var(--t-small-lh); color: var(--c-text-2); }
.key-facts .pg { justify-self: start; align-self: center; }
.key-facts .kf-total { margin-left: auto; text-align: right; justify-content: end; }
@media (max-width: 900px) { .key-facts .kf-total { margin-left: 0; text-align: left; } }

/* About: the milestone page */
body.page-about .content { max-width: 1040px; }
.about .about-title { font: var(--t-display); }
.about .panel { margin-bottom: var(--s3); }
.about .panel > h2 { font-weight: 600; font-size: var(--t-section-size); line-height: var(--t-section-lh); margin: 0 0 var(--s2); }
.about .pipe { display: block; width: 100%; height: auto; color: var(--c-text); margin: var(--s1) 0 var(--s2); }
.about .pipe-stage rect { fill: var(--c-surface); stroke: var(--c-border-strong); stroke-width: 1.2; }
.about .pipe-proof rect { stroke: var(--c-text); stroke-width: 1.8; }
.about .pipe-out rect { fill: var(--c-accent-soft); stroke: var(--c-accent-ink); }
.about .pipe-label { font-size: var(--t-card-size); line-height: var(--t-card-lh); fill: currentColor; font-weight: 600; }
.about .pipe-cap { font-family: var(--font); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); fill: var(--c-text-3); }
.about .pipe-link { stroke: var(--c-border-strong); stroke-width: 1.4; marker-end: url(#pipe-arrow); fill: none; color: var(--c-border-strong); }
.about .pipe-note { margin: 0; max-width: 70ch; }
.about .measured-list { display: grid; gap: var(--s2) var(--s3); margin: 0; }
.about .measured-list .m { display: grid; grid-template-columns: minmax(7.5rem, max-content) minmax(0, 1fr); gap: var(--s2); align-items: baseline; padding-bottom: var(--s2); border-bottom: 1px solid var(--c-border); }
.about .measured-list .m:last-child { border-bottom: 0; padding-bottom: 0; }
.about .measured-list dt { margin: 0; }
.about .measured-list dd { margin: 0; font-size: var(--t-card-size); line-height: var(--t-card-lh); }
.about .m-n { font-size: var(--t-number-lg-size); line-height: var(--t-number-lg-lh); font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.about .m-when { display: inline-block; margin-left: var(--s1); color: var(--c-text-3); font-size: var(--t-small-size); line-height: var(--t-small-lh); white-space: nowrap; }
.about .split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--s4); }
.about .split h2 { font-weight: 600; font-size: var(--t-section-size); line-height: var(--t-section-lh); margin: 0 0 var(--s1); }
.about ul.plain, .about ol.plain { margin: var(--s1) 0 0; padding-left: 1.2em; }
.about ul.plain li, .about ol.plain li { margin: 0 0 var(--s1); line-height: var(--t-body-lh); }
.about p { line-height: var(--t-body-lh); max-width: 70ch; }
@media (max-width: 720px) { .about .m-n { font-size: var(--t-number-size); line-height: var(--t-number-lh); font-variant-numeric: tabular-nums; font-weight: 600; } .about .measured-list .m { grid-template-columns: 1fr; gap: var(--s-half); } }
/* === end milestone === */

/* === ask offers (2026-10-20) === */
/* Ask, N2: the offers table under a price answer, the vendor list, the document list and the fact answer.
   Same design language as the answer card: hairline rules, numbers right-aligned, sources underlined. */
.offers { margin-top: var(--s3); }
.offers-h { margin-top: 0; display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.offers-h .sub { font-weight: 400; color: var(--c-text-3); font-size: var(--t-small-size); line-height: var(--t-small-lh); }
.offers-wrap { overflow-x: auto; margin: 0 calc(-1 * var(--s2)); padding: 0 var(--s2); }
table.offers-t { width: 100%; border-collapse: collapse; font-size: var(--t-small-size); line-height: var(--t-small-lh); }
table.offers-t th, table.offers-t td { text-align: left; vertical-align: top; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--c-border); }
table.offers-t thead th { font-weight: 500; color: var(--c-text-3); font-size: var(--t-label-size); line-height: var(--t-label-lh); text-transform: uppercase; letter-spacing: var(--t-label-ls);
  border-bottom: 1.5px solid var(--c-border-strong); white-space: nowrap; }
table.offers-t th.num, table.offers-t td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.offers-t td.c-rate { font-weight: 600; color: var(--c-text); }
table.offers-t td .sub { display: block; color: var(--c-text-3); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); }
table.offers-t td .sub.why { font-style: italic; color: var(--c-text-2); }
table.offers-t td.c-item { min-width: 14rem; max-width: 26rem; }
table.offers-t td.c-doc { min-width: 10rem; }
table.offers-t td.c-scope, table.offers-t td.c-valid { color: var(--c-text-2); min-width: 8rem; }
table.offers-t a.quiet { color: inherit; text-decoration: none; }
table.offers-t a.quiet:hover { text-decoration: underline; text-underline-offset: 3px; }
table.offers-t td.c-doc > a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--c-border-strong); color: var(--c-text); }
table.offers-t tbody.og tr.og-h th { padding-top: var(--s2); font-weight: 600; font-size: var(--t-section-size); line-height: var(--t-section-lh); color: var(--c-text);
  border-bottom: 1px solid var(--c-border); }
table.offers-t tbody.og tr.og-h th .sub { font-family: var(--font); font-size: var(--t-caption-size); line-height: var(--t-caption-lh); color: var(--c-text-3); margin-left: var(--s1); }
table.offers-t tbody.og-similar td, table.offers-t tbody.og-unpriced td { color: var(--c-text-2); }
table.offers-t tbody.og-similar td.c-rate { color: var(--c-text-2); font-weight: 500; }
table.offers-t tbody.og-unpriced td.c-rate { font-weight: 400; }
/* the vendor card: opens under the vendor's name, no script */
details.vcard { position: relative; display: inline-block; }
details.vcard > summary { cursor: pointer; list-style: none; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--c-border-strong); white-space: nowrap; }
details.vcard > summary::-webkit-details-marker { display: none; }
details.vcard > summary:hover { text-decoration-color: currentColor; }
details.vcard[open] > summary { color: var(--c-accent-ink); }
details.vcard .vc { position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; width: 22rem; max-width: 80vw; padding: var(--s2);
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow);
  font-size: var(--t-small-size); line-height: var(--t-small-lh); white-space: normal; text-align: left; }
details.vcard .vc-name { margin: 0 0 var(--s1); font-size: var(--t-card-size); line-height: var(--t-card-lh); font-weight: 600; }
details.vcard .vc-facts { display: grid; grid-template-columns: 5.5rem 1fr; gap: 2px var(--s1); margin: 0; }
details.vcard .vc-facts dt { color: var(--c-text-3); }
details.vcard .vc-facts dd { margin: 0; overflow-wrap: anywhere; }
details.vcard .vc-h { margin: var(--s2) 0 4px; color: var(--c-text-3); font-size: var(--t-label-size); line-height: var(--t-label-lh); text-transform: uppercase; letter-spacing: var(--t-label-ls); font-weight: 500; }
details.vcard .vc-items, details.vcard .vc-docs { margin: 0; padding-left: 1rem; }
details.vcard .vc-docs .sub { color: var(--c-text-3); margin-left: var(--s-half); }
details.vcard .vc-all { margin: var(--s2) 0 0; }
.vendors-t td.c-items { color: var(--c-text-2); max-width: 32rem; }
.vendors-t td.c-items .sub { display: inline; }
/* vendor list and document list: the headline number is the count; the sentence follows on the same line */
.pa-head .price.big + a, .pa-head a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--c-border-strong); }
.doc-list { margin-top: var(--s2); }
.doc-list li a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--c-border-strong); color: var(--c-text); }
/* fact answer: the value in display type (a GSTIN, an address) breaks where it must, never overflows */
.fact-head .price.big .amt.fact-amt { font-size: var(--t-number-lg-size); line-height: var(--t-number-lg-lh); overflow-wrap: anywhere; letter-spacing: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.sentences.facts { margin-top: var(--s2); }
.example-row-2 { margin-top: calc(-1 * var(--s2)); }
@media (max-width: 720px) {
  details.vcard .vc { position: static; width: auto; max-width: none; margin-top: var(--s1); box-shadow: none; }
  table.offers-t td.c-item { min-width: 10rem; }
}
/* mixed-currency sums: one display-type line per currency */
.sums li { align-items: baseline; justify-content: flex-start; }
.sums .price.big .amt { font-size: var(--t-number-lg-size); line-height: var(--t-number-lg-lh); font-weight: 600; font-variant-numeric: tabular-nums; }
/* === end ask offers === */

/* ---------------------------------------------------------------- moved from template style= attributes */
.alert.doc-alert { margin: var(--s2) 0 0; }
.alert.choose-err { margin: 0; }
/* line-item tree indent by depth (document.html): 8 px + 20 px per level, capped at 6 levels */
table.tree tr td.ind-0 { padding-left: 8px; } table.tree tr td.ind-1 { padding-left: 28px; } table.tree tr td.ind-2 { padding-left: 48px; }
table.tree tr td.ind-3 { padding-left: 68px; } table.tree tr td.ind-4 { padding-left: 88px; } table.tree tr td.ind-5 { padding-left: 108px; }
table.tree tr td.ind-6 { padding-left: 128px; }
/* form table indent by depth (form.html) */
table.fft tr td.fft-ind-1 { padding-left: 1.55rem; } table.fft tr td.fft-ind-2 { padding-left: 2.65rem; }
table.fft tr td.fft-ind-3 { padding-left: 3.75rem; } table.fft tr td.fft-ind-4 { padding-left: 4.85rem; }
table.fft tr td.fft-ind-5 { padding-left: 5.95rem; } table.fft tr td.fft-ind-6 { padding-left: 7.05rem; }

/* ---------------------------------------------------------------- /styleguide (hidden page): one sample per role */
.styleguide .panel { margin-top: var(--s3); }
.styleguide .sg-h { margin: 0 0 var(--s2); }
.sg-roles { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.sg-role { display: grid; gap: var(--s-half); padding-bottom: var(--s2); border-bottom: 1px solid var(--c-border); }
.sg-role:last-child { border-bottom: 0; padding-bottom: 0; }
.sg-meta { display: flex; flex-wrap: wrap; gap: var(--s1); align-items: baseline; }
.sg-sample { margin: 0; }
.sg-section { font: var(--t-section); }
.sg-card { font: var(--t-card); }
.sg-body { font: var(--t-body); }
.sg-small { font: var(--t-small); }
.sg-label { font: var(--t-label); letter-spacing: var(--t-label-ls); }
.sg-caption { font: var(--t-caption); }
.sg-number { font: var(--t-number); font-variant-numeric: tabular-nums; }
.sg-number-lg { font: var(--t-number-lg); font-variant-numeric: tabular-nums; }
.sg-row { display: flex; flex-wrap: wrap; gap: var(--s1); align-items: center; margin: var(--s2) 0 0; }

/* === busy (2026-10-21) === */
/* waiting states: Ask's working panel, the upload's bytes sent, and busy.js on slow form posts. Only real
   things are shown (the step the server is on in order, elapsed seconds, bytes sent); motion is decoration */
@keyframes busy-spin { to { transform: rotate(360deg); } }
@keyframes busy-scan { from { transform: translateY(-100%); } to { transform: translateY(400%); } }
@keyframes busy-sheen { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes busy-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.busy-spin { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px;
  border: 2px solid var(--c-border-strong); border-top-color: var(--c-accent); animation: busy-spin 800ms linear infinite; }
button > .busy-spin { margin-right: var(--s-half); border-color: currentColor; border-top-color: transparent; opacity: .8; }
button[aria-busy="true"] { cursor: progress; }
/* busy.js: the strip under a form that was sent */
.busy-strip { display: flex; flex-basis: 100%; align-items: center; gap: var(--s1); margin-top: var(--s1); padding: var(--s1) var(--s2);
  position: relative; overflow: hidden; border: 1px solid var(--c-info-border); border-radius: var(--radius);
  background: var(--c-info-bg); color: var(--c-text-2); font: var(--t-small); }
.busy-strip .busy-scan { position: absolute; left: 0; bottom: 0; width: 40%; height: 2px; background: var(--c-accent); animation: busy-slide 1.4s ease-in-out infinite; }
.busy-strip .busy-t { flex: 1; }
.busy-secs, .aw-secs { color: var(--c-text-3); font: var(--t-caption); font-variant-numeric: tabular-nums; }
/* Ask: the working panel in place of the answer */
.ask-working .aw-card { position: relative; overflow: hidden; padding: var(--s1) var(--s2); border-radius: var(--radius); background: var(--c-surface-2); }
.ask-working .skel { background: linear-gradient(90deg, var(--c-surface-3) 0%, var(--c-surface-3) 40%, var(--c-surface) 50%, var(--c-surface-3) 60%, var(--c-surface-3) 100%);
  background-size: 200% 100%; animation: busy-sheen 1.6s ease-in-out infinite; }
.ask-working .aw-scan { position: absolute; left: 0; right: 0; top: 0; height: 25%; pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--c-accent-soft) 70%, transparent); opacity: .7; animation: busy-scan 2.4s ease-in-out infinite; }
.ask-working .aw-step { display: flex; align-items: center; gap: var(--s1); margin: var(--s2) 0 var(--s-half); font: var(--t-card); color: var(--c-text); }
.ask-working .aw-note { margin: 0; }
/* Upload: the bytes sent so far (XHR upload.onprogress), then "Sent" while the server saves and queues */
.up-progress { margin-top: var(--s2); }
.up-bar { height: 8px; border-radius: 4px; background: var(--c-surface-3); overflow: hidden; }
.up-fill { display: block; width: 0; height: 100%; background: var(--c-accent); transition: width var(--t-change); }
.up-progress.is-sent .up-fill { background: linear-gradient(90deg, var(--c-accent) 0%, var(--c-accent-soft) 50%, var(--c-accent) 100%); background-size: 200% 100%; animation: busy-sheen 1.4s linear infinite; }
.up-progress.is-error .up-fill { background: var(--c-bad-mark); }
.up-text { margin: var(--s-half) 0 0; color: var(--c-text-2); font: var(--t-small); font-variant-numeric: tabular-nums; }
.up-progress.is-error .up-text { color: var(--c-bad); }
@media (prefers-reduced-motion: reduce) {
  .busy-spin, .busy-strip .busy-scan, .ask-working .skel, .ask-working .aw-scan, .up-progress.is-sent .up-fill { animation: none; }
  .busy-strip .busy-scan, .ask-working .aw-scan { display: none; }
  .busy-spin { border-top-color: var(--c-accent); }
  .up-fill { transition: none; }
}
/* === end busy === */

/* === documents nav (2026-10-21) === */
/* the section bar over /documents: plain-language groups with their counts; the current one is filled and its
   one-line explanation sits under the bar. The Vendors view reuses table.list. */
.doc-sections { margin: 0 0 var(--s3); }
.doc-sections .ds-list { display: flex; flex-wrap: wrap; gap: var(--s1); list-style: none; margin: 0; padding: 0; }
.doc-sections .ds-list a { display: inline-flex; align-items: baseline; gap: var(--s-half); padding: var(--s-half) var(--s2);
  border: 1px solid var(--c-border); border-radius: 999px; background: var(--c-surface); color: var(--c-text-2);
  font: var(--t-small); text-decoration: none; white-space: nowrap; }
.doc-sections .ds-list a:hover { border-color: var(--c-border-strong); color: var(--c-text); }
.doc-sections .ds-list a.on { background: var(--c-accent-soft); border-color: transparent; color: var(--c-accent-ink); font-weight: 500; }
.doc-sections .ds-n { color: var(--c-text-3); font: var(--t-caption); font-variant-numeric: tabular-nums; }
.doc-sections .ds-list a.on .ds-n { color: inherit; }
.doc-sections .ds-why { margin: var(--s1) 0 0; color: var(--c-text-2); font: var(--t-small); }
table.vendor-list td.doc-name { min-width: 200px; }
table.vendor-list td.doc-name a { font-weight: 500; }
table.vendor-list td.vl-items { min-width: 240px; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .doc-sections .ds-list a { white-space: normal; }
}
/* === end documents nav === */
