/* ========================================================================
   Media Luna Developer Documentation — Core Styles
   Modern, dark-first design inspired by Stripe/Vercel/Linear docs
   ======================================================================== */

/* ── CSS Custom Properties ─────────────────────────────────────────────── */
:root {
  /* Brand — shared with landing page */
  --ml-primary: #6366f1;
  --ml-primary-hover: #818cf8;
  --ml-primary-muted: rgba(99, 102, 241, 0.15);
  --ml-accent: #22d3ee;
  --ml-accent-muted: rgba(34, 211, 238, 0.15);
  --ml-success: #34d399;
  --ml-warning: #fbbf24;
  --ml-danger: #f87171;

  /* Dark theme (default) — aligned with landing page slate palette */
  --bg-root: #0F172A;
  --bg-surface: #1E293B;
  --bg-elevated: #334155;
  --bg-hover: #3b4c66;
  --bg-code: #0c1524;
  --bg-code-inline: rgba(99, 102, 241, 0.1);
  --bg-sidebar: #0F172A;
  --bg-panel: #162035;

  --border-primary: #334155;
  --border-hover: #475569;
  --border-focus: var(--ml-primary);

  --text-primary: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-tertiary: #94A3B8;
  --text-inverse: #0F172A;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;

  /* Sizing */
  --sidebar-width: 280px;
  --code-panel-width: 440px;
  --header-height: 60px;

  /* Motion */
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Elevation — matching landing page shadow style */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* Light theme — aligned with landing page */
[data-theme="light"] {
  --bg-root: #FFFFFF;
  --bg-surface: #F9FAFB;
  --bg-elevated: #F3F4F6;
  --bg-hover: #E5E7EB;
  --bg-code: #F3F4F6;
  --bg-code-inline: rgba(99, 102, 241, 0.08);
  --bg-sidebar: #FFFFFF;
  --bg-panel: #F9FAFB;

  --border-primary: #E5E7EB;
  --border-hover: #D1D5DB;

  --text-primary: #111827;
  --text-secondary: #374151;
  --text-tertiary: #6B7280;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.08);
}

/* ── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-root);
  color: var(--text-primary);
  line-height: 1.65;
  overflow-x: hidden;
}

a {
  color: var(--ml-primary-hover);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--ml-accent);
}

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

::selection {
  background: var(--ml-primary);
  color: white;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.35); }

/* ── Global Header ─────────────────────────────────────────────────────── */
.docs-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-primary);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 24px;
  transition: background 0.3s ease;
}

[data-theme="light"] .docs-header {
  background: rgba(255, 255, 255, 0.9);
}

.docs-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
}

.docs-header__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.docs-header__brand:hover {
  opacity: 0.8;
  color: var(--text-primary);
}

.docs-header__brand img {
  border-radius: 50%;
  width: 32px;
  height: 32px;
}

.docs-header__brand span {
  color: var(--text-primary);
}

.docs-header__nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
}

.docs-header__link {
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.docs-header__link:hover,
.docs-header__link.active {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.docs-header__link.active {
  color: var(--ml-primary-hover);
}

.docs-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.docs-header__search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  color: var(--text-tertiary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 220px;
}

.docs-header__search:hover {
  border-color: var(--border-hover);
}

.docs-header__search kbd {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-hover);
  border: 1px solid var(--border-primary);
  font-family: var(--font-sans);
  color: var(--text-tertiary);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ── Layout: Landing Page ──────────────────────────────────────────────── */
.docs-landing {
  min-height: 100vh;
  padding-top: var(--header-height);
}

.docs-hero {
  text-align: center;
  padding: 100px 24px 60px;
  position: relative;
  overflow: hidden;
}

.docs-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.docs-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 100px;
  background: var(--ml-primary-muted);
  color: var(--ml-primary-hover);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 24px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.docs-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.docs-hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* ── Card Grid ─────────────────────────────────────────────────────────── */
.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.docs-card {
  position: relative;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  transition: all var(--transition-base);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.docs-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
  color: inherit;
}

.docs-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.docs-card__icon svg {
  width: 24px;
  height: 24px;
}

.docs-card__icon--purple { background: var(--ml-primary-muted); color: var(--ml-primary-hover); }
.docs-card__icon--cyan { background: var(--ml-accent-muted); color: var(--ml-accent); }
.docs-card__icon--green { background: rgba(52, 211, 153, 0.15); color: var(--ml-success); }
.docs-card__icon--yellow { background: rgba(251, 191, 36, 0.15); color: var(--ml-warning); }
.docs-card__icon--red { background: rgba(248, 113, 113, 0.15); color: var(--ml-danger); }

.docs-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.docs-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.docs-card__arrow {
  margin-top: auto;
  color: var(--ml-primary-hover);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--transition-fast);
}

.docs-card:hover .docs-card__arrow {
  gap: 10px;
}

/* ── Three-Panel API Layout ────────────────────────────────────────────── */
.api-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--code-panel-width);
  min-height: 100vh;
  padding-top: var(--header-height);
}

.api-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-primary);
  padding: 16px 0;
  z-index: 100;
}

.api-sidebar__section {
  margin-bottom: 8px;
}

.api-sidebar__heading {
  padding: 8px 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.api-sidebar__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  border-left: 2px solid transparent;
}

.api-sidebar__link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.api-sidebar__link.active {
  color: var(--ml-primary-hover);
  background: var(--ml-primary-muted);
  border-left-color: var(--ml-primary);
}

.api-sidebar__method {
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  min-width: 36px;
  text-align: center;
}

.method-get { background: rgba(52, 211, 153, 0.15); color: var(--ml-success); }
.method-post { background: rgba(99, 102, 241, 0.15); color: var(--ml-primary-hover); }
.method-put { background: rgba(251, 191, 36, 0.15); color: var(--ml-warning); }
.method-patch { background: rgba(251, 191, 36, 0.15); color: var(--ml-warning); }
.method-delete { background: rgba(248, 113, 113, 0.15); color: var(--ml-danger); }

/* ── API Content Area ──────────────────────────────────────────────────── */
.api-content {
  grid-column: 2;
  padding: 40px 48px;
  max-width: 100%;
  overflow-x: hidden;
}

.api-content__intro {
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border-primary);
}

.api-content__intro h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.api-content__intro .version-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--ml-primary-muted);
  color: var(--ml-primary-hover);
  margin-bottom: 16px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.api-content__intro p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

/* ── Endpoint Section ──────────────────────────────────────────────────── */
.endpoint-section {
  padding: 40px 0;
  border-bottom: 1px solid var(--border-primary);
}

.endpoint-section:last-child {
  border-bottom: none;
}

.endpoint-group__title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 20px;
}

.endpoint-group__title .icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.endpoint-group__desc {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 0.95rem;
  line-height: 1.7;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.endpoint-method {
  font-size: 0.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.endpoint-path .param {
  color: var(--ml-accent);
}

.endpoint-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.endpoint-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.65;
}

/* Auth badge */
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.auth-badge--jwt {
  background: rgba(52, 211, 153, 0.12);
  color: var(--ml-success);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.auth-badge--api-key {
  background: rgba(99, 102, 241, 0.12);
  color: var(--ml-primary-hover);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.auth-badge--public {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-tertiary);
  border: 1px solid var(--border-primary);
}

.auth-badge--probe {
  background: rgba(251, 191, 36, 0.12);
  color: var(--ml-warning);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

/* ── Parameters Table ──────────────────────────────────────────────────── */
.params-section {
  margin-bottom: 24px;
}

.params-section__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-primary);
}

.param-row {
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: start;
}

[data-theme="light"] .param-row {
  border-bottom-color: rgba(0, 0, 0, 0.04);
}

.param-row:last-child {
  border-bottom: none;
}

.param-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.param-required {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ml-danger);
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.param-type {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-weight: 400;
}

.param-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.param-enum {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.param-enum code {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-code-inline);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ml-primary-hover);
}

/* ── Response Codes ────────────────────────────────────────────────────── */
.responses {
  margin-top: 20px;
}

.responses__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.response-code {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.88rem;
}

.response-code__status {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 2px 8px;
  border-radius: 4px;
  min-width: 38px;
  text-align: center;
}

.status-2xx { background: rgba(52, 211, 153, 0.15); color: var(--ml-success); }
.status-4xx { background: rgba(251, 191, 36, 0.15); color: var(--ml-warning); }
.status-5xx { background: rgba(248, 113, 113, 0.15); color: var(--ml-danger); }

.response-code__desc {
  color: var(--text-secondary);
}

/* ── Code Panel (Right Side) ───────────────────────────────────────────── */
.api-code-panel {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: var(--code-panel-width);
  height: calc(100vh - var(--header-height));
  background: var(--bg-panel);
  border-left: 1px solid var(--border-primary);
  overflow-y: auto;
  padding: 0;
  z-index: 100;
}

.code-example {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-primary);
}

.code-example__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.code-example__title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

.code-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-root);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.code-tab {
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.code-tab.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.code-block {
  position: relative;
  border-radius: var(--radius-md);
  background: var(--bg-code);
  border: 1px solid var(--border-primary);
  overflow: hidden;
}

.code-block pre {
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.code-block .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  color: var(--text-tertiary);
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition-fast);
}

.code-block:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.copy-btn.copied {
  color: var(--ml-success);
}

/* Response sample */
.response-sample {
  margin-top: 16px;
}

.response-sample__tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
}

.response-sample__tab {
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--border-primary);
  border-bottom: none;
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all var(--transition-fast);
}

.response-sample__tab.active {
  background: var(--bg-code);
  color: var(--text-primary);
}

/* ── Syntax Highlighting ───────────────────────────────────────────────── */
.token-string { color: #a5d6ff; }
.token-number { color: #79c0ff; }
.token-boolean { color: #ff7b72; }
.token-null { color: #ff7b72; }
.token-key { color: #d2a8ff; }
.token-comment { color: var(--text-tertiary); font-style: italic; }
.token-keyword { color: #ff7b72; }
.token-url { color: var(--ml-accent); }
.token-flag { color: #ffa657; }

[data-theme="light"] .token-string { color: #0a3069; }
[data-theme="light"] .token-number { color: #0550ae; }
[data-theme="light"] .token-boolean { color: #cf222e; }
[data-theme="light"] .token-null { color: #cf222e; }
[data-theme="light"] .token-key { color: #8250df; }
[data-theme="light"] .token-keyword { color: #cf222e; }
[data-theme="light"] .token-url { color: #0550ae; }
[data-theme="light"] .token-flag { color: #953800; }

/* ── Guides Layout ─────────────────────────────────────────────────────── */
.guides-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  padding-top: var(--header-height);
}

.guides-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 260px;
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-primary);
  padding: 24px 0;
}

.guides-sidebar__link {
  display: block;
  padding: 8px 24px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
}

.guides-sidebar__link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.guides-sidebar__link.active {
  color: var(--ml-primary-hover);
  border-left-color: var(--ml-primary);
  background: var(--ml-primary-muted);
}

.guides-content {
  grid-column: 2;
  padding: 48px 60px;
  max-width: 820px;
}

.guides-content h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.guides-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border-primary);
}

.guides-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.guides-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 12px;
}

.guides-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.75;
}

.guides-content code:not(pre code) {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-code-inline);
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--ml-primary-hover);
}

.guides-content pre {
  margin: 16px 0 24px;
  border-radius: var(--radius-md);
  background: var(--bg-code);
  border: 1px solid var(--border-primary);
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.guides-content ul, .guides-content ol {
  margin: 12px 0 20px;
  padding-left: 24px;
  color: var(--text-secondary);
}

.guides-content li {
  margin-bottom: 8px;
  line-height: 1.65;
}

.guides-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.9rem;
}

.guides-content th {
  text-align: left;
  padding: 10px 16px;
  border-bottom: 2px solid var(--border-primary);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.guides-content td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-secondary);
}

/* Callout boxes */
.callout {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  border: 1px solid;
  font-size: 0.9rem;
}

.callout--info {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--ml-primary-hover);
}

.callout--warning {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.2);
  color: var(--ml-warning);
}

.callout--success {
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.2);
  color: var(--ml-success);
}

.callout--danger {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.2);
  color: var(--ml-danger);
}

.callout__title {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Search Modal ──────────────────────────────────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}

.search-overlay.open {
  display: flex;
}

.search-modal {
  width: 600px;
  max-width: 95vw;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.search-modal__input {
  width: 100%;
  padding: 18px 24px;
  font-size: 1.05rem;
  font-family: var(--font-sans);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-primary);
  outline: none;
}

.search-modal__input::placeholder {
  color: var(--text-tertiary);
}

.search-modal__results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.search-result:hover,
.search-result.selected {
  background: var(--bg-hover);
}

.search-result__method {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  min-width: 32px;
  text-align: center;
}

.search-result__text {
  flex: 1;
}

.search-result__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.search-result__path {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.docs-footer {
  border-top: 1px solid var(--border-primary);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.docs-footer a {
  color: var(--text-secondary);
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .api-layout {
    grid-template-columns: var(--sidebar-width) 1fr;
  }
  .api-code-panel {
    position: static;
    width: 100%;
    height: auto;
    grid-column: 1 / -1;
    border-left: none;
    border-top: 1px solid var(--border-primary);
  }
}

@media (max-width: 900px) {
  .api-layout {
    grid-template-columns: 1fr;
  }
  .api-sidebar {
    display: none;
  }
  .api-content {
    grid-column: 1;
    padding: 24px 20px;
  }
  .guides-layout {
    grid-template-columns: 1fr;
  }
  .guides-sidebar {
    display: none;
  }
  .guides-content {
    grid-column: 1;
    padding: 32px 20px;
  }
  .docs-header__search {
    min-width: 140px;
  }
  .param-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .docs-header__nav {
    display: none;
  }
  .docs-hero h1 {
    font-size: 1.8rem;
  }
  .docs-cards {
    grid-template-columns: 1fr;
  }
}

/* ── Mobile sidebar toggle ─────────────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  cursor: pointer;
}

@media (max-width: 900px) {
  .mobile-menu-btn {
    display: flex;
  }
}

/* ── Utility ───────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.fade-in {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Schema toggle */
.schema-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-sans);
  transition: color var(--transition-fast);
}

.schema-toggle:hover {
  color: var(--text-primary);
}

.schema-toggle__icon {
  transition: transform var(--transition-fast);
  font-size: 0.7rem;
}

.schema-toggle__icon.open {
  transform: rotate(90deg);
}

.schema-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--transition-slow);
}

.schema-body.open {
  max-height: 2000px;
}
