:root { color-scheme: light dark; --fg: #1d1d1f; --bg: #fff; --muted: #5f6368; --line: #e3e3e6; --code: #f4f4f6; --accent: #2156b5; --warning: #8a5300; }
@media (prefers-color-scheme: dark) { :root { --fg: #e8e8ea; --bg: #141416; --muted: #a0a0a8; --line: #2c2c30; --code: #1f1f23; --accent: #8fb3ff; --warning: #e3a64a; } }
* { box-sizing: border-box; }
body { margin: 0; color: var(--fg); background: var(--bg); font: 17px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
header { display: flex; flex-wrap: wrap; gap: 0.5em 1.5em; align-items: baseline; padding: 0.8em 1.5em; border-bottom: 1px solid var(--line); }
header .brand { font-weight: 700; font-size: 1.2em; color: var(--fg); text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 0.3em 1em; }
nav a { color: var(--muted); text-decoration: none; }
nav a[aria-current] { color: var(--fg); font-weight: 600; }
main { max-width: 52em; margin: 0 auto; padding: 1em 1.5em 3em; }
a { color: var(--accent); }
h1 { font-size: 2em; margin: 0.6em 0 0.4em; }
h2 { margin-top: 1.8em; border-bottom: 1px solid var(--line); padding-bottom: 0.2em; }
code { background: var(--code); padding: 0.1em 0.3em; border-radius: 4px; font: 0.88em/1.5 ui-monospace, "Cascadia Code", Menlo, Consolas, monospace; }
pre { background: var(--code); padding: 0.8em 1em; border-radius: 6px; overflow-x: auto; }
pre code { background: none; padding: 0; }
table { border-collapse: collapse; width: 100%; margin: 1em 0; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--line); padding: 0.4em 0.6em; text-align: left; vertical-align: top; }
table.gallery td:first-child { width: 45%; }
table.gallery code { white-space: pre-wrap; }
.typlet-display { overflow-x: auto; overflow-y: hidden; }
.refused { color: var(--muted); font-style: italic; }
.playground label { display: block; margin: 0.6em 0; }
.playground textarea { display: block; width: 100%; font: 15px/1.4 ui-monospace, monospace; padding: 0.5em; color: var(--fg); background: var(--code); border: 1px solid var(--line); border-radius: 6px; }
.playground .controls { display: flex; flex-wrap: wrap; gap: 1em; align-items: center; color: var(--muted); }
.playground .controls label { display: inline; margin: 0; }
.preview { font-size: 1.4em; min-height: 3em; padding: 0.5em; border: 1px solid var(--line); border-radius: 6px; margin-top: 0.6em; overflow-x: auto; }
.message { color: #cc0000; background: none; white-space: pre-wrap; }
.message.warning { color: var(--warning); }
.compare-controls { display: flex; flex-wrap: wrap; gap: 0.6em 1.2em; align-items: center; margin: 1.2em 0; }
.choice { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.choice a { padding: 0.25em 0.9em; color: var(--fg); text-decoration: none; border-left: 1px solid var(--line); }
.choice a:first-child { border-left: 0; }
.choice a[aria-current] { background: var(--accent); color: var(--bg); }
.compare-controls button { font: inherit; padding: 0.25em 0.9em; color: var(--fg); background: var(--code); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.compare-controls button:disabled { opacity: 0.5; cursor: default; }
.headline { font-size: 1.15em; margin: 0.4em 0; }
.timings th { font-weight: 600; }
.timings th[scope="row"] { font-weight: 400; }
.timings td, .timings tr:first-child th { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.notes { color: var(--muted); font-size: 0.92em; }
.notes summary { cursor: pointer; }
.formula { display: grid; grid-template-columns: repeat(var(--columns, 1), minmax(0, 1fr)); gap: 0.4em 2em; align-items: start; padding: 0.9em 0; border-bottom: 1px solid var(--line); }
.formula.columns { position: sticky; top: 0; z-index: 1; padding: 0.4em 0; font-weight: 600; background: var(--bg); }
.formula .out { min-height: 1.5em; overflow-x: auto; overflow-y: hidden; }
.formula [data-engine="Typlet"] .out { font-size: 1.21em; }
.formula .source { display: block; margin-top: 0.5em; padding: 0; color: var(--muted); background: none; font-size: 0.78em; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 40em) {
  .formula { grid-template-columns: minmax(0, 1fr); }
  .formula.columns { display: none; }
  .both .cell::before { content: attr(data-engine); display: block; color: var(--muted); font-size: 0.78em; }
}
footer { max-width: 52em; margin: 0 auto; padding: 1em 1.5em 2em; color: var(--muted); font-size: 0.85em; border-top: 1px solid var(--line); }
