/* Same fonts as the landing page: Helvetica (system) for everything,
   Ballinger Mono for eyebrows and labels, and Ballinger X Condensed for
   the module names on the diagnosis card only. */
@font-face{font-family:ballinger-mono;src:url("../assets/fonts/ballinger-mono.woff2") format("woff2");font-display:swap;font-style:normal;font-weight:400;font-stretch:100%}
@font-face{font-family:ballinger-x-condensed;src:url("../assets/fonts/ballinger-x-condensed.woff2") format("woff2");font-display:swap;font-style:normal;font-weight:800;font-stretch:100%}
  :root {
    --bt-black: #000000;
    --bt-white: #FFFFFF;
    --bt-grey: #8E8E8E;
    --bt-grey-dark: #2A2A2A;
    /* Decoration vs. touchable, at a glance: --bt-grey-dark hairlines are
       never interactive, --bt-grey-mid is the one grey used on an
       interactive boundary at rest (the gate's input underlines), a full
       step up so it clears WCAG 1.4.11's 3:1 for UI components (3.24:1). */
    --bt-grey-mid: #5E5E5E;
    --bt-dim: #757575;
    /* Everything else on the page is sharp-cornered, per the design system.
       The card is the deliberate exception, a standalone object, not the seed
       of a new shape language the rest of the UI should pick up. */
    --bt-surface: #141414;
    /* --bt-dim measures 4.56:1 against pure black, which just clears AA. On
       the card's slightly lighter --bt-surface that same value drops below
       AA. This is the one grey tuned for --bt-surface instead: 4.66:1 there. */
    --bt-dim-card: #808080;
    --bt-mirror: #E2544A;
    --bt-field: #6BD96E;
    --bt-room: #E07828;
    --bt-future: #4C6EF5;
    /* Module names on the diagnosis card only: the logo face, as an exception. */
    --module: 'ballinger-x-condensed', 'Helvetica Neue Condensed', 'Arial Narrow', Arial, sans-serif;
    --mono: 'ballinger-mono', 'SF Mono', Menlo, monospace;
    --body: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    /* Ported from the landing page's own token (styles.css), where the
       chrome bar's own focus ring and hover states already reference it -
       tokenised here too rather than left as the bare hex the ported
       .btn-primary:hover/.chrome .btn rules below already hardcoded. */
    --red: #F1393A;
    /* Same value as styles.css's --radius-sm: the nav pill this funnel
       ports value-for-value was writing 6px as a bare literal on both
       surfaces - named here now too. */
    --radius-sm: 6px;

    /* Same nine-step scale as the landing page (see DESIGN.md and
       styles.css) - one product, one spacing system. See
       tools/lint-tokens.js for the enforcement. */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 24px;
    --sp-6: 32px;
    --sp-7: 48px;
    --sp-8: 64px;
    --sp-9: 96px;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body { background: var(--bt-black); }
  body {
    font-family: var(--body);
    color: var(--bt-white);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    /* Permanently dark, unlike the landing page (which flips per
       section) - so this is a flat declaration, not a per-theme one.
       Without it the UA assumes a light form-control palette: Chrome
       painted the gate's autofilled inputs light-blue-on-dark-blue over
       this page's black card, and the document scrollbar stayed light
       on a black page. */
    color-scheme: dark;
  }
  ::selection { background: var(--bt-mirror); color: var(--bt-white); }
  button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
  button, .screen, a.blockbtn, #talk-link {
    -webkit-user-select: none; user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  button:focus-visible, a:focus-visible, input:focus-visible {
    outline: 2px solid var(--bt-white);
    outline-offset: 4px;
  }
  /* Headings are focused programmatically to carry the reading position across
     screens. They are not interactive, so they take no ring. */
  .stem:focus, h1:focus { outline: none; }
  a { color: inherit; }

  /* 11px snapped to 12px (DESIGN.md's "label" role floor) - this is the
     shared base for every mono label on this surface (see the selectors
     below that use it directly, and the several more that redeclare the
     same three properties by hand instead of the class - fixed there
     too, same value, for the same reason). */
  .mono {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }

  /* ---- chrome bar (the landing page's, ported) ----
     The client asked for the landing page's frosted nav bar here so the two
     products read as one. This DELIBERATELY overrides the Bible's section 13
     banned list (gradient highlight) for this one element.
     Originally a floating rounded pill (15 Sep 2026 client decision); the
     client revised that on 21 Sep 2026 to edge-to-edge and flush with the
     top - border-radius, side/top border and the floating drop shadow are
     gone, replaced with a single bottom hairline. Same revision as the
     landing page's .chrome, mirrored here.
     Everything else on the page keeps the sharp-cornered, shadowless
     system. Values are the landing page's .chrome / .glass / .btn rules,
     dark theme only (the funnel has no light sections, so none of the
     paper-theme or chrome-on-light logic comes across). It sits under
     #grain (z 50) so the grain texture covers it like everything else. */
  .chrome {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    display: flex; align-items: center; justify-content: space-between;
    min-height: 50px;
    padding: env(safe-area-inset-top, 0) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    isolation: isolate; overflow: hidden;
    background: rgba(255, 255, 255, .04);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    backdrop-filter: blur(16px) saturate(180%);
    border: 0;
    border-radius: 0;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .14);
  }
  /* The soft highlight catching the top-left edge - what reads as glass
     rather than a blurred panel. Behind the content, in front of the blur. */
  .chrome::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
      radial-gradient(circle at 18% 0%, rgba(255, 255, 255, .30), transparent 38%),
      linear-gradient(115deg, rgba(255, 255, 255, .14), transparent 46%);
  }
  @media (prefers-reduced-transparency: reduce) {
    .chrome { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bt-black); }
    .chrome::before { display: none; }
  }
  /* The wordmark image is 15px tall, which is a fiddly touch target in a
     50px bar. The ::after overlay takes the bar's full height for tapping
     without changing the anchor's own box - the bar is overflow:hidden, so
     a full-height anchor would have its focus ring clipped away. Same
     recipe as the landing page's .chrome .mark. */
  .chrome .mark { display: flex; align-items: center; position: relative; }
  .chrome .mark::after { content: ""; position: absolute; inset: -18px -6px; }
  .wordmark-logo { height: 15px; width: auto; display: block; flex: 0 0 auto; }
  .chrome-actions { display: flex; align-items: center; gap: var(--sp-2); margin-right: -8px; }
  .btn {
    display: inline-flex; align-items: center; justify-content: center;
    /* Same scale as the landing page's chrome bar (see there): sentence
       case, 13px in a 38px pill, Medium rather than tracked-out caps.
       38x58 clears WCAG 2.2 SC 2.5.8 (24x24, AA); short of the 44x44 in
       SC 2.5.5 (AAA) is a deliberate trade for the compact bar, same
       call as the landing page's identical rule. */
    min-height: 38px; padding: var(--sp-2) var(--sp-4);
    font-family: var(--body); font-size: 14px; font-weight: 500;
    text-decoration: none;
    border: 0; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .1s ease;
  }
  .btn:active { transform: translateY(1px) scale(.985); }
  .btn-primary { background: #3D3B36; color: #F5F4F2; border: 1px solid rgba(255, 255, 255, .12); }
  /* White text measures 10.18:1 against the charcoal rest state but only
     3.55:1 against this red - fails AA. #000000 clears 5.39:1, matching
     .blockbtn:hover and .intro-cta:hover below. :not(:disabled) so a
     disabled "Sending..." button never picks up a hover fill it cannot
     act on. */
  .btn-primary:not(:disabled):hover { background: #F1393A; border-color: transparent; color: #000000; }
  .chrome-quiet { background: none; border: 1px solid rgba(255, 255, 255, .5); color: var(--bt-white); }
  .chrome-quiet:hover { border-color: #F1393A; color: #F1393A; }
  /* The one focus ring on this page scoped to red rather than the
     funnel's own white (see the base button/a/input rule above): this
     specific bar is shared, value-for-value, with the landing page's
     nav (see the comment on .btn above), so its ring should read as the
     same control, not a differently-themed one. Nothing else on this
     page's ring changes - the funnel's own white ring is the deliberate
     baseline everywhere else. */
  .chrome .btn:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
  .chrome-short { display: none; }
  /* 560px, not 640: this is the landing page's own component, ported -
     the two surfaces were swapping labels at different widths for one
     shared control. Landing is canonical (see the comment above this
     block). */
  @media (max-width: 560px) {
    .chrome .btn { padding: var(--sp-2) var(--sp-3); font-size: 14px; }
    .chrome-long { display: none; }
    .chrome-short { display: inline; }
  }
  #back {
    position: fixed; bottom: 0; left: 0; z-index: 40;
    padding: 16px var(--sp-6) calc(16px + env(safe-area-inset-bottom, 8px));
    font-family: var(--body); font-size: 14px; letter-spacing: normal; text-transform: none;
    /* Handover specifies 40 percent, which measures 3.66:1 and fails AA on the
       only control that can correct an answer. 55 percent is the nearest value
       that passes. Revert to 0.4 if the design would rather take the hit. */
    opacity: 0.55; color: var(--bt-white); display: none;
  }
  #back:hover, #back:focus-visible { opacity: 1; }

  #rule {
    position: fixed; bottom: 0; left: 0; height: 2px; width: 100%;
    background: var(--bt-grey); z-index: 30;
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.4s ease, background 0.4s ease, opacity 0.3s ease;
    opacity: 0;
  }
  #sweep {
    position: fixed; bottom: 0; left: 0; height: 2px; width: 100%;
    background: rgba(255, 255, 255, 0.75); z-index: 31;
    transform: scaleX(0); transform-origin: left;
  }

  #grain {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0;
    z-index: 50; pointer-events: none; opacity: 0.04;
  }

  /* ---- funnel stage ---- */
  #stage {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
  }
  .screen {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0;
    display: flex; flex-direction: column;
    overflow-y: auto; /* short viewports scroll instead of clipping */
    -webkit-overflow-scrolling: touch;
    padding: var(--sp-8) 24px calc(var(--sp-8) + env(safe-area-inset-bottom, 0px));
  }
  /* margin auto rather than justify-content: center, which clips overflow at the top */
  .screen > .inner { width: 100%; max-width: 680px; margin: auto; }

  /* The module chapter label. Sits above the position counter, in the
     question's own accent colour (set per-screen on .screen, see
     makeQuestion) so the four phases are named as well as felt. */
  .chapter-label {
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--accent, var(--bt-grey));
    margin-bottom: var(--sp-3);
  }

  /* Question counter. Text stays white or grey throughout; colour is
     reserved for UI elements (bars, squares, the hover/selected hairline),
     never for copy - the chapter label above carries the accent instead. */
  .qcount {
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em;
    color: var(--bt-dim); margin-bottom: var(--sp-5);
    font-variant-numeric: tabular-nums;
  }
  .qcount b {
    display: inline-block;
    color: var(--bt-white); font-weight: 400;
    animation: qcount-tick 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) 200ms backwards;
  }
  @keyframes qcount-tick {
    from { transform: translateY(-6px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

  .stem {
    font-size: clamp(23px, 3.1vw, 34px);
    font-weight: 400; line-height: 1.28; letter-spacing: -0.018em;
    max-width: 600px; margin-bottom: var(--sp-7); text-wrap: balance;
  }

  /* "Pick the closest" is an instruction FOR the options below it, so it
     belongs to them, not to the stem above - the reverse of what shipped
     (16px to the stem, 24px to the options: closer to the wrong thing).
     Sits inside .stem's own bottom margin (negative margin-top reclaims
     part of it) rather than adding to it, so a question screen's total
     stem-to-options run stays close to what it was without touching
     .stem itself - the role screen also uses .stem and gets no prompt
     line, so .stem's own margin is what sets ITS stem-to-options gap. */
  .question-prompt {
    font-family: var(--body); font-size: 14px; letter-spacing: normal;
    color: var(--bt-dim);
    margin-top: calc(-1 * var(--sp-5)); margin-bottom: var(--sp-2);
  }

  .options { border-bottom: 1px solid var(--bt-grey-dark); }
  .opt {
    display: flex; align-items: center; gap: var(--sp-4);
    /* 14px left inset reserved permanently (was 0, animated to 14px on
       hover/checked via a padding-left transition): animating padding
       is a layout property, so selecting an answer could re-wrap its
       own label and shift every row beneath it. The hairline below
       (.opt::before) still carries the same "rides in from the left"
       moment on its own transform, at zero layout cost.
       The 14px itself is exempt from DESIGN.md's scale, deliberately:
       it is a functional geometry constant (the hairline's own former
       travel distance), not a rhythm choice, and the short-viewport
       override below repeats it for the same reason - both stay
       lint-flagged on purpose rather than snapped to 12/16, which would
       be resolving a real number to a value that means something
       different. */
    width: 100%; min-height: 58px; padding: 16px 12px 16px 14px;
    border-top: 1px solid var(--bt-grey-dark);
    position: relative;
    /* Cascades in after the stem, question first then choices: the single
       change that does the most to break the "form template" feel. */
    animation: opt-in 0.32s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
    animation-delay: calc(200ms + var(--i, 0) * 45ms);
  }
  @keyframes opt-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
  /* A hairline in the module colour rides in from the left on hover and stays
     put once chosen, so the active row is legible without relying on colour. */
  .opt::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 2px; background: var(--accent, var(--bt-grey));
    transform: scaleY(0); transform-origin: center;
    transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .opt:hover::before, .opt[aria-checked="true"]::before { transform: scaleY(1); }
  /* Mirrors the 700ms auto-advance countdown on the selected row itself, in
     the accent colour, instead of leaving it to a 2px line 160-393px away at
     the extreme bottom of the viewport: this is where the eye already is. */
  .opt::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0;
    height: 2px; background: var(--accent, var(--bt-grey));
    transform: scaleX(0); transform-origin: left;
  }
  /* Transition lives only on .arming: removing the class snaps the bar back
     with no reverse-playing animation, so a correction click resets cleanly. */
  .opt.arming::after { transform: scaleX(1); transition: transform 700ms linear; }
  .opt-marker {
    display: flex; align-items: center; gap: var(--sp-3);
    flex: 0 0 auto;
    margin-right: var(--sp-4); /* gap fallback, zeroed below where gap is supported */
  }
  @supports (gap: 1px) {
    .opt-marker { margin-right: 0; }
  }
  /* Signal-bars mark, ascending A to D: a quiet, always-on hint that this
     row sits at one of four positions on a scale. Its own grey scale, never
     the module accent, so it never competes with the hover/selected state. */
  .opt .spectrum { display: flex; align-items: flex-end; gap: 2px; }
  .opt .spectrum-bar {
    width: 2px; background: var(--bt-grey-dark);
    transition: background 0.15s ease;
  }
  .opt .spectrum-bar:nth-child(1) { height: 4px; }
  .opt .spectrum-bar:nth-child(2) { height: 7px; }
  .opt .spectrum-bar:nth-child(3) { height: 10px; }
  .opt .spectrum-bar:nth-child(4) { height: 13px; }
  .opt .spectrum-bar.lit { background: var(--bt-grey); }
  .opt .sq {
    flex: 0 0 auto; width: 12px; height: 12px;
    border: 1px solid var(--accent, var(--bt-grey));
    transition: background 0.15s ease, transform 0.15s ease;
  }
  .opt .txt {
    font-size: 17px; line-height: 1.4; color: var(--bt-grey);
    text-wrap: pretty;
    transition: color 0.2s ease;
  }
  .opt:hover .txt { color: #C9C9C9; }
  .opt:hover .sq { transform: scale(1.15); }
  /* The tap landed: a one-off confirmation, not a hover state, so it is its
     own animation rather than reusing the hover transform. */
  .opt .sq.pulse { animation: sq-pulse 0.18s ease-out; }
  @keyframes sq-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
  }
  .opt[aria-checked="true"] .txt { color: var(--bt-white); }
  .opt[aria-checked="true"] .sq { background: var(--accent, var(--bt-grey)); }
  /* These stay clickable for 700ms after a choice, and permanently on any screen
     reached via Back, so they cannot use --bt-highlight (2.37:1). --bt-dim is
     the darkest grey that still passes AA against black. */
  .options.locked .opt:not([aria-checked="true"]) .txt { color: var(--bt-dim); }

  /* ---- intro ---- */
  /* The front door gets the same grammar every later screen already uses:
     a mono eyebrow, and here, a quiet preview of the reveal's colour system
     (the card's own bar order) before a single question has been asked. */
  .intro .eyebrow { margin-bottom: var(--sp-4); }
  .intro-marks { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-6); }
  .intro-marks span { width: 22px; height: 2px; }
  .intro-marks span:nth-child(1) { background: var(--bt-mirror); }
  .intro-marks span:nth-child(2) { background: var(--bt-field); }
  .intro-marks span:nth-child(3) { background: var(--bt-room); }
  .intro-marks span:nth-child(4) { background: var(--bt-future); }
  /* Cascades in with the same rhythm as the option rows and case notes below,
     so the funnel's front door and its close share one grammar. */
  .intro .eyebrow, .intro-marks, .intro h1, .intro p, .textlink {
    animation: opt-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
    animation-delay: calc(80ms + var(--i, 0) * 90ms);
  }
  /* Begin was previously the quietest control on the page - a 13px
     underlined link, the same weight as every other textlink on the site -
     on the one screen whose entire job is to get a click. Same charcoal-
     at-rest, red-on-hover recipe as .blockbtn (see there) rather than a
     third button language; stays a .textlink underneath (same class, same
     click handler, same reduced-motion carve-out) so nothing about its
     behaviour changes, only its weight. */
  /* .textlink.intro-cta, not .intro-cta alone: the base .textlink rule
     (color: var(--bt-white)) is defined later in the file and would
     otherwise win on source order despite equal specificity -- confirmed
     live, the button rendered with the right background but the wrong
     text colour until this was scoped to both classes. */
  .textlink.intro-cta {
    display: inline-flex; align-items: center; justify-content: center;
    background: #3D3B36; color: #F5F4F2;
    border: 1px solid rgba(255, 255, 255, .12);
    /* Overrides .textlink's own font-family/letter-spacing/text-transform
       (mono, tracked, uppercase): the colour recipe was already ported
       from .btn-primary (see above), but the type was still the funnel's
       own tracked-caps voice, and rounded-pill vs sharp-corner read as a
       second button language sitting right under the same fixed nav bar
       that carries the real .btn-primary. Both now match it exactly. */
    font-family: var(--body); font-size: 16px; font-weight: 500;
    letter-spacing: normal; text-transform: none;
    border-radius: 8px;
    padding: 12px var(--sp-7); margin-top: 4px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
  }
  .intro-cta::after { display: none; } /* the underline-reveal is for a bare link, not a filled block */
  /* Same swap as .blockbtn:hover, same reason: white-on-red here measured
     3.55:1, fails AA. */
  .intro-cta:hover { background: #F1393A; border-color: transparent; color: #000000; }
  .intro-cta:active { transform: translateY(1px); }
  .intro h1 {
    font-size: clamp(34px, 5.4vw, 52px);
    font-weight: 500; line-height: 1.12; letter-spacing: -0.02em;
    margin-bottom: 24px; text-wrap: balance;
  }
  .intro p {
    font-size: 16px; line-height: 1.6; color: var(--bt-grey);
    max-width: 460px; margin-bottom: var(--sp-6);
  }
  /* inline-block plus real vertical padding so the tap target clears 24px.
     The underline slides in on hover/focus rather than sitting there always,
     the same hairline-reveal language as the option rows below, so the first
     interactive element on the page teaches its interaction grammar. Touch
     has no hover to reveal it, so it stays permanently on there instead. */
  .textlink {
    display: inline-block; position: relative;
    font-family: var(--mono); font-size: 14px; letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--bt-white);
    padding: 16px 0 12px;
    transition: transform 0.1s ease;
  }
  .textlink::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
    background: var(--bt-white);
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .textlink:hover::after, .textlink:focus-visible::after { transform: scaleX(1); }
  @media (hover: none) {
    .textlink::after { transform: scaleX(1); }
  }

  /* ---- role ---- */
  .rolelabel {
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--bt-grey); margin-bottom: var(--sp-6);
  }
  /* This screen used to read as question zero of ten, with no indication it
     is not scored and not part of the diagnosis. role-stem tightens .stem's
     usual 48px margin so the reason line sits close under the question it
     is explaining, rather than floating in that gap. */
  .role-stem { margin-bottom: 8px; }
  .role-reason { font-size: 14px; color: var(--bt-grey); max-width: 440px; margin-bottom: var(--sp-6); }

  /* ---- compiling beat ----
     Honest theatre between the last answer and the reveal: the engine has
     already run by the time this is on screen, the pause is presentation
     only. A screen reader hears one static line once (.sr-only); sighted
     users see the three lines cross in the visible, aria-hidden pair. */
  .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;
  }
  .screen.compiling .inner { text-align: center; }
  .compiling-lines { position: relative; height: 24px; }
  .compiling-line {
    position: absolute; top: 0; left: 0; right: 0;
    font-family: var(--mono); font-size: 14px; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--bt-grey); text-align: center;
    opacity: 0; transform: translateY(12px);
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
  }
  .compiling-line.active { opacity: 1; transform: translateY(0); }
  .compiling-line.exited { opacity: 0; transform: translateY(-12px); }
  .compiling-marks { display: flex; gap: var(--sp-2); justify-content: center; margin-bottom: var(--sp-5); }
  .compiling-marks span { width: 22px; height: 2px; animation: compiling-pulse 1.6s ease-in-out infinite; }
  .compiling-marks span:nth-child(1) { background: var(--bt-mirror); animation-delay: 0s; }
  .compiling-marks span:nth-child(2) { background: var(--bt-field); animation-delay: 0.2s; }
  .compiling-marks span:nth-child(3) { background: var(--bt-room); animation-delay: 0.4s; }
  .compiling-marks span:nth-child(4) { background: var(--bt-future); animation-delay: 0.6s; }
  @keyframes compiling-pulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
  }
  @media (prefers-reduced-motion: reduce) {
    .compiling-line { transition: none; }
    .compiling-marks span { animation: none; opacity: 0.7; }
  }

  /* ---- results layout ----
     Card on top, CTA below it, on every screen up to 1000px: that is most
     phones AND most tablets in portrait, so "mobile" here means "narrower
     than a comfortable two-column reading width," not a literal phone check.
     Above that, two columns: the card left, the conversion column right, at a
     fixed width so surplus space goes to the card rather than stretching the
     sidebar's short lines of text. */
  .results-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-8);
    align-items: start;
    margin-bottom: var(--sp-8);
  }
  /* justify-self stays at its default (stretch), so .dcard always gets a
     definite width from its grid column: the card's own content now lives in
     absolutely-positioned faces (for the flip) and can no longer hand a
     size back up the tree the way in-flow content used to. Starts invisible:
     the entrance choreography (script) brings it in, so there is never a
     flash of the card at rest. No frame around it: the card stands on its
     own against the page black, its own hairline border and keyline is
     enough. */
  .dcard {
    perspective: 1400px;
    opacity: 0;
  }
  @media (min-width: 1000px) {
    .results-top {
      /* Fixed, not minmax(0, 440px): between 1000-1090px viewports a minmax
         upper bound would let the card shrink below the width its type scale
         is tuned to. justify-content centres the pair when the viewport
         hands back more room than the two fixed/capped tracks want. */
      grid-template-columns: 440px minmax(0, 560px);
      justify-content: center;
      gap: clamp(32px, 4.5vw, 64px);
      margin-bottom: 96px;
    }
    /* Framed and full height, matching the card's own housing, so the
       conversion column reads as anchored beside it rather than floating
       text in open black. The entrance opacity/transform live on the base
       #gate rule below now (they used to live only here, so the mobile
       conversion moment was bare text visible from t=0 -- this just
       upgrades the mobile hairline to a full frame). */
    #gate {
      border: 1px solid var(--bt-grey-dark);
      border-radius: 14px;
      padding: clamp(var(--sp-6), 3vw, var(--sp-7));
      /* NOT stretch: that matched the box's height to the card beside it
         (the card is much taller, driven by the diagnosis name), and
         margin-top:auto on the form below pushed the fields to the bottom
         of that borrowed height -- a void of about 94px between the
         microcopy and "First name" that belonged to nothing. align-self:
         start lets the box size to its own content instead. */
      align-self: start;
      display: flex;
      flex-direction: column;
    }
    /* No #gate-form margin-top here any more: it stacked a second 32px
       gap on top of #gate .micro's own 40px margin-bottom, opening a
       72px void between the microcopy and the form it introduces.
       .micro's 40px alone now governs at both widths, same as mobile. */
    /* Once the gate is gone, the lone card recentres over the notes column
       below rather than staying pinned hard left beside empty black. */
    .results-top.gated { grid-template-columns: minmax(0, 440px); justify-content: center; }
  }

  /* ---- diagnosis card ----
     A pseudo-3D object, three nested layers, each owning exactly one
     transform so they never fight:
       .dcard       sets the perspective, static
       .dcard-tilt  pointer parallax, rotateX/rotateY, small angles
       .dcard-flip  the entrance settle (script), nothing else now
     One face. Locked to 5:7, the proportions of a real trading card
     (2.5in x 3.5in): the card can change SIZE but never SHAPE. The title
     block sits at the top, the readout at the bottom, and the room in
     between is the point - it is what makes the card read as set rather
     than filled. No internal
     scroll: content is sized to fit the box, and a preview-build console
     check (see script) warns if it ever does not. Depth comes from the
     tilt and the edge, never a gradient or drop shadow. */
  .dcard-tilt {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    transform-style: preserve-3d;
    transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
    will-change: transform;
    /* Lets the face query the card's own rendered width below, rather
       than the viewport: max-width caps this element before the viewport
       and the card width necessarily match. */
    container-type: inline-size;
  }
  .dcard-flip {
    position: relative;
    z-index: 1;
    width: 100%;
    aspect-ratio: 5 / 7;
    transform-style: preserve-3d;
  }
  .dcard-face {
    position: absolute; inset: 0;
    display: flex;
    flex-direction: column;
    /* Top-anchored: content stacks from the top and whatever room is
       spare sits under the readout, where the card's bottom edge holds it. */
    justify-content: flex-start;
    /* The card's one rhythm unit: every gap that separates one typographic
       register from another (label from headline, name from definition, the
       back's own divider) is a named multiple of this, so the air between
       elements comes from one system instead of independently tuned numbers.
       Scaled by cqw like the card's own padding, so the rhythm opens and
       tightens with the card rather than the viewport. Deliberately NOT used
       inside the module-row readout on the back: that block's own row-to-row
       spacing stays a fixed constant instead (see .barrow), since a specimen
       readout's density should read as a property of the instrument, not
       something that visibly loosens just because the card got bigger.
       Raised from clamp(5px,1.6cqw,8px): the same system, just given more
       air throughout -- every gap below is still the same named multiple
       of this one unit, so the rhythm stays intact, just less tight. */
    --u: clamp(6px, 2cqw, 10px);
    /* Card-stock grain, in object space: a fine white-only tooth that tilts
       and flips WITH the card, unlike the page's own fixed #grain overlay,
       which sits in screen space and never moves with what it's covering --
       "grain on the camera, not on the card." Alpha-only (the colour matrix
       pins every pixel to pure white and only ever varies its opacity), so
       it can lighten the surface but never tint it. A different turbulence
       frequency from the page grain's 0.8, so the two never interference-
       pattern where they overlap. */
    background-color: var(--bt-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 120px 120px;
    /* A lit top edge, a shaded bottom: the uniform outline (the card's only
       cue for standing off the ground, since a shadow is invisible on pure
       black) becomes a rim catching ambient light instead of a drawn box. */
    border: 1px solid var(--bt-grey-dark);
    border-top-color: #383838;
    border-bottom-color: #232323;
    border-radius: 14px;
    /* Bottom padding reserves real room for the "Tap to spin" hint, which is
       absolutely positioned so it never affects the overflow calculation
       below, but still needs the flex content to stop short of it. Keyed to
       cqw (the card's own width, via the container on .dcard-tilt) rather
       than vw: viewport-relative padding was hitting its maximum on ordinary
       desktop windows while the card itself is capped at 440px, which is
       what let the card's last line print through the hint below. */
    padding: clamp(var(--sp-5), 6.5cqw, var(--sp-6));
    overflow: hidden;
    transition: border-color 0.35s ease;
  }
  .dcard:hover .dcard-face { border-color: #3D3D3D; border-top-color: #4C4C4C; border-bottom-color: #333333; }
  /* The edge light. The previous version was a conic gradient on a layer
     BEHIND the card that relied on the card's own opaque face to hide the
     gradient's centre - so any tilt, wobble or flip, anything that took the
     face off flat, exposed that centre as a sweep across the middle of the
     card. This is the standard masked-ring technique instead: the layer IS
     a 1.5px ring (mask-composite: exclude cuts the content box out of the
     border box), so it cannot show as a disc at any angle. One per face,
     inside the face, so it turns with the card. Two layers: a static rim
     lit from above, and a radial highlight that follows the pointer
     (--lx/--ly from the tilt's own mousemove), faded in by --lit while
     the pointer is on the card. Touch and reduced motion get the static
     rim only. */
  .dcard-face::after {
    content: ''; position: absolute; inset: 0; border-radius: 14px;
    padding: 1.5px; pointer-events: none;
    background:
      radial-gradient(240px circle at var(--lx, 50%) var(--ly, 50%), rgba(255, 255, 255, calc(0.6 * var(--lit, 0))), rgba(255, 255, 255, 0) 60%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.05) 42%, rgba(255, 255, 255, 0) 75%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    transition: --lit 0.35s ease;
  }
  @property --lit { syntax: '<number>'; inherits: true; initial-value: 0; }
  @media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .dcard-tilt:hover { --lit: 1; }
  }



  /* Pointer tilt: nothing on touch, nothing under reduced motion. The flip
     still works either way, it is just an instant swap under reduced motion. */
  @media (hover: none), (prefers-reduced-motion: reduce) {
    .dcard-tilt { transform: none !important; transition: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    .dcard-flip { transition: none; }
  }

  /* "Diagnosis:" sits at the top of the card on its own, bright; the
     name is a long way below it, by design (see .cond-name). */
  .dcard-label {
    font-family: var(--mono); font-size: 12px; line-height: 1; letter-spacing: 0.18em;
    text-transform: uppercase; color: rgba(255, 255, 255, .85); margin-bottom: 0;
  }

  /* ---- results ---- */
  #results { display: none; }
  #results.active { display: block; }
  #results {
    min-height: 100vh; min-height: 100dvh;
    padding: var(--sp-9) 24px var(--sp-9);
  }
  /* Wide enough for the two-column top. Reading sections below stay narrow. */
  #results .inner { max-width: 1180px; margin: 0 auto; }

  .eyebrow {
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--bt-grey); margin-bottom: 12px;
  }
  /* The diagnosis name: the largest thing on the card, Helvetica Regular,
     plain white, sized off the card's own width (cqw, via the container
     on .dcard-tilt) so it cannot outgrow a card that has stopped growing.
     Wraps to two lines on the longer names and balances when it does.
     Keyed by class, not id, on purpose: the overflow probe
     (runOverflowTripwire) is a clone of this face with its ids stripped,
     and id-keyed type left it measuring a default h1 - i.e. not
     measuring the card at all. */
  .cond-name {
    font-family: var(--body);
    font-weight: 400;
    font-size: clamp(28px, 9.5cqw, 40px);
    line-height: 1.05; letter-spacing: -0.02em;
    color: var(--bt-white);
    /* The card's vertical rhythm is two equal pools of air: one above the
       name, one above the definition (margin-top: auto on both splits the
       face's free room evenly between them), with the caption pinned to
       the top and the readout to the foot. The padding-top is the floor
       those pools cannot drop below on a card too short to have any
       spare room - auto margins go to 0, padding does not. */
    margin-top: auto; padding-top: calc(var(--u) * 3);
    margin-bottom: 0;
    overflow-wrap: break-word; text-wrap: balance;
  }
  .cond-name-word { white-space: nowrap; }
  .cond-name-char {
    display: inline-block; white-space: pre;
    opacity: 0; filter: blur(9px); transform: translateY(.08em);
    transition:
      opacity .5s cubic-bezier(.22, 1, .36, 1),
      filter .6s cubic-bezier(.22, 1, .36, 1),
      transform .6s cubic-bezier(.22, 1, .36, 1);
  }
  .cond-name-char.in { opacity: 1; filter: blur(0); transform: translateY(0); }
  @media (prefers-reduced-motion: reduce) {
    .cond-name-char { opacity: 1; filter: none; transform: none; transition: none; }
  }
  .cond-def {
    /* cqw, not vw: the card is capped in size before the viewport is, so
       a viewport-relative size drifts out of step with a box that stopped
       growing. A reading measure (~34ch) rather than the full width, so
       the line ends where the eye expects a paragraph to, and the right
       edge stays ragged and quiet. The second pool of air sits above it
       (see .cond-name); below it a fixed lead into the readout, so the
       definition reads as belonging to the verdict above, not the rows
       below. */
    font-size: clamp(14px, 3.9cqw, 17px); line-height: 1.35;
    color: var(--bt-white);
    max-width: 34ch;
    margin-top: auto; padding-top: calc(var(--u) * 3);
    margin-bottom: calc(var(--u) * 5);
  }
  /* Below this the card itself is rendering under 400px wide and the
     type has hit its px floors; bridge-card proportions (a little taller
     than 5:7) keep a two-line name, a four-line definition and the four
     rows from crowding each other. Sits AFTER the rules it overrides:
     same specificity, so source order decides. */
  @container (max-width: 400px) {
    .dcard-flip { aspect-ratio: 0.64; }
  }
  /* The readout: four ruled rows. Module name on its own line in the
     display face; under it, the subtitle (grey) on the left and the band
     word (plain white Helvetica, sentence case - a reading, not a tag) on
     the right, sharing a baseline; a rule closes the row - and the rule
     is the track: the module's own colour fills along it to the band's
     width (Fragile a quarter, Forming just over half, Solid most of the
     way) once the card has settled, so the level is read twice, as a
     word and as a length. Row density is a constant of the instrument,
     deliberately off the --u scale, so it does not visibly loosen because
     the card grew. Rows are the only thing on the card that hold their
     spacing when the free room above them changes. */
  .barrow { padding-top: 16px; }
  .barrow:first-child { padding-top: 0; }
  .barrow .track { height: 2px; background: #3A3A3A; position: relative; margin-top: 8px; }
  .barrow .fill {
    position: absolute; left: 0; top: 0; height: 2px; width: 100%;
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .barrow .modname {
    display: block;
    font-family: var(--module);
    font-weight: 800;
    font-size: clamp(16px, 4.4cqw, 19px);
    line-height: 1; letter-spacing: 0.01em;
    text-transform: uppercase; color: var(--bt-white);
    margin-bottom: 4px;
  }
  .barrow .rowmeta {
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  }
  /* Was clamp(11.5px, 2.9cqw, 12.5px) - a 1px range too narrow to read as
     responsive at any card width this instrument actually renders at
     (see the comment above .barrow: row density is a fixed constant of
     the card, deliberately not scaled with it). Flat 12px, DESIGN.md's
     label-role floor. */
  .barrow .subt {
    font-size: 12px; line-height: 1.3; color: var(--bt-grey);
    min-width: 0;
  }
  .barrow .bandword {
    font-family: var(--body); font-size: clamp(12px, 3cqw, 14px); line-height: 1.3;
    color: var(--bt-white); flex: 0 0 auto;
  }
  /* The Future is deliberately unscored: it has no band word and no fill,
     and its track is an empty dotted line rather than a drawn one, so the
     row shares the others' skeleton and reads as held back on purpose,
     not as a row that lost its value. */
  /* All four modules score in v2, so barRow() never actually takes the
     bandId-less branch that renders this any more; kept generic (not
     scoped to .barrow.future, which no longer exists) so it still renders
     correctly if that defensive fallback is ever hit. */
  .track-empty { height: 0; border-top: 1px dotted #4A4A4A; margin-top: 12px; }
  /* ---- gate ----
     This is the conversion moment: a mono eyebrow parallels the card's own,
     then a real headline (not another mono label), and the button is sized
     to match its importance. */
  /* A hairline top edge and a fade-in, unconditionally: below 1000px this
     was the whole of #gate's presentation, so the conversion moment was
     bare, un-choreographed text, fully visible from t=0 while the card's
     entrance played above it. The desktop rule below upgrades the hairline
     to a full frame; both widths share the same entrance now. */
  #gate {
    max-width: 560px; margin-top: 0;
    border-top: 1px solid var(--bt-grey-dark);
    padding-top: 32px;
    opacity: 0; transform: translateY(8px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  }
  .results-top.cta-in #gate { opacity: 1; transform: none; }
  /* The base rule above sets padding-top:32px for the mobile hairline
     presentation, and - because it is declared after the >=1000px frame
     rule - was winning at desktop too on source order: a frame inset
     32px at the top but up to 44px on the other three sides. Re-assert
     the frame's own inset here so the desktop box is uniform on all
     four sides. */
  @media (min-width: 1000px) {
    #gate { padding-top: clamp(var(--sp-6), 3vw, var(--sp-7)); }
  }
  #gate h2 {
    font-family: var(--body);
    font-size: clamp(22px, 3vw, 28px); font-weight: 500;
    line-height: 1.2; letter-spacing: -0.018em;
    color: var(--bt-white); text-transform: none;
    margin-bottom: 16px; text-wrap: balance;
  }
  .notes-h {
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--bt-grey); margin-bottom: 16px;
    /* Explicit rather than relying on the browser's default <h2> bold:
       Ballinger Mono ships in 400 only, so a bold heading would be a
       synthesised (smeared) bold. Naming the weight here makes that a
       decision instead of an accident. */
    font-weight: 400;
  }
  /* The confirmation headline reuses .notes-h for its stagger-in animation
     (see #notes.stagger below) and overrides the mono small-caps look with
     the same real-headline treatment #gate h2 uses just above. */
  .confirm-h {
    font-family: var(--body); text-transform: none;
    font-size: clamp(22px, 3vw, 28px); font-weight: 500;
    line-height: 1.2; letter-spacing: -0.018em; color: var(--bt-white);
  }
  #gate .micro { font-size: 16px; line-height: 1.6; color: var(--bt-grey); margin-bottom: 48px; }

  .fieldwrap { margin-bottom: 24px; }
  .fieldwrap label {
    display: block;
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--bt-grey); margin-bottom: 8px;
  }
  .fieldwrap input {
    width: 100%; background: transparent; border: 0;
    border-bottom: 1px solid var(--bt-grey-mid);
    color: var(--bt-white); font-family: var(--body); font-size: 16px;
    padding: 12px 0; border-radius: 0;
    /* Every other focus/hover state on the page eases; this one used to
       snap. */
    transition: border-bottom-color 0.18s ease;
  }
  /* outline: none used to sit here, deleting the page's own focus ring
     (the button/a/input rule near the top of this file) from all three
     text inputs AND the opt-in checkbox below, which has no underline
     to fall back on and was left with no focus indicator at all. The
     underline shift here is the pointer-focus cue; :focus-visible still
     supplies the white ring on keyboard focus, same as everywhere else
     on the page. */
  .fieldwrap input:focus { border-bottom-color: var(--bt-grey); }
  .fieldwrap .err {
    display: none;
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--bt-white); margin-top: 8px;
  }
  /* The invalid-state colour lives on the input's own underline, a UI element,
     not on the error copy beside it. */
  .fieldwrap.bad input { border-bottom-color: var(--bt-mirror); }
  .fieldwrap.bad .err { display: block; }

  /* The one optional field: a plain checkbox, not the underline-input
     treatment above, so it reads as a different kind of question (nothing
     to get wrong, nothing required). */
  .fieldwrap.optin label {
    display: flex; align-items: flex-start; gap: 12px;
    text-transform: none; letter-spacing: normal; font-family: var(--body);
    font-size: 14px; line-height: 1.5; color: var(--bt-grey); cursor: pointer;
    text-wrap: pretty;
  }
  .fieldwrap.optin input {
    width: 16px; height: 16px; margin-top: 2px; flex: 0 0 auto;
    accent-color: var(--bt-white);
  }
  [data-privacy-line] {
    font-size: 14px; line-height: 1.6; color: var(--bt-dim); margin-bottom: 24px;
  }
  [data-privacy-line] a { color: var(--bt-grey); text-decoration-color: var(--bt-grey-mid); }
  [data-privacy-line] a:hover { color: var(--bt-white); }
  .gate-general-err {
    font-size: 14px; line-height: 1.5; color: var(--bt-mirror); margin-top: 16px;
  }

  /* Sharp corners, matching the rest of the system. The card is the one
     rounded object on the page, not a shape the rest of the UI echoes. */
  /* Was a flat --bt-mirror red at rest -- the client's own read was "too
     bright", and the landing page (the same client, the sister product)
     never puts red on a surface at rest either: red there is exclusively
     a hover/active colour (.btn-primary), the resting state is charcoal.
     Ported that recipe exactly rather than inventing a funnel-specific
     one, since a unified button language across the two products was
     already on the table. */
  .blockbtn {
    display: block; width: 100%;
    background: #3D3B36; color: #F5F4F2;
    border: 1px solid rgba(255, 255, 255, .12);
    /* Same type/corner update as .textlink.intro-cta above, same reason:
       the charcoal/red recipe already matched .btn-primary, the tracked
       mono caps and sharp corners didn't. Full-width and the bigger 16px
       vertical padding stay - this sits alone in a form/closing screen,
       not a nav bar, and earns the extra weight. */
    font-family: var(--body); font-size: 16px; font-weight: 500;
    letter-spacing: normal; text-transform: none;
    border-radius: 8px; text-align: center;
    padding: 16px; margin-top: 16px; text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
  }
  /* White text measures 10.18:1 against the charcoal rest state but only
     3.55:1 against this red -- fails AA (needs 4.5:1) at 14px. Black
     clears 5.39:1 against the same red, so the label switches colour on
     hover rather than carrying one colour that is only safe on one of
     the two backgrounds. Confirmed by computing both, not assumed from
     the landing page's own version of this button. :not(:disabled) so
     the gate's "Sending..." state (script.js sets .disabled on the same
     element) never picks up a hover fill it cannot act on. */
  .blockbtn:not(:disabled):hover { background: #F1393A; border-color: transparent; color: #000000; }
  /* Tactile feedback: every control acknowledges the press. */
  .blockbtn:active { transform: translateY(1px); }
  .blockbtn:disabled { opacity: .6; cursor: not-allowed; }
  .textlink:active, .opt:active { transform: translateY(1px); }

  /* ---- case notes ---- */
  /* Centred rather than left-flush: below the wide two-column card+gate row,
     a 680px reading column pinned to the left edge left 500px of dead space
     on the right at desktop widths and read as the page going lopsided. */
  /* scroll-margin-top, not a change to the scroll call itself: renderNotes()
     scrolls this element to the viewport top, and the fixed chrome bar (its
     own task, ~54px incl. inset) now sits over that top edge, opening the
     notes on a heading sliced in half. This is the scroll target's own
     offset, so it works regardless of what scrolls it into view. */
  #notes { display: none; max-width: 560px; margin: 0 auto; scroll-margin-top: 88px; }
  .restart-wrap { text-align: center; margin: calc(-1 * var(--sp-7)) 0 var(--sp-7); }
  .restart-wrap .textlink { font-family: var(--body); font-size: 14px; letter-spacing: normal; text-transform: none; }
  #notes.active { display: block; }
  .notes-h { margin-top: 64px; }
  /* The notes read as a document being handed over, not a wall of text: each
     section (heading plus what follows it) fades up 60ms after the last. */
  #notes.stagger .notes-h,
  #notes.stagger p,
  #notes.stagger .tq {
    opacity: 0; transform: translateY(8px);
    animation: note-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
    animation-delay: calc(var(--i, 0) * 60ms);
  }
  @keyframes note-in { to { opacity: 1; transform: translateY(0); } }
  #notes p { font-size: 16px; line-height: 1.7; color: #C9C9C9; margin-bottom: 16px; }
  .tq { display: flex; gap: 16px; margin-bottom: 16px; }
  .tq .n {
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em;
    color: var(--bt-grey); padding-top: 4px;
    margin-right: 16px; /* gap fallback */
  }
  @supports (gap: 1px) {
    .tq .n { margin-right: 0; }
  }
  .tq .t { font-size: 16px; line-height: 1.6; color: #C9C9C9; }

  #closing { margin-top: 96px; padding-top: 48px; border-top: 1px solid var(--bt-grey-dark); max-width: 560px; margin-left: auto; margin-right: auto; }
  .site-footer {
    margin-top: 64px; padding-top: 24px;
    border-top: 1px solid var(--bt-grey-dark);
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; color: var(--bt-grey);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px;
  }
  .site-footer-inner {
    flex: 1 1 100%;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px;
  }
  .site-footer-brand { display: flex; align-items: center; gap: 12px; }
  .site-footer-sep { width: 1px; height: 16px; background: var(--bt-grey-dark); }
  .site-footer-logo { height: 13px; width: auto; display: block; }
  .site-footer-milkman { height: 12px; width: auto; color: var(--bt-grey); }
  .site-footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; text-transform: uppercase; letter-spacing: .08em; }
  .site-footer-links a { color: var(--bt-grey); text-decoration: none; }
  .site-footer-links a:hover { color: var(--bt-white); }
  @media (max-width: 480px) {
    .site-footer, .site-footer-inner { flex-direction: column; align-items: flex-start; }
    .site-footer-links { flex-direction: column; align-items: flex-start; gap: 8px; }
  }
  #closing p { font-size: 16px; line-height: 1.7; color: #C9C9C9; margin-bottom: 16px; }
  #closing .blockbtn { margin-top: 32px; }
  /* Reuses .textlink's slide-in underline and active-press (below) via a
     class on the element, the same grammar as Begin and Learn more, instead
     of its own permanent static underline: the closing's final control was
     the one link on the page that never acknowledged a hover or a press. */
  #talk-link { margin-top: 24px; font-size: 12px; text-decoration: none; }

  @media (prefers-reduced-motion: reduce) {
    #rule { transition: none; }
    #sweep { display: none; } /* the 700ms sweep cue is pure motion */
    .opt::after { display: none; }
    .opt .sq { transition: background 0.15s ease; }
    .opt { animation: none; opacity: 1; transform: none; }
    .opt .sq.pulse { animation: none; }
    .qcount b { animation: none; opacity: 1; transform: none; }
    #notes.stagger .notes-h,
    #notes.stagger p,
    #notes.stagger .tq { animation: none; opacity: 1; transform: none; }
    .intro .eyebrow, .intro-marks, .intro h1, .intro p,
    .textlink { animation: none; opacity: 1; transform: none; }
    .barrow .fill { transition: none; }
    .textlink::after { transition: none; }
    #gate { transition: none; }
  }

  /* Windows High Contrast forces background-color and color, so the filled
     square and the white label both disappear. Give the checked row a border
     the forced palette keeps. */
  @media (forced-colors: active) {
    .opt .sq { border: 1px solid ButtonBorder; }
    .opt[aria-checked="true"] .sq { background: Highlight; border-color: Highlight; }
    .opt[aria-checked="true"] { outline: 2px solid Highlight; outline-offset: 2px; }
    .options.locked .opt:not([aria-checked="true"]) .txt { color: GrayText; }
  }

  @media (max-width: 560px), (max-height: 620px) {
    .screen { padding: 64px 24px 48px; }
    .opt .txt { font-size: 16px; }
    #results { padding: 96px 24px 64px; }
    /* Keeps the CTA label on one line in a narrow card. No letter-spacing
       override needed any more - that was clawing back room from the
       tracked mono caps this used to render in; sentence-case Helvetica
       needs less help to fit "Get the case notes"/"Book a consultation"
       on one line at this width. */
    .blockbtn { font-size: 16px; padding: 12px; }
  }
  /* A second, tighter tier for genuinely short viewports -- landscape phones
     mainly. The tier above alone still left only ~2 of 4 options visible at
     844x390 (measured), with nothing to signal the rest were one scroll
     away. This does not chase "everything on screen with no scroll" (the
     screen already scrolls, by design, for exactly this case); it shrinks
     the fixed costs -- the counter, the stem, each option row -- enough
     that a visitor sees most or all four without having to go looking. */
  @media (max-height: 460px) {
    .screen { padding: 48px 24px 48px; }
    .qcount { margin-bottom: 12px; }
    .stem { font-size: clamp(17px, 3.6vh, 22px); line-height: 1.2; margin-bottom: var(--sp-3); }
    .opt { min-height: 46px; padding: var(--sp-2) var(--sp-2) var(--sp-2) 14px; }
    /* Was 15px, the one place on the product below DESIGN.md's 16px
       reading floor: this tier's whole job is fitting more of the option
       list into a genuinely short landscape-phone viewport (measured at
       844x390 - see the comment above), but readability is not the
       variable that gives. The tighter min-height and padding above
       still do real work here; the text no longer shrinks below the
       tier above it. */
    .opt .txt { font-size: 16px; }
  }
