:root { --bg:#fafafa; --fg:#222; --node:#fff; --edge:#555; --red:#d22; --accent:#e8eefc; --line:#888; --hl:#8fb0ff; --hlroot:#2f5fd0; --key:#fff; --blk:#333; color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#16181d; --fg:#e8e8e8; --node:#23262d; --edge:#aaa; --red:#ff6b6b; --accent:#2c3a5c; --line:#777; --hl:#5f86e0; --hlroot:#9db9ff; --key:#e8e8e8; --blk:#14161a; color-scheme: dark; }
}
body { margin:0; padding:max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); background:var(--bg); color:var(--fg); font:16px/1.3 "Helvetica Neue", "Segoe UI Symbol", "DejaVu Sans", sans-serif; }
h1 { font-size:1.1rem; margin:0 0 .25rem; text-align:center; }
p, footer { margin:0 0 .5rem; text-align:center; opacity:.7; font-size:.85rem; }
footer { margin-top:.5rem; }
footer a { color:inherit; }
svg { width:100%; max-width:900px; height:auto; display:block; margin:auto; touch-action:manipulation; }
text { fill:var(--fg); font-size:17px; text-anchor:middle; pointer-events:none; }
.role { font-size:11px; }
.borrowed { text-decoration:underline; }
.node rect, .node circle { fill:var(--node); stroke:var(--line); stroke-width:1.5; }
#a path { fill:var(--edge); }
#ar path, #as path { fill:var(--red); }
.edge { stroke:var(--edge); stroke-width:1.8; fill:none; }
.lbl { font-size:17px; paint-order:stroke; stroke:var(--bg); stroke-width:6px; }
.in .node-box, .in .edge { stroke:var(--red); }
.in text { fill:var(--red); }
.in .edge { stroke-width:2.5; }
#map .kw { fill:var(--key); stroke:var(--line); stroke-width:.6; }
#map .kb { fill:var(--blk); stroke:var(--line); stroke-width:.6; }
#map .on { fill:var(--hl); }
#map .on.root { fill:var(--hlroot); }
#map .alt { fill:var(--accent); stroke:var(--fg); stroke-dasharray:2 1.5; }
.in { --hl:#ff9a9a; --hlroot:var(--red); }
.btn { cursor:pointer; }
.btn:hover rect, .btn:hover circle { fill:var(--accent); }
.btn:focus { outline:none; }
.btn:focus-visible rect, .btn:focus-visible circle { stroke:var(--fg); stroke-width:3; }
.center circle { stroke-width:2.5; }
.center text { font-size:30px; font-weight:600; }
.slot text { font-size:15px; }
.slot.sel circle { fill:var(--accent); stroke-width:3; }
#map.open .dim { opacity:.15; }
