/* ============================================================
     Results page - page-specific CSS only.
     Inherits :root tokens and shared components from /css/main.css.
     Page palette mirrors homepage:
       --paper #fff, --paper-2 #f7f8fa, --line rgba(6,12,25,0.08),
       --ink #0F172A, --blue #2f80ff, --muted #4a5366
     Restated locally so the page never depends on main.css being
     fully present for the page-specific rules below.
     ============================================================ */
  :root {
    /* Fallback values synced to the canonical product-tokens.css (linked last, wins).
       Was #ffffff / #f7f8fa / 0.14 — conflicting with the canonical cool-white; now
       matched so this fallback can never drift from the real palette. */
    --paper:        #FCFDFF;
    --paper-2:      #F3F6FC;
    --line:         rgba(6,12,25,0.08);
    --line-strong:  rgba(6,12,25,0.16);
    --ink:          #0F172A;
    --ink-soft:     #1f2a44;
    --muted:        #4a5366;
    --dim:          #64748b;
    --blue:         #2f80ff;
    --blue-soft:    rgba(47,128,255,0.06);
    --blue-border:  rgba(47,128,255,0.2);
    --teal: var(--geo);
    --teal-soft:    rgba(20,184,166,0.06);
    --teal-border:  rgba(20,184,166,0.25);
    --purple: var(--cro);
    --purple-soft:  rgba(124,91,209,0.06);
    --purple-border: rgba(124,91,209,0.25);
    --green:        #10b981;
    --green-soft:   rgba(16,185,129,0.08);
    --green-border: rgba(16,185,129,0.25);
    --amber:        #f59e0b;
    --amber-soft:   rgba(245,158,11,0.08);
    --amber-border: rgba(245,158,11,0.25);
    --red:          #ef4444;
    --red-soft:     rgba(239,68,68,0.06);
    --red-border:   rgba(239,68,68,0.25);
    /* Cyan top band, synced to Fix-List (.tier-top) + canonical tiers.js AI-Ready hue. */
    --cyan-soft:    rgba(34,211,238,0.08);
    --cyan-border:  rgba(34,211,238,0.25);
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }

  /* Shared line-icon (24px grid, currentColor) — replaces emoji glyphs. */
  .ss-ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex-shrink: 0; }
  .error-icon .ss-ico { width: 46px; height: 46px; vertical-align: middle; }
  body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--paper-2);
    color: var(--ink);
    line-height: 1.55;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  a { color: inherit; text-decoration: none; }
  :focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

  /* Typography */
  .serif { font-family: 'Instrument Serif', serif; }
  .h1 { font-family: 'Instrument Serif', serif; font-size: clamp(26px, 4vw, 44px); line-height: 1.05; letter-spacing: -0.025em; font-weight: 400; color: var(--ink); }
  .h2 { font-family: 'Instrument Serif', serif; font-size: clamp(24px, 3vw, 38px); line-height: 1.15; letter-spacing: -0.02em; font-weight: 400; color: var(--ink); }
  .h3 { font-size: 20px; font-weight: 800; color: var(--ink); }

  /* Layout */
  .container { max-width: 900px; margin: 0 auto; padding: 0 24px; }
  .content-narrow { max-width: 700px; margin: 0 auto; padding: 0 24px; }

  /* ============ NAV ============ */
  nav.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(6,12,25,0.02);
  }
  .nav-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 24px;
  }
  .nav-logo { display: flex; align-items: center; gap: 10px; }
  .nav-logo img { height: 26px; width: auto; display: block; }
  .nav-links { display: none; gap: 28px; align-items: center; }
  .nav-links a {
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s;
  }
  .nav-links a:hover { color: var(--blue); }
  .nav-actions { display: none; gap: 12px; align-items: center; }
  .nav-cta-secondary {
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 4px;
    transition: color 0.15s;
  }
  .nav-cta-secondary:hover { color: var(--blue); }
  .nav-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--blue);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 8px;
    transition: filter 0.15s, transform 0.1s;
  }
  .nav-cta-button:hover { filter: brightness(1.06); }
  .nav-cta-button:active { transform: scale(0.98); }
  .nav-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(6,12,25,0.04);
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--ink);
    border-radius: 8px;
    transition: background 0.15s;
  }
  .nav-hamburger:hover { background: var(--paper-2); }

  .mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(252,253,255,0.98);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    z-index: 50;
  }
  .mobile-menu.open { display: block; }
  .mobile-menu-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .mobile-menu-link {
    color: var(--ink);
    font-size: 17px;
    font-weight: 500;
    padding: 14px 8px;
    border-bottom: 1px solid var(--line);
    transition: color 0.15s;
  }
  .mobile-menu-link:hover { color: var(--blue); }
  .mobile-menu-link:last-of-type { border-bottom: none; }
  .mobile-menu-cta {
    margin-top: 12px;
    justify-content: center;
    padding: 16px;
    font-size: 15px;
    text-align: center;
  }

  @media (min-width: 1024px) {
    .nav-hamburger { display: none; }
    .nav-links { display: flex; }
    .nav-actions { display: flex; }
  }

  /* ============ HERO ============ */
  .hero {
    padding: 28px 24px 32px;
    text-align: left;
    max-width: var(--content);
    margin: 0 auto;
  }
  /* Composite ring + verdict, side by side (the "one number" hero) */
  .hero-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 44px;
    margin-top: 18px;
  }
  .hero-composite {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  .hero-composite[hidden] { display: none; }
  /* Loading-state composite anchor: the namesake number, present from first paint in a
     "calculating" state (never a resting 0). The results reveal then fills a ring the
     user is already watching. Decorative (aria-hidden); checklist carries the semantics. */
  .loading-composite { display:flex; flex-direction:column; align-items:center; gap:4px; margin:0 auto 28px; }
  .loading-composite-ring { position:relative; width:118px; height:118px; }
  .lc-ring { display:block; transform:rotate(-90deg); }
  .lc-track { stroke:var(--line-strong); }
  .lc-arc { stroke:var(--blue); stroke-dasharray:66 198; transform-box:fill-box; transform-origin:center; animation:ssLcSpin 1.1s linear infinite; }
  @keyframes ssLcSpin { to { transform:rotate(360deg); } }
  .loading-composite-num { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; gap:3px; }
  .loading-composite-num span { font-family:'Inter', system-ui, sans-serif; font-variant-numeric:tabular-nums; font-weight:700; font-size:40px; line-height:1; color:var(--muted); }
  /* Em-dash placeholder via CSS content (U+2014) — kept out of the HTML so the
     em-dash stripper (html/js only) leaves it alone. Renders as "—/100" while scoring. */
  .loading-composite-num span:empty::before { content:"\2014"; }
  .loading-composite-num small { font-size:14px; color:var(--muted); position:relative; top:9px; }
  .loading-composite-label { font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }
  .loading-composite-status { font-size:13px; color:var(--dim); }
  @media (prefers-reduced-motion:reduce) { .lc-arc { animation:none; } }

  .hero-composite-ring { position: relative; width: 150px; height: 150px; }
  .hero-composite-ring ss-score-ring {
    position: absolute; inset: 0; width: 100%; height: 100%; --ss-ring-size: 100%;
  }
  /* Motion weld (#6): the composite ring's arc draw shares the same duration + curve
     as the count-up digit (--dur-hero / --ease-reveal, the CSS twin of the JS
     easeOutCubic), so number and arc move as one. Scoped to this ring only —
     sibling card rings keep the global --ease-out. */
  #composite-ring { --ss-ring-dur: var(--dur-hero); --ease-out: var(--ease-reveal); }
  .hero-composite-num {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center; gap: 3px;
  }
  .hero-composite-num span {
    /* Serif numerals to match the Fix-List + Tracker signature (product-tokens --serif,
       and the ss-score-ring default). Was Inter 700 - the only sans numeral in the funnel. */
    font-family: var(--serif, 'Instrument Serif', serif); font-variant-numeric: tabular-nums; font-weight: 400;
    font-size: 46px; line-height: 1; letter-spacing: -0.01em; color: var(--ink);
  }
  .hero-composite-num small { font-size: 15px; color: var(--muted); font-weight: 500; position: relative; top: 10px; }
  .hero-composite-label {
    font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
    margin-top: 4px;
  }
  .hero-composite-tier { font-size: 14px; font-weight: 700; color: var(--ink); }
  /* One-line benchmark under the composite ring (JS fills it; empty div renders nothing) */
  .hero-composite-benchmark { font-size: 12px; color: var(--muted); margin-top: 3px; max-width: 200px; }
  /* Phase 3: within-reach projection band. Growth narrative surfaced pre-gate; mirrors the
     Fix-List transformation band (same gradient scale) so the funnel reads as one story. */
  .hero-reach {
    max-width: var(--content-narrow, 720px); margin: 26px auto 0; text-align: center;
    background: var(--paper, #FCFDFF); border: 1px solid var(--line); border-radius: 16px;
    padding: 20px 28px 22px; box-shadow: var(--elev-1, 0 2px 12px rgba(15,23,42,0.05));
  }
  .hero-reach-line { font-size: 15px; color: var(--muted); line-height: 1.5; }
  .hero-reach-line b { color: var(--ink); font-weight: 700; }
  .hero-reach-line .hr-gain {
    color: #0e7490; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap;
  }
  .hero-reach-band {
    position: relative; height: 8px; border-radius: 999px; margin: 14px 0 9px;
    background: linear-gradient(90deg,#F87171 0%,#FB923C 26%,#FCD34D 46%,#34D399 66%,#22D3EE 100%);
  }
  .hrb-pin {
    position: absolute; top: 50%; width: 3px; height: 18px; border-radius: 2px;
    transform: translate(-50%,-50%); box-shadow: 0 0 0 3px var(--paper-2);
  }
  .hrb-pin-now { background: var(--ink); }
  .hrb-pin-target { background: var(--blue, #2F80FF); }
  /* Quick-win marker: quieter than the full-list pin. The CTA offers the fix LIST, so the
     full-list target is the headline promise and the quick win is the proof it starts fast. */
  .hrb-pin-quick { background: var(--ink); opacity: 0.34; height: 13px; }
  /* Moved inside .hero-copy (above the CTA) so the motivation precedes the ask and the
     /100 target stays adjacent to the composite ring. Left-aligned to the copy column
     rather than centred as a full-width summary bar. */
  .hero-copy .hero-reach {
    max-width: none; margin: 18px 0 22px; text-align: left;
  }
  /* One column per band, centred, rather than flex space-between. With space-between the first
     and last labels pin to the ends of the bar and the rest spread evenly between them, so no
     label sits over the band it names: the gradient's five bands are centred at 10/30/50/70/90%
     and space-between would put five labels at 0/25/50/75/100%. A five-column grid puts each
     label over the middle of its own 20-point band. */
  .hero-reach-scale {
    display: grid; grid-template-columns: repeat(5, 1fr); font-size: 10px; letter-spacing: 0.05em;
    text-transform: uppercase; color: var(--dim); font-weight: 700; text-align: center;
    gap: 2px; margin-top: 2px;
  }
  .hero-reach-scale span { line-height: 1.2; }
  /* "Low Visibility" is twice the length of its neighbours; on a narrow column let the scale
     shrink rather than force a two-line row that pushes the caption down. */
  @media (max-width: 420px) {
    .hero-reach-scale { font-size: 8.5px; letter-spacing: 0.02em; }
  }
  .hero-reach-caption { font-size: 12px; color: var(--dim); margin-top: 9px; line-height: 1.45; }
  .hero-copy { min-width: 0; }
  .hero .h1 { margin-bottom: 12px; }
  .hero .h1 em {
    font-style: italic;
    color: var(--blue);
  }
  /* Promoted AI verdict + primary CTA in the hero right column (answer-first). */
  .hero-thesis { margin: 14px 0 18px; }
  .hero-thesis .thesis-card-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin: 0 0 6px; }
  .hero-thesis .thesis-card-body { font-size: 16px; line-height: 1.55; color: var(--ink-soft, var(--ink)); }
  .hero-thesis .thesis-card-body strong { color: var(--ink); font-weight: 700; }
  .hero-cta { display: inline-flex; align-items: center; gap: 8px; background: var(--blue); color: #fff; font-weight: 700; font-size: 15px; padding: 12px 22px; border-radius: 10px; text-decoration: none; transition: filter var(--dur-fast, .15s) ease, transform var(--dur-tap, .1s) ease; }
  .hero-cta:hover { filter: brightness(1.06); }
  .hero-cta:active { transform: translateY(1px); }
  /* Demoted pillars heading: frames the three cards as the composite's decomposition. */
  .pillars-heading { max-width: var(--content); margin: 40px auto 4px; padding: 0 24px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  @media (max-width: 640px) {
    .hero-main { grid-template-columns: 1fr; gap: 20px; justify-items: start; }
    .hero-composite { align-self: center; margin: 0 auto; }
  }

  /* Blue gradient pill on light background, with pulse dot */
  .hero-domain {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--blue);
    background: var(--blue-soft);
    border: 1px solid var(--blue-border);
    border-radius: 100px;
    padding: 6px 16px;
    margin-bottom: 8px;
  }
  .hero-domain::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--blue);
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
  }
  .hero-date {
    font-size: 12px;
    color: var(--dim);
    margin-top: 6px;
  }
  /* Honest free re-scan window + Tracker hand-off (shown only on a cached/return view). */
  .hero-reset {
    font-size: 13px;
    color: var(--muted);
    margin-top: 8px;
    line-height: 1.5;
    max-width: 560px;
  }
  .hero-reset[hidden] { display: none; }
  .hero-reset strong { color: var(--ink); font-weight: 700; }
  .hero-reset a { color: var(--blue); text-decoration: none; font-weight: 600; white-space: nowrap; }
  .hero-reset a:hover { text-decoration: underline; }

  /* ============ SCORE CARDS ============ */
  .scores-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: var(--content);
    margin: 0 auto 40px;
    padding: 0 24px;
  }

  .score-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--elev-1);
    transition: box-shadow 0.2s, transform 0.2s;
  }
  .score-card:hover {
    box-shadow: var(--elev-2);
    transform: translateY(-1px);
  }
  /* Engine identity = icon + label, never colour. The only colour on a card is the
     score ring (one colour system) — no per-discipline coloured top border. */
  .score-card-icon { display: flex; justify-content: center; color: var(--muted); margin-bottom: 10px; }
  .score-card-icon svg { width: 22px; height: 22px; }

  /* Each engine card is an expandable button (opens the category drill-down) */
  .score-card[data-disc] { cursor: pointer; }
  .score-card[data-disc]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
  /* Expanded card gets a clear ring so it's obvious which breakdown is showing */
  .score-card[data-disc][aria-expanded="true"] { box-shadow: 0 0 0 2px var(--blue), 0 6px 24px rgba(6,12,25,0.06); }

  /* One-line benchmark under each pillar ring (JS fills it; empty div renders nothing) */
  .card-benchmark { font-size: 12px; color: var(--muted); margin: 2px 0 6px; }

  /* Pre-click sparkbar: the 2 weakest categories, visible on the collapsed card */
  .card-spark { margin: 4px 0 10px; display: flex; flex-direction: column; gap: 5px; }
  .spark-row { display: flex; align-items: center; gap: 8px; }
  .spark-name { flex: 0 0 auto; width: 92px; text-align: left; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .spark-bar-wrap { flex: 1; height: 5px; border-radius: 3px; background: rgba(6,12,25,0.06); overflow: hidden; }
  .spark-bar { display: block; height: 100%; border-radius: 3px; }
  .spark-more { font-size: 11px; font-weight: 600; color: var(--blue); margin-top: 2px; }

  /* Category drill-down bars */
  /* Per-card inline drawer (replaces the shared #cat-drill). Full-width grid child that
     opens beneath its own row; closed = display:none so it holds no grid cell. */
  .card-drawer { grid-column: 1 / -1; display: none; min-width: 0; }
  .card-drawer.is-open {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.32s ease;
    order: 1; /* fall to the end of the row: 3-up single row, or after the supporting pair */
  }
  .card-drawer.is-open.is-expanded { grid-template-rows: 1fr; }
  .card-drawer-inner {
    overflow: hidden; min-height: 0;
    background: var(--paper); border: 1px solid var(--line);
    border-radius: 16px; padding: 20px 24px;
    box-shadow: 0 4px 20px rgba(6,12,25,0.06);
  }
  .cat-drill-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .cdh-label { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
  .cdh-score { font-family: 'Inter', system-ui, sans-serif; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 22px; line-height: 1; color: var(--ink); }
  .cdh-tier { font-size: 13px; font-weight: 700; color: var(--ink); }
  .cat-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
  .cat-name { flex: 0 0 auto; width: 150px; font-size: 13px; color: var(--ink); }
  .cat-bar-wrap { flex: 1; height: 8px; border-radius: 4px; background: rgba(6,12,25,0.06); position: relative; }
  /* Benchmark reference: 80-mark (matches the Fix-List bars) so each reads against a target. */
  .cat-bar-wrap::after { content: ''; position: absolute; left: 80%; top: -1px; bottom: -1px; width: 0; border-left: 1.5px dashed rgba(6,12,25,0.22); z-index: 1; }
  .cat-bar { display: block; height: 100%; border-radius: 4px; transition: width 0.5s ease; }
  .cat-val { flex: 0 0 auto; width: 28px; text-align: right; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }

  /* Slim results footer — trust cues (brand, Privacy, Terms, Contact, ©) at the email decision */
  .results-footer { margin-top: 56px; background: var(--ink); }
  .results-footer-inner { max-width: var(--content); margin: 0 auto; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; }
  .rf-logo img { height: 22px; width: auto; display: block; }
  .rf-links { display: flex; gap: 22px; }
  .rf-links a { color: rgba(255,255,255,0.72); font-size: 13px; text-decoration: none; }
  .rf-links a:hover { color: #fff; text-decoration: underline; }
  .rf-copy { color: rgba(255,255,255,0.5); font-size: 12px; }
  @media (max-width: 600px) { .results-footer-inner { flex-direction: column; text-align: center; gap: 14px; } }

  .score-card-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--dim);
    margin-bottom: 16px;
  }

  /* Ring chart - lighter background ring on white */
  .ring-wrap { position: relative; width: 100px; height: 100px; margin: 0 auto 12px; }
  .ring-wrap svg { transform: rotate(-90deg); }
  .ring-bg {
    fill: none;
    stroke: rgba(6,12,25,0.08);
    stroke-width: 8;
  }
  .ring-fill {
    fill: none;
    stroke: var(--blue);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 2.5s ease, stroke 0.6s ease;
  }
  .ring-score {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 400;
    font-family: var(--serif, 'Instrument Serif', serif);
    font-variant-numeric: tabular-nums;
    color: var(--ink);
  }

  .score-card-tier {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 100px;
    display: inline-block;
    margin-bottom: 8px;
    border: 1px solid transparent;
  }
  .tier-critical {
    background: var(--red-soft);
    color: #b91c1c;
    border-color: var(--red-border);
  }
  .tier-needs-work {
    background: var(--amber-soft);
    color: #b45309;
    border-color: var(--amber-border);
  }
  /* tier-below-avg removed: collapsed from 6 tiers to 5 canonical bands */
  /* Neutralised off CTA-blue: blue is reserved for calls-to-action only, so the
     tier pill no longer competes with "click me". Reads as a calm status label. */
  .tier-competitive {
    background: var(--paper-2);
    color: var(--ink-soft);
    border-color: var(--line-strong);
  }
  .tier-average {
    background: var(--paper-2);
    color: var(--muted);
    border-color: var(--line-strong);
  }
  .tier-strong {
    background: var(--green-soft);
    color: #047857;
    border-color: var(--green-border);
  }
  /* Top band (AI-Ready/Excellent, 80+) reads cyan, matching Fix-List .tier-top and the
     canonical tiers.js AI-Ready hue. Distinguishes it from Strong (green) below. */
  .tier-excellent {
    background: var(--cyan-soft);
    color: #0e7490;
    border-color: var(--cyan-border);
  }

  .score-card-rank { font-size: 12px; color: var(--dim); }
  .score-card-rank strong { color: var(--muted); font-weight: 600; }

  /* §9.3 'biggest gap' chip. No full-width lead reflow: the weakest engine keeps its
     equal 3-up card and just gets this small inline pill. applyLeadLayout() adds .is-gap
     and injects a .gap-chip node; .scores-grid stays repeat(3, 1fr). */
  .score-card.is-gap { box-shadow: 0 0 0 2px rgba(180,83,9,0.22), 0 6px 24px rgba(6,12,25,0.08); }
  .gap-chip {
    display: inline-flex; align-items: center; gap: 5px;
    margin: 0 0 10px; padding: 3px 10px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
    color: #b45309; background: rgba(180,83,9,0.09);
    border: 1px solid rgba(180,83,9,0.22); border-radius: 999px;
    white-space: nowrap; line-height: 1.4;
  }

  /* ---- Thin audit: fewer than 2 real scores resolved. applyLeadLayout() adds .is-thin
     instead of leaving three 'Unavailable' ring cards. Resolved card(s) stay full; the
     unresolved ones collapse to a slim honest row (label + 'Unavailable' pill). ---- */
  .scores-grid.is-thin { grid-template-columns: 1fr; max-width: 460px; }
  .scores-grid.is-thin .score-card.failed {
    display: flex; align-items: center; gap: 10px;
    text-align: left; padding: 12px 16px; cursor: default;
    opacity: 0.78; box-shadow: none;
  }
  .scores-grid.is-thin .score-card.failed:hover { transform: none; box-shadow: none; }
  .scores-grid.is-thin .score-card.failed .score-card-icon,
  .scores-grid.is-thin .score-card.failed .ring-wrap,
  .scores-grid.is-thin .score-card.failed .card-spark,
  .scores-grid.is-thin .score-card.failed .card-benchmark,
  .scores-grid.is-thin .score-card.failed .card-insight { display: none; }
  .scores-grid.is-thin .score-card.failed .score-card-label {
    margin: 0; flex: 1; font-size: 14px; text-align: left; color: var(--dim);
  }
  .scores-grid.is-thin .score-card.failed [id$="-tier-badge"] { margin: 0; flex-shrink: 0; }

  /* ============ TEASER SECTION ============ */
  .teaser-section {
    max-width: var(--content-narrow);
    margin: 0 auto 32px;
    padding: 0 24px;
  }
  .teaser-box {
    background: var(--paper-2);
    border: 1.5px solid var(--line-strong);
    border-radius: 14px;
    padding: 24px 28px;
  }
  .teaser-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
  .teaser-count { font-family: var(--serif); font-variant-numeric: tabular-nums; font-weight: 400; font-size: 38px; line-height: 1; color: var(--opp-dark); }
  .teaser-head-label { font-size: 14px; color: var(--muted); flex: 1; min-width: 200px; }
  .teaser-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; }
  .teaser-item { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); }
  .teaser-item .ti-flag { color: var(--amber); font-weight: 700; flex-shrink: 0; }
  .teaser-item .ti-label { flex: 1; }
  .teaser-item .ti-label > span { display: block; }
  .teaser-item .ti-consequence { font-weight: 500; }
  .teaser-item .ti-criterion { font-size: 12px; color: var(--muted); margin-top: 1px; }
  .teaser-item.locked { cursor: pointer; }
  .teaser-item .ti-lock { flex-shrink: 0; font-size: 12px; opacity: 0.7; }
  /* Locked fixes: redaction, not a dated blur. color:transparent makes the title text
     literally unrenderable (provably no exposure), replaced by a subtle "classified"
     bar. Premium, and the count + lock + tag still signal "real fixes are gated". */
  .teaser-item .ti-blur { color: transparent; background: linear-gradient(90deg, rgba(6,12,25,0.13), rgba(6,12,25,0.05)); border-radius: 5px; padding: 2px 6px; user-select: none; }
  .teaser-sev { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 12px; font-weight: 600; flex-wrap: wrap; }
  .teaser-sev .sev-high { color: var(--red); }
  .teaser-sev .sev-med { color: var(--amber); }
  .teaser-sev .sev-low { color: var(--dim); }
  .teaser-sev .sev-dot { color: var(--dim); font-weight: 400; }
  .teaser-more { font-size: 13px; color: var(--dim); font-weight: 600; }
  .teaser-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }
  .teaser-tag.geo { background: rgba(20,184,166,0.12); color: #0f766e; }
  .teaser-tag.seo { background: rgba(47,128,255,0.1); color: #1d4ed8; }
  .teaser-tag.cro { background: rgba(124,91,209,0.1); color: var(--purple); }

  /* ── Single revealed highest-impact fix card (reveal-one-fix) ── */
  .teaser-fix-card { list-style: none; background: #fff; border: 1px solid rgba(15,23,42,0.10); border-left: 4px solid var(--purple); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; box-shadow: 0 2px 10px rgba(15,23,42,0.05); }
  .teaser-fix-card .tfc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
  .teaser-fix-card .tfc-rank { font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--purple); }
  .teaser-fix-card .tfc-urgency { font-size: 10px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
  .teaser-fix-card .tfc-urgency.high { background: rgba(220,38,38,0.10); color: #b91c1c; }
  .teaser-fix-card .tfc-urgency.medium { background: rgba(245,158,11,0.12); color: #b45309; }
  .teaser-fix-card .tfc-urgency.low { background: rgba(100,116,139,0.12); color: #475569; }
  .teaser-fix-card .tfc-title { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0 0 12px; line-height: 1.3; }
  .teaser-fix-card .tfc-row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(15,23,42,0.06); }
  .teaser-fix-card .tfc-row:first-of-type { border-top: none; }
  .teaser-fix-card .tfc-key { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
  .teaser-fix-card .tfc-val { font-size: 14px; line-height: 1.5; color: var(--ink); margin: 0; }
  @media (max-width: 520px) { .teaser-fix-card .tfc-row { grid-template-columns: 1fr; gap: 2px; } }
  /* Teaser fix metadata — mirrors the paid fix-list grammar (effort band + time + guide),
     so the free preview reads as the same product. Ported from fixlist-20260818.css §10.3. */
  .teaser-fix-card .tfc-meta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(15,23,42,0.06); }
  .tfc-meta .meta-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
  .tfc-meta .ss-ico { width: 15px; height: 15px; display: inline-block; flex-shrink: 0; }
  .tfc-meta .effort-meter { display: inline-flex; align-items: center; gap: 3px; }
  .tfc-meta .effort-meter i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); display: block; }
  .tfc-meta .effort-meter.lvl-1 i.on { background: var(--green); }
  .tfc-meta .effort-meter.lvl-2 i.on { background: var(--amber); }
  .tfc-meta .effort-meter.lvl-3 i.on { background: var(--red); }
  .tfc-meta .meta-guide { color: var(--blue); text-decoration: none; }
  .tfc-meta .meta-guide .meta-txt { color: var(--blue); }
  .tfc-meta .meta-guide:hover .meta-txt { text-decoration: underline; }
  /* Compact effort+time cue on a locked (redacted) row — quick/doable signal, no title exposed. */
  .teaser-item .ti-meta { flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
  @media (max-width: 480px) { .teaser-item .ti-meta { display: none; } }
  .teaser-unlock-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--purple); color: #fff; border: none; border-radius: 10px; padding: 11px 20px; font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer; transition: transform 0.15s, filter 0.15s; }
  .teaser-unlock-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }

  /* ---- In-place teaser capture (replaces the scroll-jump unlock button) ----
     Same purple CTA as the button it supersedes, so the moment of peak intent keeps
     its visual weight; the input is the only new affordance. Stacks on narrow
     viewports because a 2-up email field is unusable under ~420px. */
  .teaser-capture { display: flex; flex-direction: column; align-items: center; gap: 8px; }
  .tcap-form { display: flex; gap: 8px; width: 100%; max-width: 440px; }
  .tcap-input {
    flex: 1 1 auto; min-width: 0; padding: 11px 14px; font-size: 14px; font-family: inherit;
    color: var(--ink); background: var(--paper); border: 1px solid var(--line);
    border-radius: 10px; transition: border-color 0.15s, box-shadow 0.15s;
  }
  .tcap-input::placeholder { color: var(--dim); }
  .tcap-input:focus {
    outline: none; border-color: var(--purple);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 22%, transparent);
  }
  .tcap-btn {
    display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
    background: var(--purple); color: #fff; border: none; border-radius: 10px;
    padding: 11px 20px; font-size: 14px; font-weight: 700; font-family: inherit;
    cursor: pointer; white-space: nowrap; transition: transform 0.15s, filter 0.15s;
  }
  .tcap-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
  .tcap-btn:disabled { opacity: 0.65; cursor: default; }
  .tcap-micro { margin: 0; font-size: 12.5px; color: var(--muted); }
  .tcap-error { display: none; margin: 0; font-size: 13px; color: var(--red); text-align: center; }
  @media (prefers-reduced-motion: reduce) {
    .tcap-btn, .teaser-unlock-btn { transition: none; }
    .tcap-btn:hover:not(:disabled), .teaser-unlock-btn:hover { transform: none; }
  }
  @media (max-width: 460px) {
    .tcap-form { flex-direction: column; }
    .tcap-btn { justify-content: center; }
  }

  /* ============ DIVIDER ============ */
  .divider {
    max-width: var(--content-narrow);
    margin: 0 auto 32px;
    padding: 0 24px;
  }
  .divider hr {
    border: none;
    border-top: 1px solid var(--line);
  }

  /* ============ THESIS CARD ============ */
  .thesis-card-wrap {
    max-width: var(--content-narrow);
    margin: 0 auto 32px;
    padding: 0 24px;
  }
  .thesis-card-inner {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px 28px;
    box-shadow: 0 1px 3px rgba(6,12,25,0.04);
  }
  .thesis-card-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--dim);
    margin-bottom: 12px;
  }
  .thesis-card-body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--muted);
  }
  .thesis-card-body strong { color: var(--ink); font-weight: 700; }

  /* ============ EMAIL GATE ============ */
  .email-gate {
    max-width: 940px;
    margin: 0 auto 40px;
    padding: 0 24px;
  }
  .email-gate-box {
    display: flex;
    align-items: center;
    gap: 34px;
    background: var(--paper-2);
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    padding: 32px 34px;
    text-align: left;
    box-shadow: 0 1px 3px rgba(6,12,25,0.04);
  }
  .gate-ask { flex: 1 1 52%; min-width: 0; }
  .gate-preview { flex: 0 0 42%; min-width: 0; position: relative; }

  /* Personalised "sealed report" preview - makes the deliverable tangible right at the ask.
     Fix rows are redacted bars ONLY (no title text ever enters the DOM = provably no leak),
     the same discipline as the teaser findings-ledger. Header carries the real scores + count. */
  .gate-preview::before, .gate-preview::after {
    content: ''; position: absolute; inset: 0; border-radius: 12px;
    background: #fff; border: 1px solid var(--line); z-index: 0;
  }
  .gate-preview::before { transform: rotate(-2.2deg) translateY(5px); opacity: 0.5; }
  .gate-preview::after  { transform: rotate(1.6deg) translateY(3px); opacity: 0.7; }
  .gp-doc {
    position: relative; z-index: 1;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 16px 16px 0;
    box-shadow: 0 10px 30px rgba(6,12,25,0.10), 0 2px 6px rgba(6,12,25,0.05);
    overflow: hidden;
  }
  .gp-doc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
  .gp-doc-title { font-family: 'Instrument Serif', serif; font-size: 17px; color: var(--ink); line-height: 1; }
  .gp-doc-domain { font-size: 11.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46%; }
  .gp-scores { display: flex; gap: 8px; margin: 13px 0 12px; }
  .gp-score { flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 9px; padding: 7px 4px; }
  .gp-s-num { font-family: 'Instrument Serif', serif; font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
  .gp-s-lab { display: block; font-size: 9px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
  .gp-count { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
  .gp-rows { list-style: none; margin: 0; padding: 0 0 48px; display: flex; flex-direction: column; gap: 9px; }
  .gp-row { display: flex; align-items: center; gap: 9px; }
  .gp-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
  .gp-bar { height: 9px; border-radius: 5px; background: linear-gradient(90deg, rgba(6,12,25,0.13), rgba(6,12,25,0.05)); }
  .gp-tag { margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; flex-shrink: 0; }
  .gp-tag.geo { color: #0e7490; background: rgba(34,211,238,0.14); }
  .gp-tag.seo { color: #047857; background: rgba(16,185,129,0.14); }
  .gp-tag.cro { color: #6d28d9; background: rgba(124,58,237,0.14); }
  .gp-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 66px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 13px; background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 60%); }
  .gp-more { font-size: 11.5px; font-weight: 700; color: var(--blue); }
  @media (max-width: 780px) {
    .email-gate-box { flex-direction: column; gap: 26px; }
    .gate-preview, .gate-ask { flex: 1 1 auto; width: 100%; }
    .gate-preview::before, .gate-preview::after { display: none; }
    .gate-form { max-width: none; }
  }
  .gate-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: var(--red-soft);
    color: #b91c1c;
    border: 1px solid var(--red-border);
    border-radius: 100px;
    padding: 5px 14px;
    margin-bottom: 16px;
  }
  /* The nav is position:sticky;top:0 at 64px tall, so an anchor jump to the gate put
     its "N fixes ready to unlock" badge underneath the header. Offset the scroll
     target by the nav height plus a little breathing room. */
  #email-gate-section { scroll-margin-top: 80px; }
  .gate-title {
    font-family: 'Instrument Serif', serif;
    font-size: 30px;
    margin-bottom: 8px;
    line-height: 1.2;
    color: var(--ink);
    font-weight: 400;
  }
  .gate-title em {
    font-style: italic;
    color: var(--blue);
  }
  .gate-sub {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 24px;
    line-height: 1.6;
  }

  /* Verified social proof at the email gate (real FileSeal result — never fabricated) */
  .gate-proof {
    max-width: none;
    margin: 0 0 20px;
    padding: 13px 16px;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    text-align: left;
    font-size: 13px;
    line-height: 1.5;
  }
  .gate-proof-stat { display: block; font-weight: 700; color: #047857; margin-bottom: 3px; }
  .gate-proof-text { color: var(--muted); }
  .gate-proof-text a { color: var(--blue); font-weight: 600; text-decoration: none; white-space: nowrap; }
  .gate-proof-text a:hover { text-decoration: underline; }

  .gate-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: none;
    margin: 0 0 14px;
  }
  .gate-input {
    flex: 1;
    background: white;
    border: 1.5px solid var(--line-strong);
    color: var(--ink);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .gate-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-soft);
    outline: none;
  }
  .gate-input::placeholder { color: var(--dim); }
  .gate-btn {
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 13px 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: filter 0.2s, transform 0.1s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(47,128,255,0.25);
  }
  .gate-btn:hover {
    filter: brightness(1.06);
    box-shadow: 0 4px 12px rgba(47,128,255,0.3);
  }
  .gate-btn:active { transform: scale(0.98); }
  .gate-btn:disabled { opacity: 0.6; cursor: not-allowed; }

  .gate-trust {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    flex-wrap: wrap;
  }
  .gate-trust span {
    font-size: 12px;
    color: var(--dim);
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .gate-trust span::before {
    content: '✓';
    color: var(--green);
    font-weight: 700;
  }

  .gate-error {
    font-size: 13px;
    color: var(--red);
    margin-top: 8px;
    display: none;
  }

  /* ============ FOOTER ============ */
  .footer {
    background: var(--ink);
    color: rgba(255,255,255,0.7);
    padding: 56px 24px 32px;
    margin-top: 56px;
  }
  .footer-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
  }
  .footer-brand-block p {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255,255,255,0.6);
    margin: 14px 0 6px;
    max-width: 320px;
  }
  .footer-logo img {
    height: 24px;
    width: auto;
  }
  .footer-col h5 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-bottom: 14px;
  }
  .footer-col ul {
    list-style: none;
  }
  .footer-col li { margin-bottom: 8px; }
  .footer-col a {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    transition: color 0.15s;
  }
  .footer-col a:hover { color: #fff; }
  .footer-featured {
    max-width: 1100px;
    margin: 0 auto 24px;
  }
  .footer-featured-label {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  .footer-featured-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
  }
  .footer-featured-row a {
    display: inline-block;
    opacity: 0.6;
    transition: opacity 0.2s;
  }
  .footer-featured-row a:hover { opacity: 1; }
  .footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
  }
  .footer-bottom a {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    transition: color 0.15s;
  }
  .footer-bottom a:hover { color: #fff; }
  .footer-bottom-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
  }

  @media (max-width: 768px) {
    .footer-grid {
      grid-template-columns: 1fr 1fr;
      gap: 28px;
    }
    .footer-brand-block {
      grid-column: 1 / -1;
    }
  }

  /* ============ LOADING / ERROR STATES ============ */
  .loading-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* 100vh (was 60vh) so the loading screen holds a full viewport and the footer
       starts BELOW the fold. At 60vh the footer sat at ~842px (right at the viewport
       edge, in view), then shifted when #results-page swapped in ~7.5s post-scan =
       CLS 0.116 (over the 0.1 line). A full-viewport reservation moves that footer
       shift off-screen, where it no longer counts. Matches the /fix-list fix. */
    min-height: 100vh;
    text-align: center;
    padding: 40px;
  }
  .loading-title {
    font-family: 'Instrument Serif', serif;
    font-size: 26px;
    margin-bottom: 8px;
    color: var(--ink);
    font-weight: 400;
  }
  .loading-sub {
    font-size: 14px;
    color: var(--muted);
    max-width: 400px;
    line-height: 1.6;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ---- Loading -> results cross-dissolve (revealOnce) ---- */
  #results-page { transition: opacity 0.4s ease; }
  #results-page.is-entering { opacity: 0; }
  #loading-state { transition: opacity 0.32s ease; }
  #loading-state.is-dissolving {
    position: fixed; inset: 0; z-index: 5;
    opacity: 0; pointer-events: none;
    display: flex; /* preserve the flex-centred layout of .loading-page while floating */
  }
  @media (prefers-reduced-motion: reduce) {
    #results-page, #loading-state { transition: none; }
    #results-page.is-entering { opacity: 1; }
  }

  /* ============ SCAN CHECKLIST (narrated loading) ============ */
  .scan-checklist { display:flex; flex-direction:column; gap:10px; width:100%; max-width:380px; margin:14px auto 0; text-align:left; }
  .scan-step { display:flex; align-items:flex-start; gap:12px; padding:10px 14px; border-radius:10px; background:var(--paper-2); border:1px solid var(--line); transition:background .25s ease, border-color .25s ease, opacity .25s ease; }
  .scan-step.is-pending { opacity:.55; }
  .scan-step.is-active  { border-color:var(--blue-border); background:var(--blue-soft); }
  .scan-step.is-done    { border-color:var(--green-border); background:var(--green-soft); }
  .scan-step.is-failed  { border-color:var(--line-strong); background:var(--paper-2); opacity:.7; }
  .scan-check { flex-shrink:0; width:20px; height:20px; margin-top:1px; border-radius:50%; position:relative; box-sizing:border-box; border:2px solid var(--line-strong); }
  .scan-step.is-active .scan-check { border:2px solid rgba(47,128,255,.25); border-top-color:var(--blue); animation:spin .8s linear infinite; }
  .scan-step.is-done .scan-check { border-color:var(--green); background:var(--green); animation:scanCheckIn .2s ease-out; }
  .scan-step.is-done .scan-check::after { content:''; position:absolute; left:6px; top:2.5px; width:5px; height:9px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg); }
  .scan-step.is-failed .scan-check { border-color:var(--amber); background:transparent; }
  .scan-step.is-failed .scan-check::after { content:'!'; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; color:var(--amber); }
  @keyframes scanCheckIn { from { transform:scale(.4); opacity:0; } to { transform:scale(1); opacity:1; } }
  .scan-body { display:flex; flex-direction:column; gap:2px; flex:1; min-width:0; }
  .scan-title { font-size:14px; font-weight:600; color:var(--ink); }
  .scan-sub, .scan-detail { font-size:12px; line-height:1.45; color:var(--dim); transition:opacity .25s ease; }
  .scan-detail { display:none; color:var(--purple); font-weight:500; }
  .scan-step.is-active[data-disc="cro"] .scan-detail { display:block; }
  .scan-step.is-done .scan-sub, .scan-step.is-failed .scan-sub { color: var(--dim); } /* de-emphasise via state bg, not opacity, to keep AA contrast */
  .scan-score { flex-shrink:0; font-family:'Inter', system-ui, sans-serif; font-variant-numeric:tabular-nums; font-weight:700; font-size:20px; line-height:1; color:var(--ink); opacity:0; transform:translateY(4px); transition:opacity .25s ease, transform .25s ease; }
  .scan-step.is-done .scan-score { opacity:1; transform:translateY(0); }
  .rescan-banner.has-checklist { display:block; padding:14px 16px; }
  .rescan-banner.has-checklist .scan-checklist { max-width:none; margin:0; }
  @media (prefers-reduced-motion: reduce) {
    .scan-step.is-active .scan-check { animation:none; border-top-color:var(--blue); }
    .scan-step.is-done .scan-check { animation:none; }
    .scan-score, .scan-sub, .scan-detail, .scan-step { transition:none; }
    .card-drawer.is-open { transition: none; }
  }

  .error-page {
    max-width: 500px;
    margin: 0 auto;
    padding: 80px 24px;
    text-align: center;
  }
  .error-icon { font-size: 48px; margin-bottom: 16px; }
  .error-title {
    font-family: 'Instrument Serif', serif;
    font-size: 30px;
    margin-bottom: 12px;
    color: var(--ink);
    font-weight: 400;
  }
  .error-body {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 24px;
  }
  .error-body a { color: var(--blue); font-weight: 600; }
  .error-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--blue);
    color: #fff;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(47,128,255,0.25);
    transition: filter 0.15s, transform 0.1s;
  }
  .error-btn:hover { filter: brightness(1.06); }
  .error-btn:active { transform: scale(0.98); }

  /* Retry-in-place on the failure page. Deliberately quieter than .error-btn is loud: the
     retry is the primary action here, so it sits ABOVE the "run new audit" link and the link
     is what recedes. --action-blue, not --blue: white on #2F80FF is 3.72:1 and fails AA. */
  .error-retry { margin: 0 0 20px; text-align: left; }
  .error-retry-label {
    display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
  }
  .error-retry-row { display: flex; gap: 8px; }
  .error-retry-row input {
    flex: 1 1 auto; min-width: 0; font: inherit; font-size: 15px; padding: 11px 13px;
    border: 1px solid var(--line-strong, #cbd5e1); border-radius: 9px; background: #fff;
    color: var(--ink); font-family: inherit;
  }
  .error-retry-row input:focus-visible {
    outline: 2px solid var(--action-blue, #286CD8); outline-offset: 1px; border-color: transparent;
  }
  .error-retry-btn {
    flex: 0 0 auto; background: var(--action-blue, #286CD8); color: #fff; border: 0;
    border-radius: 9px; padding: 0 18px; font: inherit; font-size: 14px; font-weight: 700;
    cursor: pointer; white-space: nowrap; transition: background .15s, transform .1s, box-shadow .1s;
  }
  .error-retry-btn:hover { background: var(--blue-dark, #1e5fcc); }
  .error-retry-btn:active {
    background: var(--action-blue-pressed, #1F54A8); transform: translateY(1px) scale(.985);
    box-shadow: inset 0 2px 6px rgba(6,12,25,.32); transition-duration: .06s;
  }
  @media (prefers-reduced-motion: reduce) { .error-retry-btn:active { transform: none; } }
  .error-suggest { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
  .error-suggest button {
    background: none; border: 0; padding: 0; font: inherit; font-weight: 700; cursor: pointer;
    color: var(--action-blue, #286CD8); text-decoration: underline; text-underline-offset: 2px;
  }
  @media (max-width: 420px) {
    .error-retry-row { flex-direction: column; }
    .error-retry-btn { padding: 12px 18px; }
  }

  /* CRO issues - visually hidden but present in DOM for accessibility */
  .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;
  }

  /* ============ EXIT POPUP (injected by JS) ============ */
  .exit-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(6,12,25,0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .exit-overlay.visible { opacity: 1; pointer-events: auto; }
  .exit-popup {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 36px 32px 28px;
    max-width: 500px;
    width: 94%;
    text-align: center;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 24px 64px rgba(6,12,25,0.18);
  }
  .exit-overlay.visible .exit-popup { transform: translateY(0) scale(1); }
  .exit-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 100px;
    margin-bottom: 20px;
    border: 1px solid transparent;
  }
  .exit-badge.critical {
    background: var(--red-soft);
    color: #b91c1c;
    border-color: var(--red-border);
  }
  .exit-badge.needs-work {
    background: var(--amber-soft);
    color: #b45309;
    border-color: var(--amber-border);
  }
  .exit-badge.room {
    background: var(--green-soft);
    color: #047857;
    border-color: var(--green-border);
  }
  .exit-scores-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
  }
  .exit-score-pill {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 16px;
    min-width: 100px;
  }
  .exit-score-pill.active {
    border-color: var(--red-border);
    background: var(--red-soft);
  }
  .exit-pill-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--dim);
    margin-bottom: 4px;
  }
  .exit-pill-score {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    font-family: 'Inter', system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
  }
  .exit-pill-score.low { color: var(--red); }
  .exit-pill-score.mid { color: var(--amber); }
  .exit-pill-score.high { color: var(--green); }
  .exit-pill-tag {
    font-size: 9px;
    color: var(--dim);
    margin-top: 2px;
  }
  .exit-headline {
    font-family: 'Instrument Serif', serif;
    font-size: 24px;
    line-height: 1.3;
    margin-bottom: 6px;
    color: var(--ink);
    font-weight: 400;
  }
  .exit-body {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 24px;
  }
  .exit-domain { color: var(--blue); font-weight: 600; }
  .exit-count { color: var(--red); font-weight: 700; }
  .exit-form {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    max-width: 100%;
    box-sizing: border-box;
  }
  .exit-email-input {
    flex: 1;
    background: var(--paper);
    border: 1px solid var(--line-strong);
    color: var(--ink);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .exit-email-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-soft);
    outline: none;
  }
  .exit-email-input::placeholder { color: var(--dim); }
  .exit-cta-btn {
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: filter 0.15s, transform 0.1s, box-shadow 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(47,128,255,0.25);
  }
  .exit-cta-btn:hover { filter: brightness(1.06); }
  .exit-cta-btn:active { transform: scale(0.98); }
  .exit-cta-btn:disabled { opacity: 0.6; cursor: not-allowed; }
  .exit-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: exitSpin 600ms linear infinite;
    vertical-align: middle;
    margin-right: 6px;
  }
  @keyframes exitSpin { to { transform: rotate(360deg); } }
  .exit-error {
    font-size: 12px;
    color: var(--red);
    margin-bottom: 8px;
    display: none;
  }
  .exit-trust {
    font-size: 11px;
    color: var(--dim);
    margin-bottom: 16px;
  }
  .exit-trust span { margin: 0 6px; }
  .exit-dismiss {
    font-size: 12px;
    color: var(--dim);
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    transition: color 0.15s;
  }
  .exit-dismiss:hover { color: var(--muted); }

  @media (max-width: 640px) {
    .exit-overlay { align-items: flex-end; }
    .exit-popup {
      border-radius: 20px 20px 0 0;
      max-width: 100%;
      width: 100%;
      padding: 28px 20px 24px;
    }
    .exit-form { flex-direction: column; }
    .exit-cta-btn { width: 100%; text-align: center; }
    .exit-score-pill { min-width: 80px; padding: 10px 10px; }
    .exit-pill-score { font-size: 22px; }
    .exit-headline { font-size: 22px; }
    .exit-scores-row { gap: 8px; }
  }

  /* Animations */
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .fade-up { animation: fadeUp 0.5s ease forwards; }

  /* Skeleton cards - shimmer */
  .score-card.skeleton {
    animation: none !important;
    opacity: 1;
    position: relative;
  }
  .score-card.skeleton .ring-wrap {
    opacity: 1;
  }
  .score-card.skeleton .ring-score {
    color: transparent;
    position: relative;
  }
  .score-card.skeleton .ring-score::after {
    content: '';
    position: absolute;
    inset: 8px 12px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper-3) 50%, var(--paper-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
  }
  .score-card.skeleton .score-card-tier {
    visibility: hidden;
    position: relative;
    min-width: 80px;
    min-height: 22px;
    display: inline-block;
  }
  .score-card.skeleton .score-card-tier::after {
    content: '';
    visibility: visible;
    position: absolute;
    inset: 2px 0;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper-3) 50%, var(--paper-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
  }
  .score-card.skeleton .score-card-label {
    opacity: 0.5;
  }
  .score-card.skeleton .ring-fill {
    stroke: transparent !important;
  }
  @keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }
  .score-card { transition: opacity 0.4s ease; }
  .score-card.visible { opacity: 1; }

  /* Hero loading state */
  #hero-h1 {
    transition: opacity 0.5s ease, max-height 0.5s ease;
    overflow: hidden;
  }
  #hero-h1.loading {
    opacity: 0;
    max-height: 0;
    margin: 0;
  }

  /* Card insight */
  .card-insight {
    font-size: 13px;
    color: var(--dim);
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    animation: fadeIn 0.3s ease;
  }

  /* Skeleton category bars */
  .cat-skeleton {
    margin-top: 12px;
  }
  .cat-skeleton-row {
    display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
  }
  .cat-skeleton-label {
    width: 80px; height: 10px; border-radius: 4px;
    background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper-3) 50%, var(--paper-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
  }
  .cat-skeleton-bar {
    flex: 1; height: 6px; border-radius: 3px;
    background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper-3) 50%, var(--paper-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
  }
  .cat-skeleton-pct {
    width: 24px; height: 10px; border-radius: 4px;
    background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper-3) 50%, var(--paper-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
  }

  /* Score failed state */
  .score-card.failed .ring-score {
    color: var(--dim);
  }
  .score-card.failed .score-card-label {
    opacity: 0.5;
  }

  /* Audit banner */
  .rescan-banner {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-radius: 8px;
    background: rgba(47,128,255,0.08); border: 1px solid rgba(47,128,255,0.15);
    font-size: 13px; color: var(--blue); font-weight: 500;
    margin-bottom: 16px;
    max-height: 50px; overflow: hidden;
    transition: max-height 0.3s ease, margin 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
  }
  .scores-grid .rescan-banner {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    max-height: none;
  }
  .audit-status { font-weight: 600; }
  .audit-status-note { color: var(--dim); font-weight: 400; }
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-radius: 8px;
    background: rgba(47,128,255,0.08); border: 1px solid rgba(47,128,255,0.15);
    font-size: 13px; color: var(--blue); font-weight: 500;
    margin-bottom: 16px;
    max-height: 50px; overflow: hidden;
    transition: max-height 0.3s ease, margin 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
  }
  .rescan-banner.hidden {
    max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0;
    opacity: 0; border-width: 0;
  }
  .spinner-sm {
    width: 14px; height: 14px; border: 2px solid rgba(47,128,255,0.2);
    border-top-color: var(--blue); border-radius: 50%;
    animation: spin 0.8s linear infinite; flex-shrink: 0;
  }

  /* Mobile */
  @media (max-width: 640px) {
    .scores-grid { grid-template-columns: 1fr; gap: 12px; }
    .card-drawer.is-open { order: 0; }
    .score-card { padding: 20px 16px; }
    .gate-row { flex-direction: column; }
    .gate-title { font-size: 24px; }
    .cat-name { width: 120px; min-width: 120px; font-size: 12px; }
    .hero { padding: 40px 20px 28px; }
  }

  /* Skip link */
  .skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }
  .skip-link:focus {
    position: fixed;
    top: 12px;
    left: 12px;
    width: auto;
    height: auto;
    padding: 10px 16px;
    background: var(--ink);
    color: #fff;
    border-radius: 8px;
    z-index: 1000;
  }
