:root {
  --fg: #1d1c1a; --muted: #6b6760; --bg: #fbfaf7; --rule: #e4e0d8; --code-bg: #f1eee8;
  --link: #2a5db0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e8e6e1; --muted: #9a958c; --bg: #151514; --rule: #2c2b28; --code-bg: #1e1e1c;
    --link: #8ab4f8;
  }
}
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 18px/1.65 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; }
main { max-width: 36rem; margin: 4rem auto 3rem; padding: 0 16px; }
header { display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
h1 { font-size: 1.6rem; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
nav a { margin-left: 1rem; color: var(--muted); text-decoration: none; }
nav a:first-child { margin-left: 0; }
nav a[aria-current] { color: var(--fg); }
a { color: var(--link); text-underline-offset: 0.15em; }
ul { padding-left: 1.2rem; }
li { margin-bottom: 0.5rem; }
.small { font-size: 0.85em; color: var(--muted); }
footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.live { font: 0.8rem/1.4 ui-monospace, "SF Mono", Menlo, monospace; color: var(--muted); }
h2 { font-size: 1.05rem; font-weight: 600; margin: 2.2rem 0 0.6rem; }
dl.stats { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 1.2rem; margin: 0; }
dl.stats dt { color: var(--muted); }
dl.stats dd { margin: 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9em; }
ul.plain { list-style: none; padding: 0; }
ul.plain li { margin-bottom: 0.25rem; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85em; overflow-wrap: anywhere; }
.live a { color: inherit; }

/* docs (built by site/build-docs) */
main.doc { max-width: 44rem; }
.crumbs { margin: 0; color: var(--muted); font-size: 0.9rem; }
.crumbs a { color: var(--muted); }
main.doc h1 { font-size: 1.8rem; margin: 1.5rem 0 1rem; }
main.doc h2 { font-size: 1.3rem; margin-top: 2.4rem; }
main.doc h3 { font-size: 1.08rem; margin-top: 1.8rem; }
pre { background: var(--code-bg); border: 1px solid var(--rule); border-radius: 6px;
  padding: 0.8rem 1rem; overflow-x: auto; font-size: 0.82rem; line-height: 1.5; }
pre code { font-size: inherit; overflow-wrap: normal; }
:not(pre) > code { background: var(--code-bg); padding: 0.05em 0.3em; border-radius: 4px; }
table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 0.88rem; margin: 1rem 0; }
th, td { border: 1px solid var(--rule); padding: 0.35rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--code-bg); }
blockquote { margin: 1rem 0; padding: 0 1rem; border-left: 3px solid var(--rule); color: var(--muted); }
details.toc { border: 1px solid var(--rule); border-radius: 6px; padding: 0.5rem 1rem; margin: 1rem 0 2rem; font-size: 0.92rem; }
details.toc summary { cursor: pointer; color: var(--muted); }
details.toc ul { padding-left: 1.1rem; }
details.toc li { margin-bottom: 0.15rem; }
img { max-width: 100%; }
