:root {
  color-scheme:light;
  --canvas:#f3f0e9; --surface:#faf8f3; --paper:#fffefa; --ink:#242820;
  --ink-soft:#45483f; --muted:#6f7169; --faint:#92958c; --line:#ddd9cf;
  --line-strong:#c9c4b9; --accent:#295f52; --accent-strong:#184b40;
  --accent-soft:#e6efeb; --warm:#a65332; --warm-soft:#f5e7df; --bad:#a33f39;
  --source:#39738c; --source-soft:#e5eff3; --shadow:0 14px 42px rgba(55,47,34,.07);
  --ui:"Segoe UI Variable Text","Segoe UI",system-ui,sans-serif;
  --serif:"Sitka Text","Iowan Old Style","Palatino Linotype",Georgia,serif;
  --mono:"Cascadia Mono","SFMono-Regular",Consolas,monospace;
}
:root[data-theme="dark"] {
  color-scheme:dark;
  --canvas:#10151c; --surface:#18212a; --paper:#1c2630; --ink:#edf0ed;
  --ink-soft:#d4d8d4; --muted:#aeb8bd; --faint:#7f8e96; --line:#354550;
  --line-strong:#4a5d69; --accent:#82c8c0; --accent-strong:#a5d9d3;
  --accent-soft:#203b3e; --warm:#e09a72; --warm-soft:#3e2e29; --bad:#dc7d78;
  --source:#79add1; --source-soft:#213746; --shadow:0 18px 48px rgba(0,0,0,.2);
}
@media (prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) {
    color-scheme:dark;
    --canvas:#10151c; --surface:#18212a; --paper:#1c2630; --ink:#edf0ed;
    --ink-soft:#d4d8d4; --muted:#aeb8bd; --faint:#7f8e96; --line:#354550;
    --line-strong:#4a5d69; --accent:#82c8c0; --accent-strong:#a5d9d3;
    --accent-soft:#203b3e; --warm:#e09a72; --warm-soft:#3e2e29; --bad:#dc7d78;
    --source:#79add1; --source-soft:#213746; --shadow:0 18px 48px rgba(0,0,0,.2);
  }
}
* { box-sizing:border-box; }
html { scroll-behavior:smooth; scrollbar-color:var(--line-strong) transparent; }
body { margin:0; background:var(--canvas); color:var(--ink); font:15px/1.5 var(--ui); }
::selection { background:color-mix(in srgb,var(--accent) 28%,transparent); }
a { color:var(--accent-strong); text-decoration-thickness:.075em; text-underline-offset:.17em; }
a:hover { color:var(--warm); }
button,input,select { font:inherit; }
button { color:inherit; }
:focus-visible { outline:3px solid color-mix(in srgb,var(--warm) 70%,white); outline-offset:3px; }
.visually-hidden { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
.skip-link { position:fixed; z-index:100; left:16px; top:12px; padding:10px 14px; border-radius:8px; background:var(--ink); color:var(--paper); transform:translateY(-160%); }
.skip-link:focus { transform:none; }
.mobile-bar { display:none; }
.shell { display:grid; grid-template-columns:300px minmax(0,820px) minmax(190px,220px); gap:clamp(24px,2.6vw,42px); align-items:start; max-width:1520px; margin:0 auto; padding:28px clamp(20px,2.6vw,40px) 80px; }
.sidebar { position:fixed; top:28px; left:calc(max(0px,(100vw - 1520px) / 2) + clamp(20px,2.6vw,40px)); width:300px; height:calc(100vh - 56px); max-height:calc(100vh - 56px); display:flex; flex-direction:column; min-height:0; transition:opacity .18s ease,transform .18s ease; }
.toc { position:sticky; top:28px; max-height:calc(100vh - 56px); grid-column:3; display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.toc-scroll { min-height:0; overflow-y:auto; padding-right:5px; scrollbar-width:thin; }
main { grid-column:2; }
.brand-row { display:flex; align-items:center; gap:8px; margin:2px 4px 22px; }
.brand { display:flex; min-width:0; flex:1; align-items:center; gap:11px; color:var(--ink); text-decoration:none; }
.brand-mark { display:grid; place-items:center; width:37px; height:37px; border:1px solid var(--line-strong); border-radius:12px; background:var(--paper); box-shadow:0 5px 16px rgba(50,45,36,.07); color:var(--accent); }
.brand-mark svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.type-icon { flex:0 0 auto; width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.brand strong { display:block; font:650 15px/1.1 var(--ui); letter-spacing:-.01em; }
.brand small { display:block; margin-top:4px; color:var(--faint); font:650 9px/1 var(--ui); letter-spacing:.15em; text-transform:uppercase; }
.search-wrap { position:relative; }
.search-icon { position:absolute; left:13px; top:50%; width:17px; height:17px; transform:translateY(-50%); fill:none; stroke:var(--faint); stroke-width:2; pointer-events:none; }
.search { width:100%; min-height:44px; padding:10px 58px 10px 39px; border:1px solid var(--line); border-radius:12px; background:var(--paper); color:var(--ink); box-shadow:0 6px 22px rgba(50,45,36,.04); }
.search::placeholder { color:var(--faint); }
.key-hint { position:absolute; right:9px; top:50%; transform:translateY(-50%); padding:3px 6px; border:1px solid var(--line); border-bottom-color:var(--line-strong); border-radius:6px; color:var(--faint); background:var(--surface); font:600 10px/1.2 var(--ui); }
.quick-links { display:grid; grid-template-columns:repeat(4,1fr); gap:5px; margin:13px 0 18px; padding-bottom:13px; border-bottom:1px solid var(--line); }
.quick-links a { padding:8px 4px; border-radius:9px; color:var(--muted); text-align:center; text-decoration:none; font:650 11px/1.2 var(--ui); }
.quick-links a:hover,.quick-links a:focus-visible { background:var(--accent-soft); color:var(--accent-strong); }
.control-menu.pinned-menu { position:static; }.pinned-menu[hidden] { display:none; }.pinned-menu summary { min-width:34px; justify-content:center; gap:3px; padding-inline:6px; color:var(--accent-strong); }.pinned-menu summary > svg:first-child { width:14px; height:14px; transform:none; }.pinned-count { display:grid; min-width:17px; height:17px; place-items:center; border-radius:999px; background:var(--accent-soft); color:var(--accent-strong); font:750 9px/1 var(--ui); }.control-popover.pinned-popover { right:0; left:0; width:auto; min-width:0; padding:10px; }.pinned-head { margin:1px 2px 9px; color:var(--ink); }.pinned-title { font:700 12px/1 var(--ui); }.pinned-nav { display:grid; max-height:min(52vh,430px); gap:6px; overflow-y:auto; scrollbar-width:none; }.pinned-nav::-webkit-scrollbar { display:none; }.pinned-item { display:grid; grid-template-columns:minmax(0,1fr) 30px; align-items:center; border:1px solid var(--line); border-left:3px solid var(--accent); border-radius:8px; background:var(--surface); }.pinned-item[data-type="source"] { border-left-color:var(--source); }.pinned-item[data-type="entity"] { border-left-color:#ab94c5; }.pinned-item[data-type="question"] { border-left-color:#d8ad61; }.pinned-item[data-type="synthesis"] { border-left-color:#7394b8; }.pinned-item[data-type="index"] { border-left-color:#6d9468; }.pinned-item > a { display:grid; grid-template-columns:22px minmax(0,1fr); gap:2px 8px; align-items:center; min-width:0; padding:9px 5px 9px 9px; color:var(--ink); text-decoration:none; }.pinned-item > a:hover span { text-decoration:underline; }.pinned-item .type-icon { grid-row:1 / 3; width:20px; height:20px; color:var(--accent-strong); }.pinned-item a span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.pinned-item a small { grid-column:2; color:var(--faint); font:650 9px/1 var(--ui); letter-spacing:.06em; text-transform:uppercase; }.pinned-remove { width:28px; height:28px; border:0; background:transparent; }.pinned-remove svg { width:14px; height:14px; }
.library-head { position:relative; display:flex; align-items:center; gap:8px; margin:0 4px 8px; }
.library-label { color:var(--faint); font:700 10px/1 var(--ui); letter-spacing:.13em; text-transform:uppercase; }
.library-controls { display:flex; align-items:center; justify-content:flex-end; gap:4px; margin-left:auto; min-width:0; }
.control-menu { position:relative; color:var(--muted); font:600 11px/1.2 var(--ui); }
.control-menu summary { display:flex; align-items:center; gap:5px; min-height:30px; padding:5px 7px; border:1px solid transparent; border-radius:7px; cursor:pointer; list-style:none; white-space:nowrap; }.control-menu summary::-webkit-details-marker { display:none; }.control-menu summary svg { width:13px; height:13px; fill:none; stroke:currentColor; stroke-width:2; transition:transform .15s; }.control-menu[open] summary { border-color:var(--line-strong); background:var(--paper); color:var(--ink); }.control-menu[open] summary svg { transform:rotate(180deg); }
.control-popover { position:absolute; z-index:85; top:calc(100% + 5px); right:0; width:max-content; min-width:150px; padding:5px; border:1px solid var(--line-strong); border-radius:9px; background:var(--paper); box-shadow:var(--shadow); }
.control-popover button { display:flex; align-items:center; justify-content:space-between; width:100%; min-height:31px; padding:6px 9px; border:0; border-radius:6px; background:transparent; color:var(--muted); text-align:left; cursor:pointer; }.control-popover button:hover,.control-popover button:focus-visible { background:var(--accent-soft); color:var(--accent-strong); }.control-popover button[aria-checked="true"] { color:var(--ink); font-weight:700; }.control-popover button[aria-checked="true"]::after { content:"✓"; margin-left:14px; color:var(--accent); }
.result-count { margin:0 5px 8px; color:var(--faint); font-size:11px; }
.note-nav { flex:1 1 180px; min-height:0; overflow:auto; padding:0 5px 20px 0; scrollbar-width:thin; }
.note-nav a { display:grid; grid-template-columns:18px minmax(0,1fr) auto; gap:8px; align-items:center; margin:1px 0; padding:8px 9px 8px 9px; border-left:2px solid transparent; border-radius:7px; color:var(--muted); text-decoration:none; }
.note-nav a[hidden] { display:none; }
.note-nav a span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.note-nav a small { color:var(--faint); font:650 9px/1 var(--ui); letter-spacing:.06em; text-transform:uppercase; }
.search-snippet { grid-column:2 / -1; overflow:hidden; color:var(--faint); font:500 10px/1.35 var(--ui); text-overflow:ellipsis; white-space:nowrap; }
.note-nav a:hover { background:color-mix(in srgb,var(--paper) 70%,transparent); color:var(--ink); }
.note-nav a.active { border-left-color:var(--accent); background:var(--accent-soft); color:var(--accent-strong); font-weight:650; }
.note-nav a.active small { color:var(--accent); }
main { grid-column:2; min-width:0; background:var(--paper); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow); overflow:hidden; }
.reading-progress { position:fixed; z-index:60; left:0; top:0; width:0; height:3px; background:linear-gradient(90deg,var(--accent),var(--warm)); }
.note-body { max-width:100%; padding:clamp(36px,5vw,64px) clamp(28px,5.5vw,68px) clamp(54px,7vw,86px); color:var(--ink-soft); font:17.5px/1.7 var(--serif); font-kerning:normal; text-rendering:optimizeLegibility; }
.breadcrumb { display:flex; align-items:center; gap:8px; margin:0 0 22px; color:var(--faint); font:650 10px/1.2 var(--ui); letter-spacing:.13em; text-transform:uppercase; }
.breadcrumb a { color:var(--accent); text-decoration:none; }
.breadcrumb span[aria-hidden] { color:var(--line-strong); }
.note-body h1,.note-body h2,.note-body h3,.note-body h4,.note-body h5,.note-body h6 { position:relative; color:var(--ink); font-family:var(--ui); text-wrap:balance; scroll-margin-top:24px; }
.note-body h1 { display:flex; align-items:flex-start; gap:10px; max-width:16ch; margin:0; font:700 clamp(2.35rem,4.6vw,3.4rem)/1.05 var(--serif); letter-spacing:-.038em; }
.note-body h2 { display:flex; align-items:center; gap:9px; margin:3.2rem 0 1.1rem; padding-top:1.35rem; border-top:1px solid var(--line); font:700 1.44rem/1.22 var(--ui); letter-spacing:-.02em; }
.note-body h3 { display:flex; align-items:center; gap:8px; margin:2.35rem 0 .85rem; font:700 1.16rem/1.25 var(--ui); letter-spacing:-.015em; }
.note-body h4,.note-body h5,.note-body h6 { display:flex; align-items:center; gap:8px; margin:2rem 0 .7rem; font:700 1rem/1.3 var(--ui); }
.heading-text { min-width:0; }
.heading-copy { flex:0 0 auto; display:grid; place-items:center; width:31px; height:31px; margin-top:1px; border:0; border-radius:9px; background:transparent; color:var(--faint); cursor:pointer; opacity:0; transform:translateX(-3px); transition:opacity .16s,transform .16s,background .16s,color .16s; }
h1 .heading-copy { margin-top:.25em; }
h1:hover .heading-copy,h2:hover .heading-copy,h3:hover .heading-copy,h4:hover .heading-copy,h5:hover .heading-copy,h6:hover .heading-copy,.heading-copy:focus-visible,.heading-copy.copied { opacity:1; transform:none; }
.heading-copy:hover { background:var(--accent-soft); color:var(--accent-strong); }
.heading-copy.copied { background:var(--accent-soft); color:var(--accent-strong); }
.heading-copy svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.note-metadata { margin:20px 0 34px; padding-bottom:25px; border-bottom:1px solid var(--line); color:var(--muted); font:600 11px/1.3 var(--ui); }
.metadata-primary { display:flex; flex-wrap:wrap; align-items:center; gap:7px 12px; }
.meta-item { display:inline-flex; align-items:center; gap:6px; min-height:26px; padding:5px 8px; border:1px solid var(--line); border-radius:999px; background:var(--surface); }
.meta-type .type-icon { width:14px; height:14px; }
.metadata-primary > .meta-item:not(.meta-type):not([class*="status-"]):not(.meta-review-due) { padding-inline:1px; border-color:transparent; background:transparent; }
.meta-quiet { color:var(--faint); }
.meta-item i { width:6px; height:6px; border-radius:50%; background:var(--faint); }
.meta-item.status-stable i { background:#4e9568; }.meta-item.status-working i { background:#d28a43; }.meta-item.status-seed i { background:#6b8fb9; }.meta-item.status-stale i { background:#a16868; }
.meta-review-due { border-color:#a16868; color:#8a4e4e; background:color-mix(in srgb,#a16868 9%,var(--surface)); }
.meta-type { color:var(--accent-strong); background:var(--accent-soft); border-color:transparent; text-transform:capitalize; }
.metadata-tags { display:flex; align-items:flex-start; gap:12px; margin-top:11px; }.metadata-label { padding-top:5px; color:var(--faint); font:700 9px/1.3 var(--ui); letter-spacing:.11em; text-transform:uppercase; }.note-end-matter { margin-top:4.5rem; padding-top:2rem; border-top:1px solid var(--line); }.source-section h2 { margin:0 0 1.2rem; padding:0; border:0; font:400 1.55rem/1.2 var(--serif); letter-spacing:-.015em; }.source-list { columns:2; column-gap:42px; margin:0; padding-left:2.2rem; list-style-type:decimal-leading-zero; color:var(--muted); font:500 12px/1.55 var(--ui); }.source-list li { break-inside:avoid; margin:0 0 .72rem; padding-left:.35rem; overflow-wrap:anywhere; }.source-list li::marker { color:var(--warm); font-size:10px; font-weight:700; }.source-list a { color:var(--muted); text-decoration-color:color-mix(in srgb,var(--muted) 45%,transparent); }.source-list a:hover { color:var(--accent-strong); }
.tag-list { display:flex; flex-wrap:wrap; gap:5px; }.tag-list a { padding:2px 8px; border:1px solid var(--line); border-radius:999px; background:var(--surface); color:var(--accent-strong); text-decoration:none; }.tag-list a:hover { border-color:var(--accent); background:var(--accent-soft); }
.tag-cloud { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:center; gap:10px 16px; margin:24px 0 38px; padding:28px; border:1px solid var(--line); border-radius:16px; background:var(--surface); font-family:var(--ui); }
.tag-cloud a { color:var(--accent-strong); font-size:var(--tag-size); font-weight:650; line-height:1.05; text-decoration:none; }.tag-cloud a:hover { color:var(--warm); text-decoration:underline; }.tag-cloud small { margin-left:4px; color:var(--faint); font-size:.45em; font-weight:600; vertical-align:super; }
.tag-results { list-style:none; margin:24px 0; padding:0; }.tag-results li { border-top:1px solid var(--line); }.tag-results a { display:flex; justify-content:space-between; gap:16px; padding:13px 4px; text-decoration:none; }.tag-results a:hover span { text-decoration:underline; }.tag-results small { color:var(--muted); font:600 12px/1.5 var(--ui); }
.note-body p { margin:0 0 1.15em; hanging-punctuation:first last; }
.note-body > p:first-of-type { color:var(--ink); font-size:1.08em; line-height:1.62; }
.note-body ul,.note-body ol { padding-left:1.45em; }.note-body li { padding-left:.18em; margin:.28em 0; }.note-body li::marker { color:var(--accent); }
.note-body hr { margin:2.8rem 0; border:0; border-top:1px solid var(--line); }
.note-body blockquote { margin:1.65rem 0; padding:.05rem 0 .05rem 1.25rem; border-left:3px solid var(--warm); color:var(--muted); font-style:italic; }
.note-body img { max-width:100%; height:auto; border-radius:9px; }
.note-body table { display:block; width:100%; max-width:100%; margin:1.7rem 0; overflow-x:auto; border-collapse:collapse; font:14px/1.5 var(--ui); }
.note-body .footnote { margin-top:3rem; color:var(--muted); font:14px/1.55 var(--ui); }
.note-body .footnote hr { margin-bottom:1.25rem; }.note-body .footnote li { margin:.45rem 0; }
.note-body .footnote-ref,.note-body .footnote-backref { font-family:var(--ui); }
.note-body abbr { text-decoration:underline dotted color-mix(in srgb,var(--muted) 62%,transparent); text-decoration-thickness:.045em; text-underline-offset:.16em; cursor:help; }
.note-body p abbr,.note-body li abbr,.note-body blockquote abbr,.note-body td abbr { font-variant-caps:all-small-caps; letter-spacing:.025em; }
.note-body h1 abbr,.note-body h2 abbr,.note-body h3 abbr,.note-body h4 abbr,.note-body h5 abbr,.note-body h6 abbr { font-variant-caps:normal; letter-spacing:inherit; text-decoration:none; }
.note-body th,.note-body td { padding:11px 13px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }.note-body th { color:var(--ink); font-weight:700; background:var(--surface); }.note-body tbody tr:hover { background:color-mix(in srgb,var(--accent-soft) 45%,transparent); }
.note-body code,.note-body pre { font-family:var(--mono); font-size:.86em; font-variant-ligatures:none; }
.note-body code { padding:.12em .32em; border-radius:5px; background:var(--surface); color:var(--warm); }
.note-body pre { overflow:auto; margin:1.6rem 0; padding:18px 20px; border:1px solid var(--line); border-radius:11px; background:var(--surface); line-height:1.55; }
.note-body pre code { padding:0; background:none; color:var(--ink-soft); }
.code-frame { position:relative; margin:1.6rem 0; }.code-frame .note-code { margin:0; padding-top:48px; }.code-copy { position:absolute; z-index:2; top:8px; right:8px; width:auto; height:30px; padding:0 9px; border-radius:7px; font:650 10px/1 var(--ui); }
.note-body pre.mermaid { display:grid; place-items:center; padding:20px; white-space:normal; }
.note-body pre.mermaid svg { max-width:100%; height:auto; }
.note-body pre.mermaid svg .node rect,.note-body pre.mermaid svg .node polygon,.note-body pre.mermaid svg .node path { stroke-width:1.5px!important; }.note-body pre.mermaid svg .node rect { rx:8px; ry:8px; }.note-body pre.mermaid svg .cluster rect { rx:14px; ry:14px; stroke-dasharray:5 4; }.note-body pre.mermaid svg .flowchart-link { stroke:var(--line-strong)!important; }.note-body pre.mermaid svg .edgeLabel { color:var(--muted)!important; background:var(--paper)!important; }.note-body pre.mermaid svg .edgeLabel rect { fill:var(--paper)!important; opacity:.94!important; }
.note-body pre.mermaid.mermaid-wide,.note-body pre.mermaid.mermaid-large { display:block; }
.note-body pre.mermaid.mermaid-wide svg { min-width:min(64rem,220vw); }
.note-body pre.mermaid.mermaid-large { max-height:70vh; cursor:grab; user-select:none; touch-action:none; }
.note-body pre.mermaid.mermaid-large .flowchart-link { vector-effect:non-scaling-stroke; stroke-width:1.35px !important; opacity:.68; }
.note-body pre.mermaid a .node { cursor:pointer; }
.note-body pre.mermaid.mermaid-large .flowchart-link.wiki-edge-trunk { stroke-width:var(--bundle-width,2.4px) !important; opacity:.86; }
.note-body pre.mermaid.mermaid-large .wiki-edge-merge { fill:var(--muted); stroke:none; }
.note-body pre.mermaid.mermaid-large.dragging { cursor:grabbing; }
.note-body pre.mermaid.mermaid-error { display:block; white-space:pre-wrap; color:var(--bad); }
.mermaid-frame { margin:1.6rem 0; border:1px solid var(--line); border-radius:12px; background:var(--surface); overflow:hidden; }
.mermaid-frame > pre.mermaid { margin:0; border:0; border-radius:0; }
.mermaid-toolbar { display:flex; align-items:center; gap:6px; padding:8px; border-bottom:1px solid var(--line); background:var(--paper); font:600 11px/1.2 var(--ui); }
.mermaid-toolbar button { min-width:34px; height:31px; padding:0 9px; border:1px solid var(--line); border-radius:7px; background:var(--surface); color:var(--muted); cursor:pointer; }
.mermaid-toolbar button:hover { border-color:var(--accent); background:var(--accent-soft); color:var(--accent-strong); }
.mermaid-toolbar button[aria-pressed="true"] { border-color:var(--accent); background:var(--accent-soft); color:var(--accent-strong); }
.mermaid-status { margin-left:auto; color:var(--faint); white-space:nowrap; }
.mermaid-legend { border-top:1px solid var(--line); background:var(--paper); font:600 11px/1.2 var(--ui); }.mermaid-legend summary { width:max-content; padding:9px 12px; color:var(--muted); cursor:pointer; }.mermaid-legend-items { display:flex; flex-wrap:wrap; gap:8px 16px; padding:0 12px 11px; color:var(--muted); }.mermaid-legend-items span { display:inline-flex; align-items:center; gap:6px; }.legend-shape { width:13px; height:13px; border:1.5px solid currentColor; background:color-mix(in srgb,currentColor 12%,var(--surface)); }.legend-concept { color:var(--warm); border-radius:4px; }.legend-source { color:var(--source); border-radius:50% 50% 3px 3px; }.legend-entity { color:#ab94c5; clip-path:polygon(25% 7%,75% 7%,100% 50%,75% 93%,25% 93%,0 50%); }.legend-synthesis { color:var(--accent); box-shadow:3px 3px 0 -1px var(--surface),3px 3px 0 0 currentColor; }.legend-index { width:18px; color:#91b88d; border-radius:999px; }.legend-question { color:#d8ad61; transform:rotate(45deg); }
body.diagram-fullscreen { overflow:hidden; }
.mermaid-frame:fullscreen,.mermaid-frame.fullscreen-fallback { display:flex; flex-direction:column; width:100vw; height:100vh; margin:0; padding:16px; border:0; border-radius:0; background:var(--canvas); }
.mermaid-frame.fullscreen-fallback { position:fixed; z-index:1000; inset:0; }
.mermaid-frame:fullscreen .mermaid-toolbar,.mermaid-frame.fullscreen-fallback .mermaid-toolbar { flex:0 0 auto; border:1px solid var(--line); border-radius:10px 10px 0 0; }
.mermaid-frame:fullscreen > pre.mermaid,.mermaid-frame.fullscreen-fallback > pre.mermaid { flex:1 1 auto; min-height:0; max-height:none; border:1px solid var(--line); border-top:0; border-radius:0 0 10px 10px; }
.unresolved { color:var(--bad); border-bottom:1px dashed color-mix(in srgb,var(--bad) 72%,transparent); cursor:help; }
.callout { --callout-color:var(--accent); margin:1.6rem 0; padding:15px 18px; border:1px solid color-mix(in srgb,var(--callout-color) 30%,var(--line)); border-left:4px solid var(--callout-color); border-radius:8px; background:color-mix(in srgb,var(--callout-color) 7%,var(--surface)); font-size:.96em; }
.callout-important,.callout-tip,.callout-success { --callout-color:#9a691c; }.callout-warning,.callout-caution,.callout-danger,.callout-failure,.callout-bug { --callout-color:var(--bad); }.callout-info,.callout-question,.callout-example { --callout-color:var(--source); }
.callout > :last-child { margin-bottom:0; }.callout-title,.callout summary { color:var(--ink); font:700 .82rem/1.4 var(--ui); letter-spacing:.02em; }.callout summary { cursor:pointer; }
.note-body ul:has(> li > .task-list-item-checkbox) { padding-left:.2em; }.note-body li:has(> .task-list-item-checkbox) { padding-left:0; list-style:none; }.task-list-item-checkbox { width:1em; height:1em; margin-right:.45em; vertical-align:-.08em; accent-color:var(--accent); }
.backlinks { margin-top:4rem; padding-top:2rem; border-top:1px solid var(--line); }
.backlinks .section-label { color:var(--warm); font:700 10px/1 var(--ui); letter-spacing:.14em; text-transform:uppercase; }
.backlinks h2 { margin:.55rem 0 1rem; padding:0; border:0; font-family:var(--serif); font-size:1.55rem; }
.backlinks ul { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding:0; list-style:none; }
.backlinks li { margin:0; padding:0; }.backlinks a { display:grid; grid-template-columns:18px minmax(0,1fr); gap:3px 8px; height:100%; padding:12px 14px; border:1px solid var(--line); border-left:3px solid var(--accent); border-radius:8px; background:var(--surface); color:var(--ink); text-decoration:none; }.backlinks a .type-icon { grid-row:1 / 3; margin-top:1px; }.backlinks a small { grid-column:2; }.backlinks a[data-type="source"] { border-left-color:var(--source); }.backlinks a[data-type="entity"] { border-left-color:#ab94c5; }.backlinks a[data-type="question"] { border-left-color:#d8ad61; }
.backlinks a:hover { border-color:var(--accent); background:var(--accent-soft); }.backlinks small { color:var(--faint); font:650 9px/1 var(--ui); letter-spacing:.08em; text-transform:uppercase; }
.toc { padding-top:7px; color:var(--muted); }
.toc-title { flex:0 0 auto; margin:0 0 8px; color:var(--ink); font:700 11px/1 var(--ui); letter-spacing:.13em; text-transform:uppercase; }
.toc ol { margin:0; padding:0; list-style:none; }.toc li { margin:2px 0; }.toc a { display:block; padding:5px 8px; border-left:3px solid transparent; color:var(--muted); text-decoration:none; font:500 12px/1.4 var(--ui); }
.toc a:hover,.toc a.active { border-left-color:var(--warm); color:var(--warm); }.toc a.active { background:var(--warm-soft); }
.toc-level-3 a { padding-left:18px; }.toc-level-4 a { padding-left:27px; }
.toc-empty { color:var(--faint); font-size:12px; }
.page-actions { display:flex; flex:0 0 auto; gap:6px; margin-top:12px; padding-top:13px; border-top:1px solid var(--line); background:var(--canvas); }
.icon-button { display:grid; place-items:center; width:38px; height:38px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--muted); cursor:pointer; }
.icon-button:hover { border-color:var(--line-strong); color:var(--accent-strong); background:var(--accent-soft); }.icon-button svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
[data-pin-current][aria-pressed="true"] { border-color:var(--warm); color:var(--warm); background:var(--warm-soft); }[data-pin-current][aria-pressed="true"] svg { fill:currentColor; }
.library-collapse { flex:0 0 auto; width:34px; height:34px; border:0; background:transparent; }.library-restore { display:none; position:fixed; z-index:65; top:28px; left:14px; align-items:center; gap:7px; width:auto; padding:0 10px; box-shadow:var(--shadow); font:650 11px/1 var(--ui); }.library-restore svg { width:16px; height:16px; }
.toast { position:fixed; z-index:90; left:50%; bottom:24px; padding:10px 14px; border:1px solid var(--line-strong); border-radius:10px; background:var(--ink); color:var(--paper); box-shadow:0 10px 35px rgba(0,0,0,.24); font:650 12px/1.3 var(--ui); transform:translate(-50%,20px); opacity:0; pointer-events:none; transition:opacity .18s,transform .18s; }.toast.show { transform:translate(-50%,0); opacity:1; }
.sidebar-scrim { display:none; }
@media (min-width:1121px) { body.sidebar-collapsed .shell { grid-template-columns:minmax(0,820px) minmax(190px,220px); max-width:1120px; }.sidebar-collapsed main { grid-column:1; }.sidebar-collapsed .toc { grid-column:2; }.sidebar-collapsed .sidebar { opacity:0; pointer-events:none; transform:translateX(-22px); }.sidebar-collapsed .library-restore { display:flex; } }
@media (max-width:1120px) { .shell { grid-template-columns:280px minmax(0,820px); max-width:1140px; }.toc { display:none; }.sidebar { left:calc(max(0px,(100vw - 1140px) / 2) + clamp(20px,3vw,48px)); width:280px; }.library-collapse,.library-restore { display:none!important; } }
@media (max-width:780px) {
  .mobile-bar { position:sticky; z-index:50; top:0; display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:58px; padding:8px 15px; border-bottom:1px solid var(--line); background:color-mix(in srgb,var(--canvas) 88%,transparent); backdrop-filter:blur(16px); }
  .mobile-brand { min-width:0; overflow:hidden; color:var(--ink); font-weight:700; text-overflow:ellipsis; white-space:nowrap; }.mobile-actions { display:flex; gap:7px; }
  .shell { display:block; padding:14px 12px 40px; }.sidebar { position:fixed; z-index:80; inset:0 auto 0 0; width:min(88vw,330px); height:100%; max-height:none; padding:20px 18px; border-right:1px solid var(--line); background:var(--surface); box-shadow:20px 0 60px rgba(0,0,0,.22); transform:translateX(-105%); transition:transform .22s ease; }.sidebar.open { transform:none; }
  .sidebar-scrim { position:fixed; z-index:70; inset:0; display:block; border:0; background:rgba(8,12,9,.48); opacity:0; pointer-events:none; transition:opacity .2s; }.sidebar.open + .sidebar-scrim { opacity:1; pointer-events:auto; }
  .note-nav { flex:1; }.desktop-theme { display:none; } main { border-radius:13px; }.note-body { padding:35px 25px 55px; font-size:17.5px; }.note-body h1 { font-size:clamp(2.25rem,12vw,3.35rem); }.breadcrumb { margin-bottom:17px; }.backlinks ul { grid-template-columns:1fr; }
  .heading-copy { opacity:.72; transform:none; }.key-hint { display:none; }.search { padding-right:12px; }
}
@media (max-width:430px) { .note-body { padding:30px 20px 48px; }.note-body h1 { letter-spacing:-.035em; }.metadata-primary { gap:6px; }.metadata-tags { display:grid; gap:5px; }.source-list { columns:1; } }
@media (prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } *,*::before,*::after { animation-duration:.01ms!important; transition-duration:.01ms!important; } }
@media print { body { background:white; }.mobile-bar,.sidebar,.toc,.reading-progress,.heading-copy,.toast { display:none!important; }.shell { display:block; max-width:none; padding:0; } main { border:0; box-shadow:none; }.note-body { max-width:720px; margin:0 auto; padding:0; } }
