:root {
  --bg: #ffffff; --surface: #f6f8fa; --text: #1f2328; --muted: #59636e;
  --border: #d1d9e0; --link: #0969da; --accent: #0969da;
  --code-k: #cf222e; --code-s: #0a3069; --code-c: #59636e; --code-j: #8250df;
  --model: #0969da; --source: #1a7f37; --seed: #9a6700; --snapshot: #8250df;
  --exposure: #cf222e; --semantic_model: #1b7c83; --metric: #bc4c00; --phantom: #818b98;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117; --surface: #161b22; --text: #e6edf3; --muted: #9198a1;
    --border: #3d444d; --link: #4493f8; --accent: #4493f8;
    --code-k: #ff7b72; --code-s: #a5d6ff; --code-c: #9198a1; --code-j: #d2a8ff;
    --model: #4493f8; --source: #3fb950; --seed: #d29922; --snapshot: #ab7df8;
    --exposure: #f85149; --semantic_model: #39c5cf; --metric: #f0883e; --phantom: #9198a1;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
header.top, main { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
header.top { padding-top: 24px; }
h1 { font-size: 1.6rem; margin: 4px 0; overflow-wrap: anywhere; }
h2 { font-size: 1.05rem; margin: 24px 0 8px; }
.muted { color: var(--muted); font-weight: normal; }
.mono, code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.small { font-size: 0.85rem; }
.back { font-size: 0.9rem; }
.desc { max-width: 75ch; }
.badge { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 1px 7px;
  border-radius: 10px; vertical-align: middle; color: var(--bg); background: var(--muted); }
.badge.t-model { background: var(--model); } .badge.t-source { background: var(--source); }
.badge.t-seed { background: var(--seed); } .badge.t-snapshot { background: var(--snapshot); }
.badge.t-exposure { background: var(--exposure); } .badge.t-semantic_model { background: var(--semantic_model); }
.badge.t-metric { background: var(--metric); } .badge.t-phantom { background: var(--phantom); }
.tag { display: inline-block; border: 1px solid var(--border); border-radius: 10px;
  padding: 0 8px; font-size: 0.8rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 16px 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; overflow-wrap: anywhere; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
@media (max-width: 640px) { .cols2 { grid-template-columns: 1fr; } }
ul.links, ul.results { list-style: none; padding: 0; margin: 0; }
ul.links li { padding: 2px 0; overflow-wrap: anywhere; }
.search { position: sticky; top: 0; background: var(--bg); padding: 12px 0; }
#q { width: 100%; font-size: 1rem; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font: inherit; font-size: 0.85rem; padding: 2px 10px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.chip[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
ul.results li { border-bottom: 1px solid var(--border); }
ul.results li a { display: block; padding: 8px 4px; color: var(--text); overflow-wrap: anywhere; }
ul.results li a:hover { background: var(--surface); text-decoration: none; }
ul.results .d { display: block; color: var(--muted); font-size: 0.85rem; }
.diagram { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
svg.lineage { display: block; font-size: 12px; max-width: 100%; height: auto; }
svg.lineage .edge { fill: none; stroke: var(--muted); stroke-width: 1.25; }
svg.lineage .node rect { fill: var(--bg); stroke: var(--muted); stroke-width: 1.25; }
svg.lineage .node text { fill: var(--text); }
svg.lineage .node.t-model rect { stroke: var(--model); } svg.lineage .node.t-source rect { stroke: var(--source); }
svg.lineage .node.t-seed rect { stroke: var(--seed); } svg.lineage .node.t-snapshot rect { stroke: var(--snapshot); }
svg.lineage .node.t-exposure rect { stroke: var(--exposure); } svg.lineage .node.t-metric rect { stroke: var(--metric); }
svg.lineage .node.t-semantic_model rect { stroke: var(--semantic_model); }
svg.lineage .node.current rect { stroke-width: 2.5; fill: var(--surface); }
svg.lineage .node.current text { font-weight: 600; }
svg.lineage a:hover rect { fill: var(--surface); }
.table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
tr:target { background: var(--surface); }
pre.code { background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; overflow-x: auto; font-size: 0.85rem; line-height: 1.45; }
pre .k { color: var(--code-k); font-weight: 600; } pre .s { color: var(--code-s); }
pre .c { color: var(--code-c); font-style: italic; } pre .j { color: var(--code-j); }
main { padding-bottom: 48px; }
