:root {
  --bg: #f7f6f2; --panel: #ffffff; --ink: #1b1d22; --dim: #5a606c; --line: #e2dfd6; --accent: #2f6b4f; --accent-ink: #fff;
  --soft: #eef3ef; --warn: #8a5a00; --bad: #a3271f; --good: #2f6b4f; --code: #f1efe9; --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace; --max: 62rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #121418; --panel: #1a1d23; --ink: #e9ebef; --dim: #9aa2ae; --line: #2a2f38; --accent: #6fcf9f; --accent-ink: #0c1912; --soft: #17241d; --warn: #e5b860; --bad: #ff8b80; --good: #6fcf9f; --code: #20242c; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #121418; --panel: #1a1d23; --ink: #e9ebef; --dim: #9aa2ae; --line: #2a2f38; --accent: #6fcf9f; --accent-ink: #0c1912; --soft: #17241d; --warn: #e5b860; --bad: #ff8b80; --good: #6fcf9f; --code: #20242c; color-scheme: dark; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16.5px/1.6 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1rem; }
header.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; gap: 1rem; align-items: center; padding-top: .55rem; padding-bottom: .55rem; overflow-x: auto; }
header.top strong { white-space: nowrap; }
header.top nav { display: flex; gap: .9rem; font-size: .9rem; white-space: nowrap; }
header.top nav a { color: var(--dim); text-decoration: none; }
header.top nav a:hover { color: var(--ink); }
.hero { padding: 3rem 0 1.5rem; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); line-height: 1.15; margin: 0 0 .8rem; letter-spacing: -.01em; }
.hero p.lede { font-size: 1.15rem; color: var(--dim); max-width: 46rem; margin: 0 0 1.2rem; }
.cta { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn { display: inline-block; padding: .65rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-decoration: none; font-weight: 600; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
section { padding: 2.2rem 0; border-top: 1px solid var(--line); }
section h2 { font-size: 1.6rem; margin: 0 0 .8rem; }
section h3 { font-size: 1.15rem; margin: 1.4rem 0 .5rem; }
.kicker { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; margin-bottom: .3rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.card h3 { margin-top: 0; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.steps li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem .8rem 3.2rem; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 1rem; top: .75rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: .5rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--dim); font-weight: 600; }
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.verdict { font-weight: 700; font-family: var(--mono); font-size: .85rem; padding: .1rem .45rem; border-radius: 6px; white-space: nowrap; }
.verdict.HELD { background: var(--soft); color: var(--good); }
.verdict.FAILED { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.verdict.UNMEASURED, .verdict.loading { background: var(--code); color: var(--dim); }
code, .mono { font-family: var(--mono); font-size: .88em; background: var(--code); padding: .05rem .3rem; border-radius: 5px; }
pre { background: var(--code); padding: .9rem; border-radius: var(--radius); overflow-x: auto; font-size: .85rem; }
figure { margin: 1rem 0; }
figure svg { width: 100%; height: auto; display: block; }
figcaption { color: var(--dim); font-size: .88rem; margin-top: .4rem; }
.note { border-left: 3px solid var(--accent); background: var(--soft); padding: .7rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; }
.scope { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.calc { display: grid; gap: .5rem; }
.calc .row { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: .4rem; align-items: center; }
.calc .row.five { grid-template-columns: 2fr 1fr 1fr .7fr auto; }
.calc .row.ex { grid-template-columns: 3fr 1fr auto; }
.calc .tick { display: inline-flex; gap: .35rem; align-items: center; white-space: nowrap; color: var(--dim); font-size: .92rem; }
.calc .tick input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
.calc .years { display: inline-flex; gap: .4rem; align-items: center; color: var(--dim); }
.calc .years input { width: 3.5rem; }
.dim { color: var(--dim); font-size: .9rem; }
.calc input, .calc select { font: inherit; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); min-width: 0; }
details { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem 1rem; margin: .5rem 0; }
details summary { cursor: pointer; font-weight: 600; }
footer { padding: 2rem 0 3rem; color: var(--dim); font-size: .9rem; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .calc .row, .calc .row.five { grid-template-columns: 1fr 1fr; } .calc .row.ex { grid-template-columns: 1fr auto; } .calc .row.ex > :first-child { grid-column: 1 / -1; } .hero { padding-top: 2rem; } }
.demo { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.2rem; counter-reset: d; }
.demo > li { counter-increment: d; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; }
.demo figure { margin: 0; }
.demo img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); display: block; }
.demo figcaption { margin-top: .6rem; color: var(--ink); }
.demo figcaption strong::before { content: counter(d) ". "; color: var(--accent); }
.demo figcaption ul { margin: .4rem 0 0; padding-left: 1.1rem; color: var(--dim); font-size: .92rem; }
@media (max-width: 640px) {
  .tablewrap table, .tablewrap tbody, .tablewrap tr, .tablewrap td { display: block; width: 100%; }
  .tablewrap thead { display: none; }
  .tablewrap tr { padding: .55rem .2rem; border-bottom: 1px solid var(--line); }
  .tablewrap td { border: 0; padding: .15rem .6rem; }
  .tablewrap td:first-child { font-weight: 700; }
  .tablewrap td[data-label]:not(:empty)::before { content: attr(data-label) ": "; color: var(--dim); font-size: .88rem; }
}
.glossary { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: .5rem 1rem; margin: 0; }
.glossary dt { font-weight: 700; }
.glossary dd { margin: 0; color: var(--ink); }
@media (max-width: 640px) { .glossary { grid-template-columns: 1fr; } .glossary dd { margin-bottom: .6rem; } }
