/* MoneyMzansi: one stylesheet for the whole site.
   Light tokens follow BRIEF.md section 3 exactly. Dark mode (approved by the owner) redefines
   the same tokens under [data-theme="dark"], so components only ever use var(--c-*). */

/* ============ Fonts (self-hosted Inter, Latin subset, SIL OFL: /fonts/OFL.txt) ============ */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/inter-latin-400.woff2') format('woff2');
  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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/inter-latin-600.woff2') format('woff2');
  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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/inter-latin-700.woff2') format('woff2');
  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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Arial tuned to Inter's metrics, so text doesn't jump when Inter arrives (keeps layout shift low). */
@font-face {
  font-family: 'Fraunces'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/fraunces-latin-700.woff2') format('woff2');
  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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter Fallback'; src: local('Arial'), local('Helvetica Neue'), local('Helvetica');
  size-adjust: 107.4%; ascent-override: 90.2%; descent-override: 22.5%; line-gap-override: 0%;
}

/* ============ Tokens ============ */
:root {
  /* Brief section 3 */
  --c-primary: #0B6E4F;
  --c-primary-dark: #08553D;
  --c-primary-soft: #E6F2ED;
  --c-accent: #F2A900;
  --c-text: #1F2933;
  --c-muted: #5F6B76;
  --c-border: #E3E8EC;
  --c-surface: #F7F9FA;
  --c-bg: #FFFFFF;
  --c-danger: #B42318;
  --c-warn-soft: #FFF6E0;
  --c-chart-3: #5B6B7A;
  --c-chart-4: #2F6EB5; /* added with owner approval: 4th chart series */

  /* Derived tokens, so dark mode can retune each role separately */
  --c-primary-ink: #0B6E4F;        /* green text and icons */
  --c-logo-bar: #3F9A5F;           /* lighter green bars in the logo mark */
  --c-primary-line: #0B6E4F;       /* green borders on selected controls */
  --c-on-primary: #FFFFFF;         /* text on a solid green fill */
  --c-elevated: #FFFFFF;           /* cards and panels */
  --c-input: #FFFFFF;
  --c-border-strong: #C9D1D8;
  --c-input-line: #8A96A1;         /* 3:1 against the input background (WCAG 1.4.11) */
  --c-hover: #F1F4F6;
  --c-result: #E6F2ED;
  --c-result-line: rgba(11, 110, 79, .14);
  --c-danger-soft: #FEF3F2;
  --c-warn-line: #F3D48A;
  --c-warn-ink: #8A5A00;
  --c-focus: #0B6E4F;
  --c-series-0: var(--c-primary);
  --c-series-1: var(--c-accent);
  --c-series-2: var(--c-chart-3);
  --c-series-3: var(--c-chart-4);
  --c-header: rgba(255, 255, 255, .92);

  --font: 'Inter', 'Inter Fallback', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --fs-12: 0.75rem;
  --fs-14: 0.875rem;
  --fs-16: 1rem;
  --fs-18: 1.125rem;
  --fs-20: 1.25rem;
  --fs-24: 1.5rem;
  --fs-32: 2rem;
  --fs-40: 2.5rem;

  --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-card: 12px;
  --r-ctl: 8px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12), 0 2px 6px rgba(16, 24, 40, .06);
  --tap: 44px;
  --max: 1080px;
  --gutter: 16px;
  --header-h: 64px;

  color-scheme: light;
}

/* Dark: deep neutral surfaces, brand green lifted for contrast, gold kept as the one accent.
   Contrast (WCAG AA) checked for text, muted text, links, buttons and borders on every surface. */
:root[data-theme="dark"] {
  --c-primary: #14875F;            /* fills: white text on it is 4.6:1 */
  --c-primary-dark: #0F7352;
  --c-primary-soft: #11261E;
  --c-accent: #F2B533;
  --c-text: #E7ECF0;
  --c-muted: #9DA9B4;
  --c-border: #252E37;
  --c-surface: #12181E;
  --c-bg: #0D1115;
  --c-danger: #FF8A7F;
  --c-warn-soft: #272012;
  --c-chart-3: #8D9CAA;
  --c-chart-4: #66A3E9;

  --c-primary-ink: #5CCB9F;
  --c-logo-bar: #8FDDBB;
  --c-primary-line: #3AA87D;
  --c-on-primary: #FFFFFF;
  --c-elevated: #151C23;
  --c-input: #0F1419;
  --c-border-strong: #3A4652;
  --c-input-line: #5D6A76;
  --c-hover: #1B232B;
  --c-result: #10241C;
  --c-result-line: rgba(92, 203, 159, .16);
  --c-danger-soft: #2A1513;
  --c-warn-line: #5E4818;
  --c-warn-ink: #F2B533;
  --c-focus: #5CCB9F;
  --c-series-0: #3DBE8B;
  --c-header: rgba(13, 17, 21, .9);

  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .02);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, .45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);

  color-scheme: dark;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--s-4));
}
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  font-size: var(--fs-16);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--s-3); font-weight: 700; color: var(--c-text); text-wrap: balance; }
h1 { font-size: var(--fs-32); letter-spacing: -0.025em; }
h2 { font-size: var(--fs-24); letter-spacing: -0.015em; }
h3 { font-size: var(--fs-18); font-weight: 600; letter-spacing: -0.005em; }
p { margin: 0 0 var(--s-4); }
p, li { text-wrap: pretty; }
a { color: var(--c-primary-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--c-primary-dark); text-decoration-thickness: 2px; }
:root[data-theme="dark"] a:hover { color: var(--c-text); }
strong { font-weight: 600; }
img, svg { max-width: 100%; }
ul, ol { padding-left: 1.25em; }
input, button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table, input, output, dd, data, .num, .result-headline, .sticky-value, .chart-legend, .chart-tip { font-variant-numeric: tabular-nums; }
::selection { background: var(--c-primary-soft); color: var(--c-text); }

:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

@media (min-width: 768px) {
  h1 { font-size: var(--fs-40); }
}

/* ============ Layout ============ */
.container { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 24px; } }
main { display: block; padding-bottom: var(--s-8); }

/* ============ Header ============ */
.skip-link {
  position: absolute; left: var(--s-2); top: -100px; z-index: 100;
  background: var(--c-primary); color: var(--c-on-primary); padding: var(--s-2) var(--s-4); border-radius: var(--r-ctl); font-weight: 600;
}
.skip-link:focus { top: var(--s-2); color: var(--c-on-primary); }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--c-header); border-bottom: 1px solid var(--c-border);
  -webkit-backdrop-filter: saturate(160%) blur(10px); backdrop-filter: saturate(160%) blur(10px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: var(--s-4); }
.wordmark {
  display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap);
  font-size: var(--fs-20); font-weight: 700; text-decoration: none; letter-spacing: -0.02em; color: var(--c-text);
}
.wordmark:hover { color: var(--c-text); }
.logo-mark { width: 28px; height: 30px; flex: none; }
.logo-m { fill: var(--c-primary-ink); }
.logo-bar { fill: var(--c-logo-bar); }
.wm-mzansi { color: var(--c-text); }
.wm-money { color: var(--c-primary-ink); }

.site-nav { display: flex; align-items: center; gap: var(--s-1); }
.nav-menu { position: relative; }
.nav-toggle {
  list-style: none; display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: var(--tap); min-width: var(--tap); padding: 0 var(--s-3);
  border-radius: var(--r-ctl); font-weight: 600; font-size: var(--fs-16); cursor: pointer; user-select: none; color: var(--c-text);
}
.nav-toggle::-webkit-details-marker { display: none; }
.nav-toggle::marker { content: ''; }
.nav-toggle:hover, .nav-menu[open] .nav-toggle { background: var(--c-hover); }
.nav-toggle-label::after {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-left: var(--s-2);
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-3px) rotate(45deg); transition: transform .15s;
}
.nav-menu[open] .nav-toggle-label::after { transform: translateY(0) rotate(-135deg); }
.nav-burger { display: none; width: 24px; height: 24px; }
.nav-link, .nav-about {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s-3);
  border-radius: var(--r-ctl); color: var(--c-text); font-weight: 600; text-decoration: none;
}
.nav-link:hover, .nav-about:hover { background: var(--c-hover); color: var(--c-text); }
.nav-about { display: none; }

.nav-panel {
  position: absolute; right: 0; top: calc(100% + var(--s-2)); width: min(680px, 92vw);
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-5) var(--s-6);
  padding: var(--s-5) var(--s-6); background: var(--c-elevated); border: 1px solid var(--c-border);
  border-radius: var(--r-card); box-shadow: var(--shadow-lg);
}
.nav-group-title { font-size: var(--fs-12); font-weight: 600; color: var(--c-muted); margin: 0 0 var(--s-1); text-transform: uppercase; letter-spacing: .08em; }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group a {
  display: flex; align-items: center; min-height: 40px; padding: var(--s-1) var(--s-2); margin: 0 calc(-1 * var(--s-2));
  border-radius: var(--r-ctl); color: var(--c-text); text-decoration: none; font-size: var(--fs-16); line-height: 1.35;
}
.nav-group a:hover { background: var(--c-hover); color: var(--c-primary-ink); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--tap); height: var(--tap); padding: 0; border: 1px solid transparent; border-radius: 50%;
  background: transparent; color: var(--c-muted); transition: background-color .15s, color .15s;
}
.theme-toggle:hover { background: var(--c-hover); color: var(--c-text); }
.theme-icon { width: 20px; height: 20px; }
.theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: block; }
:root[data-theme="dark"] .theme-icon-moon { display: none; }

@media (max-width: 767.98px) {
  .nav-menu { position: static; }
  .nav-toggle-label, .nav-link { display: none; }
  .nav-burger { display: block; }
  .nav-toggle { padding: 0; justify-content: center; }
  .nav-panel {
    position: fixed; left: 0; right: 0; top: var(--header-h); width: auto; grid-template-columns: 1fr; gap: var(--s-5);
    border-radius: 0; border-width: 0 0 1px; padding: var(--s-5) var(--gutter) var(--s-6);
    max-height: calc(100dvh - var(--header-h)); overflow-y: auto; box-shadow: var(--shadow-lg);
  }
  .nav-group a { min-height: var(--tap); }
  .nav-about { display: flex; border-top: 1px solid var(--c-border); border-radius: 0; padding: var(--s-4) 0 0; margin-top: 0; }
  .site-nav { gap: 0; }
}

/* ============ Footer ============ */
.site-footer { background: var(--c-surface); border-top: 1px solid var(--c-border); padding: var(--s-7) 0 var(--s-6); font-size: var(--fs-14); color: var(--c-muted); }
.footer-top { display: grid; grid-template-columns: 1fr; gap: var(--s-6); padding-bottom: var(--s-6); }
.footer-brand .wordmark { font-size: var(--fs-18); }
.footer-tagline { max-width: 40ch; margin: var(--s-3) 0 0; line-height: 1.55; }
.footer-cols { display: grid; grid-template-columns: 1fr; gap: var(--s-5); }
.footer-col h2 { font-size: var(--fs-12); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--c-muted); margin-bottom: var(--s-2); }
.footer-col ul, .footer-links { list-style: none; margin: 0; padding: 0; }
.footer-col a, .footer-links a { display: inline-flex; align-items: center; min-height: 36px; color: var(--c-text); text-decoration: none; line-height: 1.35; }
.footer-col a:hover, .footer-links a:hover { color: var(--c-primary-ink); text-decoration: underline; }
.footer-bottom { padding-top: var(--s-5); border-top: 1px solid var(--c-border); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 var(--s-5); margin-bottom: var(--s-3); }
.footer-links a { min-height: var(--tap); font-weight: 600; }
.footer-meta { margin: 0 0 var(--s-1); }
@media (max-width: 767.98px) { .footer-col a { min-height: var(--tap); } }
@media (min-width: 560px) { .footer-cols { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) {
  .footer-top { grid-template-columns: minmax(240px, 1fr) 2.6fr; gap: var(--s-7); }
  .footer-cols { grid-template-columns: repeat(4, 1fr); }
}

/* ============ Components: buttons, chips, icons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--tap); padding: 0 var(--s-4); border: 1px solid var(--c-primary); border-radius: var(--r-ctl);
  background: var(--c-primary); color: var(--c-on-primary); font-weight: 600; font-size: var(--fs-16); line-height: 1.2;
  text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); color: var(--c-on-primary); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-secondary { background: var(--c-elevated); color: var(--c-primary-ink); border-color: var(--c-border-strong); box-shadow: var(--shadow); }
.btn-secondary:hover { background: var(--c-primary-soft); border-color: var(--c-primary-line); color: var(--c-primary-ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--c-muted); }
.btn-ghost:hover { background: var(--c-hover); border-color: transparent; color: var(--c-text); }
.btn .icon { width: 18px; height: 18px; }

.chip-row { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.chip {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s-3);
  border: 1px solid var(--c-border-strong); border-radius: 999px; background: var(--c-elevated); color: var(--c-text);
  font-size: var(--fs-14); font-weight: 600; font-variant-numeric: tabular-nums; transition: background-color .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--c-primary-line); color: var(--c-primary-ink); }
.chip[aria-pressed="true"] { background: var(--c-primary-soft); border-color: var(--c-primary-line); color: var(--c-primary-ink); }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

/* ============ Calculator page ============ */
.breadcrumbs { font-size: var(--fs-14); color: var(--c-muted); padding: var(--s-2) 0 0; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; }
.breadcrumbs li { display: inline-flex; align-items: center; }
.breadcrumbs li + li::before { content: '/'; margin: 0 var(--s-2); color: var(--c-border-strong); }
.breadcrumbs a { color: var(--c-muted); display: inline-flex; align-items: center; min-height: var(--tap); text-decoration: none; }
.breadcrumbs a:hover { color: var(--c-primary-ink); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--c-text); font-weight: 600; }

.page-intro { padding: var(--s-3) 0 var(--s-5); }
.page-intro h1 { margin-bottom: var(--s-3); }
.lead { font-size: var(--fs-18); color: var(--c-muted); max-width: 64ch; margin: 0; line-height: 1.55; }

.calc-card {
  display: grid; grid-template-columns: 1fr; gap: var(--s-5);
  background: var(--c-elevated); border: 1px solid var(--c-border); border-radius: var(--r-card);
  box-shadow: var(--shadow-md); padding: var(--s-4);
}
@media (min-width: 480px) { .calc-card { padding: var(--s-5); } }
@media (min-width: 900px) {
  .calc-card { grid-template-columns: 380px 1fr; gap: var(--s-6); padding: var(--s-6); align-items: start; }
}

.calc-inputs { display: flex; flex-direction: column; gap: var(--s-5); min-width: 0; }
.field { min-width: 0; margin: 0; padding: 0; border: 0; }
.field.is-disabled .field-label { color: var(--c-muted); }
.field-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); margin-bottom: var(--s-2); }
.field-head .field-label { margin-bottom: 0; }
.field-label { display: block; font-weight: 600; font-size: var(--fs-16); margin-bottom: var(--s-2); padding: 0; color: var(--c-text); }
.hint { font-size: var(--fs-14); color: var(--c-muted); margin: var(--s-2) 0 0; line-height: 1.45; }
.field-error { display: flex; align-items: flex-start; gap: var(--s-2); margin: var(--s-2) 0 0; font-size: var(--fs-14); font-weight: 600; color: var(--c-danger); line-height: 1.45; }
.field-error[hidden] { display: none; }
.field-error .icon { margin-top: 1px; }
.field-pair { display: grid; grid-template-columns: 1fr; gap: var(--s-5); }
@media (min-width: 480px) { .field-pair { grid-template-columns: 1fr 1fr; gap: var(--s-4); } }
.mode-note { font-size: var(--fs-14); color: var(--c-muted); margin: 0; padding: var(--s-2) var(--s-3); background: var(--c-surface); border-radius: var(--r-ctl); line-height: 1.45; }

.input {
  width: 100%; min-height: 48px; padding: var(--s-2) var(--s-3);
  border: 1px solid var(--c-input-line); border-radius: var(--r-ctl); background: var(--c-input); color: var(--c-text);
  font-size: var(--fs-18); font-weight: 500; line-height: 1.3; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--c-muted); opacity: 1; font-weight: 400; }
.input:hover { border-color: var(--c-text); }
.input:focus-visible, .input:focus { outline: 2px solid var(--c-focus); outline-offset: 2px; border-color: var(--c-primary-line); }
.input[aria-invalid="true"] { border-color: var(--c-danger); background: var(--c-danger-soft); }
.input:disabled { background: var(--c-surface); color: var(--c-muted); border-color: var(--c-border); cursor: not-allowed; }
.input[readonly] { background: var(--c-surface); }
input[type="search"].input::-webkit-search-cancel-button { cursor: pointer; }

.input-affix { position: relative; display: flex; align-items: center; }
.affix { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; color: var(--c-muted); font-size: var(--fs-18); font-weight: 500; pointer-events: none; }
.affix-prefix { left: var(--s-3); }
.affix-suffix { right: var(--s-3); }
.input-affix:has(.affix-prefix) .input { padding-left: calc(var(--s-3) + 1.25em); }
.input-affix:has(.affix-suffix) .input { padding-right: calc(var(--s-3) + 1.5em); }

/* Range slider kept in sync with a text field (inputs.js data-sync). */
.range {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: var(--tap); margin: var(--s-1) 0 0;
  background: transparent; cursor: pointer; touch-action: pan-y;
}
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--c-border); }
.range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--c-border); }
.range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--c-primary); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%;
  background: var(--c-elevated); border: 2px solid var(--c-primary-line); box-shadow: var(--shadow-md);
}
.range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--c-elevated); border: 2px solid var(--c-primary-line); box-shadow: var(--shadow-md);
}
.range:focus { outline: none; }
.range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.range:focus-visible::-moz-range-thumb { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.range:disabled { opacity: .5; cursor: not-allowed; }

/* Segmented toggle: visually hidden radios + labels */
.segmented { display: inline-flex; flex-wrap: wrap; margin: 0; padding: 3px; border: 1px solid var(--c-border); border-radius: 10px; background: var(--c-surface); gap: 2px; min-width: 0; }
.segmented-field .segmented { display: flex; }
.segmented-field .segmented label { flex: 1 1 0; }
.segmented input {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.segmented label {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: calc(var(--tap) - 6px); padding: 0 var(--s-3); border: 1px solid transparent; border-radius: 7px;
  font-weight: 600; font-size: var(--fs-16); color: var(--c-muted); cursor: pointer; transition: background-color .15s, color .15s, box-shadow .15s;
}
.segmented label:hover { color: var(--c-text); }
.segmented input:checked + label { background: var(--c-elevated); color: var(--c-primary-ink); border-color: var(--c-primary-line); box-shadow: var(--shadow); }
.segmented input:focus-visible + label { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.segmented input:disabled + label { opacity: .5; cursor: not-allowed; }
.segmented--sm { padding: 2px; }
/* 40px label + 2px padding + 1px border keeps the tap target at 44px or more. */
.segmented--sm label { font-size: var(--fs-14); min-height: 40px; padding: 0 var(--s-3); }

.stepper { display: flex; align-items: stretch; gap: var(--s-2); max-width: 220px; }
.stepper .input { text-align: center; flex: 1 1 auto; min-width: 0; }
.stepper-btn {
  flex: none; width: 48px; min-height: 48px; border: 1px solid var(--c-input-line); border-radius: var(--r-ctl);
  background: var(--c-elevated); color: var(--c-primary-ink); font-size: var(--fs-20); font-weight: 600; line-height: 1;
  transition: background-color .15s, border-color .15s;
}
.stepper-btn:hover { background: var(--c-primary-soft); border-color: var(--c-primary-line); }
.stepper-btn:disabled { color: var(--c-muted); background: var(--c-surface); border-color: var(--c-border); cursor: not-allowed; }

/* ============ Results ============ */
.calc-results { min-width: 0; }
.result-card { background: var(--c-result); border: 1px solid var(--c-result-line); border-radius: var(--r-card); padding: var(--s-5); }
@media (min-width: 900px) { .result-card { padding: var(--s-6); } }
.result-label { font-size: var(--fs-14); font-weight: 600; color: var(--c-muted); margin: 0 0 var(--s-2); letter-spacing: .01em; }
.result-headline {
  display: inline-block; margin: 0 0 var(--s-5); font-size: var(--fs-32); font-weight: 700; line-height: 1.1;
  color: var(--c-text); letter-spacing: -0.025em; padding-bottom: 6px; border-bottom: 4px solid var(--c-accent);
  overflow-wrap: anywhere;
}
@media (min-width: 900px) { .result-headline { font-size: var(--fs-40); } }
.result-list { margin: 0 0 var(--s-4); }
.result-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); padding: 10px 0; border-bottom: 1px solid var(--c-result-line); }
.result-row:last-child { border-bottom: 0; }
.result-row dt { color: var(--c-text); flex: 1 1 0; min-width: 0; }
.result-row dd { margin: 0; font-weight: 600; text-align: right; color: var(--c-text); flex: 0 1 auto; max-width: 50%; }
.result-sub { font-size: var(--fs-12); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin: var(--s-5) 0 var(--s-1); color: var(--c-primary-ink); }

/* Optional mini stat grid inside the result card (e.g. "with extra payment" vs "without"). */
.result-compare { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); margin: 0 0 var(--s-4); }
.result-compare > div { padding: var(--s-3); background: var(--c-elevated); border: 1px solid var(--c-result-line); border-radius: var(--r-ctl); min-width: 0; }
.result-compare dt, .result-compare .compare-label { font-size: var(--fs-12); font-weight: 600; color: var(--c-muted); margin: 0 0 2px; }
.result-compare dd, .result-compare .compare-value { margin: 0; font-size: var(--fs-18); font-weight: 700; color: var(--c-text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.callout { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border-radius: var(--r-ctl); font-size: var(--fs-14); line-height: 1.5; margin-top: var(--s-4); }
.callout[hidden] { display: none; }
.callout p { margin: 0; }
.callout .icon { margin-top: 2px; }
.callout-warn { background: var(--c-warn-soft); border: 1px solid var(--c-warn-line); color: var(--c-text); }
.callout-warn .icon { color: var(--c-warn-ink); }
.callout-info { background: var(--c-elevated); border: 1px solid var(--c-border); color: var(--c-text); }
.callout-info .icon { color: var(--c-primary-ink); }

.estimate-note { font-size: var(--fs-14); color: var(--c-muted); margin: var(--s-3) 0 0; }

/* ============ Share bar ============ */
.share-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: var(--s-4) 0 var(--s-6); }
.share-status { font-size: var(--fs-14); color: var(--c-primary-ink); font-weight: 600; }
.share-status:empty { display: none; }
.share-fallback { flex: 1 1 100%; }
.share-fallback[hidden] { display: none; }
.share-fallback label { display: block; font-size: var(--fs-14); font-weight: 600; margin-bottom: var(--s-1); }
.share-fallback .input { font-size: var(--fs-14); }
@media (max-width: 479.98px) {
  .share-bar .btn { flex: 1 1 auto; }
}

/* ============ Panels and charts ============ */
.panel { background: var(--c-elevated); border: 1px solid var(--c-border); border-radius: var(--r-card); box-shadow: var(--shadow); padding: var(--s-4); margin-bottom: var(--s-5); min-width: 0; }
.panel > h2 { font-size: var(--fs-20); margin-bottom: var(--s-4); }
@media (min-width: 480px) { .panel { padding: var(--s-5); } }
@media (min-width: 900px) { .panel { padding: var(--s-5) var(--s-6) var(--s-6); } }

.chart { min-width: 0; }
.chart-plot { position: relative; width: 100%; }
.chart-plot svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-grid { stroke: var(--c-border); stroke-width: 1; shape-rendering: crispEdges; fill: none; }
.chart-axis { fill: var(--c-muted); font-size: 12px; }
.chart-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-line.is-dashed, .is-dashed { stroke-dasharray: 6 5; }
.chart-guide { stroke: var(--c-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-marker { stroke: var(--c-muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-marker-label { fill: var(--c-text); font-size: 12px; font-weight: 600; }
.chart-dot { stroke: var(--c-elevated); stroke-width: 2; }
.chart-bar { shape-rendering: crispEdges; }
.donut-seg { stroke: var(--c-elevated); stroke-width: 2; cursor: pointer; }
.donut-seg:hover { opacity: .88; }
.donut-center-label { fill: var(--c-muted); font-size: 13px; }
.donut-center-value { fill: var(--c-text); font-size: 20px; font-weight: 700; }

.stroke-0 { stroke: var(--c-series-0); }
.stroke-1 { stroke: var(--c-series-1); }
.stroke-2 { stroke: var(--c-series-2); }
.stroke-3 { stroke: var(--c-series-3); }
.fill-0 { fill: var(--c-series-0); }
.fill-1 { fill: var(--c-series-1); }
.fill-2 { fill: var(--c-series-2); }
.fill-3 { fill: var(--c-series-3); }
.bg-0 { background: var(--c-series-0); }
.bg-1 { background: var(--c-series-1); }
.bg-2 { background: var(--c-series-2); }
.bg-3 { background: var(--c-series-3); }

.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 150px; max-width: 260px;
  padding: var(--s-2) var(--s-3); background: var(--c-elevated); color: var(--c-text); border: 1px solid var(--c-border);
  border-radius: var(--r-ctl); box-shadow: var(--shadow-lg);
  font-size: var(--fs-14); line-height: 1.45;
}
.chart-tip[hidden] { display: none; }
.chart-tip-title { font-weight: 600; margin-bottom: var(--s-1); }
.chart-tip-row { display: flex; align-items: center; gap: var(--s-2); }
.chart-tip-row span:last-child { margin-left: auto; padding-left: var(--s-3); font-weight: 600; white-space: nowrap; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }

.chart-legend { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2) var(--s-5); margin: var(--s-4) 0 0; padding: 0; font-size: var(--fs-14); color: var(--c-text); }
.chart-legend li { display: inline-flex; align-items: center; gap: var(--s-2); }

/* ============ Tables ============ */
.table-block { min-width: 0; }
.table-wrap { overflow: auto; max-height: 32rem; border: 1px solid var(--c-border); border-radius: var(--r-ctl); -webkit-overflow-scrolling: touch; background: var(--c-elevated); }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-14); }
.data-table th, .data-table td { padding: 10px var(--s-3); text-align: left; white-space: nowrap; border-bottom: 1px solid var(--c-border); }
.data-table thead th { position: sticky; top: 0; z-index: 1; background: var(--c-surface); font-weight: 600; font-size: var(--fs-12); text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); border-bottom-color: var(--c-border-strong); }
.data-table tbody th { font-weight: 400; }
.data-table tbody tr:nth-child(even) > * { background: var(--c-surface); }
.data-table tbody tr:hover > * { background: var(--c-hover); }
.data-table .num { text-align: right; }
.data-table tr.is-sub > * { color: var(--c-muted); }
.data-table tfoot > tr > *, .data-table tr.total > * { font-weight: 700; background: var(--c-result); border-bottom: 0; color: var(--c-text); }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tfoot tr:first-child > * { border-top: 1px solid var(--c-border-strong); }

@media (max-width: 639px) {
  /* Wide tables scroll sideways, but the row label stays put so each number keeps its description. */
  .data-table:not(.data-table--stack) tbody th[scope="row"], .data-table:not(.data-table--stack) thead th:first-child, .data-table:not(.data-table--stack) tfoot th:first-child { position: sticky; left: 0; background-clip: padding-box; border-right: 1px solid var(--c-border-strong); }
  .data-table:not(.data-table--stack) tbody th[scope="row"] { z-index: 1; background: var(--c-elevated); max-width: 9.5rem; white-space: normal; min-width: 6.5rem; }
  .data-table:not(.data-table--stack) tbody tr:nth-child(even) > th[scope="row"] { background: var(--c-surface); }
  .data-table:not(.data-table--stack) thead th:first-child { z-index: 3; }
  .data-table:not(.data-table--stack) tfoot th:first-child, .data-table:not(.data-table--stack) tr.total > th { background: var(--c-result); z-index: 1; }
}

@media (max-width: 639px) {
  /* Tighter cells and wrapping headings so most tables fit without sideways scrolling. */
  .data-table { font-size: calc(var(--fs-14) - 1px); }
  .data-table th, .data-table td { padding: 8px 8px; }
  .data-table thead th { white-space: normal; vertical-align: bottom; }
}

@media (max-width: 639px) {
  .table-wrap:has(.data-table--stack) { max-height: none; overflow: visible; border: 0; background: transparent; }
  .data-table--stack, .data-table--stack tbody, .data-table--stack tfoot { display: block; }
  .data-table--stack thead { display: none; }
  .data-table--stack tfoot tr > * { background: var(--c-result) !important; border-top: 0; }
  .data-table--stack :is(tbody, tfoot) tr { display: block; margin-bottom: var(--s-3); border: 1px solid var(--c-border); border-radius: var(--r-ctl); background: var(--c-elevated); overflow: hidden; }
  .data-table--stack :is(tbody, tfoot) tr > * { display: flex; justify-content: space-between; gap: var(--s-3); white-space: normal; text-align: right; background: transparent !important; border-bottom: 1px solid var(--c-border); }
  .data-table--stack :is(tbody, tfoot) tr > *::before { content: attr(data-label); color: var(--c-muted); font-size: var(--fs-12); text-transform: uppercase; letter-spacing: .06em; text-align: left; flex: 0 0 auto; padding-top: 2px; }
  .data-table--stack :is(tbody, tfoot) tr > :first-child { display: block; text-align: left; font-weight: 600; background: var(--c-surface) !important; }
  .data-table--stack :is(tbody, tfoot) tr > :first-child::before { display: none; }
  .data-table--lead2 :is(tbody, tfoot) tr > :first-child { display: flex; font-weight: 400; color: var(--c-muted); }
  .data-table--lead2 :is(tbody, tfoot) tr > :first-child::before { display: block; }
  .data-table--lead2 :is(tbody, tfoot) tr > :nth-child(2) { display: block; font-weight: 600; text-align: left; }
  .data-table--lead2 :is(tbody, tfoot) tr > :nth-child(2)::before { display: none; }
  .data-table--stack :is(tbody, tfoot) tr > :last-child { border-bottom: 0; }
}
.table-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-3); }
.copy-status { font-size: var(--fs-14); color: var(--c-primary-ink); font-weight: 600; }
.copy-status:empty { display: none; }

/* ============ Ad and partner slots ============ */
.ad-slot { position: relative; display: flex; align-items: center; justify-content: center; min-height: 250px; margin: var(--s-5) 0; background: var(--c-surface); border: 1px dashed var(--c-border-strong); border-radius: var(--r-ctl); }
.ad-label { position: absolute; top: var(--s-1); left: var(--s-2); font-size: var(--fs-12); color: var(--c-muted); text-transform: uppercase; letter-spacing: .05em; }
.ad-slot--guide-mid { max-width: 68ch; }
.ad-slot--sidebar { display: none; }
@media (min-width: 1080px) { .ad-slot--sidebar { display: flex; min-height: 600px; } }

.partner-slot { margin: var(--s-5) 0; }
.partner-label { font-size: var(--fs-12); color: var(--c-muted); margin: 0 0 var(--s-1); }
.partner-card { display: block; padding: var(--s-4); border: 1px solid var(--c-border); border-radius: var(--r-card); background: var(--c-elevated); box-shadow: var(--shadow); color: var(--c-text); text-decoration: none; }
.partner-card:hover { border-color: var(--c-primary-line); color: var(--c-text); }

/* ============ Guide, FAQ, related ============ */
.guide { max-width: 68ch; margin: var(--s-8) 0 var(--s-6); font-size: var(--fs-18); line-height: 1.7; }
.guide h2 { margin-top: var(--s-7); font-size: var(--fs-24); }
.guide > h2:first-child { margin-top: 0; font-size: var(--fs-32); }
.guide h3 { margin-top: var(--s-5); }
.guide li { margin-bottom: var(--s-2); }
.guide li::marker { color: var(--c-muted); }
.guide-updated { font-size: var(--fs-14); color: var(--c-muted); }
.guide-example { background: var(--c-surface); border: 1px solid var(--c-border); border-left: 4px solid var(--c-primary-line); border-radius: var(--r-ctl); padding: var(--s-4) var(--s-5); margin: var(--s-4) 0 var(--s-5); font-size: var(--fs-16); font-variant-numeric: tabular-nums; }
.guide-example > :last-child { margin-bottom: 0; }
@media (max-width: 479.98px) { .guide { font-size: var(--fs-16); } .guide > h2:first-child { font-size: var(--fs-24); } }

.faq { max-width: 68ch; margin: var(--s-7) 0; }
.faq-item { border-bottom: 1px solid var(--c-border); }
.faq-item:first-of-type { border-top: 1px solid var(--c-border); }
.faq-item summary {
  list-style: none; position: relative; display: flex; align-items: center; min-height: 60px;
  padding: var(--s-3) var(--s-7) var(--s-3) 0; font-weight: 600; cursor: pointer; line-height: 1.4;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { content: ''; }
.faq-item summary::after {
  content: ''; position: absolute; right: var(--s-3); top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--c-primary-ink); border-bottom: 2px solid var(--c-primary-ink);
  transform: translateY(-70%) rotate(45deg); transition: transform .15s;
}
.faq-item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-item summary:hover { color: var(--c-primary-ink); }
.faq-answer { padding: 0 0 var(--s-4); color: var(--c-text); }
.faq-answer > :last-child { margin-bottom: 0; }

.related { margin: var(--s-7) 0 var(--s-6); }
.tile-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-3); }
@media (min-width: 560px) { .tile-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .tile-grid { grid-template-columns: repeat(3, 1fr); gap: var(--s-4); } }
.tile {
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; column-gap: var(--s-4);
  align-items: start; padding: var(--s-4) var(--s-5) var(--s-4) var(--s-4); background: var(--c-elevated); border: 1px solid var(--c-border);
  border-radius: var(--r-card); box-shadow: var(--shadow); color: var(--c-text); text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.tile:hover { border-color: var(--c-primary-line); box-shadow: var(--shadow-md); color: var(--c-text); text-decoration: none; }
a.tile:hover .tile-name { color: var(--c-primary-ink); }
.tile-icon { grid-row: 1 / span 2; display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px; background: var(--c-primary-soft); color: var(--c-primary-ink); }
.tile-icon svg, .cat-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile-name { font-weight: 600; line-height: 1.35; padding-right: var(--s-4); }
.tile-blurb { grid-column: 2; font-size: var(--fs-14); color: var(--c-muted); line-height: 1.5; margin-top: 2px; }
.tile-arrow {
  position: absolute; top: calc(var(--s-4) + 8px); right: var(--s-4); width: 7px; height: 7px;
  border-top: 2px solid var(--c-muted); border-right: 2px solid var(--c-muted); transform: rotate(45deg); transition: transform .15s, border-color .15s;
}
a.tile:hover .tile-arrow { border-color: var(--c-primary-ink); transform: translateX(2px) rotate(45deg); }
.tile.is-soon { box-shadow: none; background: var(--c-surface); color: var(--c-muted); pointer-events: none; }
.tile.is-soon .tile-icon { background: var(--c-border); color: var(--c-muted); }
.tile.is-soon .tile-name { color: var(--c-muted); }
.tile-badge { grid-column: 2; justify-self: start; margin-top: var(--s-2); padding: 2px var(--s-2); border: 1px solid var(--c-border); border-radius: 999px; background: var(--c-elevated); font-size: var(--fs-12); font-weight: 600; color: var(--c-muted); }

.figures-checked, .disclaimer-line { font-size: var(--fs-14); color: var(--c-muted); max-width: 68ch; }
.figures-checked { margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--c-border); }
.figures-checked a, .disclaimer-line a { color: var(--c-muted); }
.figures-checked a:hover, .disclaimer-line a:hover { color: var(--c-primary-ink); }

/* ============ Sticky mobile result ============ */
.sticky-result {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  min-height: 56px; padding: var(--s-2) var(--gutter) calc(var(--s-2) + env(safe-area-inset-bottom, 0px));
  background: var(--c-elevated); border-top: 1px solid var(--c-border); box-shadow: 0 -6px 20px rgba(16, 24, 40, .08);
}
:root[data-theme="dark"] .sticky-result { box-shadow: 0 -6px 20px rgba(0, 0, 0, .5); }
.sticky-result[hidden] { display: none; }
.sticky-label { font-size: var(--fs-14); color: var(--c-muted); font-weight: 600; }
.sticky-value { font-size: var(--fs-20); font-weight: 700; color: var(--c-text); border-bottom: 3px solid var(--c-accent); line-height: 1.2; letter-spacing: -0.01em; }
@media (max-width: 899.98px) {
  body:has(.sticky-result:not([hidden])) { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 900px) { .sticky-result { display: none !important; } }

/* ============ Home ============ */
.hero { background: var(--c-surface); border-bottom: 1px solid var(--c-border); padding: var(--s-7) 0 var(--s-6); }
@media (min-width: 768px) { .hero { padding: 80px 0 var(--s-7); } }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-4); padding: 4px var(--s-3);
  border: 1px solid var(--c-border-strong); border-radius: 999px; background: var(--c-elevated);
  font-size: var(--fs-14); font-weight: 600; color: var(--c-text);
}
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c-primary); }
.hero h1 { max-width: 18ch; margin-bottom: var(--s-4); font-size: 2.25rem; letter-spacing: -0.03em; line-height: 1.08; }
@media (min-width: 768px) { .hero h1 { font-size: 3.25rem; } }
.hero-sub { font-size: var(--fs-18); color: var(--c-muted); max-width: 54ch; margin: 0; line-height: 1.55; }
@media (min-width: 768px) { .hero-sub { font-size: var(--fs-20); } }

.finder { max-width: 560px; margin-top: var(--s-6); }
.finder-label { display: block; font-weight: 600; margin-bottom: var(--s-2); }
.finder-field { position: relative; }
.finder-field .icon { position: absolute; left: var(--s-4); top: 50%; transform: translateY(-50%); color: var(--c-muted); pointer-events: none; width: 20px; height: 20px; }
.finder-field .input { min-height: 56px; padding-left: 48px; font-size: var(--fs-18); border-radius: 10px; box-shadow: var(--shadow); }
.finder-status { font-size: var(--fs-14); color: var(--c-muted); margin: var(--s-2) 0 0; min-height: 1.5em; }
.finder-empty { padding: var(--s-6) var(--s-5); text-align: center; color: var(--c-muted); background: var(--c-surface); border: 1px dashed var(--c-border-strong); border-radius: var(--r-card); margin: 0 0 var(--s-7); }

.trust-list { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: var(--s-5) 0 0; padding: 0; font-size: var(--fs-14); font-weight: 600; color: var(--c-text); }
.trust-list li { display: inline-flex; align-items: center; gap: var(--s-2); }
.trust-list .icon { color: var(--c-primary-ink); width: 18px; height: 18px; }

.home-sections { padding-top: var(--s-7); }
.category-section { margin: 0 0 var(--s-7); }
.category-section h2 { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-24); margin-bottom: var(--s-4); }
.cat-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--c-primary-soft); color: var(--c-primary-ink); flex: none; }
.home-about { max-width: 68ch; padding-top: var(--s-6); border-top: 1px solid var(--c-border); }
.home-about h2 { font-size: var(--fs-24); }
.home-about p { color: var(--c-text); }

/* ============ Simple article pages (About, legal, 404) ============ */
.article { max-width: 68ch; padding: var(--s-6) 0 var(--s-6); font-size: var(--fs-18); line-height: 1.7; }
.article h1 { margin-bottom: var(--s-3); }
.article h2 { font-size: var(--fs-24); margin-top: var(--s-7); }
.article h3 { margin-top: var(--s-5); }
.article li { margin-bottom: var(--s-2); }
.article-updated { font-size: var(--fs-14); color: var(--c-muted); margin-bottom: var(--s-6); }
.article .lead { margin-bottom: var(--s-5); font-size: var(--fs-20); }
.article-note { font-size: var(--fs-16); padding: var(--s-4) var(--s-5); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-ctl); }
.contact-email { font-size: var(--fs-20); font-weight: 600; padding: var(--s-4) var(--s-5); background: var(--c-elevated); border: 1px solid var(--c-border); border-radius: var(--r-ctl); display: inline-block; user-select: all; }
@media (max-width: 479.98px) { .article { font-size: var(--fs-16); } }

.not-found { padding: var(--s-8) 0 var(--s-6); max-width: 720px; }
.not-found .code { font-size: var(--fs-14); font-weight: 600; color: var(--c-muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: var(--s-2); }
.category-links { list-style: none; margin: var(--s-5) 0 var(--s-6); padding: 0; display: grid; grid-template-columns: 1fr; gap: var(--s-3); }
@media (min-width: 560px) { .category-links { grid-template-columns: 1fr 1fr; } }
.category-link {
  display: flex; align-items: center; gap: var(--s-3); min-height: 64px; padding: var(--s-3) var(--s-4);
  border: 1px solid var(--c-border); border-radius: var(--r-card); background: var(--c-elevated); box-shadow: var(--shadow);
  color: var(--c-text); font-weight: 600; text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
.category-link:hover { border-color: var(--c-primary-line); box-shadow: var(--shadow-md); color: var(--c-primary-ink); text-decoration: none; }

/* ============ Utilities ============ */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ============ Ledger theme (design preview) ============
   Warm paper, ink-dark rules, square corners, a serif for headings and big numbers,
   and receipt-style lines with dotted leaders. Tokens only; no new colours in components. */
:root {
  --c-bg: #F6F0E4;
  --c-surface: #EFE7D6;
  --c-elevated: #FBF7EC;
  --c-input: #FFFDF6;
  --c-text: #1B2420;
  --c-muted: #55594F;
  --c-border: #D8CEB8;
  --c-border-strong: #B3A78C;
  --c-input-line: #7A745F;
  --c-hover: #EBE2CE;
  --c-primary-soft: #DCE7D3;
  --c-result: #E3EAD6;
  --c-result-line: rgba(11, 110, 79, .22);
  --c-header: rgba(246, 240, 228, .94);
  --c-rule: #1B2420;
  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, 'Noto Serif', serif;
  --r-card: 4px;
  --r-ctl: 3px;
  --shadow: none;
  --shadow-md: none;
  --shadow-lg: 0 10px 24px rgba(27, 36, 32, .18);
}
:root[data-theme="dark"] {
  --c-bg: #14120D;
  --c-surface: #1B1913;
  --c-elevated: #1F1D16;
  --c-input: #17150F;
  --c-text: #EFE9DA;
  --c-muted: #A9A491;
  --c-border: #2E2B21;
  --c-border-strong: #4A4638;
  --c-input-line: #6E6955;
  --c-hover: #26231A;
  --c-primary-soft: #16261D;
  --c-result: #15251C;
  --c-result-line: rgba(92, 203, 159, .22);
  --c-header: rgba(20, 18, 13, .92);
  --c-rule: #EFE9DA;
  --shadow-lg: 0 14px 34px rgba(0, 0, 0, .6);
}

h1, h2, .result-headline, .slip-title { font-family: var(--font-display); }
h1, h2 { letter-spacing: -0.012em; }
.result-headline { border-bottom: 0; padding-bottom: 0; font-weight: 700; letter-spacing: -0.01em; background: linear-gradient(transparent 62%, var(--c-accent) 62%); padding: 0 6px; margin-left: -6px; }

.site-header { border-bottom: 1.5px solid var(--c-rule); }
.btn, .input, .panel, .tile, .result-card { border-radius: var(--r-card); }
.result-card { border: 1.5px solid var(--c-rule); }
.panel { border-color: var(--c-border-strong); }

.tile { border: 1.5px solid var(--c-rule); background: var(--c-elevated); padding: var(--s-4); transition: background .15s, box-shadow .2s, transform .2s; }
a.tile:hover { border-color: var(--c-rule); background: var(--c-hover); box-shadow: 0 6px 14px color-mix(in srgb, var(--c-text) 14%, transparent); transform: translateY(-3px); }
a.tile:active { transform: translateY(-1px); }
.category-link { transition: border-color .15s, box-shadow .2s, transform .2s; }
.category-link:hover { transform: translateY(-3px); box-shadow: 0 6px 14px color-mix(in srgb, var(--c-text) 14%, transparent); }
@media (prefers-reduced-motion: reduce) { .tile, a.tile:hover, a.tile:active, .category-link, .category-link:hover { transform: none; transition: none; } }
.tile-icon { border-radius: 2px; background: transparent; border: 1.5px solid var(--c-rule); color: var(--c-text); width: 38px; height: 38px; }
.tile-name { font-family: var(--font-display); font-size: var(--fs-18); letter-spacing: -0.005em; }
.tile-blurb { margin-top: var(--s-1); }
.tile-arrow { border-color: var(--c-text); }
.cat-icon { border-radius: 2px; background: transparent; border: 1.5px solid var(--c-rule); color: var(--c-text); }

/* Ledger lines: label, dotted leader, value */
.ln { display: flex; align-items: baseline; gap: 6px; font-size: var(--fs-14); color: var(--c-muted); }
.ln > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln i { flex: 1; min-width: 12px; border-bottom: 1.5px dotted var(--c-border-strong); transform: translateY(-3px); }
.ln b { color: var(--c-text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ln-last { color: var(--c-text); font-weight: 600; }
.ln-last b { background: linear-gradient(transparent 58%, var(--c-accent) 58%); padding: 0 3px; font-weight: 700; }
.tile-ex { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 2px; margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--c-border-strong); }

/* Receipt-style result card: paper, ink rule, dotted leaders, torn bottom edge */
.result-card { position: relative; background: var(--c-elevated); border: 1.5px solid var(--c-rule); box-shadow: 5px 5px 0 var(--c-primary); padding-bottom: calc(var(--s-5) + 8px); }
.result-card::after { content: ""; position: absolute; left: -1.5px; right: -1.5px; bottom: -1.5px; height: 9px; background: radial-gradient(circle at 50% 100%, var(--c-bg) 0 4px, transparent 4.6px) 0 0 / 14px 9px repeat-x; pointer-events: none; }
.result-label { text-transform: uppercase; letter-spacing: .1em; font-size: var(--fs-12); color: var(--c-primary-ink); }
.result-row { border-bottom: 0; padding: 7px 0; }
.result-row dt { display: flex; align-items: baseline; gap: 8px; flex: 1 1 auto; color: var(--c-muted); }
.result-row dt::after { content: ""; flex: 1 1 auto; min-width: 16px; border-bottom: 1.5px dotted var(--c-border-strong); transform: translateY(-4px); order: 2; }
.result-row dd { max-width: 60%; font-variant-numeric: tabular-nums; }
.result-row.is-strong dt { color: var(--c-text); font-weight: 600; }
.result-row.is-strong dd { background: linear-gradient(transparent 62%, var(--c-accent) 62%); padding: 0 3px; font-weight: 700; }
:root[data-theme="dark"] .result-row.is-strong dd { background: linear-gradient(transparent 86%, var(--c-accent) 86%); }
.result-sub, .result-group { margin-top: var(--s-5); padding-top: var(--s-3); border-top: 1.5px solid var(--c-rule); }

/* Home hero: copy on the left, a worked slip on the right */
.hero { background: var(--c-bg); border-bottom: 1.5px solid var(--c-rule); }
.hero-grid { display: grid; gap: var(--s-6); align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s-7); } }
.hero h1 { max-width: 16ch; letter-spacing: -0.02em; font-weight: 700; }
.hero h1 .mark { background: linear-gradient(transparent 66%, var(--c-accent) 66%); }
.eyebrow { font-weight: 600; letter-spacing: .02em; }
.trust-list { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); list-style: none; padding: 0; margin: var(--s-5) 0 0; font-size: var(--fs-14); color: var(--c-muted); }
.trust-list li::before { content: "\2014\00a0"; color: var(--c-primary-ink); }
.trust-list svg { display: none; }
.slip { display: flex; flex-direction: column; gap: var(--s-2); background: var(--c-elevated); border: 1.5px solid var(--c-rule); padding: var(--s-5); color: var(--c-text); text-decoration: none; transform: rotate(-1.2deg); box-shadow: 6px 6px 0 var(--c-primary); transition: transform .2s; }
.slip:hover { transform: rotate(0deg); text-decoration: none; color: var(--c-text); }
.slip .ln { font-size: var(--fs-16); padding: 3px 0; }
.slip-kicker { font-size: var(--fs-12); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--c-primary-ink); }
.slip-title { font-size: var(--fs-24); font-weight: 700; margin-bottom: var(--s-2); border-bottom: 1.5px solid var(--c-rule); padding-bottom: var(--s-2); }
.slip-foot { margin-top: var(--s-3); font-size: var(--fs-12); color: var(--c-muted); }
@media (prefers-reduced-motion: reduce) { .slip, .slip:hover { transform: none; transition: none; } }

/* Note from the team */
.team-note { max-width: 46rem; margin: var(--s-7) 0; padding: var(--s-5) var(--s-5) var(--s-4); border-left: 4px solid var(--c-primary); background: var(--c-elevated); border-top: 1px solid var(--c-border-strong); border-bottom: 1px solid var(--c-border-strong); border-right: 1px solid var(--c-border-strong); }
.team-note h2 { font-size: var(--fs-20); }
.team-note p { max-width: 62ch; }
.team-sign { font-family: var(--font-display); font-weight: 700; margin-bottom: 0; }

/* Figures register */
.status { display: inline-block; font-size: var(--fs-12); font-weight: 700; letter-spacing: .02em; padding: 2px 8px; border: 1.5px solid var(--c-rule); border-radius: 2px; background: var(--c-elevated); }
.status-verified, .status-definition { background: var(--c-result); }
.status-partly, .status-derived, .status-assumption { background: var(--c-warn-soft); }
.status-unverified, .status-not-shown { background: var(--c-danger-soft); }
.status-note { display: block; margin-top: 4px; font-size: var(--fs-12); font-weight: 400; color: var(--c-muted); }
.data-table--register td, .data-table--register th { white-space: normal; vertical-align: top; }
.data-table--register thead th:nth-child(1) { min-width: 14rem; }
.data-table--register thead th:nth-child(3) { min-width: 12rem; }
.table-wrap:has(.data-table--register) { max-height: none; }
.data-table--register td:last-child { white-space: nowrap; }
.status-wrap { display: block; }
@media (max-width: 639px) { .status-wrap { text-align: right; } .status-wrap .status { text-align: left; } .data-table--register tbody tr > :first-child { font-weight: 600; } .data-table--register td:last-child { white-space: normal; } }

/* Dark mode: keep light text off the gold, so the highlight becomes an underline */
:root[data-theme="dark"] .result-headline, :root[data-theme="dark"] .ln-last b, :root[data-theme="dark"] .hero h1 .mark { background: linear-gradient(transparent 84%, var(--c-accent) 84%); }

@media print {
  .site-header, .site-footer, .share-bar, .sticky-result, .ad-slot, .partner-slot, .theme-toggle, .table-actions, .related { display: none !important; }
  .calc-card, .panel { box-shadow: none; }
  body { background: #fff; color: #000; }
}

/* Stacked segmented toggle for longer option labels (full-width choices on phones). */
.segmented--stack { display: flex; flex-direction: column; width: 100%; }
@media (min-width: 640px) { .segmented--stack { flex-direction: row; } .segmented--stack label { flex: 1 1 0; text-align: center; } }

/* The hidden attribute always wins over component display rules. */
[hidden] { display: none !important; }

/* Tip jar link in the footer. */
.footer-tip { margin-top: var(--s-4); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); color: var(--c-muted); font-size: var(--fs-14); }
.btn-tip { min-height: 44px; }

/* ============ Toolkit: declarative tools, repeatable rows, exports ============ */
.form-heading { font-size: var(--fs-20); margin: var(--s-3) 0 0; }
.check { display: flex; align-items: center; gap: var(--s-3); min-height: 44px; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--c-primary); }
.input-affix.has-unit .input { padding-right: calc(var(--s-3) + 2.5em); }
.affix.unit { font-size: var(--fs-14); }
select.input, textarea.input { width: 100%; }
textarea.input { min-height: 88px; resize: vertical; }

.rows { min-width: 0; }
.rows-list { display: flex; flex-direction: column; gap: var(--s-3); margin-bottom: var(--s-4); }
.row-item { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); align-items: end; padding: var(--s-3); border: 1px solid var(--c-border); border-radius: var(--r-ctl); background: var(--c-surface); min-width: 0; }
.row-cell { min-width: 0; }
.row-cell:first-child { grid-column: 1 / -1; }
.row-label { display: block; margin-bottom: var(--s-1); font-size: var(--fs-14); font-weight: 600; color: var(--c-muted); }
.row-remove { grid-column: 1 / -1; justify-self: end; min-height: 44px; }
@media (min-width: 900px) {
  .is-wide .row-item { grid-template-columns: minmax(170px, 2fr) repeat(auto-fit, minmax(120px, 1fr)); }
  .is-wide .row-cell:first-child { grid-column: auto; }
  .is-wide .row-remove { grid-column: auto; justify-self: stretch; }
}
.calc-card.is-wide { grid-template-columns: 1fr; }
@media (min-width: 900px) { .calc-card.is-wide { grid-template-columns: 1fr; } }
.is-wide .calc-results { max-width: 720px; }

.result-group { margin: var(--s-4) 0 var(--s-1); font-size: var(--fs-14); font-weight: 600; color: var(--c-muted); }
.result-row.is-strong dt, .result-row.is-strong dd { font-weight: 700; }
.result-row.is-sub dt { padding-left: var(--s-4); color: var(--c-muted); }
.export-note { flex-basis: 100%; margin: 0; font-size: var(--fs-14); color: var(--c-muted); }
.file-btn { cursor: pointer; }
.file-btn:focus-within { outline: 2px solid var(--c-focus); outline-offset: 2px; }

/* Section identity: one colour stripe per section, drawn from the chart series tokens. */
.sec-budget, .sec-home { --sec-color: var(--c-primary); }
.sec-business, .sec-tools { --sec-color: var(--c-accent); }
.sec-cars { --sec-color: var(--c-series-3); }
.sec-study { --sec-color: var(--c-series-2); }
.sec-hero { border-top: 4px solid var(--sec-color, var(--c-primary)); }
.tool-page .page-intro h1 { border-left: 4px solid var(--sec-color, var(--c-primary)); padding-left: var(--s-3); }
.section-switcher ul { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-6) 0; padding: 0; list-style: none; }
.section-switcher a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-4); border: 1px solid var(--c-border-strong); border-radius: 999px; background: var(--c-elevated); font-weight: 600; font-size: var(--fs-14); }
.section-switcher a[aria-current="page"] { background: var(--c-primary-soft); border-color: var(--c-primary-line); color: var(--c-primary-ink); }
.section-about { margin-top: var(--s-6); }

@media print {
  /* Reports print in light colours whatever theme is on screen: tokens only. */
  :root, :root[data-theme="dark"] {
    --c-primary: #0B6E4F; --c-primary-dark: #08553D; --c-primary-soft: #E6F2ED; --c-text: #1F2933; --c-muted: #5F6B76;
    --c-border: #E3E8EC; --c-surface: #F7F9FA; --c-bg: #FFFFFF; --c-elevated: #FFFFFF; --c-input: #FFFFFF; --c-result: #E6F2ED;
    --c-result-line: rgba(11, 110, 79, .14); --c-primary-ink: #0B6E4F; --c-logo-bar: #3F9A5F; --c-primary-line: #0B6E4F; --c-border-strong: #C9D1D8;
    --c-series-0: #0B6E4F; --c-warn-soft: #FFF6E0; --c-warn-line: #F3D48A; --c-warn-ink: #8A5A00; --c-danger: #B42318;
    --c-chart-3: #5B6B7A; --c-chart-4: #2F6EB5; --c-accent: #F2A900;
    color-scheme: light;
  }
  .breadcrumbs, .export-bar, .row-remove, .row-add, .guide, .faq, .figures-checked, .disclaimer-line, .hint, .page-intro .lead, .section-switcher { display: none !important; }
  .calc-card, .calc-card.is-wide { display: block; border: 0; padding: 0; }
  .row-item { break-inside: avoid; border: 1px solid var(--c-border); }
  .panel, .result-card { break-inside: avoid; }
  .input { border: 0; background: transparent; padding: 0; appearance: none; }
  .input-affix .affix { position: static; }
}

/* ============ Printable documents (invoice, quote, statement, letter) ============ */
.doc-hint { margin: 0 0 var(--s-4); color: var(--c-muted); font-size: var(--fs-14); }
.doc-sheet { max-width: 800px; margin: 0 auto; padding: var(--s-5); border: 1px solid var(--c-border-strong); border-radius: var(--r-ctl); background: var(--c-elevated); font-size: var(--fs-14); line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 640px) { .doc-sheet { padding: var(--s-6); } }
.doc-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-5); margin-bottom: var(--s-5); }
.doc-brand { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.doc-logo { max-width: 180px; max-height: 80px; width: auto; height: auto; object-fit: contain; align-self: flex-start; }
.doc-party p { margin: 0; }
.doc-party h3, .doc-block h3 { margin: 0 0 var(--s-1); font-size: var(--fs-12); text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); }
.doc-title { text-align: right; }
.doc-title h2 { margin: 0 0 var(--s-2); font-size: var(--fs-24); color: var(--c-primary-ink); }
.doc-title dl { margin: 0; }
.doc-title dl > div { display: flex; justify-content: flex-end; gap: var(--s-3); }
.doc-title dt { color: var(--c-muted); }
.doc-title dd { margin: 0; font-weight: 600; }
.doc-parties { margin-bottom: var(--s-5); }
.doc-table, .doc-totals { width: 100%; border-collapse: collapse; }
.doc-table th, .doc-table td { padding: var(--s-2); border-bottom: 1px solid var(--c-border); text-align: left; vertical-align: top; }
.doc-table thead th { border-bottom: 2px solid var(--c-border-strong); font-size: var(--fs-12); text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); }
.doc-sheet .num { text-align: right; white-space: nowrap; }
.doc-totals { width: 100%; max-width: 340px; margin: var(--s-4) 0 var(--s-5) auto; }
.doc-totals td { padding: var(--s-1) var(--s-2); }
.doc-grand td { border-top: 2px solid var(--c-border-strong); font-size: var(--fs-18); font-weight: 700; }
.doc-block { margin-bottom: var(--s-4); }
.doc-block p { margin: 0; }
.doc-sign { display: grid; grid-template-columns: 1fr; gap: var(--s-2); margin-top: var(--s-6); max-width: 420px; }
.doc-sign p { margin: var(--s-3) 0 0; }
.doc-line { border-bottom: 1px solid var(--c-text); height: 28px; }
.doc-notice { margin-top: var(--s-5); color: var(--c-muted); font-size: var(--fs-12); }
@media (max-width: 599.98px) { .doc-title { text-align: left; } .doc-title dl > div { justify-content: flex-start; } .doc-table { min-width: 30rem; } }
.doc-scroll { overflow-x: auto; }

@media print {
  .has-doc .page-intro, .has-doc .calc-card, .has-doc .estimate-note, .has-doc .related, .has-doc .doc-panel > h2, .has-doc .doc-hint, .has-doc .ad-slot, .has-doc .panel:not(.doc-panel) { display: none !important; }
  .has-doc .doc-panel { border: 0; padding: 0; margin: 0; box-shadow: none; }
  .doc-sheet { border: 0; padding: 0; max-width: none; font-size: 11pt; }
  .doc-table thead { display: table-header-group; }
  .doc-table tr { break-inside: avoid; }
}

/* ============ Text outputs and file tools ============ */
.out-text-field { margin-top: var(--s-4); }
.out-text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--fs-14); min-height: 120px; }
.out-text-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-2); }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.file-item { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); border: 1px solid var(--c-border); border-radius: var(--r-ctl); background: var(--c-surface); }
.file-item .file-name { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.file-item .file-size { color: var(--c-muted); font-size: var(--fs-14); }
.file-item .btn { min-height: 44px; }
.file-drop { border: 2px dashed var(--c-input-line); border-radius: var(--r-card); padding: var(--s-5); text-align: center; background: var(--c-surface); }
.file-drop.is-over { border-color: var(--c-primary-line); background: var(--c-primary-soft); }
.download-list { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.download-list a.btn { text-decoration: none; }
.preview-img { max-width: 100%; max-height: 320px; height: auto; border: 1px solid var(--c-border); border-radius: var(--r-ctl); background: var(--c-surface); }
.privacy-note { font-size: var(--fs-14); color: var(--c-muted); margin: var(--s-3) 0 0; }
.util-card .calc-inputs { max-width: 760px; }
.qr-box { margin-top: var(--s-4); max-width: 320px; border: 1px solid var(--c-border-strong); border-radius: var(--r-ctl); overflow: hidden; background: var(--c-bg); }
.qr-box svg { display: block; width: 100%; height: auto; }
@media print { .qr-box { border: 0; } }
.calc-inputs:not(:has(*)) { display: none; }
.calc-card:has(> .calc-inputs:not(:has(*))) { grid-template-columns: 1fr; }

/* ============ CV builder ============ */
.import-box { margin-bottom: var(--s-5); }
.import-box h2 { margin-top: 0; }
.import-status { margin: var(--s-3) 0 0; }
.cv-sheet { color: var(--c-text); }
.cv-name { margin: 0; font-size: var(--fs-24); color: var(--c-primary-ink); }
.cv-headline { margin: var(--s-1) 0 0; color: var(--c-muted); }
.cv-contact-line { margin: var(--s-3) 0 var(--s-4); padding-bottom: var(--s-3); border-bottom: 2px solid var(--c-border-strong); }
.cv-section { margin-bottom: var(--s-4); }
.cv-section h3 { margin: 0 0 var(--s-2); font-size: var(--fs-12); text-transform: uppercase; letter-spacing: .08em; color: var(--c-primary-ink); border-bottom: 1px solid var(--c-border); padding-bottom: var(--s-1); }
.cv-section p, .cv-section ul { margin: 0; }
.cv-item { margin-bottom: var(--s-3); break-inside: avoid; }
.cv-item-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-1) var(--s-4); }
.cv-item-head p { margin: 0; }
.cv-when { color: var(--c-muted); white-space: nowrap; }
.cv-item ul { margin: var(--s-1) 0 0; padding-left: 1.2em; }
.cv-note { margin: var(--s-1) 0 0; color: var(--c-muted); }
.cv-tags, .cv-contact { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); }
.cv-contact { flex-direction: column; }
.cv-sidebar .cv-head { margin-bottom: var(--s-4); padding-bottom: var(--s-3); border-bottom: 2px solid var(--c-border-strong); }
.cv-cols { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
@media (min-width: 640px) { .cv-cols { grid-template-columns: 11rem 1fr; gap: var(--s-5); } }
.cv-side .cv-tags { flex-direction: column; }
@media print {
  .has-doc .import-box { display: none !important; }
  .cv-sheet { font-size: 10.5pt; }
  .cv-cols { grid-template-columns: 11rem 1fr; }
  .cv-section { break-inside: avoid-page; }
}

/* Payday Dash game */
.pd-card { display: block; }
.pd-controls { display: grid; gap: var(--s-3); margin-bottom: var(--s-4); max-width: 34rem; }
.pd-help { margin: 0; color: var(--c-muted); font-size: var(--fs-14); }
.pd-stage { display: grid; gap: var(--s-3); justify-items: center; }
.pd-canvas { display: block; width: min(100%, calc(min(72vh, 640px) * 0.642857)); height: auto; aspect-ratio: 9 / 14; background: var(--c-surface); border: 2px solid var(--c-border-strong); border-radius: var(--r-ctl); box-shadow: 0 6px 20px color-mix(in srgb, var(--c-text) 14%, transparent); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.pd-canvas:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.pd-actions { display: flex; gap: var(--s-3); justify-content: center; }
.pd-status { margin: 0; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.pd-over { margin-top: var(--s-4); padding: var(--s-4) var(--s-5); background: var(--c-result); border: 1px solid var(--c-result-line); border-radius: var(--r-ctl); font-variant-numeric: tabular-nums; }
.pd-over[hidden] { display: none; }
.pd-over h2 { margin-top: 0; }
.pd-result { font-size: var(--fs-20, 1.25rem); font-weight: 700; margin: 0 0 var(--s-2); }
.pd-line, .pd-real { margin: 0 0 var(--s-3); }
@media (prefers-reduced-motion: reduce) { .pd-canvas { scroll-behavior: auto; } }
