/* Base — reset, typography, accessibility */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--fs-400)/var(--lh-body) var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { line-height: var(--lh-tight); letter-spacing: -.025em; margin: 0 0 var(--sp-4); font-weight: 750; }
h1 { font-size: var(--fs-800); }
h2 { font-size: var(--fs-700); margin-top: var(--sp-12); }
h3 { font-size: var(--fs-600); margin-top: var(--sp-8); }
p, ul, ol { margin: 0 0 var(--sp-4); }
ul, ol { padding-left: 1.25rem; }
li + li { margin-top: var(--sp-2); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg, canvas { max-width: 100%; }
canvas { display: block; }
strong { font-weight: 700; }
small { font-size: var(--fs-300); }
code, .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: var(--r-xs); }
::selection { background: var(--accent); color: #fff; }
.skip-link {
  position: fixed; inset-inline-start: var(--sp-4); top: -100px; z-index: 200;
  background: var(--surface-solid); color: var(--text); padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm); box-shadow: var(--shadow-md); border: 1px solid var(--border-strong);
}
.skip-link:focus { top: var(--sp-3); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.page { width: var(--page); margin-inline: auto; }
.page-wide { width: var(--page-wide); margin-inline: auto; }
.section { padding-block: var(--sp-12); }
.lead { font-size: var(--fs-500); color: var(--text-muted); max-width: 68ch; }
.muted { color: var(--text-muted); }
.center { text-align: center; }
.stack > * + * { margin-top: var(--sp-4); }
.grid { display: grid; gap: var(--sp-5); }
@media (max-width: 640px) { .grid { gap: var(--sp-4); } }
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-solid); }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-300); }
caption { text-align: left; padding: var(--sp-3) var(--sp-4); font-weight: 700; color: var(--text-muted); }
th, td { padding: var(--sp-3) var(--sp-4); text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
tbody tr:last-child td, tfoot td { border-bottom: 0; }
tfoot td { font-weight: 750; background: var(--accent-soft); }
td.num, th.num { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
[aria-live] { min-height: 1em; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  .site-header, .site-footer, .theme-toggle, .search-trigger, .calc-actions, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .panel, .calc-panel { box-shadow: none !important; border: 1px solid #ccc !important; background: #fff !important; }
  .page { width: 100%; }
  a { color: #000; text-decoration: none; }
  details { display: block !important; }
  details > * { display: block !important; }
}
