/* ==========================================================================
   agent-brain site design system
   Shared by site/index.html and site/docs/index.html.
   Theme: :root holds light tokens; a prefers-color-scheme block supplies dark
   tokens unless the user has forced light; [data-theme="dark"] always wins.
   No external requests: system fonts only, no images, no CDNs.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;

  /* Light theme tokens */
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-alt: #f1f5f9;
  --card-bg: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --text-faint: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #0f766e;
  --accent-solid: #0d9488;
  --accent-hover: #115e59;
  --accent-soft: #ccfbf1;
  --ring: rgba(13, 148, 136, .45);
  --shadow: rgba(15, 23, 42, .08);
  --success: #15803d;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --note-bg: #f0fdfa;
  --note-border: #99f6e4;
  --tip-bg: #f0fdf4;
  --tip-border: #bbf7d0;

  /* Code blocks are a fixed dark "terminal" surface in both themes. */
  --code-bg: #0d1117;
  --code-border: #30363d;
  --code-text: #e6edf3;
  --code-muted: #8b949e;
  --code-accent: #5eead4;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d12;
    --surface: #12141b;
    --surface-alt: #171922;
    --card-bg: #14161d;
    --text: #e5e7eb;
    --text-muted: #9aa4b2;
    --text-faint: #7d8896;
    --border: #23262f;
    --border-strong: #33363f;
    --accent: #5eead4;
    --accent-solid: #14b8a6;
    --accent-hover: #99f6e4;
    --accent-soft: #102b29;
    --ring: rgba(94, 234, 212, .5);
    --shadow: rgba(0, 0, 0, .45);
    --success: #4ade80;
    --warn: #fbbf24;
    --warn-bg: #23200f;
    --warn-border: #46390f;
    --note-bg: #0c1f1d;
    --note-border: #1d4a45;
    --tip-bg: #0f1f16;
    --tip-border: #1c4a2e;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0d12;
  --surface: #12141b;
  --surface-alt: #171922;
  --card-bg: #14161d;
  --text: #e5e7eb;
  --text-muted: #9aa4b2;
  --text-faint: #7d8896;
  --border: #23262f;
  --border-strong: #33363f;
  --accent: #5eead4;
  --accent-solid: #14b8a6;
  --accent-hover: #99f6e4;
  --accent-soft: #102b29;
  --ring: rgba(94, 234, 212, .5);
  --shadow: rgba(0, 0, 0, .45);
  --success: #4ade80;
  --warn: #fbbf24;
  --warn-bg: #23200f;
  --warn-border: #46390f;
  --note-bg: #0c1f1d;
  --note-border: #1d4a45;
  --tip-bg: #0f1f16;
  --tip-border: #1c4a2e;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

img { max-width: 100%; height: auto; display: block; }
svg { max-width: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--accent-hover); }
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
input:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 3px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--accent-solid); color: #fff;
  padding: .6rem 1rem; border-radius: 6px; z-index: 100;
  transition: top .15s ease;
}
.skip-link:focus { top: 1rem; }

/* --------------------------------------------------------------------------
   Layout containers
   -------------------------------------------------------------------------- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section { padding: 4.5rem 0; }
.section-tight { padding: 2.5rem 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
@media (max-width: 640px) {
  .section { padding: 3rem 0; }
}

.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .75rem;
}

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.01em; line-height: 1.2; margin: 0 0 1rem; }
h1 { font-size: clamp(2rem, 1.5rem + 2vw, 3.1rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 1.3rem + 1vw, 2.1rem); margin-top: 0; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1rem; color: var(--text); }
.lede { font-size: 1.2rem; color: var(--text-muted); max-width: 640px; }
.text-muted { color: var(--text-muted); }
.center { text-align: center; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font: inherit; font-weight: 600; font-size: .95rem;
  padding: .7rem 1.3rem; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-solid); color: #fff; border-color: var(--accent-solid); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-row { display: flex; gap: .85rem; flex-wrap: wrap; align-items: center; }

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(8px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .85rem 0; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--text); }
.brand svg { width: 26px; height: 26px; flex: none; }

.main-nav { display: flex; align-items: center; gap: 1.6rem; }
.main-nav a { color: var(--text-muted); font-weight: 600; font-size: .93rem; }
.main-nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: .6rem; }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--border-strong); border-radius: 6px;
  width: 38px; height: 38px; cursor: pointer; color: var(--text);
  align-items: center; justify-content: center;
}
/* Theme toggle needs JS to do anything, so it's hidden without JS
   (the page still honors prefers-color-scheme automatically). */
.theme-toggle { display: none; }
.js .theme-toggle {
  background: none; border: 1px solid var(--border-strong); border-radius: 6px;
  width: 38px; height: 38px; cursor: pointer; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

@media (max-width: 860px) {
  /* Without JS: nav flows inline below the header row, always visible. */
  .main-nav {
    position: static; display: flex; flex-direction: row; flex-wrap: wrap;
    gap: .4rem 1.25rem; width: 100%; padding: .5rem 0 0; border-bottom: 0;
    background: none;
  }
  .main-nav a { width: auto; padding: .2rem 0; border-bottom: 0; }

  /* With JS: collapse the nav behind the toggle button. */
  .js .nav-toggle { display: inline-flex; }
  .js .main-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: flex-start; gap: 0;
    padding: .5rem 1.5rem 1rem; display: none;
  }
  .js .main-nav.is-open { display: flex; }
  .js .main-nav a { padding: .6rem 0; width: 100%; border-bottom: 1px solid var(--border); }
  .js .main-nav a:last-child { border-bottom: none; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { padding: 4.5rem 0 3.5rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 3rem; align-items: center; }
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
}
.hero h1 { margin-bottom: 1rem; }
.hero-cta { margin-top: 1.75rem; }

/* Terminal visual */
.terminal {
  background: var(--code-bg); border: 1px solid var(--code-border);
  border-radius: 10px; overflow: hidden; box-shadow: 0 20px 45px -25px var(--shadow);
  font-family: var(--font-mono); font-size: .84rem;
}
.terminal-bar { display: flex; gap: .4rem; padding: .65rem .8rem; border-bottom: 1px solid var(--code-border); }
.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: #4b5563; }
pre.terminal-body {
  margin: 0; padding: 1.1rem 1.2rem 1.3rem; color: var(--code-text); line-height: 1.65;
  overflow-x: auto; white-space: pre-wrap; word-break: break-word; font-family: var(--font-mono);
}
.terminal-body .prompt { color: var(--code-accent); }
.terminal-body .muted { color: var(--code-muted); }

/* --------------------------------------------------------------------------
   Latest-release badge (hero)
   -------------------------------------------------------------------------- */
.latest-badge {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  margin: 0 0 1.1rem; padding: .35rem .75rem;
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: 99px;
  font-size: .85rem; color: var(--text-muted);
}
.latest-badge-version { font-weight: 700; color: var(--text); font-family: var(--font-mono); }

/* --------------------------------------------------------------------------
   OS tabs (used for install commands)
   -------------------------------------------------------------------------- */
.tabs { margin: 0 0 .5rem; }
/* Without JS: hide the tablist (its buttons do nothing) and show each
   panel's own heading label instead. With JS: real tabs, labels hidden. */
[role="tablist"] { display: none; }
.js [role="tablist"] {
  display: flex; gap: 0; list-style: none; margin: 0 0 -1px; padding: 0;
  border-bottom: 1px solid var(--border);
}
[role="tab"] {
  background: none; border: none; font: inherit; font-weight: 600;
  color: var(--text-muted); padding: .55rem 1.1rem; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
[role="tab"]:hover { color: var(--text); }
[role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent-solid); }
[role="tabpanel"] { padding-top: .75rem; }
.js [role="tabpanel"][hidden] { display: none; }
.panel-label { font-size: 1rem; margin: 0 0 .5rem; }
.js .panel-label { display: none; }

/* --------------------------------------------------------------------------
   Code blocks
   -------------------------------------------------------------------------- */
/* The copy button lives in its own header bar above the code, never
   overlapping the command text (even mid-scroll on narrow viewports). */
.code-wrap {
  margin: 0 0 1.1rem; border: 1px solid var(--code-border); border-radius: 8px;
  overflow: hidden; background: var(--code-bg);
}
.code-head {
  display: none; align-items: center; justify-content: flex-end;
  padding: .4rem .55rem; border-bottom: 1px solid var(--code-border);
  background: #0a0d12;
}
.js .code-head { display: flex; }
.code-wrap pre {
  background: transparent; border: none; border-radius: 0;
  padding: .95rem 1.1rem; margin: 0; overflow-x: auto;
  font-size: .87rem; line-height: 1.55; color: var(--code-text);
}
.code-wrap code { font-family: var(--font-mono); white-space: pre; }
.copy-btn {
  display: none;
  /* Fixed dark-terminal-surface tokens, not theme tokens: this button always
     sits on the dark code header bar, which does not change with the page theme. */
  background: transparent; border: 1px solid var(--code-border); border-radius: 5px;
  padding: .25rem .6rem; font-size: .72rem; font-weight: 600; cursor: pointer;
  color: #c9d1d9; font-family: var(--font-sans);
}
.js .copy-btn { display: inline-flex; align-items: center; gap: .3rem; }
.copy-btn:hover { color: #fff; border-color: var(--code-accent); }
.copy-btn[data-copied="true"] { background: #238636; color: #fff; border-color: #238636; }
code.il {
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: 4px;
  padding: .12em .4em; font-size: .88em; font-family: var(--font-mono); color: var(--text);
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Feature grid
   -------------------------------------------------------------------------- */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 2.5rem; }
@media (max-width: 940px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .features-grid { grid-template-columns: 1fr; } }
.features-grid.features-grid-two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { .features-grid.features-grid-two { grid-template-columns: 1fr; } }
.feature-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.5rem; display: flex; flex-direction: column; gap: .6rem;
}
.feature-card .icon {
  width: 38px; height: 38px; border-radius: 8px; background: var(--accent-soft);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
}
.feature-card .icon svg { width: 20px; height: 20px; }
.feature-card h3 { margin: 0; font-size: 1.05rem; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: .92rem; }

/* --------------------------------------------------------------------------
   Steps (quick start)
   -------------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin: 2.5rem 0; counter-reset: step; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 1.4rem 1.2rem 1.2rem; border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); }
.step::before {
  counter-increment: step; content: counter(step);
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-solid); color: #fff; font-weight: 700; font-size: .85rem;
  margin-bottom: .85rem;
}
.step h3 { font-size: 1rem; margin: 0 0 .35rem; }
.step p { margin: 0; color: var(--text-muted); font-size: .9rem; }

.step-list { counter-reset: slist; list-style: none; margin: 1rem 0; padding: 0; }
.step-list li {
  position: relative; padding: 0 0 1.1rem 2.6rem; border-left: 2px solid var(--border);
  margin-left: .9rem;
}
.step-list li:last-child { border-color: transparent; padding-bottom: 0; }
.step-list li::before {
  counter-increment: slist; content: counter(slist);
  position: absolute; left: -.95rem; top: -.1rem;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-solid); color: #fff; font-weight: 700; font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
}
.step-list h4 { margin: 0 0 .25rem; font-size: .98rem; }
.step-list p { margin: 0; color: var(--text-muted); font-size: .92rem; }

/* --------------------------------------------------------------------------
   Two-column plan comparison (Free vs Pro)
   -------------------------------------------------------------------------- */
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 2.5rem; }
@media (max-width: 640px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.5rem; display: flex; flex-direction: column; gap: .6rem;
}
.plan-card h3 { margin: 0; font-size: 1.15rem; }
.plan-card .plan-tag { font-size: .8rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.plan-card ul { margin: .25rem 0 0; padding-left: 1.2rem; color: var(--text-muted); font-size: .93rem; }
.plan-card li { margin-bottom: .35rem; }

/* --------------------------------------------------------------------------
   Assistant list
   -------------------------------------------------------------------------- */
.assistant-list {
  list-style: none; margin: 2rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem;
}
@media (max-width: 760px) { .assistant-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .assistant-list { grid-template-columns: 1fr; } }
.assistant-list li {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px;
  padding: .75rem 1rem; font-weight: 600; font-size: .93rem;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .65rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--surface-alt); font-weight: 700; color: var(--text); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--surface); }
td code.il, th code.il { white-space: nowrap; }

/* --------------------------------------------------------------------------
   Requirements list
   -------------------------------------------------------------------------- */
.req-list { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: .5rem; }
.req-list li { position: relative; padding-left: 1.7rem; font-size: .95rem; line-height: 1.6; }
.req-list li svg { position: absolute; left: 0; top: .22em; width: 18px; height: 18px; color: var(--success); }

/* --------------------------------------------------------------------------
   Callouts
   -------------------------------------------------------------------------- */
.callout {
  border: 1px solid var(--border); border-left-width: 4px; border-radius: 8px;
  padding: .9rem 1.1rem; margin: 1.25rem 0; font-size: .93rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout .callout-label { display: block; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .3rem; }
.callout.note { background: var(--note-bg); border-color: var(--note-border); border-left-color: var(--accent-solid); }
.callout.note .callout-label { color: var(--accent); }
.callout.tip { background: var(--tip-bg); border-color: var(--tip-border); border-left-color: var(--success); }
.callout.tip .callout-label { color: var(--success); }
.callout.warn { background: var(--warn-bg); border-color: var(--warn-border); border-left-color: var(--warn); }
.callout.warn .callout-label { color: var(--warn); }

/* --------------------------------------------------------------------------
   Command reference list
   -------------------------------------------------------------------------- */
.cmd-ref { margin: 1rem 0; border-top: 1px solid var(--border); }
.cmd-ref-item { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--border); }
@media (max-width: 640px) { .cmd-ref-item { grid-template-columns: 1fr; gap: .3rem; } }
.cmd-ref-item code.il { white-space: normal; word-break: break-word; }
.cmd-ref-item p { margin: 0; color: var(--text-muted); font-size: .92rem; }

/* --------------------------------------------------------------------------
   FAQ (details/summary)
   -------------------------------------------------------------------------- */
.faq-list { border-top: 1px solid var(--border); margin: 1.5rem 0 0; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  cursor: pointer; font-weight: 600; padding: 1.1rem 0; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-weight: 400; font-size: 1.3rem; color: var(--text-faint); flex: none;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { color: var(--text-muted); padding-bottom: 1.1rem; margin: 0; }

/* --------------------------------------------------------------------------
   Anchor headings (self-links used throughout docs)
   -------------------------------------------------------------------------- */
main section[id], .docs-main section[id] { scroll-margin-top: 5.5rem; }
.anchor-heading { position: relative; scroll-margin-top: 5.5rem; }
.anchor-link {
  opacity: 0; margin-left: .4rem; font-weight: 400; color: var(--text-faint);
  text-decoration: none; font-size: .85em;
}
.anchor-heading:hover .anchor-link,
.anchor-link:focus-visible { opacity: 1; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding: 2.5rem 0 2rem; font-size: .85rem; color: var(--text-muted); }
.footer-top { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center; padding-bottom: 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer .disclaimer { max-width: 780px; }

/* --------------------------------------------------------------------------
   Docs layout
   -------------------------------------------------------------------------- */
.docs-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 3rem; align-items: start; padding: 2.5rem 0 4rem; }
@media (max-width: 940px) {
  .docs-shell { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
}
.docs-sidebar {
  position: sticky; top: 4.5rem; max-height: calc(100vh - 5rem); overflow-y: auto;
  padding-right: .5rem;
}
@media (max-width: 940px) {
  /* Without JS: the sidebar stays visible and open, just no longer sticky. */
  .docs-sidebar { position: static; max-height: none; display: block; border: 1px solid var(--border); border-radius: 8px; padding: .75rem 1rem; }
  /* With JS: collapse behind the "Contents" toggle button. */
  .js .docs-sidebar { display: none; }
  .js .docs-sidebar.is-open { display: block; }
}
.docs-toc-toggle {
  display: none; width: 100%; margin-bottom: 1rem; padding: .6rem .9rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  font: inherit; font-weight: 600; cursor: pointer; color: var(--text);
  align-items: center; justify-content: space-between;
}
@media (max-width: 940px) { .js .docs-toc-toggle { display: flex; } }
.docs-nav { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.docs-nav li + li { margin-top: .1rem; }
.docs-nav a {
  display: block; padding: .38rem .6rem; border-radius: 6px; color: var(--text-muted);
  border-left: 2px solid transparent;
}
.docs-nav a:hover { color: var(--text); text-decoration: none; background: var(--surface); }
.docs-nav a.is-active { color: var(--accent); border-left-color: var(--accent-solid); background: var(--accent-soft); font-weight: 600; }
.docs-main { min-width: 0; width: 100%; }
.docs-main section { padding-bottom: 3rem; margin-bottom: 3rem; border-bottom: 1px solid var(--border); }
.docs-main section:last-child { border-bottom: none; margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Landing page extras
   -------------------------------------------------------------------------- */
.hero-visual { min-width: 0; }
.hero-notes { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .45rem; color: var(--text-muted); font-size: .93rem; }
.hero-notes li { padding-left: 1.4rem; position: relative; }
.hero-notes li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-solid); }

.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
@media (max-width: 640px) { .stat-row { grid-template-columns: 1fr; } }
.stat-card { border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem 1.2rem; background: var(--card-bg); }
.stat-card strong { display: block; font-size: 1rem; margin-bottom: .3rem; }
.stat-card span { color: var(--text-muted); font-size: .9rem; }

.quickstart-cta { margin-top: 2rem; }
.section-head { max-width: 680px; }
.section-head p { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Docs extras
   -------------------------------------------------------------------------- */
.docs-main h2 { margin-top: 0; }
.docs-main h3 { margin-top: 2rem; }
.docs-main ul, .docs-main ol { padding-left: 1.3rem; color: var(--text); margin: 0 0 1rem; }
.docs-main li { margin-bottom: .4rem; }
.docs-main .lede { margin-bottom: 1.5rem; }
.docs-eyebrow { margin-bottom: .5rem; }
.docs-meta { color: var(--text-faint); font-size: .85rem; margin: 0 0 1.25rem; }
.docs-main .table-wrap { margin-top: .5rem; }
.docs-main .cmd-ref { margin-top: .5rem; }
