:root {
  --fg: #0f172a;
  --fg-strong: #020617;
  --muted: #64748b;
  --subtle: #94a3b8;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --code-bg: #f8fafc;
  --code-fg: #0f172a;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --sidebar-width: 264px;
  --content-width: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e2e8f0;
    --fg-strong: #f8fafc;
    --muted: #94a3b8;
    --subtle: #64748b;
    --bg: #0b0e14;
    --bg-soft: #0f131b;
    --border: #1e2530;
    --border-strong: #2a3340;
    --accent: #60a5fa;
    --accent-soft: rgba(96, 165, 250, .12);
    --code-bg: #0f131b;
    --code-fg: #e2e8f0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 0;
}
html, body { margin: 0; padding: 0; }
section { scroll-margin-top: 32px; min-width: 0; }
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* Sidebar */
aside {
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  padding: 32px 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
aside .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  min-height: 38px;
}
aside .brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  color: var(--fg-strong);
}
aside .menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 38px; height: 38px;
  flex: 0 0 38px;
  padding: 0;
  cursor: pointer;
  color: var(--fg-strong);
  align-items: center;
  justify-content: center;
  outline: none;
}
aside .menu-toggle:hover { background: rgba(127, 127, 127, .08); }
aside .menu-toggle:focus-visible { box-shadow: 0 0 0 2px var(--accent-soft); }
aside .menu-toggle svg { display: block; }
aside .menu-toggle .icon-close { display: none; }
aside.open .menu-toggle .icon-open { display: none; }
aside.open .menu-toggle .icon-close { display: block; }
aside .brand-mark { width: 32px; height: 32px; display: block; }
aside .brand-mark img { width: 100%; height: 100%; display: block; }
aside .brand-name {
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -.01em;
}
aside .brand-sub {
  display: block;
  font-weight: 400;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .01em;
  margin-top: 1px;
}
aside .nav-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--subtle);
  margin: 0 0 10px 10px;
}
aside ul { list-style: none; padding: 0; margin: 0; }
aside li { margin: 1px 0; }
aside a {
  display: block;
  padding: 7px 11px;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 450;
  transition: color .12s ease, background-color .12s ease;
}
aside a:hover {
  color: var(--fg-strong);
  background: rgba(127, 127, 127, .06);
}
aside a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 550;
}
aside .foot {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}
aside .foot .endpoint-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--subtle);
  margin-bottom: 6px;
}
aside .foot code {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
  color: var(--fg-strong);
}
aside .foot .links { margin-top: 14px; }
aside .foot a { display: inline; padding: 0; color: var(--muted); }
aside .foot a:hover { color: var(--accent); background: none; }

/* Main content */
main {
  padding: 32px 72px 96px;
  max-width: calc(var(--content-width) + 144px);
  min-width: 0;
  overflow-x: hidden;
}
main > :first-child { margin-top: 0; }

/* Typography */
main h1 {
  font-size: 36px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--fg-strong);
  margin: 0 0 14px;
}
main .lead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 36px;
}
main h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--fg-strong);
  margin: 48px 0 14px;
  padding-top: 4px;
}
main h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--fg-strong);
  margin: 28px 0 10px;
}
main p { margin: 14px 0; }
main ul, main ol { padding-left: 22px; margin: 14px 0; }
main li { margin: 6px 0; }
main li::marker { color: var(--subtle); }
main a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .12s ease;
}
main a:hover { border-bottom-color: currentColor; }
main strong { color: var(--fg-strong); font-weight: 600; }
main hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }

/* Inline code */
main :not(pre) > code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 1.5px 6px;
  border-radius: 5px;
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--fg-strong);
}

/* Code blocks */
main pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 16px 18px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 18px 0;
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.6;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
main pre code { white-space: pre; word-break: normal; }
main pre code {
  background: none;
  border: none;
  padding: 0;
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;
  color: var(--code-fg);
}

/* Tables */
main table {
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0;
  width: 100%;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
  display: block;
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}
main table thead, main table tbody { display: table; width: 100%; }
main th, main td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
main tr:last-child td { border-bottom: none; }
main th {
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--fg-strong);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
main td code { font-size: 12.5px; }
main td.center, main th.center { text-align: center; }

/* Blockquote — used for example prompts */
main blockquote {
  position: relative;
  margin: 10px 0;
  padding: 10px 16px 10px 42px;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14.5px;
  line-height: 1.55;
}
main blockquote::before {
  content: "\201C";
  position: absolute;
  left: 14px;
  top: 4px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--subtle);
}
main blockquote p { margin: 0; }
main blockquote + blockquote { margin-top: 6px; }

/* Responsive */
@media (max-width: 1080px) and (min-width: 861px) {
  main { padding: 32px 48px 80px; }
}

@media (max-width: 860px) {
  body { grid-template-columns: 1fr; }
  aside {
    position: sticky;
    top: 0;
    height: auto;
    padding: 14px 20px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow: visible;
    z-index: 10;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(248, 250, 252, .9);
  }
  @media (prefers-color-scheme: dark) {
    aside { background: rgba(15, 19, 27, .9); }
  }
  aside .bar { margin-bottom: 0; }
  aside .menu-toggle { display: inline-flex; }
  aside .nav-label,
  aside ul.nav { display: none; }
  aside.open .nav-label {
    display: block;
    margin: 14px 0 8px 4px;
  }
  aside.open ul.nav {
    display: block;
    padding-bottom: 6px;
  }
  aside.open li { margin: 2px 0; }
  aside.open a {
    padding: 9px 12px;
    font-size: 14.5px;
  }

  main { padding: 28px 24px 64px; }
  main h1 { font-size: 28px; }
  html { scroll-padding-top: 80px; }
  section { scroll-margin-top: 80px; }
}
