:root {
  --bg: #fbfbf9; --fg: #1c1c1a; --muted: #5f5f5a; --line: #e1e1dc; --panel: #f2f2ee;
  --link: #1f4f8a; --code: #ecece7;
  --mapped: #1d6b3a; --mapped-bg: #e3f3e8;
  --stale: #8a5a00; --stale-bg: #fbf0d5;
  --unmapped: #7a2323; --unmapped-bg: #f9e3e3;
  --uncovered: #5a3d8a; --uncovered-bg: #ece4f8;
  --bar: #3b6ea8;
  --maxw: 66rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15161a; --fg: #e6e6e2; --muted: #a2a29b; --line: #2e3036; --panel: #1d1f24;
    --link: #8ab4e8; --code: #24262c;
    --mapped: #7fd39a; --mapped-bg: #173a24;
    --stale: #f0c060; --stale-bg: #3c2e0c;
    --unmapped: #f09a9a; --unmapped-bg: #3f1c1c;
    --uncovered: #c7b2f0; --uncovered-bg: #2c2140;
    --bar: #6ea0dc;
  }
}
* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
code { background: var(--code); padding: 0.05em 0.35em; border-radius: 3px; }
pre { background: var(--code); padding: 0.8rem 1rem; overflow-x: auto; border-radius: 4px; }
h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 0.4rem; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; margin: 2.2rem 0 0.6rem; padding-top: 0.6rem; border-top: 1px solid var(--line); }
h3 { font-size: 1.05rem; margin: 1.4rem 0 0.4rem; }
p, ul, ol, table { margin: 0.6rem 0; }
ul, ol { padding-left: 1.4rem; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.1rem; }
header.site { border-bottom: 1px solid var(--line); background: var(--panel); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1.2rem; padding-top: 0.7rem; padding-bottom: 0.7rem; }
header.site .brand { font-weight: 700; font-size: 1.1rem; color: var(--fg); text-decoration: none; }
header.site nav a { color: var(--fg); text-decoration: none; margin-right: 0.9rem; font-size: 0.95rem; }
header.site nav a:hover { text-decoration: underline; }
header.site nav a[aria-current] { font-weight: 600; }
main { padding: 1.6rem 0 3rem; }
footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; padding: 1.4rem 0 2.5rem; }
footer.site p { margin: 0.3rem 0; }
.lede { font-size: 1.1rem; color: var(--muted); margin: 0 0 1.2rem; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.prov { color: var(--muted); font-size: 0.85rem; }
.badge {
  display: inline-block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 0.1em 0.55em; border-radius: 999px; vertical-align: middle; white-space: nowrap;
  text-transform: uppercase;
}
.badge.mapped { color: var(--mapped); background: var(--mapped-bg); }
.badge.stale { color: var(--stale); background: var(--stale-bg); }
.badge.unmapped { color: var(--unmapped); background: var(--unmapped-bg); }
.badge.uncovered, .badge.none { color: var(--uncovered); background: var(--uncovered-bg); }
.badge.partial { color: var(--stale); background: var(--stale-bg); }
.badge.full { color: var(--mapped); background: var(--mapped-bg); }
.badge.neutral { color: var(--muted); background: var(--panel); border: 1px solid var(--line); }
.badge.expl { color: var(--fg); background: var(--panel); border: 1px solid var(--line); text-transform: none; font-weight: 500; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.8rem; margin: 1.2rem 0; }
.tile { border: 1px solid var(--line); border-radius: 6px; padding: 0.8rem 0.9rem; background: var(--panel); }
.tile .n { font-size: 1.9rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.tile .l { color: var(--muted); font-size: 0.86rem; margin-top: 0.2rem; }
.tile.mapped .n { color: var(--mapped); } .tile.stale .n { color: var(--stale); }
.tile.unmapped .n { color: var(--unmapped); } .tile.uncovered .n { color: var(--uncovered); }
.statebar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 0.8rem 0 0.3rem; border: 1px solid var(--line); }
.statebar span { display: block; height: 100%; }
.statebar .mapped { background: var(--mapped); } .statebar .stale { background: var(--stale); } .statebar .unmapped { background: var(--unmapped); }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 0.88rem; color: var(--muted); }
.legend i { display: inline-block; width: 0.7em; height: 0.7em; border-radius: 2px; margin-right: 0.35em; }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { text-align: left; padding: 0.38rem 0.55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 0.84rem; text-transform: uppercase; letter-spacing: 0.03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1.2rem; margin: 0.8rem 0; }
.kv dt { color: var(--muted); font-size: 0.9rem; } .kv dd { margin: 0; }
.callout { border-left: 4px solid var(--line); background: var(--panel); padding: 0.7rem 1rem; margin: 1rem 0; border-radius: 0 4px 4px 0; }
.callout.unmapped { border-color: var(--unmapped); }
.callout.stale { border-color: var(--stale); }
.callout.mapped { border-color: var(--mapped); }
.callout.uncovered { border-color: var(--uncovered); }
.callout p:first-child { margin-top: 0; } .callout p:last-child { margin-bottom: 0; }
.chain { list-style: none; padding: 0; margin: 0.8rem 0; }
.chain > li { border: 1px solid var(--line); border-radius: 6px; padding: 0.7rem 0.9rem; margin: 0.5rem 0; }
.chain .an { margin: 0.6rem 0 0 0.8rem; padding-left: 0.8rem; border-left: 2px solid var(--line); }
.chain .ls { margin: 0.4rem 0 0 0.8rem; }
.rule { border-top: 1px solid var(--line); padding: 0.5rem 0; }
.rule:first-child { border-top: 0; }
.rule .t { font-weight: 600; }
.rule .m { color: var(--muted); font-size: 0.86rem; }
.rule .m b { color: var(--fg); font-weight: 600; }
.tags a, .tags span { margin-right: 0.4rem; }
.bars { margin: 0.8rem 0; }
.bars .row { display: grid; grid-template-columns: 8rem 1fr 4.5rem; align-items: center; gap: 0.6rem; font-size: 0.9rem; padding: 0.12rem 0; }
.bars .row .b { height: 0.95rem; background: var(--bar); border-radius: 2px; min-width: 1px; }
.bars .row .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.bars.unmapped .row .b { background: var(--unmapped); }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center; margin: 0.8rem 0; }
.filters input[type=search], .filters select {
  font: inherit; padding: 0.35rem 0.55rem; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--fg);
}
.filters input[type=search] { min-width: 16rem; flex: 1; }
.filters label { font-size: 0.9rem; color: var(--muted); }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]::after { content: " ↕"; opacity: 0.4; }
th[data-sort].asc::after { content: " ↑"; opacity: 1; } th[data-sort].desc::after { content: " ↓"; opacity: 1; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1.2rem; }
.search-box { position: relative; max-width: 32rem; }
#search-results { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 0 0 6px 6px; z-index: 10; max-height: 22rem; overflow-y: auto; margin: 0; padding: 0; list-style: none; display: none; }
#search-results li a { display: block; padding: 0.4rem 0.7rem; text-decoration: none; color: var(--fg); border-top: 1px solid var(--line); }
#search-results li a:hover, #search-results li a:focus { background: var(--panel); }
#search-results .k { color: var(--muted); font-size: 0.8rem; margin-right: 0.5rem; }
.skip { position: absolute; left: -999px; } .skip:focus { position: static; }
svg.hist { width: 100%; height: auto; }
svg.hist rect { fill: var(--bar); } svg.hist text { fill: var(--muted); font-size: 11px; } svg.hist line { stroke: var(--line); }
.toc { font-size: 0.9rem; column-width: 16rem; }
.toc ul { margin: 0.2rem 0; }
@media (max-width: 40rem) {
  .kv { grid-template-columns: 1fr; gap: 0.1rem; } .kv dt { margin-top: 0.5rem; }
  .bars .row { grid-template-columns: 6rem 1fr 3.5rem; }
  h1 { font-size: 1.4rem; }
}
td a.mono, td .mono { white-space: nowrap; }
