:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #16202c;
  --muted: #5b6878;
  --line: #dde2e9;
  --accent: #1d5fd1;
  --accent-ink: #ffffff;
  --silver: #6f7d8e;
  --gold: #b58a1b;
  --copper: #b5602c;
  --good: #19804a;
  --warn-bg: #fff4d6;
  --warn-ink: #7a5300;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b;
    --surface: #171e27;
    --surface-2: #1f2833;
    --text: #e8edf3;
    --muted: #9aa8b8;
    --line: #2b3643;
    --accent: #6ea2ff;
    --accent-ink: #0b1220;
    --silver: #aab6c4;
    --gold: #e0b44a;
    --copper: #e08a55;
    --good: #4cc488;
    --warn-bg: #3a2f12;
    --warn-ink: #f3d27a;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 58px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; font-size: 19px; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.brand b { color: var(--accent); font-weight: 750; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 15px; }
.nav a:hover, .nav a[aria-current] { background: var(--surface-2); color: var(--text); text-decoration: none; }

/* Price strip */
.strip { background: var(--surface); border-bottom: 1px solid var(--line); }
.strip .wrap { display: flex; gap: 6px 22px; flex-wrap: wrap; align-items: baseline; padding-top: 9px; padding-bottom: 9px; font-size: 14px; }
.strip .m { white-space: nowrap; }
.strip .m span:first-child { color: var(--muted); margin-right: 5px; }
.strip .m b { font-variant-numeric: tabular-nums; font-weight: 650; }
.strip .unit { color: var(--muted); font-size: 12px; }
.strip .when { margin-left: auto; color: var(--muted); font-size: 13px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-right: 6px; vertical-align: 1px; }
.dot.off { background: var(--muted); }
.stale { display: none; background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; }
.stale.show { display: block; }
.stale .wrap { padding-top: 8px; padding-bottom: 8px; }

/* Content */
main { padding: 26px 0 40px; }
h1 { font-size: clamp(26px, 4.6vw, 36px); line-height: 1.15; margin: 0 0 8px; letter-spacing: -.02em; }
h2 { font-size: 22px; margin: 34px 0 12px; letter-spacing: -.01em; }
h3 { font-size: 17px; margin: 22px 0 8px; }
.lede { color: var(--muted); font-size: 17px; margin: 0 0 20px; max-width: 720px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 18px 20px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }

/* Tables */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
td .yrs { color: var(--muted); font-size: 13px; display: block; }
tbody tr:hover { background: var(--surface-2); }
.val { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.over { color: var(--good); }
table.stack td a { font-weight: 600; }

/* Coin page */
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.answer { padding: 22px 22px 18px; display: grid; gap: 16px; grid-template-columns: 1fr auto; align-items: end; }
.answer .label { color: var(--muted); font-size: 15px; }
.answer .big { font-size: clamp(40px, 9vw, 60px); font-weight: 780; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.answer .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.qty { display: flex; flex-direction: column; gap: 6px; }
.qty label { font-size: 13px; color: var(--muted); }
.qty input { width: 120px; }
input[type=number], input[type=text], select {
  font: inherit; font-size: 17px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-variant-numeric: tabular-nums;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.facts div { padding: 13px 22px; border-right: 1px solid var(--line); }
.facts div:last-child { border-right: 0; }
.facts dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.note { margin: 16px 0 0; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 10px 10px 0; }
details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin: 10px 0; }
summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 20px; color: var(--muted); font-weight: 400; }
details[open] summary::after { content: "−"; }
details > div { padding: 0 18px 16px; }
details table { font-size: 14px; }
.math { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 14px; background: var(--surface-2); padding: 10px 12px; border-radius: 8px; overflow-x: auto; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.chips li { background: var(--surface-2); border-radius: 999px; padding: 3px 11px; font-size: 14px; }

/* Calculator */
.calc-total { position: sticky; bottom: 0; z-index: 5; margin-top: 18px; padding: 14px 20px; display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: baseline; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 -4px 20px rgba(0,0,0,.08); }
.calc-total .big { font-size: 30px; font-weight: 780; font-variant-numeric: tabular-nums; }
.calc-total button { margin-left: auto; }
button { font: inherit; font-size: 15px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; }
button:hover { border-color: var(--muted); }
.calc input[type=number] { width: 104px; padding: 7px 10px; font-size: 16px; }
.facebox { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.facebox label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 5px; }
.facebox .pre { display: flex; align-items: center; gap: 6px; }

/* Home */
.grid3 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tile { padding: 16px 18px; }
.tile .k { font-size: 13px; color: var(--muted); }
.tile .v { font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 13px; color: var(--muted); }
.faq h3 { margin-top: 18px; }
.faq p { margin: 4px 0 0; color: var(--muted); }
.prose { max-width: 720px; }
.prose p, .prose li { color: var(--text); }

footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; }
footer .wrap { padding-top: 22px; padding-bottom: 30px; display: grid; gap: 8px; }
footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .answer { grid-template-columns: 1fr; }
  .strip .when { margin-left: 0; width: 100%; }
  th, td { padding: 10px 10px; }
  .hide-sm { display: none; }
  .facts div { border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { margin-left: 0; width: 100%; }
}
