:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #5b6474;
  --line: #e3e7ee;
  --brand: #0f3d6e;
  --link: #1d4ed8;
  --accent: #f59e0b;
  --warn: #b91c1c;
  --chip: #eef2f8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 2px 8px rgba(15, 23, 42, .04);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #151b24;
    --text: #e6edf3;
    --muted: #9aa6b5;
    --line: #273142;
    --brand: #8ab4f8;
    --link: #8ab4f8;
    --chip: #1d2635;
    --warn: #f87171;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; overflow-x: clip; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 32px; }
h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.2; margin: 18px 0 10px; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; margin: 32px 0 10px; line-height: 1.3; }
h3 { font-size: 1.05rem; margin: 18px 0 6px; }
.lead { font-size: 1.08rem; color: var(--text); max-width: 75ch; }
.muted, small { color: var(--muted); }
.warn { color: var(--warn); }
code { background: var(--chip); padding: 1px 5px; border-radius: 4px; }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; gap: 14px; min-height: 58px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.nav { display: flex; gap: 14px; margin-left: auto; font-size: .95rem; }
.nav a { color: var(--text); text-decoration: none; }
.nav a:hover { color: var(--link); }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search input { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.search.big { max-width: 640px; margin: 14px 0 6px; }
.search.big input { padding: 13px 16px; font-size: 1.05rem; border-radius: 10px; }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 70vh; overflow: auto; z-index: 30; }
.search[data-page] .search-results { position: static; box-shadow: none; margin-top: 10px; }
.search-results a { display: block; padding: 9px 12px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.search-results a:hover, .search-results a.on { background: var(--chip); }
.search-results small { display: block; }
@media (max-width: 720px) { .nav { margin-left: 0; width: 100%; overflow-x: auto; white-space: nowrap; padding-bottom: 4px; } .search { order: 3; max-width: none; } }

/* breadcrumbs, chips */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 14px 0 0; font-size: .88rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 10px 0 16px; }
.chips a { display: inline-block; padding: 4px 11px; border-radius: 999px; background: var(--chip); color: var(--text); text-decoration: none; font-size: .9rem; border: 1px solid transparent; }
.chips a:hover { border-color: var(--link); }
.chips a[aria-current] { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .chips a[aria-current] { color: #0d1117; } }

/* facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.facts dt { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 2px 0 0; font-size: 1.35rem; font-weight: 700; }
.facts dd small { display: block; font-size: .8rem; font-weight: 400; }

/* tables */
.tbl { overflow-x: auto; margin: 12px 0 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--chip); font-size: .85rem; white-space: nowrap; position: sticky; top: 0; }
tbody th { font-weight: 600; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; }
td small, th small { display: block; font-size: .78rem; }
tr.me { background: rgba(245, 158, 11, .14); }
caption { text-align: left; padding: 8px 12px; color: var(--muted); }

/* charts */
.chart { margin: 14px 0 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.chart svg { width: 100%; height: auto; display: block; }
.chart .cv { font-size: 11px; fill: var(--text); }
.chart .cl { font-size: 11px; fill: var(--muted); }
.chart .axis { stroke: var(--line); }
.chart figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.diagram svg { width: 100%; height: auto; border-radius: var(--radius); }
.diagram figcaption { font-size: .85rem; color: var(--muted); }

/* cards and tiles */
.cards, .tiles { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cards.small { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.cards a, .tiles a { display: block; height: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.cards a:hover, .tiles a:hover { border-color: var(--link); }
.cards span, .tiles span { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }
.hero { padding: 10px 0 4px; }
.plain { list-style: none; padding: 0; }
.cols { columns: 3 220px; column-gap: 24px; }
.cols li { break-inside: avoid; margin: 2px 0; }
.makes section { break-inside: avoid; }

/* recalls, quotes */
.recall { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid #b45309; border-radius: var(--radius); padding: 10px 16px; margin: 12px 0; box-shadow: var(--shadow); }
.recall h3 { margin: 4px 0; }
.recall .meta { margin: 0 0 6px; font-size: .88rem; color: var(--muted); }
.recall p { margin: 6px 0; }
blockquote { margin: 12px 0; padding: 10px 16px; background: var(--surface); border-left: 4px solid #dc2626; border-radius: 6px; }
blockquote p { margin: 0 0 4px; }
blockquote footer { font-size: .85rem; color: var(--muted); }
.note { background: var(--chip); border-radius: var(--radius); padding: 10px 14px; }

/* faq, sources */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 8px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 2px; }
.src { margin-top: 36px; padding-top: 6px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.src h2 { font-size: 1rem; margin-top: 10px; }
.stars { color: #d97706; letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: var(--line); }

/* buttons, tools */
.cta { margin: 18px 0; }
.btn { display: inline-block; background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 8px; text-decoration: none; font-weight: 600; }
@media (prefers-color-scheme: dark) { .btn { color: #0d1117; } }
.tool { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 14px 0; }
.tool fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 10px 14px 14px; margin: 0; }
.tool legend { font-weight: 700; padding: 0 4px; }
.tool label { display: block; font-size: .9rem; margin: 8px 0 0; color: var(--muted); }
.tool input, .tool select { display: block; width: 100%; margin-top: 3px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.tool .hint { grid-column: 1 / -1; margin: 0; font-size: .9rem; color: var(--muted); }
.tool .hint input { display: inline-block; width: auto; min-width: 220px; }
.tool-out { margin: 8px 0 18px; }
.verdict { padding: 12px 16px; border-radius: var(--radius); font-weight: 600; margin: 10px 0; }
.verdict.ok { background: rgba(22, 163, 74, .14); }
.verdict.mid { background: rgba(245, 158, 11, .18); }
.verdict.bad { background: rgba(220, 38, 38, .15); }
.meter { height: 14px; background: var(--chip); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, #16a34a, #f59e0b 80%, #dc2626); }

/* footer */
.foot { background: var(--surface); border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0 16px; font-size: .92rem; }
.foot-in { display: grid; gap: 18px; grid-template-columns: 2fr 1fr 1fr 1fr; }
.foot-in nav { display: flex; flex-direction: column; gap: 5px; }
.foot-in p { color: var(--muted); margin: 6px 0; }
.foot .fine { color: var(--muted); font-size: .82rem; margin-top: 18px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; text-align: left; text-decoration: underline; }
@media (max-width: 800px) { .foot-in { grid-template-columns: 1fr 1fr; } .foot-in > div:first-child { grid-column: 1 / -1; } }
.years h2 { font-size: 1.05rem; }
