
:root { color-scheme: light dark; --fg: #1d1f23; --bg: #fbfbfa; --muted: #6b6e75; --line: #d9dade; --warn: #8a3b00; --warn-bg: #fff1e0; }
@media (prefers-color-scheme: dark) { :root { --fg: #e6e6e6; --bg: #17181b; --muted: #9a9ca3; --line: #33363c; --warn: #ffb46b; --warn-bg: #3a2a18; } }
* { box-sizing: border-box; }
[id] { scroll-margin-top: 5.5rem; }
body { margin: 0; font: 16px/1.5 system-ui, sans-serif; color: var(--fg); background: var(--bg); }
main { max-width: 56rem; margin: 0 auto; padding: 1.5rem; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--accent, currentColor); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; top: 0.4rem; left: 0.4rem; padding: 0.45rem 0.7rem; background: var(--bg); border: 2px solid var(--fg); border-radius: 4px; transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
h1 { font-size: 1.6rem; margin: 0.5rem 0 0.25rem; }
h2 { font-size: 1.1rem; margin: 1.75rem 0 0.4rem; padding-bottom: 0.25rem; border-bottom: 1px solid var(--line); }
a { color: inherit; }
.muted, .ln, .crumbs, ol.decls > li > small { color: var(--muted); }
.ln, ol.decls > li > small { font-size: 0.8rem; margin-left: 0.4rem; }
.site-head { position: sticky; top: 0; z-index: 10; margin: -0.5rem 0 0.75rem; padding: 0.5rem 0 0.45rem; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-head nav.top { margin-bottom: 0.15rem; }
.crumbs { font-size: 0.9rem; }
.crumbs a, .path-title a { text-underline-offset: 0.16em; }
.crumbs a:hover, .crumbs a:focus-visible, .path-title a:hover, .path-title a:focus-visible { color: var(--fg); text-decoration-thickness: 0.14em; }
.path-title { overflow-wrap: anywhere; }
.path-title a { color: inherit; }
dl.summary { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 1rem; }
dl.summary dd { margin: 0; }
input[type="search"] { width: 100%; margin: 0.75rem 0; padding: 0.5rem 0.75rem; font: inherit; color: var(--fg); background: transparent; border: 1px solid var(--line); border-radius: 6px; }
.filter-status { min-height: 1.5em; margin: -0.45rem 0 0.6rem; font-size: 0.85rem; color: var(--muted); }
ol.decls, ul.list { list-style: none; padding: 0; }
ol.decls > li, ul.list > li { padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.kind, ol.decls > li > b:first-child { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
ol.decls > li > b:first-child { font-weight: normal; }
.flag { font-size: 0.75rem; padding: 0 0.4rem; border-radius: 4px; }
.flag.sorry { color: var(--warn); background: var(--warn-bg); }
.doc { margin: 0.3rem 0; overflow-wrap: anywhere; }
.doc.plain { white-space: pre-wrap; }
.doc > :first-child { margin-top: 0; }
.doc > :last-child { margin-bottom: 0; }
.doc p, .doc ul, .doc ol, .doc blockquote { margin: 0.35rem 0; }
.doc ul, .doc ol { padding-left: 1.4rem; }
.doc h3, .doc h4, .doc h5, .doc h6 { font-size: 1rem; margin: 0.7rem 0 0.25rem; }
.doc h3 { font-size: 1.08rem; }
.doc blockquote { margin-left: 0; padding-left: 0.7rem; border-left: 3px solid var(--line); color: var(--muted); }
.doc hr { border: 0; border-top: 1px solid var(--line); }
.source-doc { margin: 0.4rem 0; padding: 0.2rem 0 0.2rem 0.7rem; border-left: 3px solid var(--line); }
.source-doc > .layer-label { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.source-doc > .doc { margin: 0; }
pre { overflow-x: auto; margin: 0.4rem 0; padding: 0.5rem 0.6rem; font-size: 0.85rem; background: rgba(127, 127, 127, 0.08); border-radius: 4px; }
[hidden] { display: none !important; }
.title { font-style: italic; }
.intuition { margin: 0.3rem 0; }
.steps { margin: 0.3rem 0; padding-left: 1.4rem; }
.refs { margin: 0.3rem 0; font-size: 0.9rem; }
.warn { color: var(--warn); font-size: 0.9rem; margin: 0.3rem 0; }
.src { font-size: 0.8rem; color: var(--muted); }
a.term { text-decoration: underline dotted; }
a.decl-link { text-decoration: none; }
a.decl-link::after { content: " #"; color: var(--muted); opacity: 0; }
a.decl-link:hover::after, a.decl-link:focus-visible::after { opacity: 1; }
nav.top { font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--muted); }
.site-footer { max-width: 56rem; margin: 1rem auto 0; padding: 1rem 1.5rem 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }
nav.toc, p.letters { font-size: 0.9rem; color: var(--muted); }
dl.glossary { margin: 0.4rem 0; }
dl.glossary dt { font-weight: 600; margin-top: 0.6rem; }
dl.glossary dt .kind { font-weight: normal; margin-left: 0.3rem; }
dl.glossary dd { margin: 0 0 0.2rem 1rem; }
dl.glossary dd code { white-space: pre-wrap; }
details.imports, details.imported-by, section.imports { margin: 0.4rem 0; font-size: 0.9rem; }
details.imports > summary, details.imported-by > summary { cursor: pointer; color: var(--muted); }
details.imports ul.list, details.imported-by ul.list, section.imports ul.list { margin: 0.2rem 0 0.4rem; }
details.imports ul.list > li, details.imported-by ul.list > li, section.imports ul.list > li { padding: 0.15rem 0; }
@media (max-width: 42rem) {
  main { padding: 0.9rem; }
  .site-head { position: static; margin-top: 0; }
  .path-title { font-size: 1.18rem; }
  nav.top { line-height: 1.9; }
  .site-footer { padding: 0.9rem 0.9rem 1.5rem; }
}
:root { --fg: #2b2118; --bg: #f4ecd8; --muted: #7a6a55; --line: #d8c9a8; --warn: #7a2e00; --warn-bg: #f6dfc2; --accent: #8b2635; --panel: rgba(90,60,20,0.08); }
@media (prefers-color-scheme: dark) { :root { --fg: #eadfc8; --bg: #1c1712; --muted: #a8977c; --line: #3a3026; --warn: #ffb46b; --warn-bg: #3a2a18; --accent: #d9b26f; --panel: rgba(255,235,200,0.06); } }
body { font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif; }
h1, h2, .title { font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif; }
pre, code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
a { text-decoration-color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
pre { background: var(--panel); }
h2 { border-bottom-color: var(--accent); }
input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.kind, ol.decls > li > b:first-child { color: var(--accent); }

h1 { font-variant: small-caps; letter-spacing: 0.06em; text-align: center; font-weight: 600; }
h1 + p, h1 + .muted { text-align: center; }
h2 { font-variant: small-caps; letter-spacing: 0.04em; border-bottom-style: double; border-bottom-width: 3px; }
.doc { font-style: italic; }
main { border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: rgba(255,255,255,0.12); }


.implications ul { margin: 0.2rem 0 0.4rem 1.2rem; padding: 0; }
.imp-kind { font-style: italic; }
.imp { display: inline-block; padding: 0 0.4rem; font-size: 0.75rem; border-radius: 4px; border: 1px solid var(--line); }
.imp-proposed, .imp-unchecked, .imp-candidate { color: var(--muted); border-style: dashed; }
.imp-argued { color: var(--fg); }
.imp-kernel-checked { color: var(--fg); font-weight: 600; border-width: 2px; }
.imp-fails, .imp-refuted, .imp-stale { color: var(--warn); background: var(--warn-bg); border-color: var(--warn); }
article.edge { border: 1px solid var(--line); border-radius: 6px; padding: 0.6rem 0.9rem; margin: 0.8rem 0; overflow-wrap: anywhere; }
article.edge h3 { margin: 0 0 0.3rem; font-size: 1rem; }
article.edge dt { font-weight: 600; margin-top: 0.5rem; }
article.edge dd { margin-left: 1rem; }
article.edge pre { margin: 0.2rem 0; white-space: pre-wrap; }
p.imp-stale { display: block; padding: 0.2rem 0.5rem; }
dl.imp-legend dt { font-weight: 600; margin-top: 0.4rem; }
dl.imp-legend dd { margin-left: 1rem; }
pre.bridge-source { white-space: pre-wrap; overflow-wrap: anywhere; }
pre.bridge-source span[id] { display: block; }

.cat-controls { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0; }
.cat-controls input { flex: 1 1 16rem; min-width: 0; }
.cat-controls select { max-width: 100%; }
ol.cat-list { padding-left: 1.4rem; }
ol.cat-list > li { margin: 0.5rem 0; overflow-wrap: anywhere; }
.cat-detail dl dt { font-weight: 600; margin-top: 0.4rem; }
.cat-detail dl dd { margin-left: 1rem; }
.cat-detail pre, .cat-chainbox pre { white-space: pre-wrap; }
.cat-chainbox { border: 1px solid var(--line); border-radius: 6px; padding: 0.4rem 0.8rem; margin: 0.6rem 0; }
.imp-provenance { border-left: 3px solid var(--line); padding-left: 0.6rem; }

.l4del { margin: 0.45rem 0; padding: 0.2rem 0 0.2rem 0.7rem; border-left: 3px solid var(--accent); }
.l4del > .layer-label { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.l4term { margin: 0.3rem 0; }
.l4del-sources { margin: 0.45rem 0; font-size: 0.94em; }
.l4del-provenance { margin: 0.45rem 0; padding: 0.45rem 0.6rem; border-left: 3px solid var(--warn); background: var(--warn-bg); }
.l4del-quote { margin: 0.55rem 0; padding: 0.4rem 0.8rem; border-left: 3px solid var(--accent); background: var(--panel); }
.l4del-quote p { margin: 0 0 0.3rem; }
.l4del-quote footer { color: var(--muted); font-size: 0.9em; }
.explanation-legend { margin: 0.55rem 0 0.9rem; border: 1px solid var(--line); border-radius: 6px; background: transparent; }
.explanation-legend > summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.15rem 0.45rem; cursor: pointer; padding: 0.45rem 0.7rem; color: var(--muted); font-size: 0.92rem; line-height: 1.35; list-style: none; }
.explanation-legend > summary::-webkit-details-marker { display: none; }
.explanation-legend > summary::before { content: "\25B8"; flex: 0 0 auto; color: var(--accent); font-size: 0.9em; }
.explanation-legend[open] > summary::before { content: "\25BE"; }
.explanation-legend > summary:hover { color: var(--fg); background: var(--panel); }
.explanation-legend > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 5px; }
.explanation-legend[open] > summary { color: var(--fg); border-bottom: 1px solid var(--line); }
.explanation-legend-title { font-weight: 700; }
.explanation-legend-hint { font-size: 0.9em; font-weight: 400; }
.explanation-legend-body { padding: 0.65rem 0.9rem 0.75rem; }
.explanation-legend-body > :first-child { margin-top: 0; }
.explanation-legend-body > :last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .explanation-legend > summary { display: block; }
  .explanation-legend-hint { display: block; margin-top: 0.08rem; }
}
.acronym-legend { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 0.8rem; margin: 0.35rem 0; }
.acronym-legend dt { font-weight: 700; }
.acronym-legend dd { margin: 0; }

.trust { display: inline-block; margin: 0.2rem 0; padding: 0.05rem 0.5rem; font-size: 0.8rem; border-radius: 4px; border: 1px solid var(--line); }
.trust-none, .trust-standard { color: var(--fg); }
.trust-sorry, .trust-extra { color: var(--warn); background: var(--warn-bg); border-color: var(--warn); }
.trust-unknown { color: var(--muted); border-style: dashed; }
details.trace { margin: 0.3rem 0; }
details.trace summary { cursor: pointer; font-size: 0.85rem; color: var(--muted); }
details.trace ol { padding-left: 1.2rem; }
details.trace pre { margin: 0.2rem 0; }
.trace-loading, .trace-error { margin: 0.35rem 0; }
.trace-error { color: var(--warn); }
.goal-label { font-size: 0.75rem; color: var(--muted); }
.trust-more, .rd-goals, .rd-words { font-size: 0.75rem; margin-left: 0.4rem; }
dl.badges dt { font-weight: 600; margin-top: 0.4rem; }
dl.badges dd { margin-left: 1rem; }

details.depmap { margin: 0.35rem 0 0.2rem; }
details.depmap > summary { cursor: pointer; font-size: 0.9rem; color: var(--muted); }
.depmap-wrap { overflow-x: auto; padding: 0.3rem 0; }
.depmap-legend { color: var(--muted); font-size: 0.82rem; margin: 0.15rem 0 0; }
svg.depmap-svg { display: block; font: 13px system-ui, -apple-system, "Segoe UI", sans-serif; }
svg.depmap-svg .n rect { fill: var(--panel, var(--bg)); stroke: var(--line); stroke-width: 1.2; }
svg.depmap-svg .n text { fill: var(--fg); }
svg.depmap-svg .n.here rect { fill: var(--accent, var(--fg)); stroke: var(--accent, var(--fg)); }
svg.depmap-svg .n.here text { fill: var(--bg); font-weight: 600; }
svg.depmap-svg a:hover rect, svg.depmap-svg a:focus rect { stroke: var(--accent, var(--fg)); stroke-width: 2; }
svg.depmap-svg .e { fill: none; stroke: var(--muted); stroke-width: var(--w, 1.3px); opacity: 0.75; }
svg.depmap-svg .e.declared { stroke-dasharray: 5 4; }
svg.depmap-svg .e.lit { stroke: var(--accent, var(--fg)); stroke-width: calc(var(--w, 1.3px) + 1px); opacity: 1; }
svg.depmap-svg .tip { fill: var(--muted); }
/* the project's drawings are wide: they use the whole window, not the text column */
#project-map .depmap-wrap { width: calc(100vw - 2rem); position: relative; left: 50%; transform: translateX(-50%); }
#project-map .controls { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.5rem 0; }
#project-map input[type="search"] { min-width: 18rem; }
.map-table-wrap { overflow-x: auto; }
.map-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.map-table th, .map-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; }
.map-table th:not(:first-child), .map-table td:not(:first-child) { text-align: right; white-space: nowrap; }
.depmap-text { font-size: 0.88rem; }

#reader-note { font-size: 0.9rem; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; margin: 0.6rem 0; }
#reader-note > summary { cursor: pointer; padding: 0.42rem 0.65rem; list-style-position: inside; }
#reader-note[open] > summary { border-bottom: 1px solid var(--line); }
#reader-note .reader-note-body { padding: 0.5rem 0.7rem 0.65rem; }
#reader-note .reader-note-body p { margin: 0 0 0.45rem; }
#reader-note .reader-status:empty { display: none; }
#reader-note .reader-status:not(:empty)::before { content: " — "; }
#reader-note .reader-controls { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; }
#reader-note button { font: inherit; color: inherit; background: transparent; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
details.reading { margin: 0.45rem 0 0.2rem; }
details.reading > summary { cursor: pointer; font-size: 0.9rem; color: var(--muted); }
details.reading[open] > summary { margin-bottom: 0.3rem; }
.rd { border-left: 3px solid var(--line); padding: 0.1rem 0 0.1rem 0.75rem; }
.rd p { margin: 0.35rem 0; }
.rd ul, .rd ol { margin: 0.25rem 0 0.4rem; padding-left: 1.4rem; }
.rd li { margin: 0.18rem 0; }
.rd code.rd-tac { background: var(--line); padding: 0 0.25rem; border-radius: 3px; margin-right: 0.3rem; }
.rd .rd-case { font-weight: 600; }
.rd ol.rd-calc { list-style: none; padding-left: 0.8rem; }
.rd details { margin: 0.35rem 0; }
.rd details > summary { cursor: pointer; color: var(--muted); font-size: 0.88rem; }
.rd dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.15rem 0.8rem; margin: 0.3rem 0; }
.rd dt { font-family: ui-monospace, monospace; }
.rd dd { margin: 0; }
.rd pre { overflow-x: auto; font-size: 0.85rem; }
.rd .rd-math { overflow-x: auto; overflow-y: hidden; padding: 0.15rem 0 0.25rem; }
.rd .rd-math:not(.typeset) > code { display: block; }
.rd .m.typeset .katex { font-size: 1.08em; }
.rd .rd-math.typeset .katex-display { margin: 0.35rem 0; text-align: left; }
.rd .rd-math.typeset .katex-display > .katex { text-align: left; }
.doc .m.typeset .katex, dl.glossary .m.typeset .katex { font-size: 1.05em; }
