/* Detangle export. One stylesheet, no framework, no fetched fonts. */
:root {
  color-scheme: light dark;
  --bg: #ffffff; --fg: #1b1f24; --muted: #5b6470; --border: #d8dee6;
  --link: #1f6feb; --broken: #c0392b; --surface: #f6f8fa;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117; --fg: #e6edf3; --muted: #8b949e; --border: #30363d;
    --link: #6cb6ff; --broken: #ff7b72; --surface: #161b22;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
}
@media (max-width: 60rem) { body { display: block; } }
.sidebar {
  padding: 1.5rem 1rem; border-right: 1px solid var(--border);
  max-height: 100vh; overflow: auto; position: sticky; top: 0;
}
.sidebar ul { list-style: none; margin: 0; padding-left: 0.75rem; }
.sidebar > ul { padding-left: 0; }
.sidebar a, .sidebar span { display: block; padding: 0.15rem 0; font-size: 0.9rem; }
.sidebar span { color: var(--muted); font-weight: 600; }
.sidebar a.active { font-weight: 700; }
#search { width: 100%; padding: 0.4rem 0.5rem; margin-bottom: 0.75rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: inherit; }
#results { list-style: none; padding: 0; margin: 0 0 1rem; }
main { padding: 2.5rem clamp(1rem, 4vw, 3rem); max-width: 54rem; }
a { color: var(--link); }
a.resolved-normalized, a.resolved-heuristic { text-decoration-style: dotted; }
.broken-link { color: var(--broken); text-decoration: line-through dotted; }
h1, h2, h3, h4, h5, h6 { line-height: 1.25; margin: 2rem 0 0.75rem; }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.2rem; }
pre { background: var(--surface); padding: 0.9rem 1rem; border-radius: 8px;
  overflow-x: auto; border: 1px solid var(--border); }
code { font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace; font-size: 0.9em; }
pre code { font-size: 0.85rem; }
blockquote { margin: 1rem 0; padding: 0.1rem 1rem; border-left: 3px solid var(--border); color: var(--muted); }
.transclusion { border-left-color: var(--link); }
.transclusion-source { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--border); padding: 0.4rem 0.6rem; text-align: left; }
th { background: var(--surface); }
.callout { border: 1px solid var(--border); border-left-width: 4px;
  border-radius: 6px; padding: 0.75rem 1rem; margin: 1rem 0; background: var(--surface); }
.callout-title, summary { font-weight: 650; margin: 0 0 0.35rem; }
.callout-warning, .callout-caution, .callout-danger { border-left-color: #d29922; }
.callout-tip, .callout-success { border-left-color: #3fb950; }
.callout-note, .callout-info { border-left-color: var(--link); }
.properties { background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1.5rem; font-size: 0.9rem; }
.properties dl { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 1rem; margin: 0; }
.properties dt { color: var(--muted); }
.properties dd { margin: 0; }
.diagram { margin: 1.5rem 0; overflow-x: auto; }
.diagram svg { max-width: 100%; height: auto; }
.diagnostic { color: var(--broken); font-size: 0.85rem; }
.math { font-family: ui-monospace, monospace; background: var(--surface); padding: 0.1rem 0.3rem; }
.math-block { display: block; padding: 0.75rem 1rem; border-radius: 8px; overflow-x: auto; }
.tag { color: var(--muted); }
.task { list-style: none; margin-left: -1.2rem; }
.page + .page { border-top: 1px solid var(--border); margin-top: 3rem; padding-top: 1rem; }
.page-path { color: var(--muted); font-size: 0.8rem; font-family: ui-monospace, monospace; }
img { max-width: 100%; height: auto; }