/* ═══════════════════════════════════════════════════════════════
   Vortex Engine — Developer Documentation
   Shares the vortexstudio.dev design system:
   Foundation #05060e · violet #7a6cf0 · DX12 blue #00a6fb ·
   green #00b894 · red #ff6b6b
   ═══════════════════════════════════════════════════════════════ */

:root {
  --violet: #7a6cf0;
  --violet2: #6c5ce7;
  --violet-soft: #b0a5ff;
  --blue: #00a6fb;
  --green: #00b894;
  --red: #ff6b6b;
  --amber: #ffa94d;

  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --topbar-h: 60px;
  --side-w: 288px;
  --toc-w: 230px;
  --content-max: 820px;

  --radius: 10px;
}

/* ── Dark theme (default, matches the site) ── */
:root, :root[data-theme="dark"] {
  --bg: #05060e;
  --bg-2: #080a15;
  --surface: #0b0d1a;
  --surface-2: #10131f;
  --surface-3: #151827;
  --line: #21243a;
  --line-2: #2a2d45;
  --text: #f2f3f7;
  --text-2: #c7cbdb;
  --dim: #8a8fa3;
  --dim-2: #656a80;
  --code-bg: #0a0c17;
  --code-inline-bg: #191d2e;
  --code-inline-fg: #d6b4ff;
  --sel: rgba(122,108,240,0.32);
  --shadow: 0 24px 60px -20px rgba(0,0,0,0.7);
}

/* ── Light theme ── */
:root[data-theme="light"] {
  --bg: #f7f8fb;
  --bg-2: #eef0f6;
  --surface: #ffffff;
  --surface-2: #f2f3f8;
  --surface-3: #e9ebf3;
  --line: #e2e5ee;
  --line-2: #d3d7e4;
  --text: #14162a;
  --text-2: #33384f;
  --dim: #5b6178;
  --dim-2: #868ba1;
  --code-bg: #0c0e1a;         /* code blocks stay dark for punch */
  --code-inline-bg: #ecebfb;
  --code-inline-fg: #5b43c9;
  --sel: rgba(122,108,240,0.22);
  --shadow: 0 24px 60px -24px rgba(30,32,60,0.25);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* scroll-lock while an overlay (search modal / mobile nav drawer) is open.
   On mobile we pin the body so the background can't scroll behind the drawer;
   docs.js records/restores the scroll offset via inline `top`. */
body.scroll-locked { overflow: hidden; }

::selection { background: var(--sel); }

a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }

/* faint aurora behind everything, like the main site */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vw 40vh at 82% -8%, rgba(122,108,240,0.14), transparent 60%),
    radial-gradient(50vw 40vh at 6% 4%, rgba(0,166,251,0.08), transparent 55%);
  pointer-events: none;
}
:root[data-theme="light"] body::before {
  background:
    radial-gradient(60vw 40vh at 82% -8%, rgba(122,108,240,0.10), transparent 60%),
    radial-gradient(50vw 40vh at 6% 4%, rgba(0,166,251,0.06), transparent 55%);
}

/* ═══════════ Top bar ═══════════ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 clamp(0.8rem, 2.5vw, 1.4rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.topbar-l { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.topbar-r { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }

.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-name {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  color: var(--text);
  white-space: nowrap;
}
.brand-name b { color: var(--violet); font-weight: 700; }

.pill {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  padding: 0.18rem 0.5rem;
  border-radius: 99px;
  border: 1px solid var(--violet);
  color: var(--violet);
  white-space: nowrap;
}

/* version dropdown — a .pill that is a real <select> */
select.ver-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%237a6cf0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.45rem center / 9px;
  padding-right: 1.35rem;
  cursor: pointer;
}
select.ver-select:hover,
select.ver-select:focus-visible { background-color: var(--surface-2); outline: none; }
select.ver-select option { background: var(--surface); color: var(--text); font-family: var(--mono); }

.top-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--dim);
  padding: 0.35rem 0.6rem;
  border-radius: 7px;
}
.top-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--line); }
.menu-toggle { display: none; }

.ic-sun { display: none; }
:root[data-theme="light"] .ic-moon { display: none; }
:root[data-theme="light"] .ic-sun { display: block; }

/* search trigger in the top bar */
.search-trigger {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  height: 38px;
  min-width: 240px;
  max-width: 420px;
  flex: 0 1 340px;
  margin: 0 auto 0 1.2rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  color: var(--dim);
  font-family: var(--body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.search-trigger:hover { border-color: var(--violet); background: var(--surface-2); }
.search-trigger span { flex: 1; text-align: left; }
.search-trigger kbd, .search-hint kbd, .search-in kbd {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--dim);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 0.08rem 0.38rem;
  white-space: nowrap;
}

/* ═══════════ Layout ═══════════ */
.layout {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w);
  max-width: 1600px;
  margin: 0 auto;
  padding-top: var(--topbar-h);
}

/* ── Sidebar ── */
.sidebar {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  overscroll-behavior: contain;          /* don't chain scroll to the page */
  -webkit-overflow-scrolling: touch;     /* momentum scroll on iOS */
  padding: 1.6rem 0.6rem 2rem 1.1rem;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }

.side-group { margin-bottom: 1.4rem; }
.side-group > .side-head {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim-2);
  padding: 0 0.7rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.side-head .gi {
  width: 15px; height: 15px; color: var(--violet); flex: none; opacity: .9;
}
.side-links { list-style: none; display: flex; flex-direction: column; gap: 1px; }
.side-links a {
  display: block;
  padding: 0.38rem 0.75rem;
  border-radius: 7px;
  color: var(--text-2);
  font-size: 0.865rem;
  border-left: 2px solid transparent;
  transition: background .16s, color .16s;
}
.side-links a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side-links a.active {
  background: color-mix(in srgb, var(--violet) 15%, transparent);
  color: var(--text);
  border-left-color: var(--violet);
  font-weight: 500;
}
.side-foot {
  margin-top: 1.4rem;
  padding: 1rem 0.7rem 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.side-foot a { font-family: var(--mono); font-size: 0.76rem; color: var(--dim); }
.side-foot a:hover { color: var(--violet); text-decoration: none; }

/* ── Content ── */
.content {
  min-width: 0;
  padding: 2.4rem clamp(1.2rem, 4vw, 3.4rem) 4rem;
}
.article { max-width: var(--content-max); margin: 0 auto; }
.article.swap { animation: fade-up .34s cubic-bezier(0.16,1,0.3,1); }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* breadcrumb + title block injected by renderer */
.doc-eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 0.7rem;
}

/* ── Article typography ── */
.article h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.7rem;
  text-wrap: balance;
}
.article h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  margin: 2.6rem 0 1rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
}
.article h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  margin: 1.9rem 0 0.7rem;
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
}
.article h4 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
}
.article p { margin: 0 0 1.05rem; color: var(--text-2); }
.article .lead,
.article > h1 + p {
  font-size: 1.16rem;
  line-height: 1.62;
  color: var(--dim);
  margin-bottom: 1.8rem;
}
.article a { color: var(--violet); font-weight: 500; }
.article a:hover { color: var(--violet-soft); }
:root[data-theme="light"] .article a:hover { color: var(--violet2); }
.article strong { color: var(--text); font-weight: 600; }
.article ul, .article ol { margin: 0 0 1.15rem 1.3rem; color: var(--text-2); }
.article li { margin: 0.35rem 0; }
.article li::marker { color: var(--dim-2); }
.article hr { border: none; border-top: 1px solid var(--line); margin: 2.2rem 0; }

/* heading anchor link */
.head-anchor {
  opacity: 0;
  margin-left: 0.4rem;
  color: var(--dim-2);
  font-weight: 400;
  transition: opacity .15s;
}
h2:hover .head-anchor, h3:hover .head-anchor, h4:hover .head-anchor { opacity: 1; }
.head-anchor:hover { color: var(--violet); text-decoration: none; }

/* inline code */
.article :not(pre) > code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--code-inline-bg);
  color: var(--code-inline-fg);
  padding: 0.12em 0.42em;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--line-2) 60%, transparent);
  white-space: nowrap;
}

/* blockquote */
.article blockquote {
  margin: 0 0 1.15rem;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 3px solid var(--line-2);
  color: var(--dim);
}

/* ── Callouts (> [!NOTE] etc.) ── */
.callout {
  display: flex;
  gap: 0.85rem;
  margin: 0 0 1.3rem;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 0.94rem;
}
.callout .co-ic { flex: none; width: 20px; height: 20px; margin-top: 0.15rem; }
.callout .co-body { min-width: 0; }
.callout .co-body > :last-child { margin-bottom: 0; }
.callout .co-title { font-weight: 600; color: var(--text); margin-bottom: 0.2rem; letter-spacing: 0.01em; }
.callout p { color: var(--text-2); margin-bottom: 0.5rem; }
.callout.note   { border-color: color-mix(in srgb, var(--blue) 45%, var(--line-2)); background: color-mix(in srgb, var(--blue) 8%, var(--surface)); }
.callout.note .co-ic, .callout.note .co-title { color: var(--blue); }
.callout.tip    { border-color: color-mix(in srgb, var(--green) 45%, var(--line-2)); background: color-mix(in srgb, var(--green) 8%, var(--surface)); }
.callout.tip .co-ic, .callout.tip .co-title { color: var(--green); }
.callout.warn   { border-color: color-mix(in srgb, var(--amber) 50%, var(--line-2)); background: color-mix(in srgb, var(--amber) 9%, var(--surface)); }
.callout.warn .co-ic, .callout.warn .co-title { color: var(--amber); }
.callout.danger { border-color: color-mix(in srgb, var(--red) 50%, var(--line-2)); background: color-mix(in srgb, var(--red) 9%, var(--surface)); }
.callout.danger .co-ic, .callout.danger .co-title { color: var(--red); }

/* ── Code blocks ── */
.code-wrap {
  position: relative;
  margin: 0 0 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--code-bg);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.5rem 0.4rem 0.95rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line-2) 60%, transparent);
  background: color-mix(in srgb, #ffffff 3%, var(--code-bg));
}
.code-lang {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.copy-btn:hover { color: var(--text); background: var(--surface-3); border-color: var(--line-2); }
.copy-btn.done { color: var(--green); }
.code-wrap pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.83rem;
  line-height: 1.62;
  color: #e6e8f2;
  scrollbar-width: thin;
}
.code-wrap pre::-webkit-scrollbar { height: 9px; }
.code-wrap pre::-webkit-scrollbar-thumb { background: #2a2d45; border-radius: 8px; }
.code-wrap code { font-family: inherit; white-space: pre; }

/* syntax tokens */
.tok-comment { color: #5f6787; font-style: italic; }
.tok-doc     { color: #4f9a6e; font-style: italic; }
.tok-str     { color: #f0a97e; }
.tok-num     { color: #d0a3ff; }
.tok-kw      { color: #8a7cff; font-weight: 500; }
.tok-type    { color: #4fc7f5; }
.tok-fn      { color: #f6d365; }
.tok-pre     { color: #d17ba8; }
.tok-attr    { color: #7dd3a8; }
.tok-punct   { color: #8a8fa3; }
.tok-key     { color: #4fc7f5; }        /* json keys */
.tok-bool    { color: #ff9d7a; }
.tok-tag     { color: #8a7cff; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; margin: 0 0 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); }
.article table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.article th, .article td { text-align: left; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.article th {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  background: var(--surface);
  white-space: nowrap;
}
.article tr:last-child td { border-bottom: none; }
.article tbody tr:hover { background: color-mix(in srgb, var(--violet) 5%, transparent); }
.article td code { white-space: normal; }

/* member/signature block used in the API reference */
.article .sig {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--code-bg);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--violet);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin: 0 0 0.8rem;
  overflow-x: auto;
  color: #e6e8f2;
}

.article img { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }

/* card grid for the intro / index pages: build from a <div class="cards"> */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.9rem; margin: 0 0 1.6rem; }
.cards a.card {
  display: block;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: transform .2s cubic-bezier(0.16,1,0.3,1), border-color .2s, background .2s;
}
.cards a.card:hover { transform: translateY(-3px); border-color: var(--violet); background: var(--surface-2); text-decoration: none; }
.cards .card b { display: block; font-family: var(--display); font-weight: 600; font-size: 1.02rem; margin-bottom: 0.25rem; }
.cards .card span { font-size: 0.86rem; color: var(--dim); }

/* ── Pager (prev / next) ── */
.pager {
  max-width: var(--content-max);
  margin: 2.6rem auto 0;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}
.pager a {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color .2s, background .2s, transform .2s;
  min-width: 0;
}
.pager a:hover { border-color: var(--violet); background: var(--surface-2); text-decoration: none; transform: translateY(-2px); }
.pager a.next { text-align: right; align-items: flex-end; }
.pager .p-dir { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.pager .p-title { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* ── Doc footer ── */
.doc-foot {
  max-width: var(--content-max);
  margin: 2.4rem auto 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.foot-mark { display: flex; align-items: center; gap: 0.55rem; font-family: var(--mono); font-size: 0.76rem; color: var(--dim); }
.edit-link { font-family: var(--mono); font-size: 0.76rem; color: var(--dim); }
.edit-link:hover { color: var(--violet); text-decoration: none; }

/* ── TOC (on this page) ── */
.toc {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 2.4rem 1.2rem 2rem 0.4rem;
  scrollbar-width: thin;
}
.toc-title {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim-2);
  margin-bottom: 0.8rem;
}
.toc-list { list-style: none; display: flex; flex-direction: column; gap: 1px; border-left: 1px solid var(--line); }
.toc-list a {
  display: block;
  padding: 0.24rem 0.8rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--dim);
  font-size: 0.8rem;
  line-height: 1.4;
  transition: color .15s, border-color .15s;
}
.toc-list a:hover { color: var(--text); text-decoration: none; }
.toc-list a.h3 { padding-left: 1.5rem; font-size: 0.78rem; }
.toc-list a.active { color: var(--violet); border-left-color: var(--violet); font-weight: 500; }

/* ── Search modal ── */
.search-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; }
.search-modal[hidden] { display: none; }
.search-backdrop { position: absolute; inset: 0; background: rgba(3,4,10,0.6); backdrop-filter: blur(4px); }
.search-box {
  position: relative;
  width: min(640px, 92vw);
  margin-top: 12vh;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: pop-in .18s ease;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }
.search-in { display: flex; align-items: center; gap: 0.7rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line); color: var(--dim); }
.search-in input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--body);
  font-size: 1rem;
}
.search-results { max-height: 52vh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0.4rem; }
.search-empty { padding: 1.4rem 1rem; color: var(--dim); font-size: 0.9rem; text-align: center; }
.sr-item {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
}
.sr-item:hover, .sr-item.sel { background: var(--surface-3); text-decoration: none; }
.sr-item .sr-crumb { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet); margin-bottom: 0.1rem; }
.sr-item .sr-title { font-weight: 600; font-size: 0.92rem; }
.sr-item .sr-snip { font-size: 0.8rem; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-item mark { background: color-mix(in srgb, var(--violet) 35%, transparent); color: var(--text); border-radius: 3px; padding: 0 1px; }
.search-hint { display: flex; gap: 1.1rem; padding: 0.6rem 1.1rem; border-top: 1px solid var(--line); color: var(--dim); font-size: 0.72rem; }
.search-hint span { display: flex; align-items: center; gap: 0.35rem; }

/* ── top scroll progress bar ── */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  z-index: 60;
  background: linear-gradient(90deg, var(--violet), var(--blue));
  transition: width .1s linear;
}

.noscript-note { padding: 6rem 2rem; text-align: center; font-family: var(--mono); color: var(--dim); }

/* skeleton while a page loads */
.skeleton { max-width: var(--content-max); margin: 0 auto; }
.skeleton .sk { background: var(--surface-2); border-radius: 8px; height: 1rem; margin-bottom: 0.9rem; animation: pulse 1.3s ease-in-out infinite; }
.skeleton .sk.t { height: 2.4rem; width: 55%; margin-bottom: 1.6rem; }
.skeleton .sk.w2 { width: 88%; } .skeleton .sk.w3 { width: 72%; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ═══════════ Responsive ═══════════ */
@media (max-width: 1200px) {
  .layout { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  :root { --side-w: 280px; }
  .menu-toggle { display: inline-flex; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    top: var(--topbar-h); left: 0;
    width: var(--side-w);
    /* explicit clamped height so the drawer is its own scroll container
       (height:auto + top/bottom does NOT clamp reliably) — dvh tracks the
       mobile browser chrome, vh is the fallback */
    height: calc(100vh - var(--topbar-h));
    height: calc(100dvh - var(--topbar-h));
    background: var(--bg-2);
    z-index: 45;
    transform: translateX(-105%);
    transition: transform .28s cubic-bezier(0.16,1,0.3,1);
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  /* pin the page so touch-scroll stays inside the drawer, not the background */
  body.scroll-locked { position: fixed; left: 0; right: 0; width: 100%; }
  .scrim { position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 44; background: rgba(3,4,10,0.5); opacity: 0; pointer-events: none; transition: opacity .28s; -webkit-tap-highlight-color: transparent; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .search-trigger { min-width: 0; flex: 1; margin-left: 0.4rem; }
  .search-trigger span { display: none; }
  .top-link { display: none; }
}
@media (min-width: 901px) { .scrim { display: none; } }
@media (max-width: 520px) {
  .brand-name { display: none; }
  .pill:not(.ver-select) { display: none; }  /* keep the version dropdown reachable on phones */
  .content { padding: 1.6rem 1.1rem 3rem; }
  .pager { flex-direction: column; }
}
