/* Steady Ledger website. One token system: every size, colour, radius, shadow and
   timing below comes from :root. tests/site.test.ts fails on off-scale values. */

/* ---------- fonts (static instances; fallbacks matched to avoid layout shift) ---------- */
@font-face { font-family: 'SL Serif'; src: url('fonts/SerifDisplay-Semibold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'SL Serif'; src: url('fonts/SerifDisplay-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'SL Serif'; src: url('fonts/SerifDisplay-Italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'SL Sans'; src: url('fonts/Sans-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'SL Sans'; src: url('fonts/Sans-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'SL Sans'; src: url('fonts/Sans-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'SL Sans'; src: url('fonts/Sans-Italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'SL Sans Fallback'; src: local('Arial'), local('ArialMT'); size-adjust: 98.7%; ascent-override: 99.7%; descent-override: 32%; line-gap-override: 0%; }
@font-face { font-family: 'SL Serif Fallback'; src: local('Georgia Bold'), local('Georgia-Bold'), local('Georgia'); size-adjust: 83%; ascent-override: 124.9%; descent-override: 40.4%; line-gap-override: 0%; }

:root {
  color-scheme: light dark;
  /* spacing scale */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;
  /* type scale */
  --t-sm: 1rem; --t-body: 1.125rem; --t-lead: 1.375rem; --t-h4: 1.25rem; --t-h3: 1.5rem; --t-h2: clamp(1.875rem, 1.4rem + 1.8vw, 2.625rem); --t-h1: clamp(2.375rem, 1.6rem + 3.2vw, 3.75rem); --t-num: clamp(1.75rem, 1.4rem + 1vw, 2.25rem);
  --lh: 1.6; --lh-tight: 1.15;
  /* shape */
  --r-1: 8px; --r-2: 16px; --bw: 1px; --tap: 48px;
  --stroke: 2px; /* strokes: chevrons, ticks, chart legend, hover underline; borders use --bw */
  --focus-w: 3px; --focus-offset: 2px;
  --shadow-1: 0 1px 2px rgb(24 32 47 / 0.06), 0 2px 8px rgb(24 32 47 / 0.06);
  --shadow-2: 0 2px 4px rgb(24 32 47 / 0.06), 0 16px 40px -12px rgb(24 32 47 / 0.22);
  /* layout */
  --chart-h: 300px; /* fixed so redrawing the chart at its real width never shifts the layout */
  --container: 1160px; --measure: 32em; /* about 70 characters per line in Atkinson (its “0”, which sets ch, is wide) */ --gutter: var(--s-4); --header-h: 72px;
  /* motion */
  --dur: 160ms; --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  /* fonts */
  --serif: 'SL Serif', 'SL Serif Fallback', Georgia, serif;
  --sans: 'SL Sans', 'SL Sans Fallback', Arial, system-ui, sans-serif;
  /* colour: light */
  --bg: #FBF8F1; --bg-alt: #F3EDE1; --surface: #FFFFFF; --ink: #18202F; --ink-2: #33405A; --muted: #4A5366; --rule: #DCD3C1; --rule-strong: #B9AE98;
  --insured: #1D573C; --insured-tint: #E2F0E8; --treasury: #1C4A86; --treasury-tint: #E1EAF6; --market: #844709; --market-tint: #F8E9D6; --check: #444B57; --check-tint: #E9EAEC;
  --accent: #1D573C; --accent-hover: #16442F; --on-accent: #FFFFFF; --link: #1C4A86; --focus: #1C4A86; --warn: #7A1C1C; --warn-tint: #FBE7E7; --note: #FFF3D1; --on-note: #4D3600;
  --wren-body: #3A2A21; --wren-wing: #B4633E; --wren-eye: #F7F0E4;
}
@media (min-width: 768px) { :root { --t-body: 1.1875rem; --gutter: var(--s-6); } }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151D; --bg-alt: #161C26; --surface: #1B2230; --ink: #EEF1F5; --ink-2: #CBD3DF; --muted: #B3BCCA; --rule: #2D374A; --rule-strong: #46546E;
    --insured: #8FD3AF; --insured-tint: #183427; --treasury: #9DBDF2; --treasury-tint: #172A45; --market: #E6B27A; --market-tint: #3A2711; --check: #C3C8D0; --check-tint: #262C36;
    --accent: #8FD3AF; --accent-hover: #A9E2C3; --on-accent: #0E1A13; --link: #A9C8F6; --focus: #A9C8F6; --warn: #F2A7A7; --warn-tint: #3A1C1C; --note: #3A2F12; --on-note: #F5E3B0;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4); --shadow-2: 0 2px 4px rgb(0 0 0 / 0.3), 0 16px 40px -12px rgb(0 0 0 / 0.6);
    --wren-body: #E9DCC8; --wren-wing: #D58A65; --wren-eye: #3A2A21;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--s-4)); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: var(--t-body); line-height: var(--lh); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: var(--lh-tight); margin: 0 0 var(--s-4); text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
h4 { font-size: var(--t-h4); font-family: var(--sans); font-weight: 700; letter-spacing: 0; }
p, li, dd, figcaption, td, th, summary { text-wrap: pretty; }
p { margin: 0 0 var(--s-4); }
ul, ol { margin: 0 0 var(--s-4); padding-left: var(--s-5); }
li + li { margin-top: var(--s-2); }
strong { font-weight: 700; }
a { color: var(--link); text-decoration: underline; text-decoration-thickness: var(--bw); text-underline-offset: 0.2em; transition: color var(--dur) var(--ease), text-decoration-thickness var(--dur) var(--ease); }
a:hover { text-decoration-thickness: var(--stroke); }
:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: var(--focus-offset); border-radius: var(--r-1); }
[id] { scroll-margin-top: calc(var(--header-h) + var(--s-4)); }
.skip { position: absolute; left: var(--s-4); top: calc(-1 * var(--s-9)); z-index: 100; background: var(--ink); color: var(--bg); padding: var(--s-3) var(--s-4); border-radius: var(--r-1); }
.skip:focus { top: var(--s-4); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.prose { max-width: var(--measure); }
.section { padding-block: var(--s-8); }
@media (min-width: 1024px) { .section { padding-block: var(--s-9); } }
.section--alt { background: var(--bg-alt); }
.section-head { max-width: var(--measure); margin-bottom: var(--s-7); }
.section-head > :last-child { margin-bottom: 0; }
.section-head--center { margin-inline: auto; text-align: center; }
.eyebrow { font-size: var(--t-sm); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s-3); }
.lead { font-size: var(--t-lead); line-height: 1.5; color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: var(--t-sm); }
.grid-2 { display: grid; gap: var(--s-6); }
.grid-3 { display: grid; gap: var(--s-5); }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; gap: var(--s-7); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- header ---------- */
.preview-banner { background: var(--note); color: var(--on-note); text-align: center; padding: var(--s-2) var(--s-4); font-size: var(--t-sm); font-weight: 500; }
.site-head { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: var(--bw) solid var(--rule); }
.site-head .container { display: flex; align-items: center; gap: var(--s-5); min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: var(--s-3); color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: var(--t-h4); min-height: var(--tap); }
.brand svg { width: var(--s-6); height: var(--s-6); flex: none; }
.nav { display: none; gap: var(--s-1); margin-left: auto; }
.nav a { display: inline-flex; align-items: center; min-height: var(--tap); padding-inline: var(--s-3); color: var(--ink); text-decoration: none; font-weight: 500; font-size: var(--t-sm); border-radius: var(--r-1); transition: background-color var(--dur) var(--ease); }
.nav a:hover { background: var(--bg-alt); }
.nav a:active { background: var(--rule); }
.nav a[aria-current='page'] { text-decoration: underline; text-underline-offset: 0.35em; }
.menu { margin-left: auto; }
.menu > summary { padding-block: 0; padding-inline: var(--s-3); font-size: var(--t-sm); border: var(--bw) solid var(--rule); border-radius: var(--r-1); }
.menu > summary::after { width: var(--s-2); height: var(--s-2); }
.menu-panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: var(--bw) solid var(--rule); box-shadow: var(--shadow-1); padding: var(--s-2) var(--s-4) var(--s-4); display: grid; }
.menu-panel a { display: flex; align-items: center; min-height: var(--tap); color: var(--ink); font-weight: 500; border-bottom: var(--bw) solid var(--rule); }
.menu-panel a:last-child { border-bottom: 0; }
.head-buy { margin-left: 0; }
.site-head .container { position: relative; }
@media (min-width: 1180px) { .nav { display: flex; } .menu { display: none; } }
.nav a { white-space: nowrap; }
.brand span, .site-head .btn, .menu > summary { white-space: nowrap; }
/* Larger text on a phone: the name gives way (shrinks, then trims) so the buy button never leaves the screen. */
.brand { min-width: 0; }
.brand span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.menu, .head-buy { flex: none; }
.lbl-short { display: none; }
@media (max-width: 479px) {
  .site-head .container { gap: var(--s-2); }
  .brand { font-size: var(--t-body); gap: var(--s-2); }
  .site-head .btn, .menu > summary { padding-inline: var(--s-3); font-size: var(--t-sm); }
  .menu > summary::after { display: none; }
  .lbl-long { display: none; } .lbl-short { display: inline; }
}
@media (max-width: 359px) { .brand svg { display: none; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: var(--tap); padding: var(--s-3) var(--s-5); border-radius: var(--r-1); border: var(--bw) solid transparent; font: 700 var(--t-body)/1.2 var(--sans); text-decoration: none; text-align: center; cursor: pointer; transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.btn:active { transform: translateY(var(--bw)); }
.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-1); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--rule-strong); }
.btn--secondary:hover { border-color: var(--ink); }
.btn--lg { min-height: calc(var(--tap) + var(--s-2)); padding-inline: var(--s-6); }
.btn[aria-disabled='true'] { background: var(--check-tint); color: var(--muted); box-shadow: none; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.btn-row--center { justify-content: center; }
.space-top { margin-top: var(--s-6); }
.fineprint { font-size: var(--t-sm); color: var(--muted); margin: var(--s-3) 0 0; }
.refund-note { color: var(--ink-2); margin: var(--s-4) 0 0; }
.zoom-hint { display: inline-block; } /* wraps as one unit, never wider than the caption */
.mini-result { margin: 0 0 var(--s-4); padding: var(--s-3) var(--s-4); background: var(--bg-alt); border-radius: var(--r-1); }
@media (min-width: 1024px) { .mini-result { display: none; } }
.tool-note { margin: 0 0 var(--s-4); font-weight: 700; }

/* ---------- hero ---------- */
.hero { padding-block: var(--s-7) var(--s-8); background: var(--bg-alt); border-bottom: var(--bw) solid var(--rule); }
.hero-grid { display: grid; gap: var(--s-7); align-items: center; }
@media (min-width: 1024px) { .hero { padding-block: var(--s-8) var(--s-9); } .hero-grid { grid-template-columns: 5fr 6fr; gap: var(--s-7); } }
.hero h1 { margin-bottom: var(--s-5); }
.hero .lead { max-width: 36ch; margin-bottom: var(--s-5); }
.hero-facts { list-style: none; padding: 0; margin: var(--s-5) 0 0; display: grid; gap: var(--s-2); color: var(--ink-2); }
.hero-facts li { display: flex; gap: var(--s-3); align-items: baseline; margin: 0; }
.hero-facts li::before { content: ''; width: var(--s-2); height: var(--s-2); border-radius: 50%; background: var(--insured); flex: none; transform: translateY(calc(-1 * var(--stroke))); }

/* ---------- product frames and figures ---------- */
.frame { background: var(--surface); border: var(--bw) solid var(--rule); border-radius: var(--r-2); box-shadow: var(--shadow-2); overflow: hidden; }
.frame img { width: 100%; }
.frame--plain { box-shadow: var(--shadow-1); border-radius: var(--r-1); }
figure { margin: 0; }
figcaption { font-size: var(--t-sm); color: var(--muted); margin-top: var(--s-3); }
.zoom { display: block; color: inherit; text-decoration: none; border-radius: var(--r-2); }
.zoom .frame { transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.zoom:hover .frame { transform: translateY(calc(-1 * var(--stroke))); }
.label-chip { display: inline-block; font-size: var(--t-sm); font-weight: 700; background: var(--note); color: var(--on-note); border-radius: var(--r-1); padding: var(--s-1) var(--s-3); margin: 0 0 var(--s-3); }

/* ---------- badges (safety groups) ---------- */
.badge { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 700; }
.badge svg { width: 0.8em; height: 0.8em; flex: none; }
.g-insured { color: var(--insured); } .g-insured svg { fill: var(--insured); }
.g-treasury { color: var(--treasury); } .g-treasury svg { fill: var(--treasury); }
.g-market { color: var(--market); } .g-market svg { fill: var(--market); }
.g-check { color: var(--check); } .g-check svg { fill: var(--check); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: var(--bw) solid var(--rule); border-radius: var(--r-2); padding: var(--s-5); height: 100%; }
.card h3 { font-size: var(--t-h4); font-family: var(--sans); font-weight: 700; margin-bottom: var(--s-2); letter-spacing: 0; }
.card > :last-child { margin-bottom: 0; }
.card--insured { background: var(--insured-tint); border-color: transparent; }
.card--treasury { background: var(--treasury-tint); border-color: transparent; }
.card--market { background: var(--market-tint); border-color: transparent; }
.card--check { background: var(--check-tint); border-color: transparent; }

/* ---------- feature rows ---------- */
.feature { display: grid; gap: var(--s-6); align-items: start; padding-block: var(--s-7); border-top: var(--bw) solid var(--rule); }
.feature > * { min-width: 0; } /* grid items may shrink below their content (larger text on phones) */
.feature:first-of-type { border-top: 0; padding-top: 0; }
.feature:last-of-type { padding-bottom: 0; }
@media (min-width: 1024px) { .feature { grid-template-columns: 5fr 7fr; gap: var(--s-8); } .feature--flip { grid-template-columns: 7fr 5fr; } .feature--flip > :first-child { order: 2; } }
.feature-num { display: inline-flex; align-items: center; justify-content: center; width: var(--s-7); height: var(--s-7); border-radius: 50%; font-family: var(--serif); font-weight: 600; font-size: var(--t-h4); color: var(--on-accent); background: var(--accent); margin-bottom: var(--s-4); }
.checks { list-style: none; padding: 0; }
.checks li { position: relative; padding-left: var(--s-6); }
.checks li::before { content: ''; position: absolute; left: var(--s-1); top: 0.5em; width: var(--s-3); height: var(--s-2); border-left: var(--stroke) solid var(--insured); border-bottom: var(--stroke) solid var(--insured); transform: rotate(-45deg); }
.checks.no li::before { border: 0; height: var(--stroke); background: var(--market); transform: none; top: 0.75em; }
.figure-stack { display: grid; gap: var(--s-4); }
.figure-stack > * { min-width: 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: var(--bw) solid var(--rule); border-radius: var(--r-2); background: var(--surface); }
/* Phones: guide tables become one card per row, each value labeled with its column. */
@media (max-width: 599px) {
  .table-wrap--stack { overflow: visible; border: 0; background: none; }
  .table-wrap--stack table, .table-wrap--stack tbody, .table-wrap--stack tr, .table-wrap--stack th, .table-wrap--stack td { display: block; width: auto; }
  .table-wrap--stack caption { display: block; text-align: left; font-weight: 700; padding: 0 0 var(--s-3); }
  .table-wrap--stack thead { position: absolute; width: var(--bw); height: var(--bw); overflow: hidden; clip-path: inset(50%); }
  .table-wrap--stack tr { background: var(--surface); border: var(--bw) solid var(--rule); border-radius: var(--r-2); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-3); }
  .table-wrap--stack tbody th { padding: 0 0 var(--s-2); border: 0; font-size: var(--t-h4); }
  .table-wrap--stack td { padding: var(--s-2) 0; border: 0; border-top: var(--bw) solid var(--rule); text-align: left; white-space: normal; }
  .table-wrap--stack td::before { content: attr(data-label); display: block; font-size: var(--t-sm); font-weight: 700; color: var(--muted); }
  .table-wrap--stack td[data-label=""]::before { content: none; }
  .table-wrap--stack tr > td:first-child { border-top: 0; padding-top: 0; }
  .table-wrap--stack td.num { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); text-align: right; }
  .table-wrap--stack td.num::before { display: inline; font-size: var(--t-body); color: var(--ink-2); }
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; vertical-align: top; padding: var(--s-3) var(--s-4); border-bottom: var(--bw) solid var(--rule); }
thead th { background: var(--bg-alt); font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); }
tbody th { font-weight: 700; }
tbody tr:last-child > * { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }

/* ---------- files list ---------- */
.files { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); align-content: start; }
.files li { margin: 0; display: grid; grid-template-columns: var(--s-8) 1fr; gap: var(--s-4); align-items: start; background: var(--surface); border: var(--bw) solid var(--rule); border-radius: var(--r-2); padding: var(--s-4); }
.file-type { display: flex; align-items: center; justify-content: center; height: var(--s-8); border-radius: var(--r-1); font-size: var(--t-sm); font-weight: 700; letter-spacing: 0.04em; background: var(--bg-alt); color: var(--ink-2); }
.files h3 { font-family: var(--sans); font-size: var(--t-body); font-weight: 700; margin: 0 0 var(--s-1); letter-spacing: 0; overflow-wrap: anywhere; }
.files p { margin: 0; color: var(--ink-2); }
.files .meta { font-size: var(--t-sm); color: var(--muted); margin-top: var(--s-1); }

/* ---------- gallery ---------- */
.gallery { display: grid; gap: var(--s-4); grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: var(--s-6); }
@media (min-width: 900px) { .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5); } }
.gallery .frame { border-radius: var(--r-1); aspect-ratio: 17 / 22; box-shadow: var(--shadow-1); }
.gallery img { height: 100%; object-fit: cover; object-position: top; }

/* ---------- interactive tools ---------- */
.tool { background: var(--surface); border: var(--bw) solid var(--rule); border-radius: var(--r-2); box-shadow: var(--shadow-1); padding: var(--s-5); display: grid; gap: var(--s-6); }
@media (min-width: 1024px) { .tool { grid-template-columns: 22rem 1fr; padding: var(--s-6); } }
.tool > *, .results > *, .prose > *, .grid-2 > * { min-width: 0; }
@media (max-width: 479px) { .tool { padding: var(--s-4); } }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
.field + .field { margin-top: var(--s-4); }
.field label { font-weight: 700; }
.hint { display: block; font-weight: 400; font-size: var(--t-sm); color: var(--muted); }
.input { display: flex; align-items: stretch; min-height: var(--tap); border: var(--bw) solid var(--rule-strong); border-radius: var(--r-1); background: var(--surface); transition: border-color var(--dur) var(--ease); }
.input:hover { border-color: var(--ink-2); }
.input:focus-within { outline: var(--focus-w) solid var(--focus); outline-offset: var(--focus-offset); }
.input .affix { display: flex; align-items: center; padding-inline: var(--s-3); color: var(--muted); font-weight: 700; background: var(--bg-alt); }
.input .affix:first-child { border-radius: var(--r-1) 0 0 var(--r-1); }
.input .affix:last-child { border-radius: 0 var(--r-1) var(--r-1) 0; }
.input input { flex: 1; min-width: 0; font: inherit; color: var(--ink); background: transparent; border: 0; padding: var(--s-2) var(--s-3); min-height: var(--tap); }
.input input:focus { outline: none; }
select { width: 100%; font: inherit; color: var(--ink); min-height: var(--tap); padding: var(--s-2) var(--s-3); border: var(--bw) solid var(--rule-strong); border-radius: var(--r-1); background: var(--surface); cursor: pointer; transition: border-color var(--dur) var(--ease); }
select:hover { border-color: var(--ink-2); }
select:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: var(--focus-offset); }
input[aria-invalid='true'] { background: var(--warn-tint); }
.error { color: var(--warn); font-weight: 700; font-size: var(--t-sm); margin: 0; }
.results { display: grid; gap: var(--s-5); align-content: start; transition: opacity var(--dur) var(--ease); }
.results.is-stale { opacity: 0.5; }
.stats { display: grid; gap: var(--s-3); }
@media (min-width: 600px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stat { border-radius: var(--r-1); padding: var(--s-4); background: var(--bg-alt); }
.stat .k { font-size: var(--t-sm); color: var(--ink-2); margin: 0; }
.stat .v { font-family: var(--serif); font-weight: 600; font-size: var(--t-num); line-height: var(--lh-tight); margin: var(--s-1) 0 0; }
.stat--a { background: var(--treasury-tint); } .stat--a .v { color: var(--treasury); }
.stat--b { background: var(--market-tint); } .stat--b .v { color: var(--market); }
.stat--d { background: var(--surface); border: var(--bw) solid var(--rule-strong); }
.legend { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s-4); font-size: var(--t-sm); }
.legend li { display: inline-flex; align-items: center; gap: var(--s-2); margin: 0; }
.legend i { width: var(--s-5); border-top: var(--stroke) solid; }
.legend .la i { border-color: var(--treasury); } .legend .lb i { border-color: var(--market); } .legend .lp i { border-color: var(--muted); border-top-style: dashed; }
.chart { height: var(--chart-h); }
.chart svg { display: block; width: 100%; height: 100%; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .axis { stroke: var(--rule-strong); }
.chart text { font-family: var(--sans); font-size: var(--t-sm); fill: var(--muted); }
.chart .line-a { stroke: var(--treasury); } .chart .line-b { stroke: var(--market); } .chart .line-p { stroke: var(--muted); }
.chart .dot-a { fill: var(--treasury); } .chart .dot-b { fill: var(--market); } .chart .dot-p { fill: var(--muted); }
.assumptions { color: var(--ink-2); background: var(--bg-alt); border-radius: var(--r-1); padding: var(--s-4); margin: 0; }
.sorter { background: var(--surface); border: var(--bw) solid var(--rule); border-radius: var(--r-2); padding: var(--s-5); margin-top: var(--s-5); }
.sorter label { display: block; font-weight: 700; margin-bottom: var(--s-2); }
.sorter-result { margin-top: var(--s-4); border-radius: var(--r-1); padding: var(--s-4); background: var(--bg-alt); min-height: var(--s-9); }
.sorter-result.is-insured { background: var(--insured-tint); } .sorter-result.is-treasury { background: var(--treasury-tint); }
.sorter-result.is-market { background: var(--market-tint); } .sorter-result.is-check { background: var(--check-tint); }
.sorter-result p { margin: 0; }
.sorter-result p + p { margin-top: var(--s-2); }
.checker-out { border-radius: var(--r-2); padding: var(--s-5); background: var(--bg-alt); }
.checker-out.is-over { background: var(--warn-tint); }
.checker-out.is-ok { background: var(--insured-tint); }
.checker-out > :last-child { margin-bottom: 0; }
.checker-big { font-family: var(--serif); font-weight: 600; font-size: var(--t-num); line-height: var(--lh-tight); margin: 0 0 var(--s-2); }

/* ---------- disclosures ---------- */
details { border-bottom: var(--bw) solid var(--rule); interpolate-size: allow-keywords; }
details::details-content { block-size: 0; overflow: hidden; transition: block-size var(--dur) var(--ease), content-visibility var(--dur) allow-discrete; }
details[open]::details-content { block-size: auto; }
.menu::details-content { block-size: auto; overflow: visible; transition: none; } /* the panel is positioned under the header, so nothing to grow */
.menu { border-bottom: 0; }
summary { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); min-height: var(--tap); padding-block: var(--s-4); cursor: pointer; list-style: none; font-weight: 700; transition: color var(--dur) var(--ease); }
summary::-webkit-details-marker { display: none; }
summary:hover { color: var(--link); }
summary::after { content: ''; flex: none; width: var(--s-3); height: var(--s-3); border-right: var(--stroke) solid currentColor; border-bottom: var(--stroke) solid currentColor; transform: translateY(-25%) rotate(45deg); transition: transform var(--dur) var(--ease); }
details[open] > summary::after { transform: translateY(25%) rotate(225deg); }
details > :not(summary) { margin-bottom: var(--s-4); }
.faq { max-width: var(--measure); margin-inline: auto; border-top: var(--bw) solid var(--rule); }
.faq--flush { margin-inline: 0; }
.tool-details { border: 0; }

/* ---------- price ---------- */
.price-panel { display: grid; gap: var(--s-6); background: var(--surface); border: var(--bw) solid var(--rule-strong); border-radius: var(--r-2); box-shadow: var(--shadow-2); padding: var(--s-5); }
@media (min-width: 900px) { .price-panel { grid-template-columns: 5fr 7fr; padding: var(--s-7); gap: var(--s-7); } }
.price { font-family: var(--serif); font-weight: 600; font-size: var(--t-h1); line-height: 1; margin: 0; }
.price-note { color: var(--ink-2); margin: var(--s-3) 0 var(--s-5); }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: var(--s-5); }
.steps li { counter-increment: step; display: grid; grid-template-columns: var(--s-7) 1fr; gap: var(--s-4); margin: 0; }
.steps li::before { content: counter(step); display: flex; align-items: center; justify-content: center; width: var(--s-7); height: var(--s-7); border-radius: 50%; border: var(--bw) solid var(--rule-strong); font-family: var(--serif); font-weight: 600; font-size: var(--t-h4); }
.steps h3 { font-family: var(--sans); font-size: var(--t-body); font-weight: 700; margin: var(--s-2) 0 var(--s-1); letter-spacing: 0; }
.steps p { margin: 0; color: var(--ink-2); }

/* ---------- facts list (trust) ---------- */
.facts { margin: 0; border-top: var(--bw) solid var(--rule); }
.facts > div { display: grid; gap: var(--s-1); padding-block: var(--s-4); border-bottom: var(--bw) solid var(--rule); }
@media (min-width: 900px) { .facts > div { grid-template-columns: 15rem 1fr; gap: var(--s-6); } }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; color: var(--ink-2); }
.facts dd > :last-child { margin-bottom: 0; }

/* ---------- Wren & Co. ---------- */
.wren-mark .w-body { fill: var(--wren-body); } .wren-mark .w-wing { fill: var(--wren-wing); } .wren-mark .w-eye { fill: var(--wren-eye); } .wren-mark .w-line { stroke: var(--wren-eye); } .wren-mark .w-leg { stroke: var(--wren-body); }
.about { display: grid; gap: var(--s-6); align-items: start; }
@media (min-width: 900px) { .about { grid-template-columns: 1fr 1fr; gap: var(--s-8); } }
.about-head { display: flex; gap: var(--s-4); align-items: center; margin-bottom: var(--s-4); }
.about-head svg { width: var(--s-8); height: var(--s-8); flex: none; }
.about-head h2 { margin: 0; }
.more { list-style: none; padding: 0; margin: 0; border-top: var(--bw) solid var(--rule); }
.more li { margin: 0; border-bottom: var(--bw) solid var(--rule); }
.more a { display: grid; gap: var(--s-1); padding-block: var(--s-3); text-decoration: none; color: var(--ink); }
.more a:hover .more-name { text-decoration-thickness: var(--stroke); }
.more-name { font-weight: 700; color: var(--link); text-decoration: underline; text-decoration-thickness: var(--bw); text-underline-offset: 0.2em; }
.more-line { color: var(--ink-2); }

/* ---------- footer ---------- */
.site-foot { background: var(--bg-alt); border-top: var(--bw) solid var(--rule); padding-block: var(--s-8) var(--s-7); font-size: var(--t-sm); color: var(--ink-2); }
.foot-grid { display: grid; gap: var(--s-6); }
@media (min-width: 900px) { .foot-grid { grid-template-columns: 2fr 1fr 1fr; } }
.foot-brand { display: flex; align-items: center; gap: var(--s-3); font-weight: 700; color: var(--ink); margin: 0 0 var(--s-4); }
.foot-brand svg { width: var(--s-7); height: var(--s-7); flex: none; }
.foot-list { list-style: none; padding: 0; margin: 0; }
.foot-list li { margin: 0; }
.foot-list a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--ink); }
.foot-title { font-weight: 700; color: var(--ink); margin: 0 0 var(--s-1); }
.copyright { margin: var(--s-6) 0 0; padding-top: var(--s-5); border-top: var(--bw) solid var(--rule); }

/* ---------- articles (resources and policies) ---------- */
.page-head { padding-block: var(--s-6) var(--s-7); background: var(--bg-alt); border-bottom: var(--bw) solid var(--rule); }
.page-head h1 { max-width: 22ch; }
.page-head .lead { max-width: var(--measure); }
.crumbs { font-size: var(--t-sm); margin-bottom: var(--s-3); }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; column-gap: var(--s-2); }
.crumbs li { margin: 0; display: inline-flex; align-items: center; gap: var(--s-2); }
.crumbs li + li::before { content: '/'; color: var(--muted); }
.crumbs a { display: inline-flex; align-items: center; min-height: var(--tap); }
.reviewed { font-size: var(--t-sm); color: var(--muted); margin: 0; }
.article { padding-block: var(--s-7) var(--s-9); }
.article .prose > h2 { font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.125rem); margin-top: var(--s-7); }
.article .prose > h3 { margin-top: var(--s-6); }
.article .table-wrap, .article .tool, .article .callout { margin-block: var(--s-5); }
.wide { max-width: var(--container); }
.answer { font-size: var(--t-lead); line-height: 1.5; background: linear-gradient(var(--accent), var(--accent)) left / var(--s-1) 100% no-repeat; padding-left: var(--s-5); margin: 0 0 var(--s-6); }
.callout { background: var(--bg-alt); border-radius: var(--r-2); padding: var(--s-5); }
.callout > :last-child { margin-bottom: 0; }
.callout--note { background: var(--note); color: var(--on-note); }
.callout--note a { color: inherit; }
.sources-list { font-size: var(--t-sm); padding-left: var(--s-5); }
.sources-list li { overflow-wrap: anywhere; }
.product-cta { display: grid; gap: var(--s-4); background: var(--surface); border: var(--bw) solid var(--rule-strong); border-radius: var(--r-2); padding: var(--s-5); margin-block: var(--s-7); box-shadow: var(--shadow-1); }
@media (min-width: 900px) { .product-cta { padding: var(--s-6); } }
.product-cta p { margin: 0; }
.product-cta .title { font-weight: 700; margin-bottom: var(--s-1); }
.resource-cards { display: grid; gap: var(--s-4); }
@media (min-width: 700px) { .resource-cards { grid-template-columns: repeat(2, 1fr); } }
.resource-cards a { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: var(--bw) solid var(--rule); border-radius: var(--r-2); padding: var(--s-5); height: 100%; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.resource-cards a:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-1); }
.resource-cards h3 { font-family: var(--sans); font-size: var(--t-body); font-weight: 700; color: var(--link); margin-bottom: var(--s-2); letter-spacing: 0; text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: var(--bw); }
.resource-cards p { margin: 0; color: var(--ink-2); }
.not-found { padding-block: var(--s-10); text-align: center; }
.not-found .btn-row { justify-content: center; }

/* ---------- motion ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--dur); animation-timing-function: var(--ease); }

/* ---------- email signup (free bonus) ---------- */
.signup { display: grid; gap: var(--s-5); align-items: center; margin-block: var(--s-7); padding: var(--s-5); background: var(--surface); border: var(--bw) solid var(--rule); border-radius: var(--r-2); box-shadow: var(--shadow-1); }
.signup h2 { font-size: var(--t-h3); margin-bottom: var(--s-3); }
.signup .eyebrow { margin-bottom: var(--s-2); }
.signup-body > :last-child { margin-bottom: 0; }
.signup-body > p { max-width: var(--measure); } /* readable line length when the box spans a wide container */
.signup-art { justify-self: start; width: var(--s-10); }
.signup-art img { border: var(--bw) solid var(--rule); border-radius: var(--r-1); box-shadow: var(--shadow-1); }
@media (min-width: 768px) { .signup { grid-template-columns: auto 1fr; padding: var(--s-6); gap: var(--s-6); } .signup-art { width: calc(var(--s-10) + var(--s-9)); } }
.foot-bonus, .foot-ads { font-size: var(--t-sm); }
.gift-note { color: var(--ink-2); margin: var(--s-3) 0 0; }

/* ---------- sharing ---------- */
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-5); margin-block: var(--s-6); }
.share-label { font-weight: 700; }
.share-link { display: inline-flex; align-items: center; min-height: var(--tap); }

/* ---------- the one polite prompt ---------- */
/* Phones: a compact slide-in (title, button, consent line right under it); it grows with
   larger text instead of scrolling, so the consent line is never hidden. */
.popup { position: fixed; z-index: 40; inset: auto var(--s-3) var(--s-3) var(--s-3); max-height: calc(100vh - 2 * var(--s-3)); max-height: calc(100dvh - 2 * var(--s-3)); overflow: auto; background: var(--surface); color: var(--ink); border: var(--bw) solid var(--rule-strong); border-radius: var(--r-2); box-shadow: var(--shadow-2); padding: var(--s-4) var(--s-4) var(--s-3); animation: popup-in var(--dur) var(--ease) both; }
.popup-desc { display: none; }
@media (min-width: 768px) { .popup { inset: auto var(--s-5) var(--s-5) auto; width: calc(var(--s-10) * 3); padding: var(--s-5) var(--s-5) var(--s-4); } .popup .popup-desc { display: block; } }
@keyframes popup-in { from { transform: translateY(var(--s-4)); opacity: 0; } to { transform: none; opacity: 1; } }
.popup-title { font-family: var(--serif); font-weight: 600; font-size: var(--t-h4); line-height: var(--lh-tight); margin: 0 var(--s-8) var(--s-3) 0; }
.popup-title:focus { outline: none; } /* focused only so screen readers start here; it isn't a control */
.popup p { margin: 0 0 var(--s-3); }
.popup-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.popup .fineprint { margin: 0; }
.popup-close { position: absolute; top: var(--s-2); right: var(--s-2); width: var(--tap); height: var(--tap); display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--r-1); background: transparent; color: var(--ink); font: 400 var(--t-h3)/1 var(--sans); cursor: pointer; transition: background-color var(--dur) var(--ease); }
.popup-close:hover { background: var(--bg-alt); }
.btn-text { min-height: var(--tap); padding-inline: var(--s-3); border: 0; background: none; color: var(--link); font: inherit; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; border-radius: var(--r-1); }

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0ms; }
  *, *::before, *::after { animation-duration: 0ms !important; transition-duration: 0ms !important; }
  @view-transition { navigation: none; }
}

/* ---------- print ---------- */
@media print {
  :root { --bg: #fff; --bg-alt: #fff; --surface: #fff; --ink: #000; --ink-2: #222; --muted: #333; --rule: #999; --link: #000; }
  .site-head, .preview-banner, .skip, .btn, .btn-row, .tool, .sorter, .foot-list, .more, .product-cta, .signup, .share-row, .popup, .foot-bonus, .foot-ads { display: none !important; }
  body { font-size: 11pt; }
  .hero, .page-head, .section--alt { background: none; }
  .section, .article, .hero { padding-block: 12pt; }
  .article .prose a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 9pt; overflow-wrap: anywhere; }
  .frame, .card, .table-wrap { box-shadow: none; break-inside: avoid; }
  details > :not(summary) { display: block !important; }
  details::details-content { block-size: auto !important; content-visibility: visible !important; }
}
