/* zkdocs — Zig documentation theme */
:root {
  --sidebar-w: 260px;
  --toc-w:     260px;
  --accent:    #f7a41d;
  --bg:        #0d0d1a;
  --bg-card:   rgba(255,255,255,.05);
  --bg-sidebar:#080810;
  --text:      #dcdcf0;
  --muted:     #8a8aaa;
  --border:    #1e1e38;
  --fn:        #82aaff;
  --kw:        #c792ea;
  --type:      #f07178;
  --str:       #c3e88d;
  --num:       #f78c6c;
  --mono: 'Cascadia Code','Fira Code','JetBrains Mono',monospace;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  display: flex;
  min-height: 100vh;
}

/* ── Scrollbar theming ── */
nav.sidebar,
aside.page-toc {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg-sidebar);
}
nav.sidebar::-webkit-scrollbar,
aside.page-toc::-webkit-scrollbar { width: 6px; }
nav.sidebar::-webkit-scrollbar-track,
aside.page-toc::-webkit-scrollbar-track { background: var(--bg-sidebar); }
nav.sidebar::-webkit-scrollbar-thumb,
aside.page-toc::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
nav.sidebar::-webkit-scrollbar-thumb:hover,
aside.page-toc::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Horizontal scrollbars on code blocks */
.symbol-doc pre,
.guide-content pre {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.symbol-doc pre::-webkit-scrollbar,
.guide-content pre::-webkit-scrollbar { height: 6px; }
.symbol-doc pre::-webkit-scrollbar-track,
.guide-content pre::-webkit-scrollbar-track { background: transparent; }
.symbol-doc pre::-webkit-scrollbar-thumb,
.guide-content pre::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.symbol-doc pre::-webkit-scrollbar-thumb:hover,
.guide-content pre::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Sidebar ── */
nav.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
  position: fixed;
  inset: 0 auto 0 0;
  overflow-y: auto;
  z-index: 10;
}
nav.sidebar .logo-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.5rem;
}
nav.sidebar .logo {
  display: block;
  color: var(--accent);
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  letter-spacing: .02em;
  flex: 1;
  min-width: 0;
}
nav.sidebar .repo-link {
  display: flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  flex-shrink: 0;
  transition: color .15s;
}
nav.sidebar .repo-link:hover { color: var(--accent); }
nav.sidebar h4 {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin: 1rem 0 .4rem;
}
nav.sidebar ul { list-style: none; }
nav.sidebar ul li a {
  display: block;
  padding: .2rem .5rem;
  border-radius: 4px;
  font-size: .875rem;
  font-family: var(--mono);
  color: var(--muted);
  text-decoration: none;
  transition: color .15s, background .15s;
}
nav.sidebar ul li a:hover  { color: var(--text); background: var(--bg-card); }
nav.sidebar ul li a.active { color: var(--accent); background: rgba(247,164,29,.1); }

/* ── Page body wrapper (main + footer, between the two fixed sidebars) ── */
.page-body {
  margin-left: var(--sidebar-w);
  margin-right: var(--toc-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Main content ── */
main {
  padding: 2.5rem 3rem;
  flex: 1;
  width: 100%;
  min-width: 0;
}

/* ── Site footer ── */
.site-footer {
  padding: .75rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .78rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-footer a {
  color: var(--accent);
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }

h1 { font-size: 1.75rem; color: #fff; margin-bottom: .25rem; }
h2 {
  font-size: 1.05rem;
  color: var(--accent);
  margin: 2.5rem 0 1rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--border);
}
h4 { font-size: .85rem; color: var(--muted); margin: .75rem 0 .4rem; }

.mod-path {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

/* ── Symbol cards ── */
.symbol {
  margin-bottom: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}
.symbol-sig-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}
.pill-generic {
  flex-shrink: 0;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #7dd3fc;
  background: rgba(125, 211, 252, .12);
  border: 1px solid rgba(125, 211, 252, .3);
  border-radius: 999px;
  padding: .15em .65em;
  line-height: 1.6;
  white-space: nowrap;
}
.symbol-sig code {
  font-family: var(--mono);
  font-size: .88rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}
.symbol-doc {
  margin-top: .65rem;
  font-size: .88rem;
  color: #aaa;
  line-height: 1.65;
  white-space: pre-wrap;
}

.symbol-decls {
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}
.symbol-decls h4 { margin-bottom: .5rem; }
.symbol-decls .symbol {
  background: transparent;
  border-color: rgba(255,255,255,.05);
  padding: .6rem 1rem;
}

/* ── Keyword / token colours ── */
.kw        { color: var(--kw);   }
.fn-name   { color: var(--fn);   }
.type-name { color: var(--type); }
.param-name{ color: var(--str);  }
a.type-link { color: var(--type); text-decoration: none; }
a.type-link:hover { text-decoration: underline; }
.sym-eq    { color: var(--muted); }
.sym-value { color: var(--num);   }
details.sym-value-details {
  margin-top: .4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
details.sym-value-details > summary {
  padding: .2rem .6rem;
  cursor: pointer;
  background: var(--bg-card);
  font-size: .8rem;
  color: var(--muted);
  user-select: none;
  list-style: none;
}
details.sym-value-details > summary::before { content: '▶ '; font-size: .7em; }
details.sym-value-details[open] > summary::before { content: '▼ '; }
details.sym-value-details > pre {
  margin: 0;
  border-radius: 0;
  font-size: .82rem;
  padding: .6rem .75rem;
  overflow-x: auto;
}
details.fn-body {
  margin-top: .5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
details.fn-body > summary {
  padding: .2rem .6rem;
  cursor: pointer;
  background: var(--bg-card);
  font-size: .8rem;
  color: var(--muted);
  user-select: none;
  list-style: none;
}
details.fn-body > summary::before { content: '▶ '; font-size: .7em; }
details.fn-body[open] > summary::before { content: '▼ '; }
details.fn-body > pre {
  margin: 0;
  border-radius: 0;
  overflow-x: auto;
  background: rgba(0,0,0,.3);
  padding: .75rem 1rem;
  font-size: .78rem;
}

/* ── Fields table ── */
.fields-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: .75rem;
  font-size: .875rem;
}
.fields-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: .3rem .6rem;
  border-bottom: 1px solid var(--border);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.fields-table td {
  padding: .3rem .6rem;
  border-bottom: 1px solid rgba(255,255,255,.03);
  font-family: var(--mono);
  vertical-align: top;
}
.fields-table td.field-doc {
  font-family: inherit;
  color: var(--muted);
  font-size: .84rem;
}

/* ── Module index list ── */
.module-list { list-style: none; }
.module-list li {
  margin-bottom: .75rem;
  padding: .75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.module-list li a {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 600;
  font-size: .95rem;
}
.module-list li a:hover { text-decoration: underline; }
.mod-doc { font-size: .875rem; color: var(--muted); margin-top: .25rem; }

/* ── Syntax highlighting (Phase 5 — tree-sitter) ── */
.hl-keyword  { color: var(--kw);   }
.hl-function { color: var(--fn);   }
.hl-type     { color: var(--type); }
.hl-comment  { color: #546e7a; font-style: italic; }
.hl-string   { color: var(--str);  }
.hl-number   { color: var(--num);  }
.hl-constant { color: var(--num);  }
.hl-operator { color: var(--muted); }

/* ── Markdown content (symbol docs) ── */
.symbol-doc p             { margin-bottom: .5rem; }
.symbol-doc p:last-child  { margin-bottom: 0; }
.symbol-doc code          { background: rgba(0,0,0,.3); padding: .1em .35em; border-radius: 3px; font-family: var(--mono); font-size: .84em; }
.symbol-doc pre           { background: rgba(0,0,0,.3); padding: .75rem 1rem; border-radius: 4px; overflow-x: auto; margin: .5rem 0; }
.symbol-doc pre code      { background: none; padding: 0; font-size: .875rem; }
.symbol-doc ul,.symbol-doc ol { padding-left: 1.5rem; margin: .25rem 0 .5rem; }
.symbol-doc li            { margin-bottom: .15rem; }
.symbol-doc a             { color: var(--accent); }
.symbol-doc strong        { color: var(--text); }

/* ── Guide pages ── */
.guide-content h1 { font-size: 1.75rem; color: #fff; margin-bottom: .4rem; }
.guide-content h2 { font-size: 1.2rem; color: var(--accent); margin: 2rem 0 .75rem; padding-bottom: .3rem; border-bottom: 1px solid var(--border); }
.guide-content h3 { font-size: 1rem; color: var(--text); margin: 1.5rem 0 .5rem; }
.guide-content p  { margin-bottom: 1rem; line-height: 1.7; }
.guide-content a  { color: var(--accent); }
.guide-content strong { color: var(--text); }
.guide-content code   { background: rgba(0,0,0,.3); padding: .15em .4em; border-radius: 3px; font-family: var(--mono); font-size: .875em; }
.guide-content pre    { background: rgba(0,0,0,.3); padding: 1rem 1.25rem; border-radius: 6px; overflow-x: auto; margin: 1rem 0; }
.guide-content pre code { background: none; padding: 0; }
.guide-content ul,.guide-content ol { padding-left: 1.75rem; margin: 0 0 1rem; }
.guide-content li { margin-bottom: .3rem; }

/* ── Admonitions ── */
.admonition, details.admonition {
  border-left: 4px solid var(--admon-color, #7a7a9a);
  background: var(--admon-bg, rgba(122,122,154,.08));
  border-radius: 0 6px 6px 0;
  margin: 1.25rem 0;
  overflow: hidden;
}
.admonition-title, details.admonition > summary.admonition-title {
  background: var(--admon-title-bg, rgba(122,122,154,.18));
  color: var(--admon-color, #7a7a9a);
  font-weight: 600;
  font-size: .875rem;
  padding: .45rem .9rem;
  display: flex;
  align-items: center;
  gap: .45rem;
  list-style: none;
  cursor: default;
}
details.admonition > summary.admonition-title { cursor: pointer; user-select: none; }
details.admonition > summary.admonition-title::-webkit-details-marker { display: none; }
details.admonition > summary.admonition-title::marker { content: ''; }
details.admonition > summary.admonition-title::before { content: '▶'; font-size: .5rem; transition: transform .15s ease; }
details.admonition[open] > summary.admonition-title::before { transform: rotate(90deg); }
.admonition-title::before { content: var(--admon-icon, ''); }
.admonition-body { padding: .65rem .9rem; }
.admonition-body > *:last-child { margin-bottom: 0; }

/* Per-type colours */
.admonition.note,    details.admonition.note    { --admon-color:#448aff; --admon-bg:rgba(68,138,255,.07); --admon-title-bg:rgba(68,138,255,.15); --admon-icon:'ℹ '; }
.admonition.abstract,details.admonition.abstract{ --admon-color:#00b0ff; --admon-bg:rgba(0,176,255,.07); --admon-title-bg:rgba(0,176,255,.15); --admon-icon:'📋 '; }
.admonition.info,    details.admonition.info    { --admon-color:#00b8d4; --admon-bg:rgba(0,184,212,.07); --admon-title-bg:rgba(0,184,212,.15); --admon-icon:'ℹ '; }
.admonition.tip,     details.admonition.tip     { --admon-color:#00bfa5; --admon-bg:rgba(0,191,165,.07); --admon-title-bg:rgba(0,191,165,.15); --admon-icon:'💡 '; }
.admonition.success, details.admonition.success { --admon-color:#00c853; --admon-bg:rgba(0,200,83,.07);  --admon-title-bg:rgba(0,200,83,.15);  --admon-icon:'✔ '; }
.admonition.question,details.admonition.question{ --admon-color:#64dd17; --admon-bg:rgba(100,221,23,.07);--admon-title-bg:rgba(100,221,23,.15);--admon-icon:'? '; }
.admonition.warning, details.admonition.warning { --admon-color:#ff9100; --admon-bg:rgba(255,145,0,.07); --admon-title-bg:rgba(255,145,0,.15); --admon-icon:'⚠ '; }
.admonition.failure, details.admonition.failure { --admon-color:#ff5252; --admon-bg:rgba(255,82,82,.07); --admon-title-bg:rgba(255,82,82,.15); --admon-icon:'✖ '; }
.admonition.danger,  details.admonition.danger  { --admon-color:#ff1744; --admon-bg:rgba(255,23,68,.07); --admon-title-bg:rgba(255,23,68,.15); --admon-icon:'🔥 '; }
.admonition.bug,     details.admonition.bug     { --admon-color:#f50057; --admon-bg:rgba(245,0,87,.07);  --admon-title-bg:rgba(245,0,87,.15);  --admon-icon:'🐛 '; }
.admonition.example, details.admonition.example { --admon-color:#7c4dff; --admon-bg:rgba(124,77,255,.07);--admon-title-bg:rgba(124,77,255,.15);--admon-icon:'▶ '; }
.admonition.quote,   details.admonition.quote   { --admon-color:#9e9e9e; --admon-bg:rgba(158,158,158,.07);--admon-title-bg:rgba(158,158,158,.15);--admon-icon:'" '; }

/* ── Collapsible nav sections (details/summary) ── */
details.nav-section { margin: .9rem 0 0; }
details.nav-section > summary {
  list-style: none;
  cursor: pointer;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  padding: .15rem 0;
  user-select: none;
  display: flex;
  align-items: center;
  gap: .35rem;
}
details.nav-section > summary::-webkit-details-marker { display: none; }
details.nav-section > summary::marker { content: ''; }
details.nav-section > summary::before {
  content: "▶";
  font-size: .5rem;
  display: inline-block;
  transition: transform .18s ease;
  flex-shrink: 0;
}
details.nav-section[open] > summary::before { transform: rotate(90deg); }
details.nav-section > ul { margin-top: .25rem; }

/* ── Guide subsections in nav ── */
details.nav-subsection {
  margin: .15rem 0;
  padding-left: .5rem;
  border-left: 1px solid var(--border);
}
details.nav-subsection > summary {
  list-style: none;
  cursor: pointer;
  font-size: .8rem;
  color: var(--muted);
  padding: .15rem 0;
  user-select: none;
  display: flex;
  align-items: center;
  gap: .3rem;
}
details.nav-subsection > summary::-webkit-details-marker { display: none; }
details.nav-subsection > summary::marker { content: ''; }
details.nav-subsection > summary::before {
  content: "▶";
  font-size: .45rem;
  display: inline-block;
  transition: transform .15s ease;
  flex-shrink: 0;
}
details.nav-subsection[open] > summary::before { transform: rotate(90deg); }
details.nav-subsection > ul { margin: .1rem 0 .2rem .4rem; }

/* ── Nested module children in sidebar ── */
ul.nav-children {
  list-style: none;
  margin: .1rem 0 .1rem .85rem;
  padding: 0;
  border-left: 1px solid var(--border);
  padding-left: .5rem;
}
ul.nav-children li a {
  font-size: .8rem;
  color: var(--muted);
  padding: .15rem .4rem;
}
ul.nav-children li a:hover,
ul.nav-children li a.active {
  color: var(--accent);
  background: var(--bg-card);
}

/* ── Right-column "On this page" TOC ── */
aside.page-toc {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--toc-w);
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1.75rem .75rem 2rem 1rem;
  border-left: 1px solid var(--border);
  background: var(--bg-sidebar);
}
aside.page-toc h4 {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: .4rem;
}
aside.page-toc > ul {
  list-style: none;
}
aside.page-toc > ul > li > a {
  display: block;
  padding: .2rem .4rem;
  font-size: .82rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 3px;
  overflow-wrap: break-word;
}
aside.page-toc > ul > li > a:hover { color: var(--accent); }

.toc-children {
  list-style: none;
  padding-left: .65rem;
  margin: .15rem 0;
}
.toc-children li a {
  display: block;
  padding: .15rem .4rem;
  font-size: .8rem;
  font-family: var(--mono);
  color: var(--muted);
  text-decoration: none;
  border-radius: 3px;
  overflow-wrap: break-word;
}
.toc-children li a:hover { color: var(--text); background: var(--bg-card); }

.toc-methods {
  list-style: none;
  padding-left: .65rem;
  margin: .1rem 0;
}
.toc-methods li a {
  display: block;
  padding: .1rem .4rem;
  font-size: .76rem;
  font-family: var(--mono);
  color: var(--muted);
  text-decoration: none;
  opacity: .75;
  overflow-wrap: break-word;
}
.toc-methods li a:hover { opacity: 1; color: var(--text); }

/* ── Emoji ── */
img.emoji {
  height: 1.2em;
  width: 1.2em;
  vertical-align: middle;
  display: inline-block;
}

/* ── Search bar ── */
.search-box {
  position: relative;
  margin-bottom: 1.1rem;
}
#search-input {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .82rem;
  padding: .38rem .65rem;
  outline: none;
  font-family: inherit;
}
#search-input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,.09);
}
#search-input::placeholder { color: var(--muted); }
.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 6px;
  z-index: 100;
  max-height: 340px;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,.45);
}
.search-result {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  padding: .45rem .75rem;
  text-decoration: none;
  color: var(--text);
  font-size: .82rem;
  border-bottom: 1px solid var(--border);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--bg-card); color: var(--accent); }
.sr-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-type  { font-size: .7rem; color: var(--muted); white-space: nowrap; font-family: var(--mono); }

/* ── Copy button ── */
.copy-btn {
  position: absolute;
  top: .45rem;
  right: .5rem;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  padding: .2rem .4rem;
  font-size: .72rem;
  font-family: inherit;
  line-height: 1;
  opacity: 0;
  transition: opacity .15s, color .15s, background .15s;
  display: flex;
  align-items: center;
}
pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text); background: rgba(255,255,255,.14); }

/* ── Mobile bar ── */
.mobile-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 0 .75rem;
  z-index: 20;
  gap: .5rem;
}
.mob-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: .4rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mob-btn:hover { background: var(--bg-card); }
.mob-title {
  flex: 1;
  text-align: center;
  color: var(--accent);
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 15;
}
.overlay.active { display: block; }

/* ── Responsive ── */
@media (max-width: 700px) {
  .mobile-bar { display: flex; }
  .page-body { margin-left: 0; margin-right: 0; }
  main { padding: 4.5rem 1.25rem 1.25rem; }
  .site-footer { padding: .75rem 1.25rem; }
  nav.sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 18;
  }
  nav.sidebar.open { transform: translateX(0); }
  aside.page-toc {
    transform: translateX(100%);
    transition: transform .25s ease;
    z-index: 18;
  }
  aside.page-toc.open { transform: translateX(0); }
}

/* ═══════════════════════════════════════════════
   Monokai theme
   ─────────────────────────────────────────────── */
[data-theme="monokai"] {
  --accent:    #a6e22e;
  --bg:        #171812;
  --bg-card:   rgba(255,255,255,.06);
  --bg-sidebar:#0f100a;
  --text:      #f8f8f2;
  --muted:     #857e68;
  --border:    #2e2d24;
  --fn:        #a6e22e;
  --kw:        #f92672;
  --type:      #66d9ef;
  --str:       #e6db74;
  --num:       #ae81ff;
}
[data-theme="monokai"] .hl-comment { color: #75715e; }
[data-theme="monokai"] .pill-generic {
  color: #66d9ef;
  background: rgba(102,217,239,.12);
  border-color: rgba(102,217,239,.3);
}

/* ═══════════════════════════════════════════════
   VSCode Light theme
   ─────────────────────────────────────────────── */
[data-theme="vscode-light"] {
  --accent:    #0078d4;
  --bg:        #ffffff;
  --bg-card:   #f8f8f8;
  --bg-sidebar:#f3f3f3;
  --text:      #1f1f1f;
  --muted:     #717171;
  --border:    #d4d4d4;
  --fn:        #795e26;
  --kw:        #0000ff;
  --type:      #267f99;
  --str:       #a31515;
  --num:       #098658;
}
[data-theme="vscode-light"] h1                     { color: #1f1f1f; }
[data-theme="vscode-light"] .guide-content h1      { color: #1f1f1f; }
[data-theme="vscode-light"] .symbol-doc            { color: #555; }
[data-theme="vscode-light"] .symbol-doc code,
[data-theme="vscode-light"] .guide-content code    { background: #ececec; }
[data-theme="vscode-light"] .symbol-doc pre,
[data-theme="vscode-light"] .guide-content pre,
[data-theme="vscode-light"] details.fn-body > pre  { background: #ececec; }
[data-theme="vscode-light"] .symbol-decls .symbol  { border-color: rgba(0,0,0,.07); }
[data-theme="vscode-light"] .hl-comment            { color: #008000; }
[data-theme="vscode-light"] .fields-table td       { border-bottom-color: rgba(0,0,0,.06); }
[data-theme="vscode-light"] nav.sidebar ul li a.active { background: rgba(0,120,212,.1); }
[data-theme="vscode-light"] #search-input          { background: #fff; color: #1f1f1f; }
[data-theme="vscode-light"] #search-input:focus    { background: #fff; }
[data-theme="vscode-light"] .copy-btn              { background: rgba(0,0,0,.06); }
[data-theme="vscode-light"] .pill-generic {
  color: #0078d4;
  background: rgba(0,120,212,.08);
  border-color: rgba(0,120,212,.25);
}

/* ═══════════════════════════════════════════════
   VSCode Dark theme
   ─────────────────────────────────────────────── */
[data-theme="vscode-dark"] {
  --accent:    #4ec9b0;
  --bg:        #111111;
  --bg-card:   rgba(255,255,255,.05);
  --bg-sidebar:#181818;
  --text:      #e0e0e0;
  --muted:     #9a9a9a;
  --border:    #2a2a2a;
  --fn:        #dcdcaa;
  --kw:        #569cd6;
  --type:      #4ec9b0;
  --str:       #ce9178;
  --num:       #b5cea8;
}
[data-theme="vscode-dark"] .hl-comment { color: #6a9955; }
[data-theme="vscode-dark"] .pill-generic {
  color: #4ec9b0;
  background: rgba(78,201,176,.12);
  border-color: rgba(78,201,176,.3);
}

/* ── Literate example pages ─────────────────────────────────────── */
.example-hidden { display: none !important; }

.example-page-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: .5rem;
}
.example-page-header h1 { flex: 1; margin: 0; }

#raw-toggle {
  flex-shrink: 0;
  padding: .3rem .75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text);
  font-size: .85rem;
  cursor: pointer;
  white-space: nowrap;
}
#raw-toggle:hover { border-color: var(--accent); color: var(--accent); }

pre.example-raw-view {
  border-radius: 6px;
  overflow-x: auto;
}

.example-prose {
  padding: .25rem 0 .5rem;
}
.example-prose > *:first-child { margin-top: 0; }
.example-prose > *:last-child  { margin-bottom: 0; }

pre.example-code {
  margin: 0 0 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
}

details.example-collapsed {
  margin: 0 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
details.example-collapsed > summary {
  padding: .5rem .75rem;
  cursor: pointer;
  background: var(--bg-card);
  font-weight: 600;
  user-select: none;
  list-style: none;
}
details.example-collapsed > summary::before {
  content: '▶ ';
  font-size: .75em;
}
details.example-collapsed[open] > summary::before {
  content: '▼ ';
}
details.example-collapsed > pre.example-code {
  border-radius: 0;
  margin: 0;
}
details.example-collapsed > .example-prose {
  padding: .5rem .75rem;
}
