/* wattsworthit — one stylesheet, served under a content-hashed name.
   Tokens first; the dark theme only redefines tokens. */
:root {
  --accent: #0b7a5c;
  --accent-strong: #075e47;
  --accent-soft: #e3f4ee;
  --amber: #b45309;
  --bg: #ffffff;
  --bg-alt: #f5f7f6;
  --surface: #ffffff;
  --border: #dfe5e2;
  --text: #15201c;
  --text-soft: #4f5e58;
  --text-faint: #7d8c86;
  --up: #b42318;
  --down: #067647;
  --s1: #e3f2ec; --s2: #b7dfcf; --s3: #7cc3a8; --s4: #3a9a7a; --s5: #0b5e47;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(10, 30, 22, .06), 0 8px 24px -14px rgba(10, 30, 22, .18);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1120px;
  --narrow: 760px;
}
:root[data-theme="dark"] {
  --accent: #4fd1a5;
  --accent-strong: #7fe0bf;
  --accent-soft: #11302a;
  --amber: #f0a64a;
  --bg: #0d1513;
  --bg-alt: #121d1a;
  --surface: #15211e;
  --border: #24342f;
  --text: #e7efec;
  --text-soft: #a7b8b1;
  --text-faint: #7b8d86;
  --up: #ff8a80;
  --down: #5fd6a0;
  --s1: #173029; --s2: #1d4a3c; --s3: #24705a; --s4: #33a07f; --s5: #6fd8b2;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -14px rgba(0,0,0,.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-y: scroll; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.6; color: var(--text); background: var(--bg); }
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: var(--narrow); }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* header */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 750; font-size: 1.12rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand-mark .bm-coin { fill: var(--accent); }
.brand-mark .bm-bolt { fill: var(--bg); }
.site-nav { display: flex; align-items: center; gap: 4px; }
.nav-link { color: var(--text-soft); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.nav-link:hover, .nav-link[aria-current] { color: var(--text); background: var(--bg-alt); }
.theme-toggle { background: none; border: 1px solid var(--border); border-radius: 8px; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; color: var(--text-soft); margin-left: 6px; }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (max-width: 560px) { .brand span { display: none; } .nav-link { padding: 6px 7px; font-size: .9rem; } }

.breadcrumbs { font-size: .85rem; color: var(--text-faint); padding: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs a { color: var(--text-soft); text-decoration: none; }
.breadcrumbs .sep { color: var(--text-faint); }

/* page heads */
.page-head { padding: 22px 0 8px; }
.eyebrow { font-size: .82rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.eyebrow a { text-decoration: none; }
h1 { font-size: clamp(1.8rem, 4.2vw, 2.5rem); line-height: 1.15; letter-spacing: -.02em; margin: .3em 0 .35em; text-wrap: balance; }
h2 { font-size: 1.45rem; line-height: 1.25; letter-spacing: -.01em; margin: 1.8em 0 .5em; text-wrap: balance; }
h3 { font-size: 1.15rem; margin: 1.4em 0 .4em; }
.lede { font-size: 1.15rem; color: var(--text-soft); margin: 0 0 .8em; }
.byline, .data-note, .updated { font-size: .88rem; color: var(--text-faint); margin: .3em 0; }
.byline a { color: var(--text-soft); }

/* hero */
.hero { background: linear-gradient(180deg, var(--accent-soft), var(--bg)); padding: 44px 0 26px; border-bottom: 1px solid var(--border); }
.hero h1 { max-width: 18ch; }
.hero-sub { font-size: 1.15rem; color: var(--text-soft); max-width: 60ch; margin: 0; }
.section { padding: 26px 20px 8px; }
.section-title { font-size: 1.3rem; margin: 0 0 .3em; }
.section-title a { color: var(--text); text-decoration: none; }
.section-sub { color: var(--text-soft); margin: 0 0 14px; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease; }
.card:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--text); }
.card-cat { font-size: .75rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.card-title { font-size: 1.05rem; margin: 0; line-height: 1.3; }
.card-text { font-size: .93rem; color: var(--text-soft); margin: 0; flex: 1; }
.card-go { font-size: .88rem; font-weight: 600; color: var(--accent); }
.related { padding: 10px 20px 20px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 12px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .88rem; color: var(--text-soft); }
.stat-note { font-size: .8rem; color: var(--text-faint); }
.chg { font-weight: 650; font-variant-numeric: tabular-nums; }
.chg-up { color: var(--up); }
.chg-down { color: var(--down); }

/* prose */
.prose { padding-bottom: 10px; }
.prose p, .prose li { max-width: 68ch; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .25em 0; }
.prose blockquote { margin: 1em 0; padding: .6em 1em; border-left: 3px solid var(--accent); background: var(--bg-alt); border-radius: 0 8px 8px 0; }
.callout { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; margin: 1.2em 0; }
.callout p { margin: .3em 0; }
.sources ul { font-size: .92rem; }
.method-link { font-size: .9rem; color: var(--text-soft); }

/* tables */
.table-wrap { overflow-x: auto; margin: 1em 0; border: 1px solid var(--border); border-radius: var(--radius); }
table.data { border-collapse: collapse; width: 100%; font-size: .93rem; font-variant-numeric: tabular-nums; }
table.data caption { text-align: left; padding: 10px 12px; color: var(--text-soft); font-size: .88rem; }
table.data th, table.data td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { background: var(--bg-alt); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); position: sticky; top: 0; }
table.data[data-sortable] thead th { cursor: pointer; }
table.data thead th[aria-sort="ascending"]::after { content: " ▲"; }
table.data thead th[aria-sort="descending"]::after { content: " ▼"; }
table.data tbody tr:last-child th, table.data tbody tr:last-child td { border-bottom: 0; }
table.data tr.us th, table.data tr.us td { font-weight: 700; background: var(--accent-soft); }
table.data tbody th { font-weight: 600; }

/* charts */
.chart { margin: 1.2em 0; }
.chart svg { width: 100%; height: auto; display: block; }
.ch-grid { stroke: var(--border); stroke-width: 1; }
.ch-ax { font: 12px var(--font); fill: var(--text-faint); }
.ch-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.ch-line.alt { stroke: var(--amber); }
.ch-dot { fill: var(--accent); }
.ch-dot.alt { fill: var(--amber); }
.ch-end { font: 600 12.5px var(--font); fill: var(--accent); }
.ch-end.alt { fill: var(--amber); }
.tm-1 { fill: var(--s1); } .tm-2 { fill: var(--s2); } .tm-3 { fill: var(--s3); } .tm-4 { fill: var(--s4); } .tm-5 { fill: var(--s5); } .tm-na { fill: var(--bg-alt); }
.tm-st { font: 700 14px var(--font); fill: var(--text); }
.tm-v { font: 12px var(--font); fill: var(--text-soft); }
.tm-inv { fill: #fff; }
:root[data-theme="dark"] .tm-inv { fill: #06120e; }
.chart figcaption { font-size: .85rem; color: var(--text-faint); }

/* calculators */
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 18px; margin: 10px 0 18px; }
.widget h2 { margin: 0 0 10px; font-size: 1.15rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: .88rem; font-weight: 600; }
.field input, .field select { font: inherit; font-size: 1rem; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); color: var(--text); min-width: 0; }
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { font-size: .8rem; color: var(--text-faint); margin: 0; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.preset { font: inherit; font-size: .85rem; border: 1px solid var(--border); background: var(--bg); color: var(--text-soft); border-radius: 999px; padding: 4px 11px; cursor: pointer; }
.preset:hover, .preset[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.results { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.results .stats { margin: 6px 0; }
.result-line { font-size: .95rem; color: var(--text-soft); margin: .4em 0 0; }
.err { color: var(--up); font-size: .9rem; min-height: 1.2em; margin: .3em 0 0; }
.bars { display: grid; gap: 8px; margin: 8px 0; }
.bar { display: grid; grid-template-columns: minmax(110px, 160px) 1fr auto; align-items: center; gap: 10px; font-size: .92rem; }
.bar-track { background: var(--bg-alt); border-radius: 6px; height: 14px; overflow: hidden; }
.bar-fill { background: var(--accent); height: 100%; border-radius: 6px; }
.bar.best .bar-fill { background: var(--down); }
.bar-val { font-variant-numeric: tabular-nums; font-weight: 650; }

/* buttons */
.btn { display: inline-block; background: var(--accent); color: #fff; padding: 9px 16px; border-radius: 10px; text-decoration: none; font-weight: 600; }
:root[data-theme="dark"] .btn { color: #06120e; }
.btn:hover { background: var(--accent-strong); color: #fff; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--border); }

/* faq */
.faq-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 8px 0; background: var(--surface); }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-answer p { margin: .5em 0 0; }

/* ads: space reserved so nothing jumps when a unit loads */
.ad-slot { min-height: 280px; margin: 18px 0; display: flex; justify-content: center; align-items: center; }

/* footer */
.site-footer { margin-top: 40px; border-top: 1px solid var(--border); background: var(--bg-alt); padding: 28px 0 22px; font-size: .9rem; color: var(--text-soft); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.footer-blurb { margin: .5em 0; max-width: 48ch; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 14px; align-content: start; }
.footer-nav a { color: var(--text-soft); }
.footer-bottom { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; }
.footer-bottom p { margin: 0; }
.footer-sep { margin: 0 8px; color: var(--text-faint); }
.consent-settings { font: inherit; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; color: var(--text-soft); cursor: pointer; }
@media (max-width: 720px) { .footer-top { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
