:root {
  --bg: #fbfaf7;
  --panel: #f2f0ea;
  --line: #d9d5cb;
  --ink: #1d1f22;
  --muted: #5b5f66;
  --accent: #1f5f8b;
  --accent-ink: #ffffff;
  --ok: #1f5f8b;
  --bad: #9a3412;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --heat: 31, 95, 139;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --panel: #1d2024;
    --line: #33373d;
    --ink: #e6e4df;
    --muted: #a0a4ab;
    --accent: #7fb3d9;
    --accent-ink: #0d1114;
    --ok: #7fb3d9;
    --bad: #f0a07a;
    --heat: 127, 179, 217;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, li:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
code, pre, .mono { font-family: var(--mono); font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.hero { padding-top: 36px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.kicker { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 0 0 6px; letter-spacing: .02em; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 10px; font-weight: 650; }
.lede { max-width: 780px; margin: 0 0 18px; }
h2 { font-size: 20px; margin: 40px 0 8px; font-weight: 650; }
h2 .num { font-family: var(--mono); color: var(--accent); font-size: 14px; margin-right: 8px; }
h3 { font-size: 15px; margin: 22px 0 6px; font-weight: 650; }
.toc { font-family: var(--mono); font-size: 13px; margin: 14px 0 18px; display: flex; gap: 18px; flex-wrap: wrap; }

.headline { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.card { border: 1px solid var(--line); background: var(--panel); padding: 10px 12px; border-radius: 4px; }
.card h4 { margin: 0 0 6px; font: 600 13px/1.3 var(--mono); }
.card.base h4 { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat b { display: block; font: 600 22px/1.1 var(--mono); }
.stat span { font-size: 12px; color: var(--muted); }
.stat.warn b { color: var(--bad); }

.filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
input, select, textarea, button {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 3px; padding: 5px 8px;
}
input[type=search] { flex: 1 1 180px; min-width: 0; }
textarea { width: 100%; font-family: var(--sans); resize: vertical; }

.try { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 800px) { .try { grid-template-columns: minmax(0, 1fr); } .list { max-height: 260px; } }
.list { list-style: none; margin: 0; padding: 0; max-height: 620px; overflow: auto; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); }
.list li { padding: 6px 8px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; line-height: 1.35; }
.list li:last-child { border-bottom: 0; }
.list li:hover { background: var(--bg); }
.list li[aria-selected=true] { background: var(--bg); box-shadow: inset 3px 0 0 var(--accent); }
.list .id { font-family: var(--mono); color: var(--muted); margin-right: 6px; }
.list .flag { font-family: var(--mono); font-size: 11px; color: var(--accent); margin-left: 4px; }

.detail { min-width: 0; }
.msg { border-left: 3px solid var(--accent); background: var(--panel); padding: 10px 12px; margin: 0 0 10px; font-size: 16px; white-space: pre-wrap; }
.meta { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.tbl { border-collapse: collapse; width: 100%; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-weight: 600; color: var(--muted); font-size: 12px; white-space: nowrap; }
.tbl td.n { font-family: var(--mono); text-align: right; white-space: nowrap; }
.tbl th.n { text-align: right; }
.tbl tr.gold td { background: var(--panel); }
.tbl td.sys { font-family: var(--mono); white-space: nowrap; }
.hit { color: var(--ok); }
.miss { color: var(--bad); font-weight: 600; }
.miss::after { content: " ✗"; }
.scroll { overflow-x: auto; }

.replies { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 12px; }
.reply { border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; font-size: 14px; }
.reply h4 { margin: 0 0 4px; font: 600 12px/1.3 var(--mono); color: var(--muted); }
.reply p { margin: 0 0 6px; }
.reply .why { font-size: 12px; color: var(--muted); }

.live { margin-top: 26px; border-top: 1px dashed var(--line); padding-top: 8px; }
.badge { display: inline-block; font: 12px/1.4 var(--mono); border: 1px solid var(--accent); color: var(--accent); padding: 3px 8px; border-radius: 3px; margin: 0 0 8px; }
.freeout { margin-top: 8px; font-family: var(--mono); font-size: 13px; }
.freeout dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; margin: 0; }
.freeout dt { color: var(--muted); }
.freeout dd { margin: 0; }

.callout { border: 1px solid var(--accent); border-left-width: 4px; padding: 10px 14px; border-radius: 3px; background: var(--panel); }
.callout h3 { margin-top: 0; }
.callout ul { margin: 4px 0 0; padding-left: 18px; }
.callout li { margin: 2px 0; }

.cm { display: grid; gap: 1px; font: 11px/1 var(--mono); min-width: 640px; }
.cm div { padding: 5px 2px; text-align: center; }
.cm .h { color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); padding: 4px 0; text-align: left; height: 92px; justify-self: center; }
.cm .r { color: var(--muted); text-align: right; padding-right: 6px; white-space: nowrap; }
.cm .c { border-radius: 2px; }
.cm .c.diag { outline: 1px solid var(--line); }
.cm .c.z { color: transparent; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 800px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.cols > *, .try > *, .headline > *, .replies > * { min-width: 0; }
.lim { padding-left: 18px; }
.lim li { margin: 4px 0; }
pre.code { background: var(--panel); border: 1px solid var(--line); padding: 10px; overflow-x: auto; }
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 12px; padding-bottom: 30px; font-size: 13px; color: var(--muted); }
