/* ═══════════════════════════════════════════════════════════════════════
   Design system — Marketing Audit Platform
   ═══════════════════════════════════════════════════════════════════════

   Rewritten after a readability review. What changed and why:

   TYPE. Section headings were 11px uppercase mono tracked out at 0.14em.
   That is a label treatment, not a heading, and a page of them is genuinely
   hard to read — tracked-out uppercase defeats word-shape recognition, and
   11px is below the comfortable floor. Headings are now real headings:
   19px/600, sentence case. Body moves 15px → 16px (the current standard for
   UI body text) at 1.6 line-height. Inter replaces IBM Plex Sans + Newsreader:
   a tall x-height keeps 13px labels legible without inflating the base size,
   and one family with six weights carries the whole hierarchy. The serif is
   gone — a display face on a figure reads as decoration in a data tool.

   COLOUR. Every data colour here was validated with the dataviz palette
   checker against this file's own surfaces, not chosen by eye:

     severity ordinal ramp (light) #7f1414 #bd2d2d #dc5f35 #e38d6a
       monotone lightness, ΔL ≥ 0.06 per step, light end 2.53:1 on white,
       hue spread 17°
     severity ordinal ramp (dark)  #ffb4b4 #f58585 #dd5f52 #ab4a3f
       monotone, dark end 3.17:1 on #17191c, hue spread 10°
     sequential blue (meters)      #86b6ef #3987e5 #256abf #184f95 / dark steps
       passes ordinal checks in both modes

   Severity is an *ordered* scale, so it gets a single-hue ordinal ramp rather
   than four categorical hues. The categorical status palette's serious↔warning
   pair measures ΔE 13.6 for normal vision — below the 15 floor — and those two
   would sit adjacent in a severity bar. The ordinal ramp avoids that entirely.

   Status colour never carries meaning alone: every badge pairs it with a glyph
   and a word, which is also what keeps it readable in greyscale print.

   DENSITY. Hierarchy before density: two or three things per screen get size
   and weight, the rest recedes. Everything else is behind progressive
   disclosure.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── tokens ─────────────────────────────────────────────────────────── */

:root {
  color-scheme: light;

  /* surfaces */
  --plane:        #f6f7f9;   /* page background */
  --surface:      #ffffff;   /* cards, the chart surface the palette validated against */
  --surface-2:    #f1f3f6;   /* insets, table header, track backgrounds */
  --surface-hover:#eef1f5;

  /* ink — contrast-first */
  --ink:          #0f1115;   /* 17.4:1 on surface */
  --ink-2:        #4a4f58;   /*  8.3:1 — body prose, secondary */
  --ink-3:        #717784;   /*  4.6:1 — labels, axis, metadata */
  --ink-4:        #9aa0ab;   /*  2.9:1 — decorative only, never text that matters */

  /* lines */
  --rule:         #e4e7ec;
  --rule-firm:    #d0d5dd;
  --ring:         rgba(15, 17, 21, 0.08);

  /* brand */
  --accent:       #2a78d6;
  --accent-ink:   #1c5cab;   /* accent used as text on light */
  --accent-wash:  #eaf2fd;
  --accent-edge:  #c9ddf8;

  /* severity — validated ordinal ramp, critical → low */
  --sev-critical: #7f1414;
  --sev-high:     #bd2d2d;
  --sev-medium:   #dc5f35;
  --sev-low:      #e38d6a;
  --sev-info:     #9aa0ab;   /* neutral: informational implies no action */

  /* severity washes for badge backgrounds */
  --sev-critical-wash: #fdeaea;
  --sev-high-wash:     #fdeeee;
  --sev-medium-wash:   #fdf0ea;
  --sev-low-wash:      #fdf3ee;
  --sev-info-wash:     #f1f3f6;

  /* status — always shipped with glyph + label */
  --ok:           #0ca30c;
  --ok-ink:       #046104;
  --ok-wash:      #e8f8e8;
  --warn:         #b26a00;   /* darkened from #fab219 for text legibility */
  --warn-wash:    #fdf3e2;
  --danger:       #c0392b;
  --danger-wash:  #fdecea;

  /* sequential blue — meters and magnitude */
  --seq-1:        #86b6ef;
  --seq-2:        #3987e5;
  --seq-3:        #256abf;
  --seq-4:        #184f95;
  --seq-track:    #e3edfb;   /* unfilled meter track: lighter step, same hue */

  /* type */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas,
          monospace;

  /* elevation — restrained; a border does most of the work */
  --lift-1: 0 1px 2px rgba(15, 17, 21, 0.04);
  --lift-2: 0 2px 4px rgba(15, 17, 21, 0.06), 0 1px 2px rgba(15, 17, 21, 0.04);
  --lift-3: 0 8px 24px rgba(15, 17, 21, 0.10), 0 2px 6px rgba(15, 17, 21, 0.06);

  --radius:    10px;
  --radius-sm:  6px;
  --radius-lg: 14px;

  --sidebar-w: 252px;
}

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

    --plane:        #0c0e11;
    --surface:      #17191c;   /* the dark surface the palette validated against */
    --surface-2:    #1f2227;
    --surface-hover:#232730;

    --ink:          #f4f6f8;
    --ink-2:        #b6bcc6;
    --ink-3:        #868d99;
    --ink-4:        #656c78;

    --rule:         #262a30;
    --rule-firm:    #353a42;
    --ring:         rgba(255, 255, 255, 0.10);

    --accent:       #3987e5;
    --accent-ink:   #86b6ef;
    --accent-wash:  #14233a;
    --accent-edge:  #1f3a5e;

    /* dark severity ramp — re-stepped for this surface, not flipped */
    --sev-critical: #ffb4b4;
    --sev-high:     #f58585;
    --sev-medium:   #dd5f52;
    --sev-low:      #ab4a3f;
    --sev-info:     #868d99;

    --sev-critical-wash: #2e1a1c;
    --sev-high-wash:     #2b1a1b;
    --sev-medium-wash:   #28191a;
    --sev-low-wash:      #231819;
    --sev-info-wash:     #1f2227;

    --ok:           #3fbf3f;
    --ok-ink:       #6fd46f;
    --ok-wash:      #112a11;
    --warn:         #e8a93c;
    --warn-wash:    #2a2112;
    --danger:       #ef6b66;
    --danger-wash:  #2b1816;

    --seq-1:        #cde2fb;
    --seq-2:        #9ec5f4;
    --seq-3:        #5598e7;
    --seq-4:        #2a78d6;
    --seq-track:    #1c2838;

    --lift-1: 0 1px 2px rgba(0, 0, 0, 0.3);
    --lift-2: 0 2px 6px rgba(0, 0, 0, 0.35);
    --lift-3: 0 10px 28px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --plane: #0c0e11; --surface: #17191c; --surface-2: #1f2227;
  --surface-hover: #232730;
  --ink: #f4f6f8; --ink-2: #b6bcc6; --ink-3: #868d99; --ink-4: #656c78;
  --rule: #262a30; --rule-firm: #353a42; --ring: rgba(255,255,255,.10);
  --accent: #3987e5; --accent-ink: #86b6ef; --accent-wash: #14233a;
  --accent-edge: #1f3a5e;
  --sev-critical: #ffb4b4; --sev-high: #f58585; --sev-medium: #dd5f52;
  --sev-low: #ab4a3f; --sev-info: #868d99;
  --sev-critical-wash: #2e1a1c; --sev-high-wash: #2b1a1b;
  --sev-medium-wash: #28191a; --sev-low-wash: #231819; --sev-info-wash: #1f2227;
  --ok: #3fbf3f; --ok-ink: #6fd46f; --ok-wash: #112a11;
  --warn: #e8a93c; --warn-wash: #2a2112;
  --danger: #ef6b66; --danger-wash: #2b1816;
  --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #5598e7; --seq-4: #2a78d6;
  --seq-track: #1c2838;
  --lift-1: 0 1px 2px rgba(0,0,0,.3);
  --lift-2: 0 2px 6px rgba(0,0,0,.35);
  --lift-3: 0 10px 28px rgba(0,0,0,.5);
}

/* ── reset and base ─────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;                 /* was 15px */
  line-height: 1.6;
  font-feature-settings: "cv05" 1, "cv08" 1, "ss01" 1;  /* Inter: open a, l, g */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── type scale ─────────────────────────────────────────────────────── */

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.014em;
  text-wrap: balance;
}

h1 { font-size: 1.875rem; line-height: 1.2; letter-spacing: -0.022em; }  /* 30px */
h2 { font-size: 1.1875rem; line-height: 1.32; }                          /* 19px */
h3 { font-size: 1rem; line-height: 1.4; }                                /* 16px */
h4 { font-size: 0.9375rem; line-height: 1.45; }                          /* 15px */

p { margin: 0; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* The one number a view leads with. Proportional figures on purpose:
   tabular-nums makes a large value look loose. */
.hero-figure {
  font-size: clamp(2.75rem, 6vw, 3.5rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: proportional-nums;
}

/* Eyebrow: small, but sentence case and only lightly tracked. */
.eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-3);
}

.lede {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 68ch;
}

.meta { font-size: 0.875rem; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.strong { font-weight: 600; color: var(--ink); }
.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 0.875em; }
.nowrap { white-space: nowrap; }

/* ── app shell ──────────────────────────────────────────────────────── */

.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 12px 20px;
  background: var(--surface);
  border-right: 1px solid var(--rule);
}

.wordmark {
  display: flex; align-items: center; gap: 9px;
  padding: 0 10px 18px;
  font-size: 1rem; font-weight: 650; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none;
}
.wordmark:hover { text-decoration: none; }
.wordmark .mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: linear-gradient(145deg, var(--seq-2), var(--seq-4));
  display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 700;
}

.sidebar-group {
  margin: 16px 10px 4px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink-4);
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 1px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem; font-weight: 450;
  color: var(--ink-2); text-decoration: none;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: var(--surface-hover); color: var(--ink); text-decoration: none; }
.nav-item[aria-current="page"] {
  background: var(--accent-wash); color: var(--accent-ink); font-weight: 550;
}
.nav-item .glyph { width: 18px; flex: none; text-align: center; opacity: .85; font-size: 15px; }
.nav-item .count {
  margin-left: auto; font-size: 0.75rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--surface-2); color: var(--ink-3);
  border-radius: 20px; padding: 1px 7px;
}
.nav-item[aria-current="page"] .count { background: var(--surface); color: var(--accent-ink); }
.nav-item .soon {
  margin-left: auto; font-size: 0.6875rem; font-weight: 600;
  color: var(--ink-4); border: 1px solid var(--rule-firm);
  border-radius: 20px; padding: 0 6px;
}

.workspace-chip {
  margin-top: auto; padding: 12px 10px 0;
  border-top: 1px solid var(--rule);
  display: flex; align-items: center; gap: 10px;
}
.workspace-chip .avatar {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: var(--surface-2); color: var(--ink-2);
  display: grid; place-items: center; font-size: 13px; font-weight: 650;
}
.workspace-chip .who { min-width: 0; }
.workspace-chip .name {
  font-size: 0.875rem; font-weight: 550; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.workspace-chip .plan { font-size: 0.75rem; color: var(--ink-3); }

.app-main { display: flex; flex-direction: column; min-width: 0; }

.app-topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 28px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.app-topbar .context { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-topbar .context strong { font-size: 0.9375rem; font-weight: 600; }
.app-topbar .context .domain {
  font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-topbar nav { display: flex; align-items: center; gap: 6px; }

.app-body {
  width: 100%; max-width: 1240px;
  padding: 26px 28px 72px;
  display: flex; flex-direction: column; gap: 22px;
}

.drawer-toggle { display: none; }

/* ── breadcrumbs, page head ─────────────────────────────────────────── */

.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 0; padding: 0; list-style: none;
  font-size: 0.8125rem; color: var(--ink-3);
}
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--accent-ink); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--ink-4); }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.page-head .titles { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.page-head .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── cards ──────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--lift-1);
}
.card--pad { padding: 20px; }
.card--flush { padding: 0; overflow: hidden; }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 15px 20px;
  border-bottom: 1px solid var(--rule);
}
.card-head h2 { font-size: 1.0625rem; }
.card-head .hint { font-size: 0.8125rem; color: var(--ink-3); }
.card-body { padding: 20px; }
.card-foot {
  padding: 13px 20px; border-top: 1px solid var(--rule);
  background: var(--surface-2); font-size: 0.875rem; color: var(--ink-2);
}

.grid { display: grid; gap: 14px; }
.grid--stats   { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid--cards   { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--halves  { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.grid--thirds  { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ── stat tiles & hero ──────────────────────────────────────────────── */

.stat {
  display: flex; flex-direction: column; gap: 5px;
  padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: var(--lift-1);
}
.stat .label {
  font-size: 0.8125rem; font-weight: 500; color: var(--ink-3);
  display: flex; align-items: center; gap: 6px;
}
.stat .value {
  font-size: 1.75rem; font-weight: 640; line-height: 1.1;
  letter-spacing: -0.025em;
}
.stat .value--sm { font-size: 1.125rem; letter-spacing: -0.01em; }
.stat .note { font-size: 0.8125rem; color: var(--ink-3); }
.stat .sparkline { margin-top: 2px; }

.hero-card {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 22px 24px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius-lg); box-shadow: var(--lift-1);
}
.hero-card .hero-main { display: flex; flex-direction: column; gap: 3px; }
.hero-card .hero-aside { margin-left: auto; min-width: 230px; }

/* ── badges ─────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 0.8125rem; font-weight: 550; line-height: 1.5;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge .glyph { font-size: 0.75em; line-height: 1; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* severity — colour + glyph + word, never colour alone */
.badge--critical      { color: var(--sev-critical); background: var(--sev-critical-wash); border-color: color-mix(in srgb, var(--sev-critical) 22%, transparent); }
.badge--high          { color: var(--sev-high);     background: var(--sev-high-wash);     border-color: color-mix(in srgb, var(--sev-high) 22%, transparent); }
.badge--medium        { color: var(--sev-medium);   background: var(--sev-medium-wash);   border-color: color-mix(in srgb, var(--sev-medium) 22%, transparent); }
.badge--low           { color: var(--sev-low);      background: var(--sev-low-wash);      border-color: color-mix(in srgb, var(--sev-low) 25%, transparent); }
.badge--informational { color: var(--ink-3);        background: var(--sev-info-wash);     border-color: var(--rule); }

/* run / order status */
.badge--completed, .badge--confirmed, .badge--ready, .badge--resolved, .badge--paid,
.badge--fulfilled, .badge--active, .badge--succeeded, .badge--processed
  { color: var(--ok-ink); background: var(--ok-wash); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.badge--running, .badge--queued, .badge--pending, .badge--pending_payment, .badge--open,
.badge--incomplete, .badge--verifying, .badge--trialing
  { color: var(--accent-ink); background: var(--accent-wash); border-color: var(--accent-edge); }
.badge--partial, .badge--partially_completed, .badge--past_due, .badge--cancel_at_period_end,
.badge--partially_refunded, .badge--authorized
  { color: var(--warn); background: var(--warn-wash); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.badge--failed, .badge--payment_failed, .badge--unpaid, .badge--disputed, .badge--rejected
  { color: var(--danger); background: var(--danger-wash); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.badge--skipped, .badge--not_assessed, .badge--draft, .badge--cancelled, .badge--canceled,
.badge--ignored, .badge--accepted_risk, .badge--expired, .badge--refunded, .badge--planned
  { color: var(--ink-3); background: var(--surface-2); border-color: var(--rule); }

.badge--plain { color: var(--ink-2); background: var(--surface-2); border-color: var(--rule); }
.badge--accent { color: var(--accent-ink); background: var(--accent-wash); border-color: var(--accent-edge); }

/* a running job gets motion so progress is visible without a fake number */
.badge--running .dot { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .badge--running .dot { animation: none; } }

.confidence {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.8125rem; color: var(--ink-3);
}
.confidence .bars { display: inline-flex; gap: 2px; align-items: flex-end; }
.confidence .bars i {
  display: block; width: 3px; border-radius: 1px; background: var(--ink-4);
}
.confidence .bars i:nth-child(1) { height: 5px; }
.confidence .bars i:nth-child(2) { height: 8px; }
.confidence .bars i:nth-child(3) { height: 11px; }
.confidence--high .bars i { background: var(--ok); }
.confidence--medium .bars i:nth-child(-n+2) { background: var(--warn); }
.confidence--low .bars i:nth-child(1) { background: var(--danger); }

/* ── meters (a ratio against a limit) ───────────────────────────────── */

.meter {
  height: 7px; border-radius: 20px; overflow: hidden;
  background: var(--seq-track);
}
.meter > span {
  display: block; height: 100%; border-radius: 20px;
  background: var(--seq-3);
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}
.meter--sm { height: 5px; }
.meter--lg { height: 10px; }
/* fill carries severity; the track stays the same hue family throughout */
.meter--good > span   { background: var(--ok); }
.meter--warn > span   { background: var(--warn); }
.meter--danger > span { background: var(--danger); }

.meter-row { display: flex; flex-direction: column; gap: 6px; }
.meter-row .meter-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.meter-row .meter-label { font-size: 0.9375rem; font-weight: 500; }
.meter-row .meter-value {
  font-size: 0.9375rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.meter-row .meter-foot { font-size: 0.8125rem; color: var(--ink-3); }

/* score dial — a ratio, drawn as an arc; value is always written too */
.dial { display: inline-grid; place-items: center; position: relative; }
.dial svg { display: block; transform: rotate(-90deg); }
.dial .dial-value {
  position: absolute; display: flex; flex-direction: column;
  align-items: center; line-height: 1;
}
.dial .dial-number { font-size: 1.375rem; font-weight: 650; letter-spacing: -0.02em; }
.dial .dial-unit { font-size: 0.6875rem; color: var(--ink-3); margin-top: 2px; }

/* ── severity distribution bar ──────────────────────────────────────── */

.sev-bar {
  display: flex; height: 10px; border-radius: 20px; overflow: hidden;
  background: var(--surface-2); gap: 2px;      /* 2px surface gap between fills */
}
.sev-bar > span { display: block; min-width: 3px; }
.sev-bar .s-critical      { background: var(--sev-critical); }
.sev-bar .s-high          { background: var(--sev-high); }
.sev-bar .s-medium        { background: var(--sev-medium); }
.sev-bar .s-low           { background: var(--sev-low); }
.sev-bar .s-informational { background: var(--sev-info); }

.sev-legend {
  display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0;
  list-style: none;
}
.sev-legend li { display: flex; align-items: center; gap: 7px; font-size: 0.875rem; }
.sev-legend .swatch {
  width: 10px; height: 10px; border-radius: 3px; flex: none;
}
.sev-legend .swatch.s-critical      { background: var(--sev-critical); }
.sev-legend .swatch.s-high          { background: var(--sev-high); }
.sev-legend .swatch.s-medium        { background: var(--sev-medium); }
.sev-legend .swatch.s-low           { background: var(--sev-low); }
.sev-legend .swatch.s-informational { background: var(--sev-info); }
.sev-legend .n {
  font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink);
}
.sev-legend .k { color: var(--ink-3); }
.sev-legend li[data-zero="true"] { opacity: .45; }

/* ── tables ─────────────────────────────────────────────────────────── */

.scroll { overflow-x: auto; }
.scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9375rem; }

thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2);
  padding: 9px 14px;
  font-size: 0.8125rem; font-weight: 600; color: var(--ink-2);
  text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--rule);
}
tbody td, tbody th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  text-align: left; font-weight: 400; vertical-align: top;
}
tbody th { font-weight: 550; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody tr { transition: background .1s ease; }
tbody tr:hover { background: var(--surface-hover); }

th.num, td.num {
  text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.row-sub { display: block; font-size: 0.8125rem; color: var(--ink-3); margin-top: 2px; }

/* sortable header */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th.sortable::after {
  content: "↕"; margin-left: 6px; opacity: .35; font-size: 0.875em;
}
th.sortable[aria-sort="ascending"]::after  { content: "↑"; opacity: 1; }
th.sortable[aria-sort="descending"]::after { content: "↓"; opacity: 1; }

/* ── finding rows ───────────────────────────────────────────────────── */

.finding-row {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 15px 20px;
  border-bottom: 1px solid var(--rule);
  color: inherit; text-decoration: none;
  transition: background .1s ease;
  position: relative;
}
.finding-row:last-child { border-bottom: 0; }
.finding-row:hover { background: var(--surface-hover); text-decoration: none; }
.finding-row:hover .fr-title { color: var(--accent-ink); }
.finding-row::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: transparent;
}
.finding-row[data-severity="critical"]::before { background: var(--sev-critical); }
.finding-row[data-severity="high"]::before     { background: var(--sev-high); }
.finding-row[data-severity="medium"]::before   { background: var(--sev-medium); }
.finding-row[data-severity="low"]::before      { background: var(--sev-low); }

.fr-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.fr-title { font-size: 0.9375rem; font-weight: 550; line-height: 1.4; }
.fr-summary {
  font-size: 0.875rem; color: var(--ink-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.fr-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px;
  font-size: 0.8125rem; color: var(--ink-3);
}
.fr-meta .chip {
  background: var(--surface-2); border-radius: 5px; padding: 1px 6px;
  font-family: var(--mono); font-size: 0.75rem;
}
.fr-side {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none;
}
.finding--quiet { opacity: .62; }

/* ── forms & controls ───────────────────────────────────────────────── */

.form { display: flex; flex-direction: column; gap: 18px; max-width: 34rem; }
.form--wide { max-width: 50rem; }
.form--narrow { max-width: 24rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label {
  font-size: 0.875rem; font-weight: 550; color: var(--ink);
}

input[type="text"], input[type="password"], input[type="number"], input[type="email"],
input[type="url"], input[type="search"], input[type="date"], input[type="file"],
select, textarea {
  width: 100%;
  font-family: var(--sans); font-size: 0.9375rem; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-firm);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input:hover, select:hover, textarea:hover { border-color: var(--ink-4); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
input[type="color"] {
  width: 56px; height: 36px; padding: 2px; cursor: pointer;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%23717784' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.help { font-size: 0.875rem; color: var(--ink-3); line-height: 1.5; }
.error { font-size: 0.875rem; color: var(--danger); font-weight: 500; }

.field--check { flex-direction: row; align-items: flex-start; gap: 9px; }
.field--check input[type="checkbox"] { width: 17px; height: 17px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.field--check > label { font-weight: 400; color: var(--ink-2); font-size: 0.9375rem; }

.radios ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.radios label { font-weight: 400; font-size: 0.9375rem; display: flex; gap: 8px; align-items: center; }
.radios input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }

/* ── buttons ────────────────────────────────────────────────────────── */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--sans); font-size: 0.9375rem; font-weight: 550;
  line-height: 1.2;
  padding: 9px 16px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff;
  border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: var(--lift-1);
  transition: filter .12s ease, transform .06s ease, background .12s ease;
}
.button:hover { filter: brightness(1.07); text-decoration: none; }
.button:active { transform: translateY(1px); }
.button--quiet {
  background: var(--surface); color: var(--ink);
  border-color: var(--rule-firm); box-shadow: var(--lift-1);
}
.button--quiet:hover { background: var(--surface-hover); filter: none; }
.button--ghost {
  background: transparent; color: var(--ink-2); border-color: transparent;
  box-shadow: none;
}
.button--ghost:hover { background: var(--surface-hover); color: var(--ink); filter: none; }
.button--danger {
  background: transparent; color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent); box-shadow: none;
}
.button--danger:hover { background: var(--danger-wash); filter: none; }
.button--sm { font-size: 0.875rem; padding: 6px 11px; }
.button--lg { font-size: 1rem; padding: 12px 22px; }
.button--block { width: 100%; }
.button[disabled], .button[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--sans); font-size: 0.9375rem; color: var(--ink-2);
}
.linkish:hover { color: var(--accent-ink); text-decoration: underline; }
.linkish.danger:hover { color: var(--danger); }

.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.actions form { margin: 0; }

/* ── filter chips & segmented control ───────────────────────────────── */

.filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
}
.filters .field { gap: 5px; flex: 0 1 170px; }
.filters .field--search { flex: 1 1 260px; }
.filters .field > label { font-size: 0.8125rem; font-weight: 500; color: var(--ink-3); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.chip-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  font-size: 0.875rem; font-weight: 500;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--rule-firm);
  cursor: pointer; text-decoration: none;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.chip-toggle:hover { background: var(--surface-hover); color: var(--ink); text-decoration: none; }
.chip-toggle[aria-pressed="true"], .chip-toggle.is-active {
  background: var(--accent-wash); color: var(--accent-ink);
  border-color: var(--accent-edge); font-weight: 600;
}
.chip-toggle .n {
  font-variant-numeric: tabular-nums; font-size: 0.8125rem;
  background: var(--surface-2); border-radius: 20px; padding: 0 6px;
}
.chip-toggle[aria-pressed="true"] .n { background: var(--surface); }

.segmented {
  display: inline-flex; align-self: flex-start; padding: 3px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--rule);
  border-radius: 20px;
}
.segmented a, .segmented button {
  padding: 5px 14px; border-radius: 20px; border: 0; background: transparent;
  font-family: var(--sans); font-size: 0.875rem; font-weight: 550;
  color: var(--ink-3); cursor: pointer; text-decoration: none;
}
.segmented a:hover, .segmented button:hover { color: var(--ink); text-decoration: none; }
.segmented [aria-current="true"], .segmented .is-active {
  background: var(--surface); color: var(--ink); box-shadow: var(--lift-1);
}

/* ── tabs ───────────────────────────────────────────────────────────── */

.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--rule);
  overflow-x: auto;
}
.tabs a, .tabs button {
  padding: 10px 14px; border: 0; background: none; cursor: pointer;
  font-family: var(--sans); font-size: 0.9375rem; font-weight: 500;
  color: var(--ink-3); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs [aria-selected="true"], .tabs .is-active {
  color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 600;
}

/* ── progressive disclosure ─────────────────────────────────────────── */

details.disclose {
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
details.disclose + details.disclose { margin-top: 8px; }
details.disclose > summary {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; cursor: pointer; list-style: none;
  font-size: 0.9375rem; font-weight: 550;
  transition: background .1s ease;
}
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary:hover { background: var(--surface-hover); }
details.disclose > summary::after {
  content: "›"; margin-left: auto; font-size: 1.25rem; color: var(--ink-3);
  transition: transform .16s ease;
}
details.disclose[open] > summary::after { transform: rotate(90deg); }
details.disclose[open] > summary { border-bottom: 1px solid var(--rule); }
details.disclose .disclose-body { padding: 16px; }

summary { cursor: pointer; }
.disclose-inline > summary {
  font-size: 0.875rem; font-weight: 550; color: var(--accent-ink);
  list-style: none; display: inline-flex; align-items: center; gap: 5px;
}
.disclose-inline > summary::-webkit-details-marker { display: none; }
.disclose-inline > summary::before { content: "＋"; font-size: 0.875em; }
.disclose-inline[open] > summary::before { content: "－"; }
.disclose-inline > summary:hover { text-decoration: underline; }

/* ── key/value lists ───────────────────────────────────────────────── */

.kv { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 10px 20px; margin: 0; }
.kv dt { font-size: 0.875rem; color: var(--ink-3); }
.kv dd { margin: 0; font-size: 0.9375rem; word-break: break-word; }

.notes { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 0.9375rem; }
.notes li { margin-bottom: 7px; line-height: 1.55; }
.notes li:last-child { margin-bottom: 0; }

/* ── evidence / code ───────────────────────────────────────────────── */

.evidence-block {
  position: relative;
  background: var(--surface-2); border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-family: var(--mono); font-size: 0.8125rem; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
  max-height: 22rem; overflow: auto;
  color: var(--ink-2);
}
.copy-button {
  position: absolute; top: 8px; right: 8px;
  padding: 3px 9px; border-radius: 5px;
  font-family: var(--sans); font-size: 0.75rem; font-weight: 550;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--rule-firm); cursor: pointer;
  opacity: .55; transition: opacity .12s ease;
}
.evidence-block:hover .copy-button, .copy-button:focus-visible { opacity: 1; }
.copy-button:hover { background: var(--surface-hover); color: var(--ink); }

/* ── callouts & messages ───────────────────────────────────────────── */

.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }

.msg {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 15px; border-radius: var(--radius-sm);
  font-size: 0.9375rem; line-height: 1.55;
  background: var(--accent-wash); color: var(--ink);
  border: 1px solid var(--accent-edge);
}
.msg::before { content: "ⓘ"; flex: none; color: var(--accent-ink); font-size: 1em; }
.msg--success { background: var(--ok-wash); border-color: color-mix(in srgb, var(--ok) 28%, transparent); }
.msg--success::before { content: "✓"; color: var(--ok-ink); }
.msg--warning { background: var(--warn-wash); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
.msg--warning::before { content: "⚠"; color: var(--warn); }
.msg--error { background: var(--danger-wash); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }
.msg--error::before { content: "✕"; color: var(--danger); }

.callout {
  padding: 15px 17px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  font-size: 0.9375rem; color: var(--ink-2); line-height: 1.6;
}
.callout strong { color: var(--ink); }
.callout--warn { border-left-color: var(--warn); }
.callout--quiet { border-left-color: var(--rule-firm); }

/* ── empty states ──────────────────────────────────────────────────── */

.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 12px; padding: 48px 32px;
  background: var(--surface); border: 1px dashed var(--rule-firm);
  border-radius: var(--radius-lg);
}
.empty .empty-art {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--accent-wash); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 24px;
}
.empty h2 { font-size: 1.1875rem; }
.empty p { color: var(--ink-2); max-width: 46ch; font-size: 0.9375rem; }

/* ── progress rows ─────────────────────────────────────────────────── */

.progress-rows { display: flex; flex-direction: column; }
.progress-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 0; border-bottom: 1px solid var(--rule);
}
.progress-row:last-child { border-bottom: 0; }
.progress-row .who { display: flex; flex-direction: column; gap: 3px; flex: 1 1 220px; min-width: 0; }
.progress-row .who strong { font-weight: 550; font-size: 0.9375rem; }
.progress-row .who .detail { font-size: 0.8125rem; color: var(--ink-3); }

.list-rows { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; border-bottom: 1px solid var(--rule);
  text-decoration: none; color: inherit;
  transition: background .1s ease;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-hover); text-decoration: none; }
.list-row .lr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.list-row .lr-title { font-size: 0.9375rem; font-weight: 550; }
.list-row:hover .lr-title { color: var(--accent-ink); }
.list-row .lr-sub { font-size: 0.8125rem; color: var(--ink-3); }

/* ── module selection cards ────────────────────────────────────────── */

.module-card {
  background: var(--surface); border: 1px solid var(--rule-firm);
  border-radius: var(--radius); position: relative;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.module-card:hover { border-color: var(--ink-4); box-shadow: var(--lift-2); }
.module-card:has(input:checked) {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash);
}
.module-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.module-card > label { display: flex; gap: 12px; padding: 16px 18px; cursor: pointer; align-items: flex-start; }
.module-card input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.module-card .mc-body { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.module-card .mc-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 1rem; font-weight: 600; }
.module-card .mc-desc { font-size: 0.875rem; color: var(--ink-2); line-height: 1.55; }
.module-card .mc-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; font-size: 0.8125rem; color: var(--ink-3); }
.module-card .mc-list { margin: 10px 0 0; padding-left: 18px; font-size: 0.875rem; color: var(--ink-2); }
.module-card .mc-list li { margin-bottom: 4px; }
.module-card .caveat { display: flex; gap: 7px; font-size: 0.875rem; color: var(--warn); }

/* ── prose blocks (finding detail) ─────────────────────────────────── */

.prose { display: flex; flex-direction: column; gap: 10px; }
.prose p { color: var(--ink-2); max-width: 70ch; line-height: 1.65; }
.prose h3 { font-size: 0.9375rem; font-weight: 600; color: var(--ink); margin-top: 6px; }
.prose ol, .prose ul { margin: 0; padding-left: 20px; color: var(--ink-2); }
.prose li { margin-bottom: 7px; line-height: 1.6; }

.ai-note {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px dashed var(--rule-firm);
  font-size: 0.875rem; color: var(--ink-3); line-height: 1.55;
}

/* ── misc utilities ────────────────────────────────────────────────── */

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack--tight { gap: 9px; }
.stack--loose { gap: 24px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row--tight { gap: 7px; }
.spread { justify-content: space-between; }
.inline-list { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0; padding: 0; list-style: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 11px 16px;
  border-radius: 0 0 var(--radius-sm) 0; font-weight: 550;
}
.skip-link:focus { left: 0; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 4px 0; }

/* ── marketing / auth pages ────────────────────────────────────────── */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 20;
}
.topbar nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar nav a { font-size: 0.9375rem; font-weight: 500; color: var(--ink-2); }
.topbar nav a:hover { color: var(--ink); text-decoration: none; }

.sheet {
  max-width: 1120px; margin-inline: auto;
  padding: 44px 24px 80px;
  display: flex; flex-direction: column; gap: 40px;
}
.sheet--narrow { max-width: 30rem; }

.masthead { display: flex; flex-direction: column; gap: 14px; }
.masthead--narrow { max-width: 34rem; }
.masthead h1 { font-size: clamp(1.875rem, 5vw, 2.75rem); letter-spacing: -0.03em; }
.standfirst { font-size: 1.0625rem; color: var(--ink-2); max-width: 62ch; line-height: 1.6; }

.footer {
  border-top: 1px solid var(--rule); padding: 24px 28px;
  font-size: 0.875rem; color: var(--ink-3); text-align: center; line-height: 1.6;
}

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.feature { display: flex; flex-direction: column; gap: 9px; }
.feature .feature-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-wash); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 17px;
}
.feature h3 { font-size: 1rem; }
.feature ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 0.9375rem; }
.feature li { margin-bottom: 5px; }

/* ── pricing ───────────────────────────────────────────────────────── */

.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; align-items: start; }
.price-card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius-lg); box-shadow: var(--lift-1);
  position: relative;
}
.price-card--featured {
  border-color: var(--accent); box-shadow: var(--lift-3);
}
.price-card--featured::before {
  content: "Most popular"; position: absolute; top: -11px; left: 22px;
  background: var(--accent); color: #fff;
  font-size: 0.75rem; font-weight: 600; padding: 2px 10px; border-radius: 20px;
}
.price-card .plan-name { font-size: 1.0625rem; font-weight: 650; }
.price-card .plan-for { font-size: 0.875rem; color: var(--ink-3); }
.price-card .amount { display: flex; align-items: baseline; gap: 5px; }
.price-card .amount .figure {
  font-size: 2.25rem; font-weight: 650; letter-spacing: -0.03em; line-height: 1;
}
.price-card .amount .per { font-size: 0.875rem; color: var(--ink-3); }
.price-card .plan-features { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.price-card .plan-features li {
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
  font-size: 0.9375rem; line-height: 1.45;
}
.price-card .plan-features .k { flex: 1 1 auto; min-width: 0; }
.price-card .plan-features .tick { color: var(--ok-ink); flex: none; font-weight: 700; }
.price-card .plan-features .cross { color: var(--ink-4); flex: none; }
.price-card .plan-features .k { color: var(--ink-3); }
.price-card .plan-features .v { font-weight: 600; margin-left: auto; white-space: nowrap;
                                 font-variant-numeric: tabular-nums; }

/* ── responsive ────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: column;
    border-right: 0; border-bottom: 1px solid var(--rule);
    padding: 12px 14px;
  }
  .wordmark { padding-bottom: 0; }
  .sidebar nav, .sidebar .workspace-chip, .sidebar .sidebar-group { display: none; }
  .sidebar:has(.drawer-toggle:checked) nav,
  .sidebar:has(.drawer-toggle:checked) .workspace-chip,
  .sidebar:has(.drawer-toggle:checked) .sidebar-group { display: flex; }
  .sidebar:has(.drawer-toggle:checked) .sidebar-group { display: block; }
  .sidebar .drawer-label {
    position: absolute; top: 14px; right: 14px;
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    font-size: 0.875rem; font-weight: 550; color: var(--ink-2);
    border: 1px solid var(--rule-firm); border-radius: var(--radius-sm);
    padding: 6px 11px;
  }
  .sidebar .workspace-chip { margin-top: 12px; }
  .app-body { padding: 20px 16px 56px; }
  .app-topbar { padding: 10px 16px; }
  .sheet { padding: 32px 18px 56px; gap: 32px; }
  .topbar { padding: 12px 16px; }
}
@media (min-width: 961px) { .sidebar .drawer-label { display: none; } }

@media (max-width: 600px) {
  body { font-size: 15.5px; }
  .page-head { gap: 14px; }
  .page-head .actions { width: 100%; }
  .finding-row { flex-direction: column; gap: 10px; }
  .finding-row .fr-side { flex-direction: row; align-items: center; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 12px; }
  .hero-card .hero-aside { margin-left: 0; width: 100%; }
  .card-body, .card-head, .card--pad { padding-inline: 16px; }
  .finding-row, .list-row { padding-inline: 16px; }
  thead th, tbody td, tbody th { padding: 10px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ── print ─────────────────────────────────────────────────────────── */

@media print {
  .sidebar, .app-topbar, .actions, .skip-link, .filters { display: none !important; }
  .app { display: block; }
  .app-body { max-width: none; padding: 0; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Marketing page
   ═══════════════════════════════════════════════════════════════════════
   The imagery here is the product's own interface — real dials, meters,
   severity bars and finding rows — rather than stock illustration. It shows
   what a buyer actually gets, it cannot drift from the real UI, and it needs
   no image assets or external requests.

   Anything showing numbers is labelled as an example (PRD 28: never present
   demo metrics as real).
   ═══════════════════════════════════════════════════════════════════════ */

.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 48px; align-items: center;
  padding: 56px 0 40px;
}
.hero-copy { display: flex; flex-direction: column; gap: 20px; }
.hero-copy h1 {
  font-size: clamp(2.25rem, 4.6vw, 3.4rem);
  line-height: 1.06; letter-spacing: -0.035em;
}
.hero-copy .standfirst { font-size: 1.125rem; }

.eyebrow-pill {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 5px 13px; border-radius: 20px;
  background: var(--accent-wash); color: var(--accent-ink);
  border: 1px solid var(--accent-edge);
  font-size: 0.875rem; font-weight: 550;
}

/* URL entry in the hero — the shortest path from landing to value. */
.url-start {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 7px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--rule-firm);
  box-shadow: var(--lift-2);
}
.url-start input {
  flex: 1 1 220px; border: 0; box-shadow: none; background: transparent;
  font-size: 1rem; padding: 10px 12px;
}
.url-start input:focus { box-shadow: none; }
.url-start .button { flex: none; }

.trust-row {
  display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center;
  font-size: 0.875rem; color: var(--ink-3);
}
.trust-row span { display: inline-flex; align-items: center; gap: 6px; }
.trust-row .tick { color: var(--ok-ink); font-weight: 700; }

/* ── the product mock ───────────────────────────────────────────────── */

.mock {
  border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--rule);
  box-shadow: var(--lift-3);
  overflow: hidden;
  position: relative;
}
.mock::after {                      /* a hairline sheen, not a gradient wash */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}
.mock-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--rule);
}
.mock-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rule-firm); }
.mock-bar .addr {
  margin-left: 8px; flex: 1; min-width: 0;
  font-family: var(--mono); font-size: 0.75rem; color: var(--ink-3);
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 6px; padding: 3px 9px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mock-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.mock-label {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: .02em;
  background: var(--ink); color: var(--plane);
  border-radius: 20px; padding: 2px 9px; opacity: .85;
}

.mock-dials { display: flex; gap: 10px; flex-wrap: wrap; }
.mock-dial {
  flex: 1 1 86px; display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 12px 8px;
  border: 1px solid var(--rule); border-radius: var(--radius-sm);
  background: var(--surface);
}
.mock-dial .cap {
  font-size: 0.75rem; color: var(--ink-3); text-align: center; line-height: 1.3;
}

/* ── step diagrams ──────────────────────────────────────────────────── */

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.step {
  display: flex; flex-direction: column; gap: 12px;
  padding: 22px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--rule);
  box-shadow: var(--lift-1);
  transition: transform .16s ease, box-shadow .16s ease;
}
.step:hover { transform: translateY(-2px); box-shadow: var(--lift-2); }
.step .n {
  width: 28px; height: 28px; border-radius: 9px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-size: 0.875rem; font-weight: 700;
}
.step h3 { font-size: 1.0625rem; }
.step p { font-size: 0.9375rem; color: var(--ink-2); line-height: 1.55; }
.step .step-art {
  margin-top: auto; padding-top: 8px;
  border-top: 1px solid var(--rule);
}

/* ── module explorer (CSS-only tabs) ────────────────────────────────── */

.explorer { display: grid; grid-template-columns: minmax(200px, 270px) minmax(0, 1fr); gap: 0;
            border: 1px solid var(--rule); border-radius: var(--radius-lg);
            background: var(--surface); overflow: hidden; box-shadow: var(--lift-1); }
.explorer input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.explorer-nav { display: flex; flex-direction: column; padding: 8px;
                background: var(--surface-2); border-right: 1px solid var(--rule); }
.explorer-nav label {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 0.9375rem; font-weight: 500; color: var(--ink-2);
  transition: background .12s ease, color .12s ease;
}
.explorer-nav label:hover { background: var(--surface-hover); color: var(--ink); }
.explorer-nav label .ic {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: grid; place-items: center; font-size: 13px;
  background: var(--surface); border: 1px solid var(--rule); color: var(--accent-ink);
}
.explorer-panels { position: relative; }
.explorer-panel { display: none; padding: 24px; flex-direction: column; gap: 14px; }
.explorer-panel h3 { font-size: 1.1875rem; }
.explorer-panel .checklist { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.explorer-panel .checklist li {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 0.9375rem; color: var(--ink-2); line-height: 1.5;
}
.explorer-panel .checklist .tick { color: var(--ok-ink); font-weight: 700; flex: none; }
.explorer-panel .cant {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border-left: 3px solid var(--warn);
  font-size: 0.875rem; color: var(--ink-2); line-height: 1.55;
}

#m-website:checked  ~ .explorer-panels #p-website,
#m-performance:checked ~ .explorer-panels #p-performance,
#m-seo:checked      ~ .explorer-panels #p-seo,
#m-geo:checked      ~ .explorer-panels #p-geo,
#m-social:checked   ~ .explorer-panels #p-social,
#m-paid:checked     ~ .explorer-panels #p-paid { display: flex; }

#m-website:checked      ~ .explorer-nav label[for="m-website"],
#m-performance:checked  ~ .explorer-nav label[for="m-performance"],
#m-seo:checked          ~ .explorer-nav label[for="m-seo"],
#m-geo:checked          ~ .explorer-nav label[for="m-geo"],
#m-social:checked       ~ .explorer-nav label[for="m-social"],
#m-paid:checked         ~ .explorer-nav label[for="m-paid"] {
  background: var(--surface); color: var(--ink); font-weight: 600;
  box-shadow: var(--lift-1);
}
.explorer input[type="radio"]:focus-visible + label { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ── anatomy callouts ───────────────────────────────────────────────── */

.anatomy { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.anatomy-notes { display: flex; flex-direction: column; gap: 14px; }
.anatomy-note { display: flex; gap: 12px; }
.anatomy-note .pin {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: var(--ink); color: var(--plane);
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 700;
}
.anatomy-note h4 { font-size: 0.9375rem; margin-bottom: 2px; }
.anatomy-note p { font-size: 0.875rem; color: var(--ink-2); line-height: 1.5; }

/* ── honesty cards ──────────────────────────────────────────────────── */

.honest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.honest {
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--rule);
}
.honest .ic {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: 16px;
  background: var(--surface-2); border: 1px solid var(--rule);
}
.honest h3 { font-size: 1rem; }
.honest p { font-size: 0.9375rem; color: var(--ink-2); line-height: 1.55; }

/* ── closing CTA ────────────────────────────────────────────────────── */

.cta-band {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center; padding: 48px 28px;
  border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--rule);
  box-shadow: var(--lift-1);
}
.cta-band h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); letter-spacing: -0.028em; }

.section-head { display: flex; flex-direction: column; gap: 9px; max-width: 58ch; }
.section-head h2 { font-size: clamp(1.375rem, 2.8vw, 1.875rem); letter-spacing: -0.026em; }

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 36px; }
  .anatomy { grid-template-columns: 1fr; }
  .explorer { grid-template-columns: 1fr; }
  .explorer-nav { flex-direction: row; overflow-x: auto; border-right: 0;
                  border-bottom: 1px solid var(--rule); }
  .explorer-nav label { white-space: nowrap; }
}

/* ── payment flow ──────────────────────────────────────────────────────
   The purchase is three moments — review, pay, confirmed — and the
   anxious one is the middle. These components exist so money never moves
   behind a page that looks inert. */

/* Where you are in the purchase. An ordered list, so it reads in a screen
   reader as "1 of 3" rather than as decoration. */
.flow {
  list-style: none; margin: 0 0 24px; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0;
  counter-reset: flow;
}
.flow li {
  flex: 1 1 0; min-width: 7rem; position: relative;
  padding: 0 0 0 34px; counter-increment: flow;
  font-size: 0.875rem; color: var(--ink-3);
  display: flex; flex-direction: column; justify-content: center; min-height: 28px;
}
.flow li::before {
  content: counter(flow);
  position: absolute; left: 0; top: 0;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--surface-2); color: var(--ink-3);
  border: 1px solid var(--rule);
}
/* The rule between steps. Not on the last one. */
.flow li:not(:last-child)::after {
  content: ""; position: absolute; left: 24px; top: 11.5px; right: 8px;
  height: 1px; background: var(--rule);
}
.flow li[aria-current="step"] { color: var(--ink); font-weight: 550; }
/* Wash + ink, not white on accent: white on --accent is 4.42:1, which fails
   AA for a 12px numeral (and 3.64:1 in dark mode). These pairs measure
   5.88:1 and 7.48:1. */
.flow li[aria-current="step"]::before {
  background: var(--accent-wash); color: var(--accent-ink);
  border-color: var(--accent);
}
.flow li[data-done="true"]::before {
  content: "✓"; font-size: 0.8125rem;
  background: var(--ok-wash); color: var(--ok-ink); border-color: var(--ok);
}
.flow li[data-done="true"] { color: var(--ink-2); }

/* A receipt, not a definition list: the total is the one number that
   matters, so it gets the size the kv layout denied it. */
.receipt { display: flex; flex-direction: column; gap: 0; }
.receipt-line {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 9px 0; border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.receipt-line .k { color: var(--ink-2); }
.receipt-line .v { font-variant-numeric: tabular-nums; }
.receipt-line--total {
  border-bottom: 0; padding-top: 14px; margin-top: 2px;
  border-top: 1px solid var(--rule-firm);
}
.receipt-line--total .k { color: var(--ink); font-weight: 550; }
.receipt-line--total .v {
  font-size: 1.75rem; font-weight: 600; letter-spacing: -0.02em; color: var(--ink);
}
.receipt-line--note { border-bottom: 0; padding-top: 2px; }
.receipt-line--note .k { font-size: 0.8125rem; color: var(--ink-3); }

/* What the money buys, ticked. */
.unlocks { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.unlocks li {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 0.9375rem; color: var(--ink-2);
}
.unlocks .tick { color: var(--ok-ink); flex: none; font-weight: 600; }

/* Accepted methods. Inline SVG only — no external asset can be blocked or
   go stale, and each badge keeps a text label for the icon-blind case. */
.pay-methods { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.pay-method {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border: 1px solid var(--rule); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 0.8125rem; color: var(--ink-2);
}
.pay-method svg { flex: none; display: block; }

/* The verifying state. Something must move, or the page reads as broken at
   exactly the moment the customer's money has left their account. */
.pending-strip {
  height: 4px; border-radius: 999px; overflow: hidden;
  background: var(--seq-track); position: relative;
}
.pending-strip::after {
  content: ""; position: absolute; inset: 0;
  width: 38%; border-radius: 999px; background: var(--accent);
  animation: pending-sweep 1.5s ease-in-out infinite;
}
@keyframes pending-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}
.pending-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pending-steps li {
  display: flex; gap: 10px; align-items: baseline;
  font-size: 0.9375rem; color: var(--ink-3);
}
.pending-steps li[data-done="true"] { color: var(--ink-2); }
.pending-steps li[data-done="true"] .mark { color: var(--ok-ink); }
.pending-steps .mark { flex: none; width: 1.1em; font-weight: 600; }
.pending-meta { font-size: 0.8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* A paid total, stated once and loudly, on the result screen. */
.paid-amount {
  display: flex; flex-direction: column; gap: 2px;
}
.paid-amount .figure {
  font-size: 2.25rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.paid-amount .label { font-size: 0.8125rem; color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  .pending-strip::after { animation: none; width: 100%; opacity: 0.45; }
}

@media (max-width: 560px) {
  .flow li:not(:last-child)::after { display: none; }
  .flow { gap: 10px; }
  .flow li { flex: 1 1 100%; }
  .receipt-line--total .v { font-size: 1.5rem; }
  .paid-amount .figure { font-size: 1.875rem; }
}
