* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.65;
  word-break: keep-all;
  line-break: strict;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 4px; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: var(--fs-2xl); font-weight: 600; }
h2 { font-size: var(--fs-lg); font-weight: 600; }
h3 { font-size: var(--fs-md); font-weight: 600; }
p { max-width: 72ch; }
ul, ol { margin: 0; padding: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
::selection { color: var(--ink); background: var(--gold-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 20; padding: 8px 16px; color: var(--on-accent); background: var(--accent); border-radius: var(--r-ctl); }
.skip-link:focus { top: 16px; }
.btn {
  min-height: var(--h-ctl);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  color: var(--ink);
  background: var(--surface);
  font-weight: 500;
  line-height: 1.4;
  transition: background-color 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out;
}
.btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.btn:active { background: var(--sunken); }
.btn.primary { color: var(--on-accent); border-color: var(--accent); background: var(--accent); }
.btn.primary:hover { color: var(--on-accent); border-color: var(--accent-hover); background: var(--accent-hover); }
.btn.primary:active { background: var(--accent-hover); }
.btn.ghost { border-color: transparent; color: var(--accent); background: transparent; }
.btn.gold { color: var(--on-accent); border-color: var(--gold); background: var(--gold); }
.btn.small { min-height: 32px; padding: 4px 12px; font-size: var(--fs-sm); }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.text-link { display: inline-flex; align-items: center; gap: var(--s1); min-height: 32px; font-weight: 500; }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.caption { font-size: var(--fs-cap); line-height: 1.55; }
.num, time, .metric, .version { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow-free { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 500; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  color: var(--ink-2);
  background: var(--surface);
  font-size: var(--fs-sm);
  line-height: 1.35;
}
.badge.ok { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.badge.warn { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.badge.danger { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.badge.gold { color: var(--gold); border-color: var(--gold); background: var(--gold-soft); }
.dot { width: 7px; height: 7px; border-radius: var(--round); background: currentColor; }
.rule { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.inset { background: var(--sunken); border-radius: var(--r-ctl); }
.label { display: block; margin-bottom: 6px; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 500; }
.input, .select, .textarea {
  width: 100%;
  min-height: var(--h-ctl);
  padding: 8px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
}
.textarea { min-height: 96px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--accent); }
.input:disabled, .select:disabled, .textarea:disabled { color: var(--ink-3); background: var(--sunken); }
.field-error { color: var(--danger); font-size: var(--fs-sm); }
.table-wrap { width: 100%; overflow: hidden; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--ink-2); background: var(--sunken); font-size: var(--fs-sm); font-weight: 500; }
td { font-size: var(--fs-base); }
tbody tr:hover { background: var(--accent-soft); }
tbody tr:last-child td { border-bottom: 0; }
.status-list { list-style: none; display: grid; gap: var(--s3); }
.status-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); padding-bottom: var(--s3); border-bottom: 1px solid var(--line); }
.status-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); }
.tab { min-height: 40px; padding: 8px 12px; color: var(--ink-2); background: transparent; border: 0; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--accent); background: var(--accent-soft); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.notice { padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-ctl); color: var(--ink-2); background: var(--sunken); }
.notice.warn { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.notice.error { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.empty-state, .error-state, .loading-state { padding: var(--s6); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.skeleton { width: 72%; height: 14px; margin: 8px 0; border-radius: var(--r-ctl); background: var(--sunken); }
.skeleton.short { width: 42%; }
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: var(--r-ctl);
  box-shadow: var(--shadow);
}
.toast[hidden] { display: none; }
.cite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  margin: 0 2px;
  padding: 0 6px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--r-ctl);
  font-family: var(--mono);
  font-size: var(--fs-cap);
  vertical-align: middle;
}
.cite:hover { color: var(--on-accent); background: var(--accent); }
.citation-target { scroll-margin-top: 88px; }
.citation-target.is-highlighted { outline: 2px solid var(--accent); outline-offset: 4px; }
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: var(--s4); cursor: pointer; color: var(--ink); font-weight: 500; }
summary:hover { color: var(--accent); }
details > div { padding: 0 0 16px; color: var(--ink-2); }
.demo-boundary { color: var(--ink-3); font-size: var(--fs-cap); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media print {
  body { background: var(--surface); }
  .btn, .toast, .skip-link { display: none !important; }
  a { color: var(--ink); }
}
