/* Funox Docs — lives inside the landing page. /styles.css supplies the tokens,
   the header and the footer; everything here is prefixed .docs- so the two
   stylesheets never collide. */

:root {
  --docs-nav-h: 71px;
  --docs-bar-h: 48px;
  --docs-body: #3a4a68;
  --docs-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

html { scroll-padding-top: calc(var(--docs-nav-h) + var(--docs-bar-h) + 20px); }

/* `hidden` on both html and body turns body into a scroll box, which stops
   position: sticky from working. */
body, body.nav-open { overflow: visible; overflow-x: clip; }
html.docs-lock { overflow: hidden; }

nav ul a[aria-current="page"] { color: var(--primary); }

.docs-page svg { flex-shrink: 0; }
:where(.docs-page) button { font: inherit; cursor: pointer; }
.docs-wrap :focus-visible,
.docs-bar :focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 8px; }

.docs-skip {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  padding: 10px 20px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 14px; font-weight: 800;
}
.docs-skip:focus { top: 12px; }

/* ── Page frame ──────────────────────────────────────────── */

.docs-wrap {
  position: relative;
  background: linear-gradient(180deg, var(--bg-alt) 0, var(--bg) 320px);
}
.docs-glow {
  position: absolute; inset: 0 0 auto; height: 380px;
  overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 35%, transparent);
  mask-image: linear-gradient(#000 35%, transparent);
}
.docs-glow::before,
.docs-glow::after {
  content: '';
  position: absolute; width: 440px; height: 440px; border-radius: 50%;
  filter: blur(70px);
}
.docs-glow::before { top: -250px; right: -120px; background: linear-gradient(135deg, var(--primary), #66c2ff); opacity: 0.26; }
.docs-glow::after { top: -300px; left: -170px; background: linear-gradient(135deg, var(--accent), #ff8a4c); opacity: 0.18; }

.docs-shell {
  position: relative;
  display: grid; grid-template-columns: 280px minmax(0, 1fr) 216px; gap: 48px; align-items: start;
  max-width: 1440px; margin: 0 auto; padding: 36px 48px 80px;
}

/* ── Sidebar ─────────────────────────────────────────────── */

.docs-sidebar {
  position: sticky; top: calc(var(--docs-nav-h) + var(--docs-bar-h) + 24px); z-index: 5;
  display: flex; flex-direction: column;
  max-height: calc(100vh - var(--docs-nav-h) - var(--docs-bar-h) - 48px);
  padding: 14px;
  background: #fff; border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow);
}
.docs-sidebar-head { display: none; }

.docs-search {
  position: relative; flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  height: 46px; margin-bottom: 14px; padding: 0 12px 0 16px;
  background: #fff; border: 2px solid var(--border); border-radius: 999px; color: var(--muted);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.docs-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(26,140,255,0.14); }
.docs-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 15px; font-weight: 700; color: var(--text);
}
.docs-wrap .docs-search input:focus-visible { outline: 0; }
.docs-search input::placeholder { color: var(--muted); font-weight: 600; }
.docs-search input::-webkit-search-cancel-button { display: none; }
.docs-search kbd {
  padding: 2px 8px; border-radius: 6px; background: var(--bg-alt);
  font-family: var(--docs-mono); font-size: 11px; font-weight: 500; color: var(--muted);
}
.docs-search:focus-within kbd { display: none; }

.docs-results {
  position: absolute; top: calc(100% + 10px); left: -2px; z-index: 60;
  width: min(440px, calc(100vw - 32px)); max-height: min(70vh, 480px); overflow-y: auto;
  padding: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.docs-hit { display: block; padding: 10px 12px; border-radius: 12px; }
.docs-hit:hover, .docs-hit.sel { background: var(--bg-alt); }
.docs-hit-meta { display: block; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--primary); }
.docs-hit-title { display: block; font-size: 15px; font-weight: 800; color: var(--text); }
.docs-hit-text { display: block; margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.docs-hit mark { background: transparent; color: var(--primary-dark); font-weight: 800; }
.docs-empty { padding: 16px 12px; font-size: 14px; font-weight: 600; color: var(--muted); }

.docs-nav {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  margin-right: -8px; padding: 4px 8px 32px 0;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 28px), transparent);
}
.docs-nav-section { margin-bottom: 20px; }
.docs-nav-section:last-child { margin-bottom: 8px; }
.docs-nav-group { margin-bottom: 4px; }
.docs-nav-label {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; padding: 0 12px;
  font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text);
}
.docs-nav-label svg { color: var(--primary); }
.docs-nav-toggle {
  width: 100%; margin-bottom: 0; padding: 10px 12px; border: 0; border-radius: 10px;
  background: transparent; text-align: left;
  transition: background 0.2s;
}
.docs-nav-toggle:hover { background: var(--bg-alt); }
.docs-nav-toggle span { flex: 1; }
.docs-nav-toggle svg:last-child { color: var(--muted); transform: rotate(90deg); transition: transform 0.3s cubic-bezier(.2,.7,.2,1); }
.docs-nav-group.open .docs-nav-toggle svg:last-child { transform: none; }
.docs-nav-fold { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s cubic-bezier(.2,.7,.2,1); }
.docs-nav-group.open .docs-nav-fold { grid-template-rows: 1fr; }
.docs-nav.static .docs-nav-fold { transition: none; }
.docs-nav-items { min-height: 0; overflow: hidden; }
.docs-nav-group.open .docs-nav-items { padding: 2px 0 10px; }
.docs-nav-item {
  display: block; margin-bottom: 2px; padding: 8px 12px; border-radius: 10px;
  font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.docs-nav-item:hover { background: var(--bg-alt); color: var(--text); }
.docs-nav-item.active { background: var(--bg-alt); color: var(--primary-dark); font-weight: 800; }

.docs-home {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 14px 12px 4px; border-top: 1px dashed var(--border);
  font-size: 14px; font-weight: 800; color: var(--text);
  transition: color 0.2s;
}
.docs-home svg { transition: transform 0.25s cubic-bezier(.2,.7,.2,1); }
.docs-home:hover { color: var(--primary); }
.docs-home:hover svg { transform: translateX(-3px); }

/* ── Secondary header: quick links ───────────────────────── */

.docs-bar {
  position: sticky; top: var(--docs-nav-h); z-index: 50;
  display: flex; align-items: center; gap: 8px;
  height: var(--docs-bar-h); padding: 0 48px;
  background: rgba(255,255,255,0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.docs-quick { display: flex; align-items: center; gap: 4px; min-width: 0; }
.docs-quick-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px;
  font-size: 14.5px; font-weight: 800; color: var(--muted); white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.docs-quick-link:hover { background: var(--bg-alt); color: var(--text); }
.docs-quick-link.active { background: var(--bg-alt); color: var(--primary-dark); }
.docs-menu-btn, .docs-search-btn { display: none; }

.docs-overlay {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(10,26,61,0.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}

/* ── Article ─────────────────────────────────────────────── */

.docs-main { min-width: 0; max-width: 780px; }

.docs-crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 14px;
  font-size: 13px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted);
}
.docs-crumbs a { transition: color 0.2s; }
.docs-crumbs a:hover { color: var(--primary); }
.docs-crumbs svg { opacity: 0.55; }
.docs-crumbs .current { color: var(--primary); }

.docs-article { font-size: 16px; line-height: 1.7; color: var(--docs-body); overflow-wrap: break-word; }
.docs-article > :first-child { margin-top: 0; }
.docs-article > :last-child { margin-bottom: 0; }

.docs-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 16px; }
.docs-article h1 { flex: 1 1 320px; min-width: 0; font-size: clamp(30px, 3.6vw, 42px); font-weight: 900; line-height: 1.1; letter-spacing: -1px; color: var(--text); }
.docs-article h2 { margin: 44px 0 14px; padding-top: 30px; border-top: 1px solid var(--border); font-size: 26px; font-weight: 900; line-height: 1.2; letter-spacing: -0.5px; color: var(--text); }
.docs-article h3 { margin: 30px 0 10px; font-size: 19px; font-weight: 800; line-height: 1.3; color: var(--text); }
.docs-article h4 { margin: 24px 0 8px; font-size: 16px; font-weight: 800; color: var(--text); }
.docs-article :is(h2, h3, h4) { position: relative; }
.docs-anchor { position: absolute; left: -0.9em; padding-right: 0.3em; color: var(--border); font-weight: 700; opacity: 0; transition: opacity 0.2s, color 0.2s; }
.docs-article :is(h2, h3, h4):hover .docs-anchor, .docs-anchor:focus-visible { opacity: 1; }
.docs-anchor:hover { color: var(--primary); }

.docs-article p { margin-bottom: 16px; }
.docs-ai + p { font-size: 18px; color: var(--muted); }
.docs-article strong { font-weight: 800; color: var(--text); }
.docs-article a:not(.docs-anchor) {
  color: var(--primary-dark); font-weight: 700;
  text-decoration: underline; text-decoration-color: rgba(26,140,255,0.35); text-decoration-thickness: 2px; text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}
.docs-article a:not(.docs-anchor):hover { text-decoration-color: var(--primary); }

.docs-article ul, .docs-article ol { margin-bottom: 16px; padding-left: 24px; }
.docs-article li { margin-bottom: 6px; }
.docs-article ul > li::marker { color: var(--primary); }
.docs-article ol > li::marker { color: var(--primary-dark); font-weight: 800; }
.docs-article li > ul, .docs-article li > ol { margin: 6px 0 0; }
.docs-article li > p { margin-bottom: 6px; }
.docs-article ul:has(> li > input[type="checkbox"]) { padding-left: 2px; list-style: none; }
.docs-article li > input[type="checkbox"] { width: 16px; height: 16px; margin-right: 10px; vertical-align: -2px; accent-color: var(--primary); }

.docs-article hr { margin: 32px 0; border: 0; border-top: 1px solid var(--border); }
.docs-article blockquote { margin-bottom: 16px; padding: 4px 18px; border-left: 4px solid var(--primary); color: var(--muted); }

.docs-article :not(pre) > code {
  padding: 2px 7px; border-radius: 6px; background: var(--bg-alt); color: var(--navy);
  font-family: var(--docs-mono); font-size: 0.85em; font-weight: 500; letter-spacing: 0;
  overflow-wrap: anywhere;
}
.docs-article a code { color: inherit; }

.docs-code { margin-bottom: 22px; border-radius: 16px; background: var(--navy); box-shadow: var(--shadow); overflow: hidden; }
.docs-code-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 18px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.docs-code-lang { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(255,255,255,0.55); }
.docs-copy {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border: 0; border-radius: 999px;
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.85);
  font-size: 12px; font-weight: 800;
  transition: background 0.2s, color 0.2s;
}
.docs-copy:hover { background: var(--primary); color: #fff; }
.docs-copy.done { background: rgba(45,212,167,0.18); color: var(--green); }
.docs-code pre { padding: 16px 18px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.2) transparent; }
.docs-code code { font-family: var(--docs-mono); font-size: 13.5px; line-height: 1.7; color: #e6eefc; white-space: pre; tab-size: 2; }

.hljs-keyword, .hljs-built_in, .hljs-type, .hljs-selector-tag, .hljs-doctag { color: #7cc4ff; }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-meta .hljs-string { color: #5ee6c0; }
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet { color: #ffc83d; }
.hljs-comment, .hljs-quote, .hljs-meta { color: #7f93b8; font-style: italic; }
.hljs-title, .hljs-section, .hljs-name, .hljs-selector-id, .hljs-selector-class { color: #f9a8d4; }
.hljs-attr, .hljs-attribute, .hljs-property, .hljs-variable, .hljs-template-variable, .hljs-params { color: #c4b5fd; }
.hljs-deletion { color: #ff8a8a; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

.docs-table { margin-bottom: 22px; border: 1px solid var(--border); border-radius: 16px; overflow-x: auto; }
.docs-article table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.docs-article th { padding: 12px 16px; background: var(--bg-alt); text-align: left; font-size: 12px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.docs-article td { padding: 12px 16px; border-top: 1px solid var(--border); vertical-align: top; }
.docs-article td:first-child { color: var(--text); font-weight: 600; }
.docs-article th code { text-transform: none; }
.docs-article :is(td, th) code { white-space: nowrap; }
.docs-article td code { background: var(--bg-alt); }
.docs-article th code { background: #fff; }

.docs-callout {
  --c: var(--primary-dark); --c-bg: var(--bg-alt); --c-line: rgba(26,140,255,0.25);
  margin-bottom: 22px; padding: 16px 20px;
  background: var(--c-bg); border: 1px solid var(--c-line); border-radius: 16px;
}
.docs-callout-tip { --c: #0b8f6c; --c-bg: rgba(45,212,167,0.10); --c-line: rgba(45,212,167,0.4); }
.docs-callout-warning { --c: #a35f00; --c-bg: rgba(255,200,61,0.16); --c-line: rgba(255,200,61,0.6); }
.docs-callout-danger { --c: #c62828; --c-bg: rgba(239,68,68,0.08); --c-line: rgba(239,68,68,0.3); }
.docs-callout-title { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; font-weight: 800; color: var(--c); }
.docs-callout > :last-child { margin-bottom: 0; }
.docs-callout p, .docs-callout li { font-size: 15px; }
.docs-callout :not(pre) > code { background: rgba(255,255,255,0.75); }

/* ── AI Summary ──────────────────────────────────────────── */

.docs-ai-btn {
  position: relative; isolation: isolate; overflow: hidden; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px 6px 7px; border: 2px solid transparent; border-radius: 999px;
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(135deg, var(--primary), #8b5cf6, #ec4899, var(--accent)) border-box;
  color: var(--text); font-size: 14px; font-weight: 800; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(26,140,255,0.18);
  transition: transform 0.25s cubic-bezier(.2,.7,.2,1), box-shadow 0.25s;
}
.docs-ai-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(26,140,255,0.28); }
.docs-ai-spark {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b5cf6); color: #fff;
}
.docs-ai-btn.attract .docs-ai-spark { animation: docs-ai-twinkle 2.4s ease-in-out infinite; }
.docs-ai-btn.attract::after {
  content: ''; position: absolute; top: 0; left: 0; z-index: -1;
  width: 40%; height: 100%; pointer-events: none;
  background: linear-gradient(120deg, transparent, rgba(26,140,255,0.2), transparent);
  animation: docs-ai-shine 3.2s ease-in-out infinite;
}
@keyframes docs-ai-twinkle { 50% { transform: rotate(10deg) scale(1.1); } }
@keyframes docs-ai-shine {
  0% { transform: translateX(-200%) skewX(-20deg); }
  55%, 100% { transform: translateX(420%) skewX(-20deg); }
}

.docs-ai { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s cubic-bezier(.2,.7,.2,1), margin 0.35s; }
.docs-ai.open { grid-template-rows: 1fr; margin-bottom: 24px; }
.docs-ai-card {
  min-height: 0; overflow: hidden;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  opacity: 0; transition: opacity 0.25s;
}
.docs-ai.open .docs-ai-card { opacity: 1; }
.docs-ai-card p { margin: 0; }

.docs-ai-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 14px 8px 18px; }
.docs-ai-badge {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6); color: #fff;
}
.docs-ai-heading { flex: 1; min-width: 0; }
.docs-ai-title { font-size: 16px; font-weight: 800; line-height: 1.3; color: var(--text); }
.docs-ai-sub { font-size: 13px; line-height: 1.4; color: var(--muted); }
.docs-ai-actions { flex-shrink: 0; display: flex; gap: 2px; }
.docs-ai-act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.docs-ai-act[hidden] { display: none; }
.docs-ai-act:hover { background: var(--bg-alt); color: var(--primary-dark); }
.docs-ai-act span { display: flex; }
.docs-ai-act .ok, .docs-ai-act.done .cp { display: none; }
.docs-ai-act.done .ok { display: flex; color: #0b8f6c; }

.docs-ai-body { min-height: 76px; padding: 6px 18px 16px; font-size: 15px; line-height: 1.6; }
.docs-ai-card .docs-ai-text p { margin-bottom: 8px; }
.docs-ai-card .docs-ai-text ul { margin-bottom: 0; }
.docs-ai-card .docs-ai-text > :last-child { margin-bottom: 0; }
.docs-ai-skel { display: flex; flex-direction: column; gap: 10px; padding: 6px 0; }
.docs-ai-skel span {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(26,140,255,0.08), rgba(26,140,255,0.22), rgba(26,140,255,0.08)); background-size: 200% 100%;
  animation: docs-ai-shimmer 1.4s linear infinite;
}
.docs-ai-cursor {
  display: inline-block; width: 6px; height: 1em; margin-left: 3px; border-radius: 2px;
  background: var(--primary); vertical-align: text-bottom;
  animation: docs-ai-blink 1s steps(2) infinite;
}
@keyframes docs-ai-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes docs-ai-blink { 50% { opacity: 0; } }
.docs-ai-error { padding: 12px 14px; border: 1px solid rgba(239,68,68,0.3); border-radius: 12px; background: rgba(239,68,68,0.08); font-size: 14px; }
.docs-ai-error strong { display: block; color: #c62828; }
.docs-ai-card .docs-ai-note { padding: 10px 18px 12px; border-top: 1px dashed var(--border); font-size: 12px; line-height: 1.5; color: var(--muted); }

/* ── Pager, closing card, table of contents ──────────────── */

.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.docs-pager-card {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 18px 22px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), border-color 0.35s, box-shadow 0.35s;
}
.docs-pager-card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 20px 48px rgba(10,26,61,0.10); }
.docs-pager-card.next { align-items: flex-end; text-align: right; }
.docs-pager-dir { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.docs-pager-title { max-width: 100%; font-size: 17px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color 0.2s; }
.docs-pager-card:hover .docs-pager-title { color: var(--primary); }

.docs-cta {
  position: relative; overflow: hidden;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px;
  margin-top: 28px; padding: 30px 34px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--navy) 100%);
  border-radius: 24px; box-shadow: 0 24px 60px rgba(26,140,255,0.22); color: #fff;
}
.docs-cta::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.08) 1px, transparent 0); background-size: 24px 24px;
}
.docs-cta > * { position: relative; }
.docs-cta-text { flex: 1 1 260px; }
.docs-cta-title { margin-bottom: 4px; font-size: 24px; font-weight: 900; line-height: 1.2; letter-spacing: -0.5px; }
.docs-cta-sub { font-size: 15px; opacity: 0.92; }
.docs-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.docs-cta .btn { padding: 12px 24px; font-size: 14.5px; white-space: nowrap; }
.docs-cta .btn-primary { background: #fff; color: var(--primary); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.docs-cta .btn-primary:hover { background: var(--bg-alt); color: var(--primary-dark); }
.docs-cta .btn-ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.4); }
.docs-cta .btn-ghost:hover { box-shadow: inset 0 0 0 2px #fff; transform: translateY(-2px); }

.docs-toc {
  position: sticky; top: calc(var(--docs-nav-h) + var(--docs-bar-h) + 24px);
  max-height: calc(100vh - var(--docs-nav-h) - var(--docs-bar-h) - 48px); overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.docs-toc-title { margin-bottom: 12px; font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text); }
.docs-toc-link {
  display: block; padding: 5px 0 5px 16px; border-left: 2px solid var(--border);
  font-size: 13.5px; font-weight: 600; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere;
  transition: color 0.2s, border-color 0.2s;
}
.docs-toc-link.l3 { padding-left: 28px; }
.docs-toc-link:hover { color: var(--text); }
.docs-toc-link.active { border-left-color: var(--primary); color: var(--primary-dark); font-weight: 800; }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 1180px) {
  .docs-shell { grid-template-columns: 264px minmax(0, 1fr); gap: 40px; }
  .docs-toc { display: none; }
}

@media (max-width: 900px) {
  :root { --docs-nav-h: 65px; --docs-bar-h: 52px; }

  .docs-bar { padding: 0 12px; }
  .docs-menu-btn, .docs-search-btn {
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border: 0; border-radius: 12px;
    background: var(--bg-alt); color: var(--primary-dark);
  }
  .docs-quick {
    flex: 1; padding: 0 16px 0 4px;
    overflow-x: auto; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6px, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6px, #000 calc(100% - 24px), transparent);
  }
  .docs-quick::-webkit-scrollbar { display: none; }
  .docs-quick-link { padding: 7px 12px; font-size: 14px; }
  .docs-quick-link svg { display: none; }

  .docs-shell { display: block; padding: 26px 20px 56px; }
  .docs-main { max-width: none; }

  .docs-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 130;
    width: min(88vw, 340px); max-height: none;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    border: 0; border-radius: 0 24px 24px 0; box-shadow: var(--shadow-lg);
    transform: translateX(-105%); visibility: hidden;
    transition: transform 0.35s cubic-bezier(.2,.7,.2,1), visibility 0s 0.35s;
  }
  body.docs-menu-open .docs-sidebar { transform: none; visibility: visible; transition-delay: 0s; }
  body.docs-menu-open .docs-overlay { opacity: 1; pointer-events: auto; }

  .docs-sidebar-head {
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px; padding-left: 4px;
    font-size: 18px; font-weight: 900; letter-spacing: -0.3px; color: var(--text);
  }
  .docs-close {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 0; border-radius: 12px;
    background: var(--bg-alt); color: var(--text);
  }
  .docs-results { width: 100%; left: 0; }
  .docs-search kbd { display: none; }
  .docs-nav-item { padding: 10px 12px; }
  .docs-home { padding-bottom: 8px; }

  .docs-crumbs { font-size: 12px; letter-spacing: 1.2px; }
  .docs-article { font-size: 15.5px; }
  .docs-article h1 { letter-spacing: -0.8px; }
  .docs-ai + p { font-size: 16.5px; }
  .docs-article h2 { margin-top: 36px; padding-top: 26px; font-size: 22px; }
  .docs-article h3 { font-size: 18px; }
  .docs-anchor { display: none; }
  .docs-code { border-radius: 14px; }
  .docs-code code { font-size: 13px; }
  .docs-article table:has(th:nth-child(3)) { min-width: 520px; }

  .docs-pager { grid-template-columns: 1fr; gap: 12px; margin-top: 36px; }
  .docs-pager-card.next { align-items: flex-start; text-align: left; }
  .docs-cta { padding: 26px 22px; border-radius: 22px; }
  .docs-cta-title { font-size: 21px; }
  .docs-cta-actions { width: 100%; }
  .docs-cta .btn { flex: 1 1 auto; text-align: center; }
}

@media (max-width: 480px) {
  .docs-shell { padding: 22px 14px 48px; }
}

@media print {
  body > nav, .nav-overlay, .docs-bar, .docs-overlay, .docs-sidebar, .docs-toc, .docs-pager, .docs-cta, .docs-copy, .docs-glow, .docs-ai-btn, .docs-ai, body > footer { display: none !important; }
  .docs-wrap { background: none; }
  .docs-shell { display: block; padding: 0; }
  .docs-code { box-shadow: none; }
}
