:root {
  --bg: oklch(1 0 0);
  --surface: oklch(0.965 0.012 130);
  --ink: oklch(0.22 0.028 130);
  --muted: oklch(0.42 0.02 130);
  --line: oklch(0.88 0.015 130);
  --primary: oklch(0.38 0.09 130);
  --primary-ink: oklch(0.99 0.01 130);
  --accent: oklch(0.62 0.12 80);
  --pass: oklch(0.4 0.09 145);
  --fail: oklch(0.48 0.16 28);
  --warn: oklch(0.55 0.12 70);
  --radius: 10px;
  --shadow: 0 8px 24px oklch(0.22 0.028 130 / 0.08);
  --max: 1120px;
  --z-nav: 20;
  --z-sticky: 30;
  --z-toast: 40;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--primary); text-underline-offset: 0.15em; }
a:hover { color: oklch(0.3 0.08 130); }
h1, h2, h3 { text-wrap: balance; letter-spacing: -0.02em; }
h1 { font-size: 1.85rem; line-height: 1.2; margin: 0 0 0.4rem; }
h2 { font-size: 1.45rem; margin: 0 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.65rem; }
p { max-width: 70ch; }
.wrap { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
header.site {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  height: 64px;
}
.nav {
  height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: inherit; }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-name { font-weight: 750; letter-spacing: 0.04em; font-size: 0.82rem; line-height: 1.15; }
.brand-name small { display: block; font-weight: 600; letter-spacing: 0.12em; font-size: 0.62rem; color: var(--muted); }
nav.links { display: flex; gap: 1rem; font-size: 0.88rem; }
nav.links a { color: var(--ink); text-decoration: none; white-space: nowrap; }
nav.links a:hover, nav.links a[aria-current="page"] { color: var(--primary); }
.menu-btn {
  display: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 0.4rem 0.65rem; font: inherit; color: var(--ink);
}
.hero { padding: 1.5rem 0 1rem; }
.lede { color: var(--muted); margin: 0 0 1rem; max-width: 62ch; }
.verified {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; font-weight: 650; color: var(--primary);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.25rem 0.7rem; margin-bottom: 0.85rem;
}
.crumbs { font-size: 0.8rem; color: var(--muted); margin: 0 0 0.75rem; }
.crumbs a { color: var(--muted); }
.callout {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  margin: 0.75rem 0 1rem;
  font-size: 0.9rem;
  max-width: 70ch;
}
.legacy {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  margin: 1.25rem 0;
}
.note { font-size: 0.82rem; color: var(--muted); max-width: 70ch; }
.ad-slot {
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); font-size: 0.75rem; text-align: center;
  display: grid; place-items: center;
}
.ad-top { min-height: 90px; margin: 0.75rem 0 1rem; }
.ad-mid { min-height: 250px; margin: 1.5rem 0; }
.layout {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 1.25rem; align-items: start;
}
.panel {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.05rem 1.15rem;
}
.step { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.step:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1rem; }
label.field { display: flex; flex-direction: column; gap: 0.28rem; font-size: 0.82rem; font-weight: 650; }
.hint { font-weight: 500; color: var(--muted); font-size: 0.75rem; }
input, select, button { font: inherit; }
input[type="number"], input[type="text"], select {
  border: 1px solid var(--line); border-radius: 8px; padding: 0.55rem 0.65rem;
  background: var(--bg); color: var(--ink); width: 100%;
}
input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
.seg { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.seg label {
  position: relative;
  border: 1px solid var(--line); border-radius: 8px; padding: 0.45rem 0.75rem;
  cursor: pointer; font-size: 0.88rem; font-weight: 650;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span,
.seg label:has(input:checked) { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.check { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.88rem; font-weight: 550; }
.calc-block { margin: 0 0 0.25rem; }
.calc-block > h2 { font-size: 1.2rem; margin: 0 0 0.85rem; }
.results {
  position: sticky; top: 80px; z-index: var(--z-sticky);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem;
  box-shadow: var(--shadow);
}
.score-num { font-size: 3rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.score-den { font-size: 1.1rem; color: var(--muted); font-weight: 650; }
.badge {
  display: inline-block; border-radius: 999px; padding: 0.2rem 0.6rem;
  font-size: 0.75rem; font-weight: 750; letter-spacing: 0.04em;
  color: var(--primary-ink); background: var(--primary);
}
.badge.fail { background: var(--fail); }
.badge.warn { background: var(--warn); color: var(--ink); }
.event-rows { display: grid; gap: 0.45rem; margin: 0.9rem 0; }
.event-row { display: grid; grid-template-columns: 1fr auto auto; gap: 0.5rem; font-size: 0.86rem; align-items: baseline; }
.event-row b { font-variant-numeric: tabular-nums; }
.gap { color: var(--muted); font-size: 0.78rem; }
.tips { margin: 0; padding-left: 1.1rem; font-size: 0.88rem; }
.tips li { margin: 0.35rem 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.btn {
  border: 0; border-radius: 8px; padding: 0.55rem 0.85rem; cursor: pointer;
  background: var(--primary); color: var(--primary-ink); font-weight: 700;
}
.btn:active { transform: scale(0.98); }
.btn.ghost { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.next {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.9rem;
}
.next a {
  text-decoration: none; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 0.55rem 0.65rem;
  font-size: 0.8rem; font-weight: 650;
}
section.block { padding: 2rem 0 0.5rem; }
.prose p, .prose li { color: var(--ink); }
.prose ul { padding-left: 1.15rem; }
.table-wrap { overflow-x: auto; margin: 0.75rem 0 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
th, td { padding: 0.45rem 0.5rem; text-align: center; border-bottom: 1px solid var(--line); }
th { background: var(--surface); font-size: 0.72rem; letter-spacing: 0.02em; }
td:first-child, th:first-child { text-align: left; white-space: nowrap; }
caption { text-align: left; font-weight: 700; padding: 0.65rem 0.5rem 0.35rem; }
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem;
}
.cards a {
  text-decoration: none; color: inherit; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.9rem; background: var(--surface);
}
.cards h3 { margin-bottom: 0.25rem; }
.cards p { margin: 0; font-size: 0.85rem; color: var(--muted); }
details.faq { border-bottom: 1px solid var(--line); padding: 0.7rem 0; }
details.faq summary { cursor: pointer; font-weight: 700; }
details.faq p { margin: 0.45rem 0 0; }
footer.site { margin-top: 2.5rem; padding: 1.5rem 0 2rem; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--muted); }
footer.site p { max-width: 80ch; }
.src a { margin-right: 0.75rem; }
.toast {
  position: fixed; bottom: 1rem; right: 1rem; z-index: var(--z-toast);
  background: var(--primary); color: var(--primary-ink); padding: 0.55rem 0.8rem;
  border-radius: 8px; font-size: 0.85rem; font-weight: 650; display: none;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .results { position: static; }
  nav.links { display: none; }
  nav.links.open {
    display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: 64px;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 0.75rem 1rem 1rem;
  }
  .menu-btn { display: inline-flex; }
  h1 { font-size: 1.55rem; }
  .fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:active { transform: none; }
}
