/* BillComb - Warm Paper & Pine (design_handoff_billcomb/theme.css, extended)

   Type: Newsreader (headlines), Archivo (UI + wordmark),
   IBM Plex Mono (CPT codes, deadlines, dollar amounts).

   Contrast ratios in comments are text-on---surface pairs, AA-verified.
   Do not introduce new color-on-color combinations without checking.
   Findings are separated by lightness as well as hue, so a grayscale
   print stays legible. */

/* ---------------------------------------------------------------- fonts
   Self-hosted latin-subset woff2 (all OFL). Newsreader and Archivo are
   variable files covering the whole weight range we use; Plex Mono ships
   as two static instances. Emails use the system stack instead. */

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(/static/fonts/newsreader-500-600.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 500 600;
  font-display: swap;
  src: url(/static/fonts/newsreader-500-600-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/archivo-400-800.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/plex-mono-500.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/static/fonts/plex-mono-600.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------------------------------------------------------------- tokens */

:root {
  color-scheme: light;

  --font-display: 'Newsreader', Georgia, serif;
  --font-ui: 'Archivo', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --bg: #FAF6EF;
  --surface: #FFFFFF;
  --text: #201E1A;          /* 15.6:1 AAA */
  --text-muted: #5B564C;    /* 7.0:1 */
  --border: #E6DFD2;
  --brand: #1E5748;         /* 8.4:1 */
  --brand-strong: #123B31;
  --accent: #A85B22;        /* 5.0:1 */
  --finding-error: #9E2B25;    /* provable error · 7.4:1 · gray L~36 */
  --finding-question: #4A6C9B; /* worth asking · 5.4:1 · gray L~45 */
  --success: #1E6B45;       /* money recovered · 6.4:1 */
  --warning: #8A5A00;       /* deadlines · 5.9:1 */

  /* interaction + tints (pair each *-bg with its matching ink token) */
  --brand-tint: #E7F0EC;         /* selected / active bg */
  --focus-ring: #1E5748;         /* 3px halo at 25% alpha */
  --focus-halo: rgba(30, 87, 72, 0.25);
  --finding-error-bg: #F8E9E7;   /* w/ --finding-error 6.3:1 */
  --finding-question-bg: #EAF0F7;/* w/ --finding-question 4.9:1 */
  --success-bg: #E9F3EC;         /* w/ --success 5.8:1 */
  --warning-bg: #F9EED8;         /* w/ --warning 5.2:1 */
  --overlay: rgba(32, 30, 26, 0.55);
  --link: var(--brand);
  --link-hover: var(--brand-strong);
  --redact: #D8D3C7;        /* teaser redaction bars */
  --disabled-bg: #EDE8DD;
  --disabled-text: #8B8478; /* 3.2:1 - ok for disabled */

  /* spacing scale (px values are the scale names) */
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-44: 44px;
  --space-56: 56px;

  /* radius: chips · buttons/cards · panels · pills */
  --radius-chip: 6px;
  --radius-button: 10px;
  --radius-panel: 12px;
  --radius-pill: 99px;

  /* type - Newsreader headline scale */
  --text-hero: 41px;        /* line-height 1.12 */
  --leading-hero: 1.12;
  --text-total: 34px;       /* report $ total */
  --text-hero-mobile: 28px;
  --text-section: 21px;
  --text-card-title: 17px;

  /* type - Archivo UI scale */
  --text-body-lg: 16px;
  --text-body: 14px;
  --text-ui: 13.5px;
  --text-support: 12.5px;
  --text-tag: 11px;         /* weight 800, tracking +0.06em */
  --tag-tracking: 0.06em;

  /* type - Plex Mono: codes, amounts, meta. Never below 10px. */
  --text-mono: 12px;
  --text-mono-sm: 11px;

  --hit-target: 44px;       /* minimum tap size on mobile */
}

/* Dark palette. Applied two ways so an explicit choice wins in BOTH
   directions: (a) OS preference, unless the user explicitly chose light;
   (b) explicit data-theme="dark", regardless of OS. The two blocks must
   stay identical - keep them in sync. */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #1B1813;
    --surface: #262219;
    --text: #F4EFE4;          /* 13.8:1 */
    --text-muted: #B3AA99;    /* 6.9:1 */
    --border: #3D372B;
    --brand: #7CC4AA;         /* 7.8:1 */
    --brand-strong: #A5DCC6;
    --accent: #DFA06A;        /* 7.1:1 */
    --finding-error: #E8938B;    /* 6.8:1 */
    --finding-question: #9DB8DE; /* 7.8:1 */
    --success: #85D2A8;       /* 8.9:1 */
    --warning: #E0B370;       /* 8.2:1 */

    --brand-tint: #2A3B34;
    --focus-ring: #7CC4AA;
    --focus-halo: rgba(124, 196, 170, 0.25);
    --finding-error-bg: #3B2723;   /* w/ --finding-error 5.4:1 */
    --finding-question-bg: #283039;/* w/ --finding-question 5.9:1 */
    --success-bg: #24382C;         /* w/ --success 6.6:1 */
    --warning-bg: #3A301D;         /* w/ --warning 6.2:1 */
    --overlay: rgba(0, 0, 0, 0.6);
    --redact: #4A423A;
    --disabled-bg: #2E2A22;
    --disabled-text: #8B8478;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #1B1813;
  --surface: #262219;
  --text: #F4EFE4;          /* 13.8:1 */
  --text-muted: #B3AA99;    /* 6.9:1 */
  --border: #3D372B;
  --brand: #7CC4AA;         /* 7.8:1 */
  --brand-strong: #A5DCC6;
  --accent: #DFA06A;        /* 7.1:1 */
  --finding-error: #E8938B;    /* 6.8:1 */
  --finding-question: #9DB8DE; /* 7.8:1 */
  --success: #85D2A8;       /* 8.9:1 */
  --warning: #E0B370;       /* 8.2:1 */

  --brand-tint: #2A3B34;
  --focus-ring: #7CC4AA;
  --focus-halo: rgba(124, 196, 170, 0.25);
  --finding-error-bg: #3B2723;   /* w/ --finding-error 5.4:1 */
  --finding-question-bg: #283039;/* w/ --finding-question 5.9:1 */
  --success-bg: #24382C;         /* w/ --success 6.6:1 */
  --warning-bg: #3A301D;         /* w/ --warning 6.2:1 */
  --overlay: rgba(0, 0, 0, 0.6);
  --redact: #4A423A;
  --disabled-bg: #2E2A22;
  --disabled-text: #8B8478;
}

/* ---------------------------------------------------------------- base */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 var(--space-12);
}

h1 {
  font-size: var(--text-hero-mobile);
  line-height: var(--leading-hero);
}

h2 {
  font-size: var(--text-section);
}

h3 {
  font-size: var(--text-card-title);
}

@media (min-width: 720px) {
  h1 {
    font-size: var(--text-hero);
  }
}

a {
  color: var(--link);
}

a:hover {
  color: var(--link-hover);
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  font-weight: 500;
}

:focus-visible {
  outline: 3px solid var(--focus-halo);
  outline-offset: 1px;
}

.tag {
  font-size: var(--text-tag);
  font-weight: 800;
  letter-spacing: var(--tag-tracking);
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- shell */

.site-header {
  border-bottom: 1px solid var(--border);
  padding: var(--space-12) var(--space-24);
  background: var(--surface);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  text-decoration: none;
  color: var(--text);
  min-height: var(--hit-target);
}

.brand-mark {
  width: 24px;
  height: 24px;
  color: var(--brand);
  flex: none;
}

.wordmark {
  font-family: var(--font-ui);
  font-size: var(--text-body-lg);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: lowercase;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-16);
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit-target);
  font-size: var(--text-ui);
  font-weight: 600;
  text-decoration: none;
}

.site-main {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-24);
}

.site-footer {
  max-width: 960px;
  margin: var(--space-32) auto 0;
  padding: var(--space-24);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  flex-wrap: wrap;
}

.footer-links {
  list-style: none;
  display: flex;
  gap: var(--space-16);
  margin: 0;
  padding: 0;
  color: var(--text-muted);
  font-size: var(--text-support);
}

/* Footer theme toggle: two explicit choices, active one filled. The server
   renders the state from the "theme" cookie - no client script involved. */
.theme-toggle {
  display: inline-flex;
  gap: 0;
  max-width: none;
  flex-direction: row;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.theme-toggle button {
  background: transparent;
  color: var(--text-muted);
  border: 0;
  border-radius: 0;
  font-size: var(--text-support);
  font-weight: 600;
  padding: 0 var(--space-16);
  min-height: 36px;
  min-width: var(--hit-target);
}

.theme-toggle button[aria-pressed="true"] {
  background: var(--brand);
  color: var(--surface);
}

/* ---------------------------------------------------------------- forms */

form {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  max-width: 512px;
}

.inline-form {
  display: inline-flex;
  max-width: none;
}

label {
  font-size: var(--text-ui);
  font-weight: 700;
}

input,
select {
  font-family: var(--font-ui);
  font-size: var(--text-body);
  color: var(--text);
  background: var(--surface);
  padding: var(--space-8) var(--space-12);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  min-height: var(--hit-target);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-8);
  font-weight: 400;
  font-size: var(--text-body);
}

.checkbox-label input {
  width: auto;
  min-height: 0;
  margin-top: 0.2rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.field-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-support);
}

/* Waitlist honeypot: off-screen (not display:none, which some bots skip) so no
   human sees it but a form-filling bot still trips it. See
   web.routes.waitlist.HONEYPOT_FIELD. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Field errors name the consequence, never "invalid input". */
.field-error,
.form-error,
.form-errors {
  color: var(--finding-error);
  font-size: var(--text-support);
}

/* ---------------------------------------------------------------- buttons
   One primary per screen. A disabled button always carries its reason in
   the label - never a bare grey button. */

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: var(--text-ui);
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  padding: var(--space-8) var(--space-20);
  min-height: var(--hit-target);
  border-radius: var(--radius-button);
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}

button.primary,
.button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--surface);
}

button.primary:hover,
.button.primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: var(--surface);
}

button.secondary,
.button.secondary {
  background: transparent;
  border-color: var(--brand);
  color: var(--brand);
}

button.secondary:hover,
.button.secondary:hover {
  border-color: var(--brand-strong);
  color: var(--brand-strong);
}

button:disabled,
button.disabled,
.button.disabled {
  background: var(--disabled-bg);
  border-color: var(--disabled-bg);
  color: var(--disabled-text);
  cursor: not-allowed;
  pointer-events: none;
}

button.danger,
.button.danger {
  background: var(--finding-error);
  border-color: var(--finding-error);
  color: var(--surface);
}

.cta-row {
  display: flex;
  gap: var(--space-16);
  margin-top: var(--space-16);
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- trust + disclaimer */

.trust-strip {
  display: flex;
  gap: var(--space-16);
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius-chip);
  padding: var(--space-8) var(--space-12);
  background: var(--bg);
}

.trust-strip span {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  font-weight: 500;
  color: var(--text-muted);
}

/* Same text, same position (bottom, top border, mono) on every
   report/letter/teaser surface. Never conditional. */
.disclaimer {
  border-top: 1px solid var(--border);
  margin-top: var(--space-32);
  padding-top: var(--space-8);
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-muted);
}

.disclaimer p {
  margin: 0;
}

/* ---------------------------------------------------------------- deadline
   The date is the hero, days-left is the chip. Tone thresholds:
   success >30d · warning <=30d · error <=7d. */

.deadline-hero {
  border: 2px solid var(--brand);
  border-radius: var(--radius-panel);
  padding: var(--space-16);
  background: var(--bg);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
}

.deadline-date {
  font-family: var(--font-display);
  font-size: var(--text-total);
  font-weight: 600;
  line-height: 1.2;
}

.deadline-chip {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: var(--space-4) var(--space-12);
  font-size: var(--text-support);
  font-weight: 700;
}

.deadline-chip.tone-success {
  background: var(--success-bg);
  color: var(--success);
}

.deadline-chip.tone-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.deadline-chip.tone-error {
  background: var(--finding-error-bg);
  color: var(--finding-error);
}

/* ---------------------------------------------------------------- cards */

.sku-cards,
.case-cards {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-16);
}

.sku-card,
.case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  padding: var(--space-20);
  text-decoration: none;
  color: var(--text);
}

.sku-card {
  display: block;
}

.case-card {
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

/* -------------------------------------------------------------- account (A9)
   Case cards, reminder prefs, and the deletion card on one page. The deletion
   card is top-level and red-bordered, same prominence as the rest - not buried. */

.account {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.account-actions {
  margin: 0;
}

.account-empty {
  color: var(--text-muted);
}

.account-case-card {
  justify-content: space-between;
  flex-wrap: wrap;
}

.case-card-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: flex-start;
}

.case-type {
  font-family: var(--font-mono);
  font-size: var(--text-support);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.case-headline {
  font-family: var(--font-display);
  font-size: var(--text-card-title);
  font-weight: 600;
  color: var(--text);
}

.case-card-deadline {
  margin-top: var(--space-4);
}

.case-card-action {
  flex: none;
}

/* Prefs + deletion share the panel shell; the deletion card overrides its
   border to earned red. */
.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: var(--space-24);
}

.account-card h2 {
  margin-top: 0;
  margin-bottom: var(--space-8);
  font-size: var(--text-section);
}

.prefs-intro {
  color: var(--text-muted);
  margin-top: 0;
}

.prefs-fieldset {
  border: 0;
  margin: 0 0 var(--space-16);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-16);
}

.prefs-option {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  min-height: 44px;
  font-size: var(--text-body);
}

.prefs-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

/* The deletion card: red border, consequence copy, typed-DELETE confirm. */
.delete-card {
  border: 2px solid var(--finding-error);
}

.delete-heading {
  color: var(--finding-error);
}

.delete-copy {
  color: var(--text-muted);
  margin-top: 0;
}

.delete-error {
  color: var(--finding-error);
  font-weight: 600;
  background: var(--finding-error-bg);
  border-radius: var(--radius-chip);
  padding: var(--space-8) var(--space-12);
}

.delete-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-12);
  margin-top: var(--space-16);
}

.delete-confirm-label {
  flex-basis: 100%;
  font-size: var(--text-ui);
  color: var(--text-muted);
}

.delete-confirm-input {
  font-family: var(--font-mono);
  font-size: var(--text-body);
  letter-spacing: 0.08em;
  padding: var(--space-8) var(--space-12);
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  background: var(--bg);
  color: var(--text);
}

.delete-confirm-input:focus-visible {
  outline: 3px solid var(--focus-halo);
  border-color: var(--finding-error);
}

.account-deleted-lead {
  font-size: var(--text-card-title);
}

.finding-list,
.artifact-list,
.document-list {
  list-style: none;
  padding: 0;
}

/* Findings: tiers differ by lightness + structure, never hue alone.
   ERROR = surface card + 5px left bar; QUESTION = tint bg, no bar. */
.finding {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  padding: var(--space-12);
  margin-bottom: var(--space-8);
  display: flex;
  gap: var(--space-12);
  align-items: baseline;
}

.finding-error {
  border-left: 5px solid var(--finding-error);
}

.finding-error .finding-tier {
  color: var(--finding-error);
}

.finding-question {
  background: var(--finding-question-bg);
  border-color: var(--finding-question-bg);
}

.finding-question .finding-tier {
  color: var(--finding-question);
}

.finding-tier {
  font-size: var(--text-tag);
  font-weight: 800;
  letter-spacing: var(--tag-tracking);
  text-transform: uppercase;
}

.finding-impact {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  font-weight: 600;
  margin-left: auto;
}

/* Teaser: totals are true and visible; specifics are server-redacted. */
.teaser {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-panel);
  padding: var(--space-24);
  text-align: center;
}

.teaser-count {
  font-family: var(--font-display);
  font-size: var(--text-total);
  font-weight: 600;
  margin: 0 0 var(--space-8);
}

.redacted {
  background: var(--redact);
  color: transparent;
  border-radius: var(--radius-chip);
  user-select: none;
}

.policy-version,
.policy-placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* ---------------------------------------------------------------- report /
   teaser / decoder surfaces (A5 · A6 · A7). Shared meta line, then per-state
   pieces. Desktop puts findings left, the unlock/rail sticky right. */

.report-meta {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin: 0;
}

.teaser-page,
.decoder-page,
.report-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  max-width: 760px;
}

/* Teaser headline: count + approximate total are true and fully visible. */
.teaser-headline {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: var(--space-20);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.teaser-eyebrow {
  font-family: var(--font-display);
  font-size: var(--text-body-lg);
  color: var(--text-muted);
}

.teaser-headline .teaser-count {
  font-family: var(--font-ui);
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
}

.teaser-sub {
  font-size: var(--text-support);
  color: var(--text-muted);
}

/* Finding cards: ERROR = surface card + 5px left bar; QUESTION = tint, no bar.
   Tiers separate by lightness + structure, never hue alone. */
.finding-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  padding: var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.finding-card-error {
  border-left: 5px solid var(--finding-error);
}

.finding-card-error .finding-tier {
  color: var(--finding-error);
}

.finding-card-question {
  background: var(--finding-question-bg);
  border-color: var(--finding-question-bg);
}

.finding-card-question .finding-tier {
  color: var(--finding-question);
}

.finding-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-12);
}

.finding-card-body {
  margin: 0;
  font-size: var(--text-body);
  color: var(--text);
}

.finding-citation {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  color: var(--text-muted);
  background: var(--bg);
  border-radius: var(--radius-chip);
  padding: var(--space-8) var(--space-12);
}

/* The one shape a redacted specific ever takes: a solid bar over transparent
   text, fixed width, never a (reversible, print-ignoring) blur. */
.finding-redaction {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  padding: 2px var(--space-8);
}

/* Unlock panel (#unlock): honest tier pair, one primary CTA, the Paddle line. */
.unlock {
  background: var(--surface);
  border: 2px solid var(--brand);
  border-radius: var(--radius-panel);
  padding: var(--space-16);
}

.unlock-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  margin: 0;
}

.tier-pair {
  display: flex;
  gap: var(--space-12);
}

.tier-option {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-button);
  padding: var(--space-12);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: relative;
  cursor: pointer;
}

.tier-option input {
  position: absolute;
  top: var(--space-8);
  left: var(--space-8);
}

.tier-recommended {
  flex: 1.2;
  border: 2px solid var(--brand);
  background: var(--brand-tint);
}

.tier-badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: var(--surface);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  border-radius: var(--radius-chip);
  padding: 2px var(--space-8);
  white-space: nowrap;
}

.tier-price {
  font-size: var(--text-card-title);
  font-weight: 800;
  color: var(--text);
}

.tier-recommended .tier-price {
  color: var(--brand);
}

.tier-label {
  font-size: var(--text-support);
  color: var(--text-muted);
}

.tier-recommended .tier-label {
  color: var(--brand);
}

.unlock-reason {
  margin: 0;
  font-size: var(--text-support);
  color: var(--text-muted);
  line-height: 1.5;
}

.unlock-cta {
  width: 100%;
}

.unlock-paddle {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

.unlock-pending-note,
.unlock-done-note {
  margin: 0;
  font-weight: 700;
  text-align: center;
}

.unlock-done-sub {
  margin: var(--space-8) 0 0;
  font-size: var(--text-support);
  color: var(--text-muted);
  text-align: center;
}

/* Report total (A6) + rail + building note. */
.report-total {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.report-total-amount {
  font-family: var(--font-display);
  font-size: var(--text-total);
  font-weight: 600;
}

.report-total-sub {
  font-size: var(--text-ui);
  color: var(--text-muted);
}

.rail-heading {
  font-size: var(--text-card-title);
  margin: 0 0 var(--space-8);
}

.building-note {
  margin: 0;
  color: var(--text-muted);
  font-style: italic;
}

/* The report rail (A6): next-steps checklist, downloads, print. Sticky right on
   desktop (the grid rule below), stacked under the findings on mobile. */
.report-rail {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.rail-appeal-link {
  text-align: center;
}

/* The disclaimer stays first in the DOM (it must precede any finding content -
   compliance item 7, tested) but sits at the foot of the findings column, the
   fixed position it holds on every report surface. `order` moves only the
   painting, never the source. */
.report-page > .disclaimer {
  order: 90;
}

.next-steps {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  padding: var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.next-steps-heading {
  font-family: var(--font-ui);
  font-size: var(--text-tag);
  font-weight: 800;
  letter-spacing: var(--tag-tracking);
  color: var(--accent);
}

.next-steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* The step is the button - the whole row toggles. No frame of its own until
   focused, so the checklist reads as a list, not a stack of buttons. */
.next-step {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-8);
  background: none;
  border: none;
  padding: var(--space-4) 0;
  font-family: var(--font-ui);
  font-size: var(--text-ui);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  min-height: 32px;
}

.next-step-box {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-chip);
  border: 1.5px solid var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
}

.next-step-done .next-step-box {
  background: var(--brand);
  border-color: var(--brand);
  /* The tick sits on the brand fill, so it must be the on-brand ink (surface),
     not a hardcoded white: in dark mode --brand is a light mint and a white
     tick would all but vanish on it. Same pattern as .tier-badge. */
  color: var(--surface);
}

.next-step-done .next-step-label {
  color: var(--text-muted);
  text-decoration: line-through;
}

.rail-downloads {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.rail-print {
  background: none;
  border: none;
  padding: var(--space-8) 0 0;
  font-family: var(--font-ui);
  font-size: var(--text-support);
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: underline;
  text-align: center;
  cursor: pointer;
}

/* All-clear: a delivered scan with no findings. Celebrated honestly, refund
   promise restated. */
.all-clear {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--success);
  border-radius: var(--radius-panel);
  padding: var(--space-24);
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.all-clear-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.all-clear-title {
  font-family: var(--font-display);
  font-size: var(--text-total);
  font-weight: 600;
  margin: 0;
}

.all-clear-body,
.all-clear-refund {
  margin: 0;
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--text);
}

.all-clear-refund {
  color: var(--text-muted);
}

/* Decoder (A7): the deadline is the hero, and free. */
.deadline-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.deadline-eyebrow,
.decode-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  font-weight: 600;
  color: var(--text-muted);
  margin: 0;
}

.decode-eyebrow {
  font-family: var(--font-ui);
  font-weight: 800;
  letter-spacing: var(--tag-tracking);
  color: var(--accent);
}

.deadline-sub {
  margin: 0;
  font-size: var(--text-support);
  color: var(--text-muted);
  line-height: 1.5;
}

.deadline-unknown {
  gap: var(--space-8);
}

.deadline-unknown-note {
  font-family: var(--font-display);
  font-size: var(--text-section);
  font-weight: 600;
}

.decode-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.decode-body {
  margin: 0;
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--text);
}

/* Dedicated checkout page (the one Paddle-overlay surface). */
.checkout-page {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.checkout-heading {
  font-size: var(--text-section);
  margin: 0;
}

.checkout-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: var(--space-16);
}

.checkout-line {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.checkout-sku {
  font-weight: 700;
}

.checkout-tier {
  font-size: var(--text-support);
  color: var(--text-muted);
}

.checkout-price {
  font-family: var(--font-mono);
  font-size: var(--text-card-title);
  font-weight: 600;
}

.checkout-pay {
  width: 100%;
  text-align: center;
}

.checkout-note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  color: var(--text-muted);
  text-align: center;
}

/* ---------------------------------------------------------------- appeal (A8)
   The roadmap timeline is the page spine; the document cards hang off it. On
   mobile the timeline is a vertical rail of dots; desktop lays it horizontal
   above a 2-col document grid (the media queries below). */
.appeal-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  max-width: 980px;
}

.appeal-intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.appeal-title {
  font-family: var(--font-display);
  font-size: var(--text-section);
  font-weight: 600;
  margin: 0;
}

.appeal-lede {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 60ch;
}

/* The timeline: a vertical spine of dots joined by a line, each step a label,
   an optional corroborated date, and a note. */
.roadmap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: var(--space-24) var(--space-20);
}

.roadmap-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.roadmap-step {
  position: relative;
  display: flex;
  gap: var(--space-12);
  padding-bottom: var(--space-20);
}

/* The connecting spine: a line down the left, behind the dots. The last step
   drops it so the line ends at the final dot. */
.roadmap-step::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.roadmap-step:last-child {
  padding-bottom: 0;
}

.roadmap-step:last-child::before {
  display: none;
}

.roadmap-dot {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 2px solid var(--border);
  margin-top: 3px;
  z-index: 1;
}

.roadmap-step-done .roadmap-dot {
  background: var(--success);
  border-color: var(--success);
}

.roadmap-step-current .roadmap-dot {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-tint);
}

.roadmap-step-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.roadmap-label {
  font-size: var(--text-ui);
  color: var(--text-muted);
}

.roadmap-step-current .roadmap-label {
  color: var(--text);
  font-weight: 700;
}

.roadmap-date {
  font-family: var(--font-display);
  font-size: var(--text-card-title);
  font-weight: 600;
  color: var(--text);
}

.roadmap-sent {
  font-size: var(--text-support);
  font-weight: 700;
  color: var(--success);
}

.roadmap-note {
  font-size: var(--text-support);
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 60ch;
}

/* The documents hanging off the timeline. */
.appeal-docs {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.appeal-doc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  padding: var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.appeal-doc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-12);
}

.appeal-doc-title {
  font-family: var(--font-display);
  font-size: var(--text-card-title);
  font-weight: 600;
  color: var(--text);
}

.appeal-doc-sent {
  flex: none;
  font-size: var(--text-support);
  font-weight: 700;
  color: var(--success);
}

.appeal-doc-blurb {
  margin: 0;
  font-size: var(--text-body);
  color: var(--text-muted);
  line-height: 1.55;
}

.appeal-doc-actions {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
}

/* Desktop: findings column left, unlock/rail sticky right. */
@media (min-width: 900px) {
  .teaser-page,
  .decoder-page,
  .report-page {
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-auto-rows: min-content;
    gap: var(--space-16) var(--space-24);
    max-width: 980px;
    align-items: start;
  }

  .report-meta,
  .teaser-headline,
  .teaser-page > .disclaimer,
  .decoder-page > .disclaimer,
  .report-page > .disclaimer,
  .report-total,
  .all-clear,
  .deadline-block,
  .decode-card,
  .teaser-page > .expedited-notice,
  .decoder-page > .expedited-notice,
  #findings {
    grid-column: 1;
  }

  .unlock,
  .report-rail {
    grid-column: 2;
    position: sticky;
    top: var(--space-16);
  }

  /* The roadmap becomes a horizontal band; the documents a 2-col grid beneath. */
  .roadmap-timeline {
    flex-direction: row;
    justify-content: space-between;
  }

  .roadmap-step {
    flex-direction: column;
    flex: 1;
    padding-bottom: 0;
    padding-right: var(--space-16);
  }

  .roadmap-step::before {
    left: 14px;
    right: 0;
    top: 6px;
    bottom: auto;
    width: auto;
    height: 2px;
  }

  .roadmap-step:last-child::before {
    display: none;
  }

  .roadmap-step-body {
    margin-top: var(--space-8);
  }

  .appeal-docs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
  }
}

/* ---------------------------------------------------------------- auth (A1)
   One 420px card, centered at every breakpoint. The card cycles states by
   being swapped whole (#auth-card); "sending" is htmx's .htmx-request class
   on the posting form, styled here - the server never renders it. */

.auth-shell {
  display: flex;
  justify-content: center;
  padding: var(--space-32) 0;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: var(--space-24);
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.auth-card form {
  max-width: none;
}

h1.auth-card-title {
  font-size: var(--text-section);
  margin: 0;
}

.auth-card-lede {
  margin: 0;
}

.auth-card-note,
.auth-card-alt {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-support);
}

.auth-card-support {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-mono-sm);
}

/* Button label flips to "Sending…" while the htmx request is in flight. */
.cta-busy {
  display: none;
}

form.htmx-request .cta-label {
  display: none;
}

form.htmx-request .cta-busy {
  display: inline;
}

/* Resend countdown - CSS only. Both children share one grid cell so the
   swap from countdown text to live button causes no layout jump. The number
   is an animated @property integer surfaced through a counter; without
   @property support the text degrades gracefully and the button still
   appears at 60s (visibility needs no interpolation). */

@property --resend-seconds {
  syntax: "<integer>";
  initial-value: 60;
  inherits: true;
}

.resend-gate {
  display: grid;
}

.resend-gate > * {
  grid-area: 1 / 1;
}

.resend-wait {
  margin: 0;
  align-self: center;
  color: var(--text-muted);
  font-size: var(--text-support);
  animation:
    resend-count 60s linear forwards,
    resend-conceal 0s 60s forwards;
}

.resend-count {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  font-weight: 600;
}

.resend-count::after {
  counter-reset: resend-t var(--resend-seconds);
  content: counter(resend-t, decimal-leading-zero);
}

@keyframes resend-count {
  from {
    --resend-seconds: 60;
  }

  to {
    --resend-seconds: 0;
  }
}

@keyframes resend-conceal {
  to {
    visibility: hidden;
  }
}

.resend-form {
  visibility: hidden;
  opacity: 0;
  animation: resend-reveal 0.2s 60s forwards;
}

@keyframes resend-reveal {
  to {
    visibility: visible;
    opacity: 1;
  }
}

/* ---------------------------------------------------------------- funnel progress
   4 fixed stages (email · questions · documents · results) - the segments
   and label come from partials/_progress_steps.html, never per-SKU. */

.progress-steps {
  display: flex;
  gap: 5px;
}

.progress-segment {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
}

.progress-segment.done {
  background: var(--brand);
}

.progress-label {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  font-weight: 500;
  color: var(--text-muted);
  margin: var(--space-8) 0 var(--space-16);
}

/* ---------------------------------------------------------------- intake (A2) */

.intake-layout {
  display: grid;
  gap: var(--space-32);
  align-items: start;
}

.intake-main {
  max-width: 480px;
}

.intake-main h1 {
  font-size: var(--text-section);
}

.intake-form {
  gap: var(--space-16);
}

/* Desktop-only sticky rail: plain-English justifications per question. */
.intake-rail {
  display: none;
}

@media (min-width: 940px) {
  .intake-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .intake-rail {
    display: block;
    position: sticky;
    top: var(--space-24);
    border-left: 1px solid var(--border);
    padding-left: var(--space-16);
  }
}

.rail-title {
  font-size: var(--text-card-title);
}

.rail-list {
  margin: 0;
  font-size: var(--text-support);
  color: var(--text-muted);
}

.rail-list dt {
  font-weight: 700;
  color: var(--text);
  margin-top: var(--space-12);
}

.rail-list dd {
  margin: var(--space-4) 0 0;
  line-height: 1.6;
}

/* Consent card - the designed moment before any question. */

.consent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.consent-title {
  font-size: var(--text-card-title);
  margin: 0;
}

.consent-body {
  margin: 0;
  font-size: var(--text-ui);
  color: var(--text-muted);
  line-height: 1.6;
}

.consent-agree {
  align-items: center;
  font-size: var(--text-ui);
  font-weight: 600;
}

.consent-agree input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--brand);
}

/* CTA gated on consent - a client nicety layered over the server's 422:
   without :has() support the button is simply live and the server answers. */

.intake-form .cta-reason {
  display: none;
}

.intake-form:has(input[name="consent"]:not(:checked)) .consent-gated {
  background: var(--disabled-bg);
  border-color: var(--disabled-bg);
  color: var(--disabled-text);
  pointer-events: none;
}

.intake-form:has(input[name="consent"]:not(:checked)) .consent-gated .cta-ready {
  display: none;
}

.intake-form:has(input[name="consent"]:not(:checked)) .consent-gated .cta-reason {
  display: inline;
}

/* Radio cards: 2-4 options, >=44px targets; selected = brand-tint fill +
   brand border. Above 4 options use a native <select> instead. */

.radio-cards {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.radio-cards legend {
  padding: 0;
  font-size: var(--text-body);
  font-weight: 700;
  margin-bottom: var(--space-8);
}

.radio-cards-row {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.radio-card {
  position: relative;
  flex: 1 1 120px;
  min-height: var(--hit-target);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8) var(--space-12);
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 9px;
  font-size: var(--text-ui);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  margin: 0;
  min-height: 0;
}

.radio-card:has(input:checked) {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 0.5px var(--brand);
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 700;
}

.radio-card:has(input:focus-visible) {
  outline: 3px solid var(--focus-halo);
  outline-offset: 1px;
}

/* Expedited notice (#expedited-notice): warning amber, never error red -
   urgency is not an error. Rendered before payment, always. */

.expedited-notice {
  background: var(--warning-bg);
  border: 1.5px solid var(--warning);
  border-radius: var(--radius-panel);
  padding: var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.expedited-tag {
  color: var(--warning);
  font-family: var(--font-mono);
  font-weight: 600;
}

.expedited-body {
  margin: 0;
  font-size: var(--text-ui);
  line-height: 1.55;
}

.expedited-link {
  color: var(--warning);
  font-weight: 700;
  font-size: var(--text-ui);
}

/* Free expedited-appeal phone script page. */

.script-page {
  max-width: 640px;
}

.script-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-panel);
  padding: var(--space-16) var(--space-20);
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  margin: var(--space-16) 0 var(--space-24);
}

.script-line {
  margin: 0;
  line-height: 1.6;
}

.script-blank {
  background: var(--brand-tint);
  border-radius: var(--radius-chip);
  padding: 0 var(--space-4);
  font-style: italic;
  color: var(--text-muted);
}

/* Upload (A3): camera-first at 375px; desktop adds the drag-drop zone and
   the QR handoff rail. */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.upload-layout {
  display: grid;
  gap: var(--space-32);
  align-items: start;
}

.upload-main {
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.upload-main h1 {
  font-size: var(--text-section);
  margin: 0;
}

.upload-reentry-note {
  margin: 0;
  font-size: var(--text-ui);
  color: var(--text-muted);
  line-height: 1.6;
}

.doc-checklist {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.doc-chip {
  border: 1.5px dashed var(--disabled-text);
  color: var(--text-muted);
  font-size: var(--text-support);
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 6px var(--space-12);
}

.doc-chip.done {
  border: 1.5px solid transparent;
  background: var(--success-bg);
  color: var(--success);
  font-weight: 700;
}

.upload-widget {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

/* The one oversized button in the product: the camera is the primary path. */
.upload-camera {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-20) var(--space-16);
  font-size: var(--text-body-lg);
  border-radius: var(--radius-panel);
}

.upload-camera-sub {
  font-size: var(--text-support);
  font-weight: 500;
  color: var(--brand-tint);
}

.upload-picker {
  text-align: center;
}

.file-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: var(--space-12) var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.file-list.is-empty {
  display: none;
}

.file-row {
  display: flex;
  align-items: center;
  gap: var(--space-12);
}

.file-thumb {
  width: 34px;
  height: 42px;
  background: var(--border);
  border-radius: 5px;
  flex: none;
}

.file-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.file-name {
  font-size: var(--text-support);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-progress {
  display: block;
  position: relative;
  height: 5px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}

.file-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--brand);
  border-radius: 3px;
}

.file-percent {
  flex: none;
  font-size: var(--text-mono-sm);
  color: var(--text-muted);
}

.file-note {
  font-size: var(--text-support);
  color: var(--text-muted);
}

.file-note-ok {
  color: var(--success);
  font-weight: 600;
}

.file-error {
  font-size: var(--text-support);
  color: var(--finding-error);
  line-height: 1.5;
}

.file-retry {
  flex: none;
  border: 0;
  background: none;
  padding: var(--space-8);
  font: inherit;
  font-size: var(--text-support);
  font-weight: 700;
  color: var(--brand);
  text-decoration: underline;
  cursor: pointer;
}

/* Desktop only: pointers exist, dragging is real. */
.upload-dropzone {
  display: none;
  border: 2px dashed var(--border);
  border-radius: var(--radius-panel);
  padding: var(--space-24);
  text-align: center;
  color: var(--text-muted);
}

.upload-dropzone.is-active {
  border-color: var(--brand);
  background: var(--brand-tint);
}

.doc-help {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  padding: var(--space-12) var(--space-16);
}

.doc-help summary {
  cursor: pointer;
  font-size: var(--text-ui);
  font-weight: 600;
  color: var(--brand);
}

.doc-help-list {
  margin: var(--space-8) 0 0;
  font-size: var(--text-support);
  color: var(--text-muted);
}

.doc-help-list dt {
  font-weight: 700;
  color: var(--text);
  margin-top: var(--space-12);
}

.doc-help-list dd {
  margin: var(--space-4) 0 0;
  line-height: 1.6;
}

.upload-submit {
  margin: 0;
}

.upload-cta {
  width: 100%;
}

/* Desktop -> mobile handoff. Hidden below 940px like every rail. */
.upload-rail {
  display: none;
}

.qr-handoff p {
  margin: 0 0 var(--space-12);
  font-size: var(--text-support);
  color: var(--text-muted);
  line-height: 1.6;
}

.qr-code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  padding: var(--space-12);
  display: inline-block;
  color: var(--text);
}

/* segno writes a fixed stroke color; CSS wins over presentation attributes,
   so the code inherits the theme's ink and stays scannable in dark mode
   against the light .qr-code tile. */
.qr-code svg path {
  stroke: currentColor;
}

.qr-note {
  color: var(--disabled-text);
  font-size: 10px;
}

@media (min-width: 940px) {
  .upload-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .upload-dropzone {
    display: block;
  }

  .upload-rail {
    display: block;
    position: sticky;
    top: var(--space-24);
    border-left: 1px solid var(--border);
    padding-left: var(--space-16);
  }
}

/* Processing (A4): one centered column on every width - waiting screens
   don't earn layout. */

.processing-page {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.processing-page h1 {
  font-size: var(--text-section);
  margin: 0;
}

.status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: var(--space-20);
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.status-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  font-size: var(--text-ui);
  color: var(--text-muted);
}

.status-steps li::before {
  content: "\25CB\00A0\00A0"; /* open circle: not started */
  font-family: var(--font-mono);
  color: var(--disabled-text);
}

.status-steps li.done {
  color: var(--text);
}

.status-steps li.done::before {
  content: "\2713\00A0\00A0";
  color: var(--success);
}

.status-steps li.active {
  color: var(--text);
  font-weight: 600;
}

.status-steps li.active::before {
  content: "\25CF\00A0\00A0"; /* filled circle: happening now */
  color: var(--brand);
}

.status-eta {
  margin: 0;
  color: var(--text-muted);
}

.status-email {
  font-size: var(--text-support);
  color: var(--text-muted);
  align-items: center;
}

.status-email input {
  accent-color: var(--brand);
}

/* The summary-bill pivot: accent sienna, never error red - a summary bill is
   normal, not the user's mistake. */

.pivot-card {
  background: var(--surface);
  border: 2px dashed var(--accent);
  border-radius: var(--radius-panel);
  padding: var(--space-20);
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.pivot-card p {
  margin: 0;
  font-size: var(--text-ui);
  color: var(--text-muted);
  line-height: 1.6;
}

.pivot-tag {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
}

.pivot-title {
  margin: 0;
}

.pivot-cta {
  text-align: center;
}

.pivot-note {
  color: var(--disabled-text);
}

/* The illegible/retake state: your photo vs a readable example. */

.retake-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: var(--space-20);
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.retake-title {
  margin: 0;
}

.retake-reason {
  margin: 0;
  font-size: var(--text-ui);
  color: var(--finding-error);
  line-height: 1.5;
}

.retake-compare {
  display: flex;
  gap: var(--space-12);
  margin-top: var(--space-12);
}

.retake-figure {
  flex: 1;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.retake-figure figcaption {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.retake-preview {
  width: 100%;
  max-width: 100%;
  height: 140px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius-chip);
}

.retake-preview-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--disabled-bg);
  color: var(--disabled-text);
  font-size: var(--text-section);
}

/* Schematic of a readable page: crisp lines, nothing more. */
.retake-example {
  height: 140px;
  border: 1px solid var(--border);
  border-radius: var(--radius-chip);
  padding: var(--space-12);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.retake-example span {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--text-muted);
  width: 55%;
}

.retake-example span.wide {
  width: 85%;
  background: var(--border);
}

.retake-tips {
  margin: 0;
  padding-left: var(--space-20);
  font-size: var(--text-ui);
  color: var(--text-muted);
  line-height: 1.7;
}

.retake-cta {
  text-align: center;
}

/* ---------------------------------------------------------------- print
   Grayscale-safe by design: findings separate by lightness (error L~36 vs
   question L~45) and always keep the word tags next to the color. */

@media print {
  :root,
  :root[data-theme="dark"] {
    /* Paper is light; force the light palette even if the screen theme
       was dark. */
    color-scheme: light;
    --bg: #FFFFFF;
    --surface: #FFFFFF;
    --text: #201E1A;
    --text-muted: #5B564C;
    --border: #E6DFD2;
    --brand: #1E5748;
    --brand-strong: #123B31;
    --accent: #A85B22;
    --finding-error: #9E2B25;
    --finding-question: #4A6C9B;
    --success: #1E6B45;
    --warning: #8A5A00;
    --brand-tint: #E7F0EC;
    --finding-error-bg: #F8E9E7;
    --finding-question-bg: #EAF0F7;
    --success-bg: #E9F3EC;
    --warning-bg: #F9EED8;
    --redact: #D8D3C7;
    --disabled-bg: #EDE8DD;
    --disabled-text: #8B8478;
  }

  /* Chrome collapses: navigation, rails, and anything interactive. */
  .site-header,
  .site-footer,
  .theme-toggle,
  .rail,
  .report-rail,
  .cta-row,
  button,
  .button {
    display: none !important;
  }

  .site-main {
    max-width: none;
    padding: 0;
  }

  /* Findings paginate whole - a card never breaks across pages. */
  .finding,
  .finding-list li,
  .finding-card,
  .deadline-hero,
  .roadmap-step,
  .appeal-doc,
  .sku-card,
  .case-card {
    break-inside: avoid;
  }

  /* The disclaimer repeats on every printed page: position: fixed is
     stamped per page in print. Body padding reserves room for it. */
  body {
    padding-bottom: 64px;
  }

  .disclaimer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #FFFFFF;
  }
}
