/* Fisco design system. Static, no build step, no external requests.
   Direction C layout + D palette (ink and marigold on cream). Logo 1 "Total".
   Theme: light by default, dark via prefers-color-scheme unless [data-theme="light"].
   [data-theme="light"|"dark"] on any element also scopes a theme (used by the design canvas). */

/* ---------- Tokens: shared ---------- */
:root, [data-theme] {
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --text-xs: 0.8125rem;   /* 13 */
  --text-sm: 0.875rem;    /* 14 */
  --text-md: 1rem;        /* 16 */
  --text-lg: 1.125rem;    /* 18 */
  --text-xl: 1.375rem;    /* 22 */
  --text-2xl: 1.75rem;    /* 28 */
  --text-3xl: 2.25rem;    /* 36 */
  --text-4xl: 3rem;       /* 48 */

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-pill: 999px;
  --gutter: 16px;
  --max: 1120px;
  --target: 44px;
}

/* ---------- Tokens: light ---------- */
:root, [data-theme="light"] {
  --bg: #FFF8EC;
  --surface: #FFFFFF;
  --surface-2: #FBF3E2;
  --ink: #1F2A2A;            /* 13.98:1 on bg */
  --ink-2: #4A5857;          /* 7.04:1 on bg, 7.43:1 on surface */
  --line: #E6D9BE;           /* decorative dividers */
  --line-strong: #6F807E;    /* input borders, 4.15:1 on surface */
  --accent: #F4B63F;         /* marigold */
  --on-accent: #1F2A2A;      /* 8.16:1 on accent */
  --focus: #1F2A2A;
  --link-ul: #F4B63F;
  --btn-bg: #1F2A2A; --btn-ink: #FFF8EC; --btn-hover-bg: #F4B63F; --btn-hover-ink: #1F2A2A;
  --answer-bg: #1F2A2A; --answer-ink: #FFF8EC; --answer-num: #F4B63F; --answer-eyebrow: #F9D27F;
  --stat-hi: #FCE7B2; --stat-hi-ink: #1F2A2A;
  --ok-bg: #DDEFD9;   --ok-ink: #14532D;
  --warn-bg: #FFF1C2; --warn-ink: #3D2900; --warn-border: #8A5A00;
  --caution-bg: #FBE7B0; --caution-ink: #5C3B00;
  --err-bg: #FBE4DF;  --err-ink: #5E1509; --err-border: #A3331E;
  --bad-bg: #F9D9D2;  --bad-ink: #7A1F10;
  --shadow: 0 1px 0 rgba(31,42,42,.06), 0 12px 28px -18px rgba(31,42,42,.35);
  --logo-tile: #1F2A2A; --logo-f: #FFF8EC; --logo-rule: #F4B63F;
  color-scheme: light;
}

/* ---------- Tokens: dark (designed, not inverted) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141A1A; --surface: #1C2424; --surface-2: #101515;
    --ink: #F3EDE0; --ink-2: #B5BFBC; --line: #2E3A3A; --line-strong: #6E8280;
    --accent: #F4B63F; --on-accent: #141A1A; --focus: #F4B63F; --link-ul: #F4B63F;
    --btn-bg: #F4B63F; --btn-ink: #141A1A; --btn-hover-bg: #F3EDE0; --btn-hover-ink: #141A1A;
    --answer-bg: #24302F; --answer-ink: #F3EDE0; --answer-num: #F4B63F; --answer-eyebrow: #F9D27F;
    --stat-hi: #3A2F12; --stat-hi-ink: #F3EDE0;
    --ok-bg: #1E3A27; --ok-ink: #9FE0B0;
    --warn-bg: #3A2D0C; --warn-ink: #FBE3A5; --warn-border: #C9A227;
    --caution-bg: #3D2E0B; --caution-ink: #F6CD72;
    --err-bg: #44201A; --err-ink: #FFC9BE; --err-border: #E0654A;
    --bad-bg: #4A1D17; --bad-ink: #FFB3A5;
    --shadow: 0 1px 0 rgba(0,0,0,.4), 0 12px 28px -18px rgba(0,0,0,.8);
    --logo-tile: #F4B63F; --logo-f: #141A1A; --logo-rule: #141A1A;
    color-scheme: dark;
  }
}
[data-theme="dark"] {
  --bg: #141A1A; --surface: #1C2424; --surface-2: #101515;
  --ink: #F3EDE0; --ink-2: #B5BFBC; --line: #2E3A3A; --line-strong: #6E8280;
  --accent: #F4B63F; --on-accent: #141A1A; --focus: #F4B63F; --link-ul: #F4B63F;
  --btn-bg: #F4B63F; --btn-ink: #141A1A; --btn-hover-bg: #F3EDE0; --btn-hover-ink: #141A1A;
  --answer-bg: #24302F; --answer-ink: #F3EDE0; --answer-num: #F4B63F; --answer-eyebrow: #F9D27F;
  --stat-hi: #3A2F12; --stat-hi-ink: #F3EDE0;
  --ok-bg: #1E3A27; --ok-ink: #9FE0B0;
  --warn-bg: #3A2D0C; --warn-ink: #FBE3A5; --warn-border: #C9A227;
  --caution-bg: #3D2E0B; --caution-ink: #F6CD72;
  --err-bg: #44201A; --err-ink: #FFC9BE; --err-border: #E0654A;
  --bad-bg: #4A1D17; --bad-ink: #FFB3A5;
  --shadow: 0 1px 0 rgba(0,0,0,.4), 0 12px 28px -18px rgba(0,0,0,.8);
  --logo-tile: #F4B63F; --logo-f: #141A1A; --logo-rule: #141A1A;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--text-md)/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
.theme-scope { background: var(--bg); color: var(--ink); font: 400 var(--text-md)/1.55 var(--font-body); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; margin: 0; }
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
p { margin: 0 0 var(--s-3); }
.small { font-size: var(--text-sm); color: var(--ink-2); }
.nl { color: var(--ink-2); font-weight: 400; }
.num, .money { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.eyebrow { font-size: var(--text-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--link-ul); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { background: var(--accent); color: var(--on-accent); text-decoration-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: var(--gutter); top: -100px; background: var(--btn-bg); color: var(--btn-ink); padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); z-index: 10; }
.skip:focus { top: var(--s-2); }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 760px) { .container { padding-inline: var(--s-5); } }

/* ---------- Header, brand, nav (1 tool now, 3-5 later) ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-5); padding-block: var(--s-2); }
.brand { display: inline-flex; align-items: center; min-height: var(--target); color: var(--ink); text-decoration: none; }
.brand:hover { background: none; color: var(--ink); }
.brand { gap: 10px; }
.brand svg { height: 36px; width: 36px; display: block; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.625rem; line-height: 1; letter-spacing: -0.01em; }
.brand .tile { fill: var(--logo-tile); } .brand .f { fill: var(--logo-f); } .brand .rule { fill: var(--logo-rule); }
.nav { flex: 1 1 auto; min-width: 0; }
.nav ul { display: flex; gap: var(--s-1); list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.nav li { flex: none; }
.nav a { display: inline-flex; align-items: center; min-height: var(--target); padding: 0 var(--s-4); border-radius: var(--r-pill); font-weight: 600; font-size: var(--text-sm); text-decoration: none; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--btn-bg); color: var(--btn-ink); }
.nav .soon { color: var(--ink-2); }
@media (min-width: 760px) { .nav { flex: 0 1 auto; } .nav ul { justify-content: flex-end; } }

/* ---------- Page intro ---------- */
.intro { padding-block: var(--s-5) var(--s-4); }
.intro h1 { max-width: 22ch; margin-bottom: var(--s-3); }
.intro p { max-width: 62ch; color: var(--ink-2); font-size: var(--text-lg); }
@media (min-width: 960px) { .intro { padding-block: var(--s-6) var(--s-5); } .intro h1 { font-size: var(--text-4xl); } }

/* ---------- Scope strip: who this calculator is for ---------- */
.intro-row { display: grid; gap: var(--s-4); align-items: end; padding-block: var(--s-5) var(--s-4); }
.intro-row .intro { padding: 0; }
@media (min-width: 960px) { .intro-row { grid-template-columns: minmax(0, 1fr) 380px; gap: var(--s-6); padding-block: var(--s-6) var(--s-5); } }
.scope { background: var(--stat-hi); color: var(--stat-hi-ink); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); }
.scope-title { margin: 0 0 var(--s-2); font-weight: 700; font-size: var(--text-sm); letter-spacing: .06em; text-transform: uppercase; }
.scope-list { list-style: none; margin: 0 0 var(--s-2); padding: 0; display: grid; gap: var(--s-2); }
.scope-list li { display: flex; gap: var(--s-2); align-items: flex-start; font-weight: 600; }
.scope-list li::before { content: "\2713"; flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-ink); font-size: 13px; line-height: 22px; text-align: center; }
.scope .small { margin: 0; color: var(--stat-hi-ink); opacity: .85; }
.scope .nl { color: inherit; opacity: .8; }

/* ---------- Layout: form + result ---------- */
.layout { display: grid; gap: var(--s-5); align-items: start; padding-bottom: var(--s-7); }
@media (min-width: 960px) { .layout { grid-template-columns: 400px minmax(0, 1fr); gap: var(--s-6); } .layout .col-form { position: sticky; top: var(--s-4); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); box-shadow: var(--shadow); }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: var(--s-1); margin-bottom: var(--s-4); }
.field > label, legend { font-weight: 700; font-size: var(--text-md); }
.help { font-size: var(--text-sm); color: var(--ink-2); margin: 0; }
.input, select, .input-group {
  min-height: var(--target); width: 100%; border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font: inherit; padding: 0 var(--s-4);
}
.input-group { display: flex; align-items: stretch; padding: 0; overflow: hidden; }
.input-group .prefix { display: flex; align-items: center; justify-content: center; min-width: 44px; background: var(--surface-2); color: var(--ink-2); border-right: 1.5px solid var(--line-strong); font-weight: 600; }
.input-group input { flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; font: inherit; padding: 0 var(--s-4); min-height: 41px; font-variant-numeric: tabular-nums; }
.input-group input:focus-visible { outline: none; }
.input-group:focus-within, .input:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
select { appearance: none; padding-right: var(--s-6); background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.input-group:hover, select:hover, .input:hover { border-color: var(--ink); }
.field.has-error .input-group, .field.has-error .input, .field.has-error select { border-color: var(--err-border); border-width: 2px; }
.field-error { display: flex; gap: var(--s-2); align-items: flex-start; margin: 0; font-size: var(--text-sm); font-weight: 600; color: var(--err-ink); }
.field-error::before { content: "!"; flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--err-border); color: var(--bg); font-size: 12px; line-height: 18px; text-align: center; }
.input-group.is-disabled, select:disabled { opacity: .55; cursor: not-allowed; }
.check { display: flex; gap: var(--s-3); align-items: flex-start; margin-bottom: var(--s-4); }
.check input { appearance: none; flex: none; width: 24px; height: 24px; margin: 10px 0 0; border: 2px solid var(--line-strong); border-radius: 7px; background: var(--surface); display: grid; place-content: center; cursor: pointer; }
.check input::after { content: ""; width: 12px; height: 7px; border-left: 3px solid var(--btn-ink); border-bottom: 3px solid var(--btn-ink); transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.check input:checked { background: var(--btn-bg); border-color: var(--btn-bg); }
.check input:checked::after { opacity: 1; }
.check .check-body { display: flex; flex-direction: column; gap: var(--s-1); padding-top: var(--s-2); }
.check label { font-weight: 700; cursor: pointer; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 52px; padding: 0 var(--s-6); border: 2px solid var(--btn-bg); border-radius: var(--r-pill); background: var(--btn-bg); color: var(--btn-ink); font: 700 var(--text-lg)/1 var(--font-body); cursor: pointer; width: 100%; text-decoration: none; }
.btn:hover { background: var(--btn-hover-bg); color: var(--btn-hover-ink); border-color: var(--btn-hover-bg); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.secondary:hover { background: var(--ink); color: var(--bg); }
.btn.is-loading { cursor: progress; }
.btn.is-loading::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.assumes { margin-top: var(--s-4); border-top: 1px dashed var(--line-strong); padding-top: var(--s-2); }
.assumes summary { display: flex; align-items: center; gap: var(--s-2); min-height: var(--target); font-weight: 600; font-size: var(--text-sm); cursor: pointer; list-style: none; }
.assumes summary::-webkit-details-marker { display: none; }
.assumes summary::before { content: "+"; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-strong); text-align: center; line-height: 19px; font-weight: 700; }
.assumes[open] summary::before { content: "\2212"; }
.assumes ul { margin: 0 0 var(--s-2); padding-left: var(--s-5); font-size: var(--text-sm); color: var(--ink-2); }
.assumes li { margin-bottom: var(--s-1); }

/* ---------- Result: answer, cards, notices ---------- */
.placeholder-panel { border: 2px dashed var(--line-strong); border-radius: var(--r-lg); padding: var(--s-6) var(--s-5); color: var(--ink-2); }
.placeholder-panel strong { display: block; color: var(--ink); font-family: var(--font-display); font-size: var(--text-xl); margin-bottom: var(--s-1); }
.answer { background: var(--answer-bg); color: var(--answer-ink); border-radius: var(--r-lg); padding: var(--s-5); }
.answer .eyebrow { color: var(--answer-eyebrow); }
.answer h2 { font-size: var(--text-2xl); margin: var(--s-2) 0; }
.answer h2 .figure { color: var(--answer-num); font-size: 1.25em; white-space: nowrap; }
.answer p { margin: 0; opacity: .92; }
@media (min-width: 760px) { .answer { padding: var(--s-6); } .answer h2 { font-size: var(--text-3xl); } }
.stats { display: grid; gap: var(--s-3); margin-top: var(--s-3); }
@media (min-width: 560px) { .stats { grid-template-columns: 1fr 1fr; } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); }
.stat.hi { background: var(--stat-hi); color: var(--stat-hi-ink); border-color: transparent; }
.stat .label { font-weight: 700; font-size: var(--text-sm); }
.stat .big { display: block; font-family: var(--font-display); font-weight: 800; font-size: var(--text-3xl); line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat p { margin: var(--s-1) 0 0; font-size: var(--text-sm); }
.stat:not(.hi) p { color: var(--ink-2); }

.notice, .error { border: 1.5px solid; border-radius: var(--r-md); padding: var(--s-3) var(--s-4); display: flex; gap: var(--s-3); align-items: flex-start; font-size: var(--text-sm); margin: var(--s-3) 0; }
.notice { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-border); }
.error { background: var(--err-bg); color: var(--err-ink); border-color: var(--err-border); }
.notice .badge, .error .badge { flex: none; }
.error strong, .notice strong { display: block; font-size: var(--text-md); }
.error p, .notice p { margin: 0; }
#flags { margin: 0; padding: 0; list-style: none; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--text-xs); font-weight: 700; line-height: 1.6; white-space: nowrap; }
.badge::before { font-size: .85em; }
.badge.final { background: var(--ok-bg); color: var(--ok-ink); } .badge.final::before { content: "\2713"; }
.badge.proposal { background: var(--caution-bg); color: var(--caution-ink); } .badge.proposal::before { content: "\25B2"; }
.badge.unchanged_law { background: var(--caution-bg); color: var(--caution-ink); } .badge.unchanged_law::before { content: "\25C6"; }
.badge.unknown { background: var(--bad-bg); color: var(--bad-ink); } .badge.unknown::before { content: "?"; font-weight: 800; }
.badge.missing { background: var(--bad-bg); color: var(--bad-ink); } .badge.missing::before { content: "\2715"; }

/* ---------- Receipt breakdown ---------- */
.breakdown-title { margin: var(--s-6) 0 var(--s-1); }
.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4) var(--s-4) var(--s-3); margin-top: var(--s-3); }
.block h3 { display: flex; gap: var(--s-3); align-items: center; font-size: var(--text-xl); }
.block h3 .step { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-ink); font: 700 var(--text-sm)/28px var(--font-body); text-align: center; letter-spacing: 0; }
.block > .small { margin: var(--s-1) 0 var(--s-2); }
table.receipt { width: 100%; border-collapse: collapse; }
table.receipt td { padding: var(--s-3) 0; vertical-align: top; border-bottom: 1px dotted var(--line-strong); }
table.receipt td.op { width: 32px; padding-right: var(--s-2); color: var(--ink-2); font-weight: 700; font-variant-numeric: tabular-nums; }
table.receipt td.num { text-align: right; white-space: nowrap; padding-left: var(--s-3); font-weight: 600; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.label { font-weight: 600; }
.label .nl { font-weight: 400; }
.explain { font-size: var(--text-sm); color: var(--ink-2); margin-top: 2px; }
.meta { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); align-items: center; margin-top: var(--s-1); font-size: var(--text-xs); }
.src { font-weight: 600; font-size: var(--text-xs); }
.src::after { content: " \2197"; }
@media (pointer: coarse) { .src { display: inline-flex; align-items: center; min-height: var(--target); } }
table.receipt tr.result-row td { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 800; padding-top: var(--s-3); font-size: var(--text-lg); }
table.receipt tr.result-row td.num { font-family: var(--font-display); font-size: var(--text-xl); }
.rounding-note { margin-top: var(--s-4); }

/* ---------- How and when you pay ---------- */
.steps { list-style: none; counter-reset: s; margin: var(--s-3) 0 0; padding: 0; display: grid; gap: var(--s-3); }
.steps li { counter-increment: s; position: relative; padding: var(--s-3) var(--s-4) var(--s-3) 56px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.steps li::before { content: counter(s); position: absolute; left: var(--s-4); top: var(--s-3); width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 800 var(--text-sm)/28px var(--font-display); text-align: center; }
.steps p { margin: 0; }

/* ---------- Rules page ---------- */
.open-points { margin: var(--s-4) 0 var(--s-5); padding: 0; list-style: none; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: var(--s-7); }
table.rules { width: 100%; border-collapse: collapse; }
table.rules th { text-align: left; font-size: var(--text-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding: var(--s-3) var(--s-4); background: var(--surface-2); border-bottom: 1px solid var(--line); }
table.rules td { padding: var(--s-4); vertical-align: top; border-bottom: 1px solid var(--line); }
table.rules tr:last-child td { border-bottom: 0; }
table.rules tr:target { background: var(--stat-hi); }
.rule-name { font-weight: 700; } .rule-name .nl { font-weight: 400; }
code, .value { font-family: var(--font-mono); font-size: var(--text-sm); overflow-wrap: anywhere; word-break: break-word; }
code.id { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: var(--text-xs); }
.value { display: block; background: var(--surface-2); border-radius: var(--r-sm); padding: var(--s-2) var(--s-3); }
@media (max-width: 759px) {
  table.rules thead { display: none; }
  table.rules, table.rules tbody, table.rules tr, table.rules td { display: block; }
  .table-wrap { background: none; border: 0; border-radius: 0; overflow: visible; }
  table.rules tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-2) var(--s-4); margin-bottom: var(--s-3); }
  table.rules td { border: 0; padding: var(--s-2) 0; }
  table.rules td[data-label]::before { content: attr(data-label); display: block; font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 2px; }
  table.rules td.rule-cell::before { display: none; }
}

/* ---------- Prose (privacy) ---------- */
.prose { max-width: 68ch; padding-bottom: var(--s-7); }
.prose h2 { font-size: var(--text-xl); margin: var(--s-6) 0 var(--s-2); }
.prose ul { padding-left: var(--s-5); margin: 0 0 var(--s-4); }
.prose li { margin-bottom: var(--s-2); }
.prose .lead { font-size: var(--text-lg); color: var(--ink-2); }
.promise { display: grid; gap: var(--s-2); margin: var(--s-5) 0; padding: var(--s-4) var(--s-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); list-style: none; }
.promise li { margin: 0; display: flex; gap: var(--s-3); font-weight: 600; }
.promise li::before { content: "\2713"; color: var(--ok-ink); background: var(--ok-bg); width: 22px; height: 22px; flex: none; border-radius: 50%; text-align: center; font-size: 13px; line-height: 22px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface-2); padding-block: var(--s-5); font-size: var(--text-sm); color: var(--ink-2); }
.site-footer .container { display: grid; gap: var(--s-2); }
.site-footer .disclaimer { color: var(--ink); max-width: 80ch; margin: 0; }
.site-footer .checked { font-family: var(--font-mono); font-size: var(--text-xs); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .btn.is-loading::before { animation: none; border-right-color: currentColor; }
}

/* ---------- Fisco changes on top of the design handoff (see docs/design-system.md) ---------- */
/* Top-align the intro beside the taller scope box, so headings start at the same height on every page. */
.intro-row { align-items: start; }
/* 320px: long Dutch terms in the receipt set the grid track's min-content wider than the screen. */
.layout > * { min-width: 0; }
table.receipt .label, table.receipt .explain { overflow-wrap: anywhere; }
table.receipt td.op { white-space: nowrap; }
.nl[lang="nl"] { hyphens: auto; }  /* keeps "÷ 12" on one line */

/* Sentence case everywhere: no all-caps labels. */
.eyebrow, .scope-title, table.rules th, table.rules td[data-label]::before {
  text-transform: none; letter-spacing: 0;
}
.eyebrow { font-size: var(--text-sm); }
.site-footer .checked { font-family: inherit; }
.src::after { content: none; }

/* Signature: the accountant's double rule (as in the logo) under the grand total only. */
#sections .block:last-child tr.result-row td { border-bottom: 6px double var(--ink); }
.answer h2 .figure { display: inline-block; border-bottom: 6px double var(--answer-num); line-height: 1.05; }

/* "Who this is for" folds on small screens (app.js); always readable on desktop. */
.scope-details > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: var(--s-2); min-height: 28px; align-items: center; }
.scope-details > summary::-webkit-details-marker { display: none; }
.scope-details > summary::after { content: "+"; font-weight: 800; }
.scope-details[open] > summary::after { content: "\2212"; }
.scope-details:not([open]) > summary { margin: 0; }

/* Narrow phones: all nav items fit without hiding the last one. */
@media (max-width: 399px) { .nav a { padding: 0 9px; font-size: var(--text-xs); } }

/* One tax year: plain text, not a menu. */
.year-static { margin: 0; font-weight: 600; }
.year-static strong { font-family: var(--font-display); font-size: var(--text-lg); margin-left: var(--s-1); }

/* Empty result panel: a worked example computed by the engine. */
.placeholder-panel p { margin: 0 0 var(--s-2); }
.placeholder-panel .example { color: var(--ink); }
.placeholder-panel .example strong { display: inline; font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; margin: 0; }

/* Breakdown: explanations behind "Why?", so the calculation reads at a glance. */
details.why { display: contents; font-size: var(--text-xs); }
details.why[open] > .explain { order: 9; flex-basis: 100%; }
details.why > summary { display: inline-flex; align-items: center; min-height: 24px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
details.why .explain { font-size: var(--text-sm); }
@media (pointer: coarse) { details.why > summary { min-height: var(--target); } }

/* How you pay: steps in order are numbered; options are not. */
.options-title { font-size: var(--text-lg); margin: var(--s-5) 0 0; }
.steps.options li { counter-increment: none; padding-left: var(--s-4); }
.steps.options li::before { content: none; }

/* Rules page: values in plain language; ids and stored values folded into research notes. */
.value-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.rule-cell > .small { margin: var(--s-1) 0 0; }
details.notes { margin-top: var(--s-2); font-size: var(--text-xs); color: var(--ink-2); }
details.notes > summary { cursor: pointer; font-weight: 600; min-height: 24px; }
details.notes p { margin: var(--s-1) 0; }
details.notes .value { display: inline; padding: 1px 6px; font-size: var(--text-xs); }
@media (min-width: 760px) { table.rules td[data-label="Value"] { min-width: 300px; } }
