/* Docs wiki. Extends site.css: same tokens (the site is dark only). */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--accent); color: #06130a; padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 8px; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
nav a[aria-current="page"] { color: var(--text); }

.docs-bar { border-bottom: 1px solid var(--line); background: var(--bg); }
.docs-bar .wrap { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.docs-bar #search { flex: 1; max-width: 460px; --pagefind-ui-scale: .9; --pagefind-ui-primary: var(--accent); --pagefind-ui-text: var(--text); --pagefind-ui-background: var(--panel); --pagefind-ui-border: var(--line); --pagefind-ui-tag: var(--panel); --pagefind-ui-border-width: 1px; --pagefind-ui-border-radius: 10px; --pagefind-ui-font: inherit; }
.docs-menu-btn { display: none; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font: inherit; cursor: pointer; }

.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: 40px; align-items: start; }
.docs-nav { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: auto; padding: 28px 0; font-size: 14px; }
.docs-nav h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 6px; }
.docs-nav h2:first-child { margin-top: 0; }
.docs-nav ul, .docs-toc ul, .crumbs ol { list-style: none; margin: 0; padding: 0; }
.docs-nav a { display: block; padding: 4px 10px; border-radius: 8px; color: var(--muted); }
.docs-nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.docs-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-dim); }
.docs-toc { position: sticky; top: 72px; padding: 28px 0; font-size: 13px; }
.docs-toc h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.docs-toc a { display: block; padding: 3px 0; color: var(--muted); }
.docs-toc .l3 a { padding-left: 14px; }
.docs-main { min-width: 0; padding-bottom: 72px; }
.docs-main .prose { padding: 40px 0 24px; max-width: 760px; }
.crumbs { padding-top: 28px; font-size: 13px; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; }
.prose h2 .anchor, .prose h3 .anchor, .prose h4 .anchor { margin-left: 8px; opacity: 0; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .anchor:focus { opacity: 1; }
.prose code { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .9em; }
.prose pre { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.prose ol { padding-left: 22px; }
.prose blockquote { margin: 16px 0; padding: 4px 16px; border-left: 3px solid var(--line); }
.callout { margin: 20px 0; padding: 4px 18px; border-radius: var(--radius); border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--accent-dim); }
.callout.warning { border-left-color: #e3b341; background: rgba(227, 179, 65, .12); }
.callout p { color: var(--text); }
.docs-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 32px; }
.docs-sections h2 { font-size: 18px; margin-top: 24px; }
.docs-sections ul { padding-left: 18px; }

.ask { margin: 32px 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.ask h2 { margin: 0 0 4px; }
.ask form { display: flex; gap: 10px; margin: 10px 0; }
.ask input { flex: 1; min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font: inherit; }
.ask ol { padding-left: 20px; }
.ask li p { margin: 2px 0 12px; }
.ask mark { background: var(--accent-dim); color: var(--text); }

.page-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.page-tools button, .page-tools a { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.page-tools button:hover, .page-tools a:hover { border-color: var(--accent); text-decoration: none; }
.prevnext { display: flex; justify-content: space-between; gap: 16px; }
.prevnext a { display: block; flex: 1; max-width: 48%; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
.prevnext a:hover { border-color: var(--accent); text-decoration: none; }
.prevnext a span { display: block; font-size: 12px; color: var(--muted); }
.prevnext .next { text-align: right; }

@media (max-width: 1060px) { .docs { grid-template-columns: 220px minmax(0, 1fr); } .docs-toc { display: none; } }
@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .docs-menu-btn { display: block; }
  .docs-nav { position: static; max-height: none; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .docs-nav { display: none; }
  .docs-nav.open { display: block; }
  .docs-sections { grid-template-columns: 1fr; }
  .ask form { flex-direction: column; }
}
