/* ==========================================================================
   MTD Made Clear: shared design system ("Quiet Utility")
   Pure CSS, no dependencies. WCAG 2.2 AA.
   Contrast (on #FFFFFF): text 17.9:1 · muted 7.6:1 · accent 5.5:1 ·
   safe 5.0:1 · warn 5.0:1 · danger 6.5:1 · control border 4.8:1
   ========================================================================== */

:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --text: #0F172A;
  --muted: #475569;
  --line: #CBD5E1;          /* card borders (decorative) */
  --line-soft: #E2E8F0;     /* row dividers (decorative) */
  --line-strong: #64748B;   /* form controls: meets 1.4.11 non-text contrast */
  --accent: #0F766E;        /* Deep Trust Teal */
  --accent-hover: #115E59;
  --brand-teal: #0B6B5B;    /* logo wordmark: "MTD" and "Clear" */
  --brand-navy: #0C1757;    /* logo wordmark: "Made" */
  --tint: #F0FDFA;          /* result highlight */
  --tint-line: #99F6E4;
  --safe: #15803D;   --safe-bg: #F0FDF4;
  --warn: #B45309;   --warn-bg: #FFFBEB;
  --danger: #B91C1C; --danger-bg: #FEF2F2;
  --radius: 8px;
  --radius-lg: 12px;
  --gutter: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.55 var(--font);
  overflow-wrap: break-word;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: 0.25em; }
strong { font-weight: 650; }
small, .small { font-size: 0.875rem; }
.num, table, input, .result, time { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

@media (min-width: 800px) {
  h1 { font-size: 2.125rem; }
  h2 { font-size: 1.5rem; }
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 var(--gutter); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -100px; z-index: 100;
  background: var(--text); color: #fff; padding: 12px 16px; border-radius: var(--radius);
}
.skip-link:focus { top: 8px; color: #fff; }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
/* Wordmark, drawn as text in the logo's colours (crisp at any size, no image to load) */
.brand {
  display: inline-flex; align-items: center; gap: 0.28em; min-height: 48px;
  font-weight: 800; font-size: 1.375rem; line-height: 1; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap;
}
.brand-teal { color: var(--brand-teal); }
.brand-navy { color: var(--brand-navy); }
.brand:hover { text-decoration: none; }
.brand:hover .brand-teal, .brand:hover .brand-navy { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.nav li { margin: 0; }
.nav a {
  display: flex; align-items: center; min-height: 48px; padding: 0 10px;
  color: var(--text); text-decoration: none; border-radius: var(--radius); font-size: 0.9375rem;
}
.nav a:hover { background: var(--bg); color: var(--accent-hover); }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 650; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.nav .nav-all { display: none; }
@media (max-width: 759px) {
  .nav li { display: none; }
  .nav li.nav-all { display: block; }
  .nav .nav-all a { font-weight: 600; color: var(--accent); }
}

/* ---------- Breadcrumb + page head ---------- */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; margin: 4px 0 0; padding: 0; font-size: 0.875rem; color: var(--muted); }
.breadcrumb li { margin: 0; display: flex; align-items: center; }
.breadcrumb li + li::before { content: "›"; margin: 0 6px; color: var(--muted); }
.breadcrumb a { color: var(--muted); display: inline-flex; align-items: center; min-height: 48px; }
.breadcrumb [aria-current="page"] { color: var(--text); }

.page-head { padding: 4px 0 16px; }
.page-head h1 { margin-bottom: 8px; }
.lead { font-size: 1.0625rem; color: var(--muted); max-width: 62ch; margin-bottom: 12px; }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 0.875rem; color: var(--muted); margin: 0; }

.privacy {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8125rem; color: var(--text); line-height: 1.35;
  background: var(--tint); border: 1px solid var(--tint-line); border-radius: 999px; padding: 4px 12px 4px 8px;
}
.privacy svg { width: 16px; height: 16px; flex: none; color: var(--accent); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 16px; }
@media (min-width: 800px) { .card { padding: 24px; } }

/* ---------- Tool layout: 55 / 45 split ---------- */
.tool-shell { position: relative; }
.tool { display: grid; gap: 16px; }
.tool > * { min-width: 0; }
@media (min-width: 800px) {
  .tool { grid-template-columns: 55fr 45fr; gap: 24px; align-items: stretch; }
  /* JS adds .can-stick only when the whole panel fits the screen, so nothing is ever cut off */
  .result-sticky.can-stick { position: sticky; top: 16px; }
}

/* Live mini result: sticks to the top of the screen whenever the result
   headline is out of view (JS toggles .is-dim). Bounded by .tool-shell. */
.mini-result {
  position: sticky; top: 0; z-index: 5; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius);
  box-shadow: 0 2px 0 rgba(15, 23, 42, 0.06);
  color: var(--text); text-decoration: none; font-size: 0.9375rem; line-height: 1.3;
  transition: opacity 0.15s, visibility 0.15s;
}
.mini-result:hover { color: var(--text); background: var(--tint); }
.mini-result strong { color: var(--accent); }
.mini-result .mini-go { color: var(--accent); font-weight: 600; white-space: nowrap; }
.mini-result.is-dim { opacity: 0; visibility: hidden; }
@media (min-width: 800px) {
  .mini-result { margin-bottom: -48px; }   /* overlays the tool instead of taking space */
}

/* ---------- Forms ---------- */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.section { padding: 20px 0; border-top: 1px solid var(--line-soft); }
.section:first-child { padding-top: 0; border-top: 0; }
.section:last-child { padding-bottom: 0; }
.section-title { display: block; font-size: 1.0625rem; font-weight: 700; margin: 0 0 12px; padding: 0; }
.section-title .step { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 0.8125rem; vertical-align: 1px; }

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.label { display: block; font-weight: 600; margin-bottom: 2px; }
.hint { display: block; font-size: 0.875rem; color: var(--muted); margin: 0 0 8px; line-height: 1.45; }
.input, .select {
  display: block; width: 100%; min-height: 48px; padding: 10px 12px;
  font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  -webkit-appearance: none; appearance: none;
}
.input:focus, .select:focus { border-color: var(--accent); outline: 3px solid var(--accent); outline-offset: 0; }
.input::placeholder { color: #64748B; opacity: 1; }
.select {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%230F172A' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.affix { position: relative; }
.affix .prefix, .affix .suffix { position: absolute; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.affix .prefix { left: 12px; }
.affix .suffix { right: 12px; }
.affix .prefix + .input { padding-left: 28px; }
.affix .input.has-suffix { padding-right: 36px; }
.affix .input.has-suffix-wide { padding-right: 84px; }
.field-row { display: grid; gap: 12px; }
@media (min-width: 520px) { .field-row { grid-template-columns: 1fr 1fr; } }
.calc-line { font-size: 0.875rem; color: var(--muted); margin: 8px 0 0; }
.calc-line strong { color: var(--text); }
.field-warn { font-size: 0.875rem; color: var(--warn); font-weight: 600; margin: 8px 0 0; }

/* Segmented control (radio group) */
.segmented { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented label {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 48px; padding: 6px 10px; cursor: pointer;
  font-size: 0.9375rem; font-weight: 600; line-height: 1.25; color: var(--text); background: var(--surface);
}
.segmented label + input + label, .segmented input + label ~ label { border-left: 1px solid var(--line-strong); }
.segmented input:checked + label { background: var(--accent); color: #fff; }
.segmented input:focus-visible + label { outline: 3px solid var(--text); outline-offset: -5px; border-radius: 6px; }

/* Checkbox chips */
.checks { display: grid; gap: 8px; }
@media (min-width: 520px) { .checks--2 { grid-template-columns: 1fr 1fr; } }
.check {
  display: flex; align-items: flex-start; gap: 10px; min-height: 48px; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  cursor: pointer; font-size: 0.9375rem; line-height: 1.35;
}
.check:hover { border-color: var(--line-strong); }
.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.check:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.check:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.check input:focus-visible { outline: none; }

/* Switch (native checkbox with role="switch") */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; cursor: pointer; font-weight: 600; }
.switch input {
  -webkit-appearance: none; appearance: none; position: relative; flex: none; margin: 0; cursor: pointer;
  width: 46px; height: 28px; border-radius: 999px; background: var(--line-strong); transition: background 0.15s;
}
.switch input::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform 0.15s;
}
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
.sub-panel { margin-top: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 16px; border-radius: var(--radius);
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  font: 600 0.9375rem/1.2 var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; text-decoration: none; }
.btn--secondary { background: var(--surface); color: var(--accent); }
.btn--secondary:hover { background: var(--tint); color: var(--accent-hover); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row .btn { flex: 1 1 auto; }

/* ---------- Status badges (colour + text, never colour alone) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border: 1px solid currentColor; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 700; line-height: 1.35; letter-spacing: 0.01em;
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge--safe { color: var(--safe); background: var(--safe-bg); }
.badge--warn { color: var(--warn); background: var(--warn-bg); }
.badge--danger { color: var(--danger); background: var(--danger-bg); }
.badge--neutral { color: var(--muted); background: var(--surface); }

/* ---------- Result card ---------- */
.result { background: var(--tint); border: 1px solid var(--tint-line); border-radius: var(--radius-lg); padding: 20px 16px; }
@media (min-width: 800px) { .result { padding: 24px; } }
.result-kicker { margin: 12px 0 0; font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.result-headline { margin: 2px 0 4px; font-size: 1.75rem; font-weight: 750; line-height: 1.15; letter-spacing: -0.02em; }
.result-sub { margin: 0; font-size: 0.9375rem; color: var(--muted); }
.result-block { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--tint-line); }
.result-block h3 { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 8px; }

.kv { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.kv th, .kv td { padding: 6px 0; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.kv th { text-align: left; font-weight: 400; padding-right: 12px; }
.kv td { text-align: right; white-space: nowrap; font-weight: 600; }
.kv .kv-sub { display: block; font-size: 0.8125rem; color: var(--muted); }
.kv tr.kv-total th, .kv tr.kv-total td { font-weight: 750; border-bottom: 0; padding-top: 8px; font-size: 1rem; }
.kv tr.kv-muted th, .kv tr.kv-muted td { color: var(--muted); font-weight: 400; border-bottom: 0; }

/* Threshold meter */
.meter { position: relative; height: 12px; margin: 30px 0 6px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; }
.meter-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: var(--accent); border-radius: 999px; transition: width 0.2s ease-out; }
.meter-mark { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--text); }
.meter-mark span { position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.meter-scale { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); }

/* Per-cohort test list */
.tests { list-style: none; margin: 0; padding: 0; }
.tests li { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.9375rem; }
.tests li:last-child { border-bottom: 0; }
.tests .t-when { display: block; font-size: 0.8125rem; color: var(--muted); }
.tests li.is-hit { font-weight: 650; }
.pill { flex: none; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; font-size: 0.8125rem; font-weight: 700; background: var(--surface); }
.pill--yes { color: var(--accent); }
.pill--no, .pill--na { color: var(--muted); }

.notes { list-style: none; margin: 0; padding: 0; font-size: 0.9375rem; }
.notes li { position: relative; margin: 0; padding: 6px 0 6px 18px; }
.notes li::before { content: ""; position: absolute; left: 2px; top: 0.95em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.notes li.note--warn::before { background: var(--warn); }

a[href^="tel:"] { white-space: nowrap; }   /* never split a phone number across lines */

/* Numbered steps (for example, how to apply to HMRC) */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; font-size: 0.9375rem; }
.steps li { counter-increment: step; position: relative; margin: 0; padding: 7px 0 7px 32px; border-bottom: 1px solid var(--line-soft); }
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 7px;
  display: flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border: 1px solid var(--accent); border-radius: 50%; color: var(--accent);
  font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums;
}

.result-actions { margin-top: 16px; }
.result-privacy { margin: 12px 0 0; }
.copy-status { min-height: 1.4em; margin: 8px 0 0; font-size: 0.875rem; font-weight: 600; color: var(--accent); }

/* Range sliders (native input, keyboard accessible) */
.range-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.range-head output { flex: none; min-width: 2ch; text-align: right; font-size: 1.125rem; font-weight: 750; color: var(--accent); font-variant-numeric: tabular-nums; }
.range { display: block; width: 100%; height: 48px; margin: 0; background: transparent; accent-color: var(--accent); cursor: pointer; }
.range:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.range-scale { display: flex; justify-content: space-between; margin-top: -6px; font-size: 0.75rem; color: var(--muted); }

/* Penalty points meter: colour is always paired with "x of 4 points" text */
.points { display: flex; gap: 6px; margin: 4px 0 6px; }
.points span { flex: 1; height: 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); }
.points span.on { background: var(--warn); border-color: var(--warn); }
.points.is-max span.on { background: var(--danger); border-color: var(--danger); }

/* Letter preview (Tool 4): a disclosure with scrollable, keyboard-focusable text */
.letter-wrap > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; color: var(--accent); }
.letter-wrap > summary:hover { color: var(--accent-hover); }
.letter {
  max-height: 320px; overflow: auto; margin: 4px 0 0; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  font: 0.8125rem/1.55 var(--font); white-space: pre-wrap; overflow-wrap: anywhere;
}
.letter:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media print { .letter-wrap > summary { display: none; } .letter { max-height: none; overflow: visible; border: 0; padding: 0; } }

/* Anchor jumps land below the sticky mini result bar */
.result, .tool-wide, .tool-shell { scroll-margin-top: 64px; }

/* ---------- Deadline table (full-width, below a tool) ---------- */
.tool-wide { margin-top: 16px; }
@media (min-width: 800px) { .tool-wide { margin-top: 24px; } }
.tool-wide h2 { margin-bottom: 4px; }
.dl-table td { vertical-align: top; }
.dl-table .dl-date { width: 1%; white-space: nowrap; font-weight: 700; }
.dl-table .dl-date .pill { display: block; width: max-content; margin-top: 6px; }
.dl-table .dl-title { display: block; font-weight: 600; }
.dl-table .dl-detail { display: block; margin-top: 2px; font-size: 0.875rem; color: var(--muted); }
.dl-table .dl-tag { display: inline-block; margin-top: 6px; font-size: 0.8125rem; font-weight: 600; color: var(--safe); }
.dl-table .dl-tag--warn { color: var(--warn); }
.dl-table tr.is-past td, .dl-table tr.is-past .dl-title { color: var(--muted); font-weight: 400; }
.dl-table tr.is-next td { background: var(--tint); }
/* ---------- Software comparison table (Tool 5) ---------- */
.cmp-filter { margin: 12px 0 0; max-width: 520px; }
.cmp td { vertical-align: top; }
.cmp .c-name { font-weight: 650; }
.cmp .c-type { display: block; margin-top: 2px; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.cmp .c-note { display: block; margin-top: 4px; font-size: 0.875rem; color: var(--muted); }
.cmp .c-flag { display: block; margin-top: 4px; font-size: 0.8125rem; font-weight: 600; color: var(--warn); }
.cmp .c-cost { width: 1%; text-align: right; white-space: nowrap; font-weight: 750; }
.cmp .c-sub { display: block; min-width: 92px; font-size: 0.8125rem; font-weight: 400; color: var(--muted); white-space: normal; }
.cmp .c-fd { width: 1%; white-space: nowrap; }
.cmp .c-fd-inline { display: none; }
.cmp tr.is-best td { background: var(--tint); }
.cmp .pill { display: inline-block; }
.cmp td > .pill--best { margin-top: 6px; }
.pill--best { color: var(--safe); }
.pill--check { color: var(--warn); }
.cmp-foot { margin: 12px 0 0; font-size: 0.875rem; color: var(--muted); }
@media (max-width: 559px) {   /* phones: the tax return pill moves under the name, so the table fits */
  .cmp th, .cmp td { padding: 10px 8px; }
  .cmp .c-fd { display: none; }
  .cmp .c-fd-inline { display: block; margin-top: 6px; }
}

.pill--next { color: var(--accent); }
.pill--soon { color: var(--warn); }
.pill--past { color: var(--muted); }

/* ---------- Affiliate box (contextual, labelled) ---------- */
.affiliate { margin-top: 16px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.affiliate-label { margin: 0 0 4px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.affiliate h2 { font-size: 1.0625rem; margin: 0 0 6px; }
.affiliate p { font-size: 0.9375rem; margin-bottom: 12px; }

/* ---------- Ad slots: fixed min-height prevents CLS ---------- */
.ad-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 280px; margin: 32px 0; padding: 8px 0;
  border: 1px dashed var(--line); border-radius: var(--radius);
  contain: layout; overflow: hidden;
}
.ad-slot .ad-label { font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
@media (min-width: 800px) { .ad-slot--wide { min-height: 250px; } }

/* ---------- Article content ---------- */
.content { margin-top: 8px; }
.prose { max-width: 68ch; }
.content > section { padding-top: 16px; }
.content h2 { margin-top: 1.5em; }
.content h3 { margin-top: 1.5em; }
.formula { margin: 16px 0; padding: 16px; background: var(--tint); border: 1px solid var(--tint-line); border-radius: var(--radius); font-weight: 600; line-height: 1.5; }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data thead th { font-size: 0.8125rem; font-weight: 650; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--bg); }
table.data tbody tr:last-child th, table.data tbody tr:last-child td { border-bottom: 0; }
table.data .r { text-align: right; white-space: nowrap; }
table.data tfoot td, table.data tfoot th { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; }
.split { display: grid; gap: 16px; margin: 16px 0; }
@media (min-width: 640px) { .split { grid-template-columns: 1fr 1fr; } }
.split > div { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.split h3 { margin-top: 0; font-size: 1rem; }
.split ul { margin: 0; }
.example { margin: 16px 0; padding: 20px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
@media (min-width: 800px) { .example { padding: 24px; } }
.example h3 { margin-top: 0; }
.example .table-wrap { border-radius: var(--radius); }
.example-try { margin: 12px 0 0; }
.example-result { margin: 12px 0 0; padding: 12px 16px; background: var(--tint); border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; }
.faq h3 { margin: 1.25em 0 0.35em; }
.faq p { margin-bottom: 0; }

.tool-links { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 640px) { .tool-links { grid-template-columns: 1fr 1fr; } }
.tool-links li { margin: 0; }
.tool-link {
  display: block; height: 100%; min-height: 48px; padding: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  color: var(--text); text-decoration: none;
}
.tool-link:hover { border-color: var(--accent); color: var(--text); background: var(--tint); }
.tool-link strong { display: block; color: var(--accent); margin-bottom: 2px; }
.tool-link span { font-size: 0.9375rem; color: var(--muted); }
.sources { font-size: 0.875rem; color: var(--muted); }
.sources ul { padding-left: 1.1em; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; padding: 24px 0 32px; background: var(--surface); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9375rem; }
.footer-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 20px; margin: 0 0 12px; padding: 0; }
.footer-nav li { margin: 0; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 48px; }
.disclaimer { color: var(--text); max-width: 72ch; }
.site-footer .small { margin: 0; }
.footer-legal ul { margin: 8px 0 0; }

/* ---------- Policy pages (/privacy/, /cookies/) ---------- */
.policy { padding-bottom: 8px; }
.policy h1 { margin-top: 8px; }
.policy h2 { margin-top: 1.75em; }
.policy .example h2 { margin-top: 0; }
@media (max-width: 479px) {   /* 4-column policy tables fit a phone without sideways scrolling */
  .policy table.data { font-size: 0.875rem; }
  .policy table.data th, .policy table.data td { padding: 8px 6px; }
}
.policy code { font-size: 0.875em; padding: 1px 4px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 4px; }
/* Placeholders to fill in before launch: search the HTML for class="fill" */
mark.fill { background: var(--warn-bg); color: var(--warn); border: 1px dashed var(--warn); border-radius: 4px; padding: 0 4px; font-weight: 600; }

/* ---------- Motion + print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.print-only { display: none; }
@media print {
  @page { margin: 16mm; }
  body { background: #fff; font-size: 11pt; }
  .site-header, .breadcrumb, .skip-link, .ad-slot, .affiliate, .mini-result, .no-print, .footer-nav, .content, .cta { display: none !important; }
  .print-only { display: block !important; }
  .tool { display: block; }
  .result-sticky { position: static; }
  .result { background: #fff; border: 1px solid #000; break-inside: avoid; }
  .badge, .pill { background: #fff !important; }
  .site-footer { margin-top: 16px; border: 0; padding: 0; }
  a { color: #000; text-decoration: none; }
}
