/* Documentation pages, on the site theme in /site.css. */
:root { --bg: var(--page); --surface: var(--panel); --text: var(--ink); --muted: var(--mut); --border: var(--rule); --accent: var(--acc); --accent-ink: var(--acc-ink);
  --warn: var(--acc-ink); --code-bg: #eef1f5; --note: #e8f3fb; --warn-bg: #e8f3fb; --sidebar: 250px; --toc: 220px; }
body.docs { background: var(--bg); }
.docs .nav .wrap { max-width: 1400px; padding-left: 20px; padding-right: 20px; }
.docs-top { display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 20; min-height: 49px; padding: 7px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.docs-label { color: var(--text); font-size: 13px; font-weight: 600; }
.btn.small { padding: 5px 12px; }
.prose a:not(.doc-card):not(.headerlink):not(.shot) { color: var(--accent-ink); text-decoration: underline; }
.crumbs a, .page-tools a { text-decoration: underline; }
.search { position: relative; margin-left: auto; width: min(360px, 45vw); }
.search input { width: 100%; padding: 8px 12px; border-radius: 2px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; font-size: .95rem; }
#search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 2px; box-shadow: 0 10px 30px rgba(0,0,0,.15);
  max-height: 60vh; overflow: auto; }
#search-results a { display: block; padding: 7px 10px; border-radius: 2px; text-decoration: none; color: var(--text); }
#search-results a:hover, #search-results a.active { background: var(--note); }
#search-results small { display: block; color: var(--muted); }
.nav-toggle { display: none; }

.docs-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--toc); gap: 0; max-width: 1400px; margin: 0 auto; }
.docs-nav, .docs-toc { position: sticky; top: 49px; align-self: start; max-height: calc(100vh - 49px); overflow: auto; padding: 22px 16px; font-size: 13px; }
.docs-nav { border-right: 1px solid var(--border); }
.docs-nav ul, .docs-toc ul { list-style: none; margin: 0 0 18px; padding: 0; }
.docs-nav li a, .docs-toc li a { display: block; padding: 4px 10px; border-radius: 2px; color: var(--muted); text-decoration: none; line-height: 1.35; }
.docs-nav li a:hover, .docs-toc li a:hover { color: var(--text); background: var(--surface); }
.docs-nav li a[aria-current="page"] { color: var(--accent); background: var(--note); font-weight: 600; }
.docs-toc li.l3 a { padding-left: 22px; font-size: .88rem; }
.docs-toc li a.active { color: var(--accent); }
.nav-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 0 0 8px 10px; }
.nav-title a { color: inherit; text-decoration: none; }

.docs-main { padding: 18px 36px 80px; min-width: 0; margin: 0; max-width: none; }
.crumbs { font-size: .88rem; color: var(--muted); margin: 0; }
.crumbs a { color: var(--muted); }
.page-tools { float: right; font-size: .85rem; margin-top: -1.3em; }

.prose { max-width: 820px; }
.prose h1 { font-size: 28px; font-weight: 400; margin: 18px 0 10px; }
.prose h2 { font-size: 20px; font-weight: 400; margin: 2.2em 0 .6em; padding-top: .4em; border-top: 1px solid var(--border); }
.prose h3 { font-size: 15px; font-weight: 600; margin: 1.8em 0 .5em; }
.prose h4 { font-size: 14px; margin: 1.4em 0 .4em; }
.prose h2:first-of-type { border-top: 0; }
.prose :is(h2, h3, h4) { scroll-margin-top: 62px; }
.headerlink { margin-left: .4em; color: var(--border); text-decoration: none; font-weight: 400; visibility: hidden; }
.prose :is(h2, h3, h4):hover .headerlink { visibility: visible; color: var(--muted); }
.prose p, .prose li { line-height: 1.65; }
.prose li { margin: .25em 0; }
.prose .lead { font-size: 15px; color: var(--muted); }
.prose code { background: var(--code-bg); padding: .12em .38em; border-radius: 2px; font-size: .88em; word-break: normal; overflow-wrap: anywhere; }
.prose pre { position: relative; background: var(--code-bg); border: 1px solid var(--border); border-radius: 2px; padding: 14px 16px; overflow-x: auto; line-height: 1.5; }
.prose pre code { background: none; padding: 0; font-size: .86rem; overflow-wrap: normal; white-space: pre; }
.copy-btn { position: absolute; top: 8px; right: 8px; font: inherit; font-size: .78rem; padding: 3px 9px; border-radius: 2px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s; }
.prose pre:hover .copy-btn, .copy-btn:focus { opacity: 1; }
.table-wrap { overflow-x: auto; margin: 1em 0 1.4em; border: 1px solid var(--border); border-radius: 2px; background: var(--surface); }
.prose table { font-size: 13px; }
.prose th, .prose td { padding: 8px 12px; vertical-align: top; }
.prose th { background: var(--bg); color: var(--text); }
.prose tr:last-child td { border-bottom: 0; }
.prose td code { white-space: nowrap; }
.prose td code.wrap, .prose .table-wrap.wide td code { white-space: normal; }
.prose img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 2px; display: block; margin: 0 auto;
  box-shadow: 0 4px 18px rgba(16, 24, 40, .08); background: #fff; }
.prose a.shot { display: block; margin: 1.2em 0 .3em; }
.prose a.shot + em, .prose p > a.shot:only-child + br + em { display: block; text-align: center; color: var(--muted); font-size: .88rem; }
.prose figure { margin: 1.4em 0; }
.prose figcaption { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 6px; }
.prose p.caption { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 2px; }
.prose img.half { max-width: min(560px, 100%); }
.prose blockquote { margin: 1em 0; padding: 4px 16px; border-left: 3px solid var(--border); color: var(--muted); }
.prose kbd { font: inherit; font-size: .82em; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 2px; background: var(--surface); white-space: nowrap; }
.prose dt { font-weight: 600; margin-top: .8em; }
.prose dd { margin-left: 1.2em; }
.admonition { border: 1px solid var(--border); border-left: 4px solid var(--accent); background: var(--note); border-radius: 2px; padding: 2px 16px; margin: 1.2em 0; }
.admonition.warning { border-left-color: var(--warn); background: var(--warn-bg); }
.admonition-title { font-weight: 700; margin-bottom: 0; }
.card-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin: 24px 0; }
.doc-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 2px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.doc-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.doc-card span { color: var(--muted); font-size: .92rem; line-height: 1.45; }
.pager { display: flex; justify-content: space-between; gap: 12px; max-width: 820px; margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--border); }
.pager a { display: flex; flex-direction: column; padding: 10px 14px; border: 1px solid var(--border); border-radius: 2px; text-decoration: none; background: var(--surface); max-width: 48%; }
.pager a span { font-size: .8rem; color: var(--muted); }
.pager .next { margin-left: auto; text-align: right; }

@media (max-width: 1150px) {
  .docs-shell { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 820px) {
  .docs-shell { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-flex; }
  .docs-nav { display: none; position: static; background: var(--surface); max-height: none; border-right: 0; border-bottom: 1px solid var(--border); }
  .docs-nav.open { display: block; }
  .docs-main { padding: 14px 16px 64px; }
  .docs-label { display: none; }
  .search { width: auto; flex: 1; }
  .page-tools { float: none; margin: 4px 0 0; }
  .docs-top { padding: 7px 16px; gap: 10px; }
  .docs .nav .wrap { padding-left: 16px; padding-right: 16px; }
}
.prose thead:not(:has(th:not(:empty))) { display: none; }
