:root {
  --bg: #f4efe4; --bg-2: #ece5d5; --card: #fbf8f1; --ink: #1d1b22; --ink-2: #5b574f; --ink-3: #6f6a5e;
  --rule: #d9d1be; --accent: #4338ca; --accent-soft: #e3e1fa; --code-bg: #1d1b22; --code-ink: #ece8dd;
  --serif: ui-serif, 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #16151a; --bg-2: #1d1c23; --card: #1e1d25; --ink: #ece8dd; --ink-2: #b2ada0; --ink-3: #8f8a7e;
    --rule: #2d2b36; --accent: #8f87ff; --accent-soft: #2a2850; --code-bg: #0f0e13; --code-ink: #ece8dd;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #16151a; --bg-2: #1d1c23; --card: #1e1d25; --ink: #ece8dd; --ink-2: #b2ada0; --ink-3: #8f8a7e;
  --rule: #2d2b36; --accent: #8f87ff; --accent-soft: #2a2850; --code-bg: #0f0e13; --code-ink: #ece8dd;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--sans); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -48px; background: var(--accent); color: var(--bg); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { top: 8px; }
.disclaimer { background: var(--bg-2); border-bottom: 1px solid var(--rule); color: var(--ink-2); font-size: 13px; text-align: center; padding: 6px 16px; }
.bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.brand { font-family: var(--serif); font-size: 18px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand b { color: var(--accent); }
.tag { font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: 0.06em; background: var(--accent-soft); color: var(--accent); padding: 2px 6px; border-radius: 4px; margin-left: 4px; }
.bar-link { color: var(--ink-2); text-decoration: none; font-size: 14px; padding: 6px 8px; border-radius: 6px; }
.bar-link:hover { background: var(--bg-2); color: var(--ink); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; background: transparent; color: var(--ink); border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; }
.icon-btn:hover { background: var(--bg-2); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.search input { width: 100%; height: 36px; padding: 0 12px; background: var(--card); color: var(--ink); border: 1px solid var(--rule); border-radius: 8px; font: 14px var(--sans); }
.search input::placeholder { color: var(--ink-3); }
.results { position: absolute; top: 42px; left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--card); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.4); max-height: 70vh; overflow: auto; z-index: 40; }
.results a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.results a:hover, .results a:focus-visible { background: var(--accent-soft); }
.results strong { display: block; font-size: 14px; }
.results span { display: block; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.results .empty { padding: 10px; color: var(--ink-2); font-size: 14px; }
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr) 220px; gap: 32px; max-width: 1280px; margin: 0 auto; padding: 24px 16px 48px; }
.sidebar { position: sticky; top: 70px; align-self: start; max-height: calc(100vh - 90px); overflow: auto; font-size: 14.5px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--ink-2); text-decoration: none; }
.sidebar a:hover { background: var(--bg-2); color: var(--ink); }
.sidebar a[aria-current='page'] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-links { margin: 16px 10px 0; font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; }
.toc { position: sticky; top: 70px; align-self: start; max-height: calc(100vh - 90px); overflow: auto; font-size: 13.5px; }
.toc p { margin: 0 0 8px; font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc a { display: block; padding: 3px 12px; color: var(--ink-2); text-decoration: none; overflow-wrap: anywhere; }
.toc a:hover { color: var(--accent); }
.toc .d3 a { padding-left: 24px; font-size: 13px; }
main { min-width: 0; outline: none; }
.doc h1 { font: 600 clamp(28px, 5vw, 38px)/1.15 var(--serif); margin: 0 0 16px; letter-spacing: -0.01em; }
.doc h2 { font: 600 24px/1.25 var(--serif); margin: 40px 0 12px; padding-top: 8px; border-top: 1px solid var(--rule); }
.doc h3 { font: 600 18px/1.3 var(--sans); margin: 28px 0 8px; }
.doc h1 .anchor { display: none; }
.anchor { margin-left: -1.1em; padding-right: 0.3em; color: var(--ink-3); text-decoration: none; opacity: 0; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
.doc p, .doc li { overflow-wrap: anywhere; }
.doc blockquote { margin: 16px 0; padding: 10px 16px; border-left: 3px solid var(--accent); background: var(--card); border-radius: 0 8px 8px 0; color: var(--ink-2); }
.doc blockquote p { margin: 0; }
.doc code { font: 0.88em var(--mono); background: var(--bg-2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.doc pre { position: relative; margin: 16px 0; padding: 14px 16px; background: var(--code-bg); color: var(--code-ink); border-radius: 10px; overflow-x: auto; font: 13px/1.55 var(--mono); }
.doc pre code { background: none; padding: 0; font: inherit; overflow-wrap: normal; }
.copy { position: absolute; top: 8px; right: 8px; padding: 3px 9px; font: 12px var(--sans); color: var(--code-ink); background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; cursor: pointer; }
.copy:hover { background: rgba(255, 255, 255, 0.2); }
.copy:active { transform: translateY(1px); }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); }
.doc table { border-collapse: collapse; width: 100%; font-size: 14px; }
.doc th, .doc td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.doc th { background: var(--bg-2); font-weight: 600; white-space: nowrap; }
.doc tr:last-child td { border-bottom: 0; }
.twin { margin-top: 40px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.prevnext a { display: block; padding: 12px 16px; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); text-decoration: none; color: var(--ink); font-weight: 600; }
.prevnext a:hover { border-color: var(--accent); }
.prevnext a span { display: block; font: 12px var(--sans); color: var(--ink-3); font-weight: 400; }
.prevnext .next { text-align: right; }
.foot { border-top: 1px solid var(--rule); padding: 20px 16px; text-align: center; color: var(--ink-2); font-size: 13px; }
.foot p { margin: 0; }
@media (max-width: 1080px) { .shell { grid-template-columns: 220px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 800px) {
  .menu-btn { display: inline-grid; }
  .bar-link { display: none; }
  .shell { display: block; padding-top: 16px; }
  .sidebar { position: fixed; z-index: 25; top: 0; bottom: 0; left: 0; width: min(80vw, 300px); max-height: none; padding: 110px 12px 24px; background: var(--bg); border-right: 1px solid var(--rule); transform: translateX(-102%); transition: transform 0.18s ease; }
  .nav-open .sidebar { transform: none; }
  .search { max-width: none; }
  .brand .tag { display: none; }
}
@media (max-width: 400px) { .brand { font-size: 16px; } .bar { gap: 8px; padding: 8px 10px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .sidebar { transition: none; } }
