@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter-tight-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Clear-sky palette: white paper, one deep cobalt, sun yellow for the few
   numbers that deserve it, warm orange kept for losses and warnings. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f3f5fb;
  --ink: #0d1130;
  --ink-soft: #565c7a;
  --line: #e2e5f0;
  --accent: #1b2fa6;
  --accent-soft: #eaedfb;
  --on-accent: #ffffff;
  --feature: #0f1a5c;
  --feature-ink: #ffffff;
  --feature-soft: #c3cbf2;
  --feature-line: #2a3679;
  --sun: #ffd66b;
  --sky-1: #f4a93a;
  --sky-2: #fbd06e;
  --sky-3: #fff1c7;
  --glow-1: #ffffff;
  --glow-2: #fff4cc;
  --hill-1: #b9d77a;
  --hill-2: #86b852;
  --hero-ink: #0d1130;
  --hero-ink-soft: #2b2a3f;
  --hero-shade: #fff6dc;
  --hero-shade-a: .55;
  --hero-shade-b: .3;
  --hero-link-bg: rgba(255, 255, 255, .7);
  --hero-scrim: linear-gradient(180deg, rgba(255, 246, 220, .6) 0%, rgba(255, 246, 220, .35) 55%, rgba(255, 246, 220, 0) 80%);
  --panel-1: #3550b8;
  --panel-2: #1b2c80;
  --day: 1;
  --night: 0;
  --warn: #b0501c;
  --warn-soft: #fdf0e7;
  --gain: #1b2fa6;
  --loss: #b0501c;
  --seg-a: #1b2fa6;
  --seg-b: #f0b43c;
  --seg-c: #8b9bd4;
  --radius: 20px;
  --radius-sm: 12px;
  --maxw: 72rem;
  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0d1f;
    --surface: #111533;
    --surface-alt: #181d42;
    --ink: #eef0fa;
    --ink-soft: #a3a9c8;
    --line: #252b56;
    --accent: #8ea2ff;
    --accent-soft: #1c2358;
    --on-accent: #0a0d1f;
    --feature: #1f2a7c;
    --feature-ink: #ffffff;
    --feature-soft: #b4bde6;
    --feature-line: #3a4796;
    --warn: #f0a877;
    --warn-soft: #33221a;
    --gain: #8ea2ff;
    --loss: #f0a877;
    --seg-a: #8ea2ff;
    --seg-b: #f0b43c;
    --seg-c: #5d6aa8;
    --sky-1: #050823;
    --sky-2: #121a52;
    --sky-3: #2c3a80;
    --glow-1: #dfe6ff;
    --glow-2: #8fa2e8;
    --hill-1: #22403a;
    --hill-2: #183329;
    --panel-1: #22357f;
    --panel-2: #121c55;
    --day: 0;
    --night: 1;
    --hero-ink: #ffffff;
    --hero-ink-soft: #e8ecff;
    --hero-shade: #0b1450;
    --hero-shade-a: .72;
    --hero-shade-b: .45;
    --hero-link-bg: transparent;
    --hero-scrim: linear-gradient(180deg, rgba(8, 14, 60, .55) 0%, rgba(8, 14, 60, .3) 55%, rgba(8, 14, 60, 0) 80%);
  }
}

/* chosen with the header button; same tokens as the system dark theme */
:root[data-theme="dark"] {
  --bg: #0a0d1f;
  --surface: #111533;
  --surface-alt: #181d42;
  --ink: #eef0fa;
  --ink-soft: #a3a9c8;
  --line: #252b56;
  --accent: #8ea2ff;
  --accent-soft: #1c2358;
  --on-accent: #0a0d1f;
  --feature: #1f2a7c;
  --feature-ink: #ffffff;
  --feature-soft: #b4bde6;
  --feature-line: #3a4796;
  --warn: #f0a877;
  --warn-soft: #33221a;
  --gain: #8ea2ff;
  --loss: #f0a877;
  --seg-a: #8ea2ff;
  --seg-b: #f0b43c;
  --seg-c: #5d6aa8;
  --sky-1: #050823;
  --sky-2: #121a52;
  --sky-3: #2c3a80;
  --glow-1: #dfe6ff;
  --glow-2: #8fa2e8;
  --hill-1: #22403a;
  --hill-2: #183329;
  --panel-1: #22357f;
  --panel-2: #121c55;
  --day: 0;
  --night: 1;
  --hero-ink: #ffffff;
  --hero-ink-soft: #e8ecff;
  --hero-shade: #0b1450;
  --hero-shade-a: .72;
  --hero-shade-b: .45;
  --hero-link-bg: transparent;
  --hero-scrim: linear-gradient(180deg, rgba(8, 14, 60, .55) 0%, rgba(8, 14, 60, .3) 55%, rgba(8, 14, 60, 0) 80%);
}

* { box-sizing: border-box; }

html { accent-color: var(--accent); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--font);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); color: var(--ink); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 48rem) { .wrap { padding: 0 32px; } }

a { color: var(--accent); text-underline-offset: .2em; }
h1, h2, h3, h4, h5 { line-height: 1.15; margin: 0 0 .5em; font-weight: 500; letter-spacing: -0.025em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 1.4rem + 3.6vw, 4.1rem); font-weight: 400; letter-spacing: -0.035em; line-height: 1.05; }
h2 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem); margin-top: 3rem; font-weight: 400; letter-spacing: -0.03em; }
h3 { font-size: clamp(1.3rem, 1.15rem + .6vw, 1.6rem); margin-top: 1.5rem; }
h4 { font-size: 1.05rem; }
h5 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--ink-soft); font-size: .92em; }
main p, main li { max-width: 70ch; }

/* ---------- header ---------- */
.site-header { background: var(--bg); }
.site-header .wrap { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; padding-block: 1.1rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; text-decoration: none; color: var(--ink); margin-right: auto; letter-spacing: -0.01em; }
.brand-mark { width: 34px; height: 34px; flex: none; color: var(--accent); }
.brand-text span { display: block; font-weight: 400; font-size: .76rem; color: var(--ink-soft); letter-spacing: 0; }
.site-nav { display: flex; gap: 1.4rem; font-size: .93rem; }
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--accent); text-underline-offset: .45em; }
.lang-switch { display: flex; gap: .2rem; font-size: .8rem; padding: .2rem; border-radius: 999px; background: var(--surface-alt); }
.lang-switch a { padding: .25rem .6rem; border-radius: 999px; text-decoration: none; color: var(--ink-soft); font-weight: 500; }
.lang-switch a[aria-current="true"] { background: var(--accent); color: var(--on-accent); }
.theme-toggle {
  display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; cursor: pointer;
  background: var(--surface-alt); color: var(--ink); border: 0; border-radius: 999px;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: var(--accent-soft); color: var(--accent); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle[aria-pressed="true"] .icon-sun { display: block; }
.theme-toggle[aria-pressed="true"] .icon-moon { display: none; }

/* ---------- banner ---------- */
.banner { background: var(--warn-soft); color: var(--warn); padding: .6rem 0; }
.banner .wrap { font-size: .88rem; font-weight: 500; }

main { padding-block: .75rem 4rem; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: 28px; min-height: clamp(24rem, 18rem + 12vw, 30rem);
  color: var(--hero-ink); background: #1a33b0; margin-bottom: 1.5rem;
}
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; z-index: -1; }
/* day in the light theme, night with a moon and stars in the dark theme */
.hero-art .sky-1 { stop-color: var(--sky-1); }
.hero-art .sky-2 { stop-color: var(--sky-2); }
.hero-art .sky-3 { stop-color: var(--sky-3); }
.hero-art .glow-1 { stop-color: var(--glow-1); }
.hero-art .glow-2, .hero-art .glow-3 { stop-color: var(--glow-2); }
.hero-art .panel-1 { stop-color: var(--panel-1); }
.hero-art .panel-2 { stop-color: var(--panel-2); }
.hero-art .hill-1 { fill: var(--hill-1); }
.hero-art .hill-2 { fill: var(--hill-2); }
.hero-art .shade-1, .hero-art .shade-2, .hero-art .shade-3 { stop-color: var(--hero-shade); }
.hero-art .shade-1 { stop-opacity: var(--hero-shade-a); }
.hero-art .shade-2 { stop-opacity: var(--hero-shade-b); }
.hero-art .hero-day { opacity: var(--day); }
.hero-art .hero-night { opacity: var(--night); }
.hero-art .hero-glare { opacity: calc(.35 + var(--day) * .65); }
.hero-art .hero-day, .hero-art .hero-night { transition: opacity .6s ease-out; }
@media (prefers-reduced-motion: reduce) { .hero-art .hero-day, .hero-art .hero-night { transition: none; } }
.hero { background: var(--sky-1); }
.hero-copy { position: relative; z-index: 1; padding: clamp(1.5rem, 1rem + 3vw, 3rem); max-width: 40rem; }
.hero h1 { color: var(--hero-ink); margin-bottom: 1rem; font-size: clamp(2rem, 1.3rem + 2.6vw, 3.3rem); }
.hero-lead { color: var(--hero-ink-soft); font-size: clamp(1rem, .95rem + .3vw, 1.15rem); max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin: 1.75rem 0 0; }
.button-link {
  color: var(--hero-ink); font-weight: 500; text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: .35em;
  padding: .45rem .9rem; margin-left: -.9rem; border-radius: 999px; background: var(--hero-link-bg);
}
.button-link:hover { text-decoration-thickness: 2px; }

/* the privacy promise sits in a notch cut out of the picture's corner */
.hero-facts {
  position: absolute; right: 0; bottom: 0; z-index: 1;
  padding: 1rem 0 0 1rem; background: var(--bg); border-top-left-radius: 28px;
}
.hero-promise {
  display: flex; align-items: flex-start; gap: .75rem; margin: 0; max-width: 24rem;
  padding: 1rem 1.25rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); font-size: .92rem; line-height: 1.45;
}
.hero-promise svg { flex: none; color: var(--accent); margin-top: .05rem; }
@media (max-width: 52rem) {
  .hero { min-height: 0; }
  .hero-facts { position: relative; padding: 1.25rem 1rem 1rem; background: none; }
  .hero-actions { margin-top: 1.25rem; }
  .hero-lead { margin-bottom: 0; }
  /* move the sun or moon into the corner, clear of the text */
  .hero-art .hero-day, .hero-art .hero-moon, .hero-art .hero-glow { transform: translate(190px, -75px); }
  .hero-promise { max-width: none; }
  /* on narrow screens the copy spans the whole picture: darken it from the top */
  .hero::after {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: var(--hero-scrim);
  }
}

/* ---------- buttons ---------- */
.button, button.primary {
  display: inline-flex; align-items: center; gap: .6rem;
  font: inherit; font-weight: 600; font-size: .98rem; padding: .8rem 1.5rem;
  border: 0; cursor: pointer; border-radius: 999px; text-decoration: none;
  background: var(--accent); color: var(--on-accent);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), filter .2s;
}
.button::after {
  content: ""; width: 1.6rem; height: 1.6rem; border-radius: 999px; flex: none;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3Cmask id='m'%3E%3Crect width='24' height='24' fill='white'/%3E%3Cpath d='M12 7v10M7.5 12.5 12 17l4.5-4.5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/mask%3E%3C/defs%3E%3Ccircle cx='12' cy='12' r='12' fill='white' mask='url(%23m)'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .92;
}
.button { padding-right: 1.1rem; }
.button:hover, button.primary:hover { filter: brightness(1.12); transform: translateY(-1px); }
.button-light { background: #fff; color: #0f1a5c; }
button.secondary {
  font: inherit; font-size: .92rem; font-weight: 600; padding: .5rem 1rem; cursor: pointer;
  background: transparent; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px;
}
button.secondary:hover { background: var(--accent-soft); }
.field input:focus-visible, .field select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.hero a:focus-visible { outline-color: var(--hero-ink); }
@media (prefers-reduced-motion: reduce) { .button, button.primary { transition: none; } }

/* ---------- panels and form ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(1.25rem, 1rem + 1.2vw, 2rem); margin: 1.25rem 0;
}
.panel > h3:first-child { margin-top: 0; }

fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; }
legend { font-weight: 500; padding: 0; margin-bottom: 1rem; font-size: clamp(1.3rem, 1.15rem + .6vw, 1.6rem); letter-spacing: -0.025em; }

.fields { display: grid; gap: 1.1rem 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.field input[type="number"], .field input[type="text"], .field select {
  width: 100%; padding: .75rem .9rem; font: inherit; color: var(--ink);
  background: var(--surface-alt); border: 1px solid transparent; border-radius: var(--radius-sm);
  transition: border-color .15s, background .15s;
}
.field input:hover, .field select:hover { border-color: var(--line); }
.field input:focus-visible, .field select:focus-visible { background: var(--surface); border-color: var(--accent); outline-offset: 1px; }
.field .hint { display: block; margin-top: .4rem; color: var(--ink-soft); font-size: .84rem; }
.upload-field { margin-bottom: 1.25rem; }
.upload-field input { max-width: 20rem; }
.upload-field .hint { max-width: 70ch; }
.upload .choice { border: 0; padding: 0; }
.upload .choice legend { font-size: .9rem; font-weight: 600; letter-spacing: 0; margin-bottom: .5rem; }
.choice-option { display: flex; align-items: baseline; gap: .55rem; margin-bottom: .4rem; cursor: pointer; font-size: .95rem; }
.choice-option input { flex: none; transform: translateY(.1em); }
.threshold-panel .threshold-assumption { font-size: .88rem; color: var(--ink-soft); }
.upload-subtitle { font-size: 1rem; font-weight: 600; margin: 0 0 .4rem; }

/* each yes/no question keeps its follow-up amount inside the same card */
.fields.fields-toggles { margin-top: 1.1rem; grid-template-columns: 1fr; gap: .6rem; }
.toggle { display: grid; align-items: center; border-radius: var(--radius-sm); border: 1px solid var(--line); transition: border-color .15s, background .15s; }
@media (min-width: 40rem) {
  .toggle { grid-template-columns: 1fr minmax(15rem, 20rem); }
  .toggle .toggle-detail { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .75rem; padding: .5rem .6rem .5rem 0; }
  .toggle .toggle-detail[hidden] { display: none; }
  .toggle .toggle-detail label { margin: 0; white-space: nowrap; }
  .toggle .toggle-detail input[type="number"] { padding-block: .55rem; }
}
.toggle:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.field-inline { display: flex; align-items: center; gap: .6rem; padding: .75rem .9rem; }
.field-inline label { margin: 0; font-weight: 500; flex: 1; cursor: pointer; }
.field-inline input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin: 0; flex: none; }
.toggle-detail { padding: 0 .9rem .9rem 2.65rem; }
.toggle-detail label { font-weight: 500; font-size: .86rem; }
.toggle .field input[type="number"] { background: var(--surface); }
.field input[aria-invalid="true"] { border-color: var(--warn); background: var(--warn-soft); }
.field-error { display: block; margin-top: .4rem; color: var(--warn); font-size: .88rem; font-weight: 600; }
.suffix { color: var(--ink-soft); font-size: .86rem; font-weight: 400; }

/* optional meter upload, folded into the form */
.upload { border-top: 1px solid var(--line); padding: 1.1rem 0 0; margin-bottom: 1.5rem; }
.upload summary { cursor: pointer; font-weight: 500; font-size: 1.1rem; letter-spacing: -0.015em; }
.upload[open] summary { margin-bottom: .85rem; }
.upload p:last-child { margin-bottom: 0; }
.upload input[type="file"] { font: inherit; font-size: .92rem; display: block; width: 100%; max-width: 100%; }
.upload input[type="file"]::file-selector-button {
  font: inherit; font-weight: 600; margin-right: .75rem; padding: .5rem 1rem; border-radius: 999px;
  border: 1px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer;
}

.error {
  margin-top: 1rem; padding: .8rem 1rem; border-radius: var(--radius-sm);
  background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn);
}

/* ---------- results ---------- */
.loading { color: var(--ink-soft); }
#result-title { margin-top: 3.5rem; }
#result-title:focus { outline: none; }
.basis { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .5rem; margin: 0 0 1.25rem; font-size: .88rem; color: var(--ink-soft); max-width: none; }
.basis-label { font-weight: 600; color: var(--ink); }
.basis-item { padding: .15rem .6rem; border-radius: 999px; background: var(--surface-alt); }
.basis-edit { font-weight: 600; margin-left: .25rem; }

.verdict { padding: clamp(1.4rem, 1rem + 2vw, 2.5rem); border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.verdict-line { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); font-weight: 500; letter-spacing: -0.01em; line-height: 1.4; margin-bottom: 1.25rem; max-width: 60ch; }
.verdict-figures { display: grid; gap: 1.25rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); padding-top: 1.25rem; border-top: 1px solid var(--line); }
.figure p { margin: 0; max-width: none; }
.figure .figure-label { font-size: .86rem; color: var(--ink-soft); margin-bottom: .4rem; max-width: 24rem; }
.figure .figure-value { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); font-weight: 400; line-height: 1.05; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.figure-arrow { color: var(--ink-soft); font-size: .6em; vertical-align: .15em; margin: 0 .15em; }
.figure .figure-delta { display: inline-block; margin-top: .6rem; font-size: .88rem; font-weight: 600; padding: .2rem .65rem; border-radius: 999px; background: var(--surface-alt); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.verdict-loss .figure .figure-delta { background: var(--warn-soft); color: var(--warn); }
.verdict-gain .figure .figure-delta { background: var(--accent-soft); color: var(--accent); }
.figure-self .figure-value { color: var(--accent); }
.verdict .verdict-total { margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .92rem; color: var(--ink-soft); }
.figure .figure-note { margin-top: .6rem; font-size: .92rem; color: var(--ink-soft); }
.verdict-context { margin: 0; color: var(--ink-soft); }

#results.is-stale > :not(.stale-note) { opacity: .4; }
.stale-note {
  position: sticky; top: .75rem; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem;
  margin: 1rem 0; padding: .8rem .8rem .8rem 1.25rem; border-radius: var(--radius);
  background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn);
}
.stale-note p { margin: 0; font-weight: 600; flex: 1 1 16rem; }

.badge-meter {
  display: inline-block; margin-top: .75rem; padding: .3rem .75rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: .85rem; font-weight: 600;
}

/* the one idea no other calculator has: a deep navy feature block */
.panel-highlight { background: var(--feature); border-color: var(--feature); color: var(--feature-ink); }
.panel-highlight h3 { color: var(--feature-ink); font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); font-weight: 400; letter-spacing: -0.03em; }
.panel-highlight p { color: var(--feature-soft); }
.panel-highlight .muted { color: var(--feature-soft); }
.threshold-table { border-collapse: collapse; margin: 1.25rem 0; font-variant-numeric: tabular-nums; width: 100%; display: block; overflow-x: auto; }
.threshold-table th, .threshold-table td { text-align: left; padding: .8rem 1.5rem .8rem 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.threshold-table thead th { font-size: .8rem; color: var(--ink-soft); font-weight: 500; padding-block: .4rem; }
.threshold-table tbody th { font-weight: 500; white-space: nowrap; }
.threshold-value { font-size: 1.6rem; font-weight: 400; letter-spacing: -0.03em; white-space: nowrap; }
.threshold-value .unit { font-size: .8rem; font-weight: 500; color: var(--ink-soft); letter-spacing: 0; }
.row-below .threshold-value { color: var(--accent); }
.threshold-meaning { font-size: .92rem; min-width: 14rem; color: var(--ink-soft); }
@media (max-width: 34rem) {
  .threshold-table thead { display: none; }
  .threshold-table tr { display: grid; grid-template-columns: auto 1fr; gap: 0 1rem; align-items: baseline; padding: .7rem 0; border-bottom: 1px solid var(--line); }
  .threshold-table th, .threshold-table td { border: 0; padding: 0; }
  .threshold-table .threshold-meaning { grid-column: 1 / -1; min-width: 0; margin-top: .2rem; }
}

/* switch-off prices: quarters by years */
.threshold-scroll { overflow-x: auto; margin: 1.25rem 0 .75rem; }
.threshold-grid { border-collapse: collapse; width: 100%; min-width: 30rem; font-variant-numeric: tabular-nums; }
.threshold-grid th, .threshold-grid td { padding: .7rem .75rem; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.threshold-grid th:first-child { text-align: left; padding-left: 0; font-weight: 500; }
.threshold-grid thead th { font-size: .82rem; font-weight: 500; color: var(--ink-soft); }
.threshold-grid td { font-size: 1.2rem; letter-spacing: -0.02em; }
.threshold-grid .cell-below { color: var(--accent); font-weight: 500; }
.threshold-grid .cell-zero { color: var(--ink-soft); }
.threshold-panel .threshold-key { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; font-size: .88rem; margin-bottom: .75rem; }
.threshold-key .key-below::before, .threshold-key .key-zero::before { content: ""; display: inline-block; width: .7rem; height: .7rem; border-radius: 999px; margin-right: .45rem; vertical-align: .05em; }
.threshold-key .key-below::before { background: var(--accent); }
.threshold-key .key-zero::before { background: var(--line); }

/* levers: numbered cards for what is worth it, a quiet list for what is not */
.levers-group { font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin: 1.75rem 0 .75rem; color: var(--ink-soft); }
.levers { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); list-style: none; padding: 0; margin: 0; counter-reset: lever; }
.lever {
  counter-increment: lever; position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1.25rem;
}
.lever::before { content: counter(lever, decimal-leading-zero); display: block; font-size: .82rem; color: var(--ink-soft); margin-bottom: .6rem; font-variant-numeric: tabular-nums; }
.lever h5 { font-size: 1.1rem; margin: 0 0 .3rem; font-weight: 500; }
.lever p:last-child { margin-bottom: 0; }
.lever-gain { font-size: 1.9rem; font-weight: 400; letter-spacing: -0.03em; color: var(--gain); margin: .2rem 0 .6rem; font-variant-numeric: tabular-nums; }
.lever-gain span { font-size: .82rem; font-weight: 500; color: var(--ink-soft); letter-spacing: 0; }
main .lever, main .lever-skip { max-width: none; }
.levers-skip { list-style: none; padding: 0; margin: 0; }
.lever-skip { padding: .9rem 0; border-top: 1px solid var(--line); color: var(--ink-soft); }
.lever-skip p { margin: 0; font-size: .92rem; max-width: 70ch; }
.lever-skip .lever-skip-title { color: var(--ink); font-weight: 500; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .3rem; font-size: 1rem; }
.pills { display: flex; flex-wrap: wrap; gap: .4rem; margin: .75rem 0 0; }
.pill { font-size: .78rem; padding: .25rem .65rem; border-radius: 999px; background: var(--surface-alt); color: var(--ink-soft); font-weight: 500; }
.pill-free { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pill-warn { background: var(--warn-soft); color: var(--warn); font-weight: 600; }

/* the result: three questions in order */
.step { margin: 1.25rem 0; padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.step > h3 { display: flex; align-items: center; gap: .75rem; margin: 0 0 1rem; font-size: clamp(1.25rem, 1.1rem + .6vw, 1.55rem); }
.step-num { display: inline-grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .95rem; font-weight: 600; letter-spacing: 0; }
.step .verdict-line { margin-bottom: .6rem; }
.step .verdict-share { color: var(--ink-soft); margin-bottom: 1.1rem; }
.step .operator { margin: 1.1rem 0 0; }

.years-strip { padding-top: 1rem; border-top: 1px solid var(--line); }
.years-strip .years-strip-label { font-size: .84rem; color: var(--ink-soft); margin-bottom: .5rem; }
.years-strip-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: .5rem; list-style: none; margin: 0; padding: 0; }
.years-strip-list li { display: grid; gap: .1rem; padding: .6rem .75rem; border-radius: var(--radius-sm); background: var(--surface-alt); font-variant-numeric: tabular-nums; max-width: none; }
.years-strip-list li.is-current { background: var(--accent-soft); }
.ys-year { font-size: .8rem; color: var(--ink-soft); }
.ys-delta { font-size: 1.15rem; font-weight: 500; letter-spacing: -0.02em; }
.ys-pct { font-size: .8rem; color: var(--ink-soft); }

.actions { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .75rem; }
.action { padding: 1rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); max-width: none; }
.action.is-worth { border-color: var(--accent); background: var(--accent-soft); }
.action p { margin: 0; max-width: 70ch; }
.action-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem 1rem; margin-bottom: .35rem; }
.action .action-title { font-weight: 600; }
.action .action-gain { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.action:not(.is-worth) .action-gain { color: var(--ink-soft); }
.action-gain span { font-size: .8rem; font-weight: 400; color: var(--ink-soft); letter-spacing: 0; }
.action .action-how { font-size: .92rem; color: var(--ink-soft); }
.action .action-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .6rem; font-size: .84rem; color: var(--ink-soft); }

.advice.is-no { border-color: var(--line); }
.advice.is-yes { border-color: var(--accent); }
.advice .advice-answer { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); line-height: 1.45; letter-spacing: -0.01em; max-width: 60ch; }
.advice p:last-child { margin-bottom: 0; }

.fold > summary { cursor: pointer; list-style-position: outside; }
.fold > summary::marker { color: var(--accent); }
.more { margin: 1.5rem 0; border-top: 1px solid var(--line); }
.more-item { border-bottom: 1px solid var(--line); padding: .85rem 0; }
.more-item > summary { font-weight: 500; font-size: 1.02rem; }
.more-item[open] > summary { margin-bottom: .75rem; }
.more-item .panel { margin: 0; padding: 0; border: 0; background: none; border-radius: 0; }
.more-item .panel > h3:first-child { display: none; }
.more .years { margin: 0; }
.operator.fold > summary { font-size: .95rem; }
.operator.fold[open] > summary { margin-bottom: .6rem; }

/* the visitor's grid company */
.operator { margin: 0 0 1.25rem; padding: 1rem 1.25rem; border-radius: var(--radius-sm); background: var(--surface-alt); font-size: .92rem; }
.operator p { margin: 0 0 .5rem; max-width: none; }
.operator ul { margin: .25rem 0 .6rem; padding-left: 1.1rem; }
.operator li { margin-bottom: .2rem; max-width: 70ch; }
.operator-name { font-size: 1rem; font-weight: 600; }
.operator-label { font-weight: 400; color: var(--ink-soft); }
.operator-choice { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; }
.operator-choice select { font: inherit; padding: .4rem .6rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); max-width: 100%; }
.operator-effect { font-weight: 600; }
.operator .operator-meta { margin: 0; font-size: .8rem; color: var(--ink-soft); }
.operator.is-uncertain { border: 1px dashed var(--line); }

/* the same house, year by year */
.years-scroll { overflow-x: auto; margin: 1rem 0 .75rem; }
.years-table { border-collapse: collapse; width: 100%; min-width: 40rem; font-variant-numeric: tabular-nums; }
.years-table th, .years-table td { text-align: right; padding: .65rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.years-table th:first-child { text-align: left; padding-left: 0; }
.years-table thead th { font-size: .8rem; font-weight: 500; color: var(--ink-soft); white-space: normal; vertical-align: bottom; }
.years-table tbody th { font-weight: 600; }
.years-table tr.is-current { background: var(--accent-soft); }
.years-table tr.is-current th { padding-left: .6rem; }
.years-tag { display: inline-block; margin-left: .4rem; font-size: .72rem; font-weight: 500; color: var(--accent); }
.years-delta { font-weight: 600; }
.years-delta.is-loss { color: var(--loss); }
.years-delta.is-gain { color: var(--gain); }
.years .years-range { font-weight: 500; margin-bottom: .5rem; }
.years p:last-child { margin-bottom: 0; }

/* payment decomposition */
.bar { display: flex; height: 18px; border-radius: 999px; overflow: hidden; background: var(--surface-alt); margin: 1.25rem 0 1rem; gap: 3px; }
.bar-seg { display: block; height: 100%; }
.seg-guaranteed { background: var(--seg-a); }
.seg-timing { background: var(--seg-b); }
.seg-go { background: var(--seg-c); }
.seg-negative { background: repeating-linear-gradient(45deg, var(--loss), var(--loss) 4px, transparent 4px, transparent 8px), var(--warn-soft); }
.key.seg-negative { border: 1px solid var(--loss); }
.legend { margin: 0; display: grid; gap: .6rem; }
.legend > div { display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr; gap: .5rem; align-items: baseline; }
@media (max-width: 34rem) { .legend > div { grid-template-columns: 1fr; gap: .1rem; } }
.legend dt { font-weight: 500; display: flex; align-items: center; gap: .5rem; }
.legend dd { margin: 0; font-variant-numeric: tabular-nums; }
.key { width: .8rem; height: .8rem; border-radius: 999px; display: inline-block; flex: none; }

/* payment breakdown as a receipt */
.receipt { border-collapse: collapse; width: 100%; max-width: 44rem; margin-top: .5rem; font-variant-numeric: tabular-nums; }
.receipt th, .receipt td { padding: .6rem 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.receipt th { text-align: left; font-weight: 500; }
.receipt th .muted { display: block; font-weight: 400; font-size: .84rem; margin-top: .1rem; margin-left: 1.5rem; }
.receipt td { text-align: right; white-space: nowrap; font-size: 1.05rem; padding-left: 1rem; }
.receipt .op { display: inline-block; width: 1.5rem; color: var(--ink-soft); }
.receipt tfoot th, .receipt tfoot td { font-weight: 600; border-bottom: 0; border-top: 2px solid var(--ink); }

/* raw figures */
.facts { margin: 1.5rem 0; }
.facts-title { font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin: 0 0 .75rem; }
.grid-stats { display: grid; gap: 0 1.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
@media (min-width: 48rem) { .grid-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { padding: .8rem 0; border-top: 1px solid var(--line); }
.stat dt { font-size: .82rem; color: var(--ink-soft); margin-bottom: .15rem; }
.stat dd { margin: 0; font-size: 1.35rem; font-weight: 400; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }


.callout { border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin: 1rem 0; border: 1px solid var(--line); }
.callout-info { background: var(--accent-soft); border-color: var(--accent); }
.callout-warn { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.callout p:last-child { margin-bottom: 0; }

input, select, textarea, table, img, svg { max-width: 100%; }

/* ---------- content pages ---------- */
.prose { max-width: 46rem; padding-top: 1.5rem; }
.prose h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin-bottom: .45rem; }
.prose li::marker { color: var(--accent); }
.prose table { border-collapse: collapse; width: 100%; margin: 1.25rem 0; }
.prose th, .prose td { text-align: left; padding: .7rem .75rem .7rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 600; }

/* FAQ and problem report */
.faq-item { margin: 2rem 0; }
.faq-item h2 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); margin: 0 0 .6rem; }
.faq .faq-sources { font-size: .84rem; color: var(--ink-soft); }
.report { margin: .5rem 0 1.5rem; font-size: .9rem; display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; }

/* ---------- footer ---------- */
footer.site-footer { background: var(--surface-alt); color: var(--ink-soft); font-size: .88rem; border-radius: 28px 28px 0 0; }
footer.site-footer .wrap { padding-block: 2rem 2.5rem; display: grid; gap: .4rem; }
footer.site-footer p { margin: 0; max-width: 70ch; }

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