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

:root {
  --bg: #0f1117;
  --bg-card: #161b27;
  --bg-sidebar: #111318;
  --bg-code: #1a1f2e;
  --border: #1e2535;
  --border-light: #252d3f;
  --text: #e2e8f0;
  --text-secondary: #8892a4;
  --text-muted: #505a6e;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --green: #10b981;
  --yellow: #f59e0b;
  --red: #ef4444;
  --purple: #8b5cf6;
  --cyan: #06b6d4;
  --sidebar-w: 260px;
  --topbar-h: 56px;
  --radius: 8px;
  --font: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.7; overflow-x: hidden; }

/* ── TOPBAR ── */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); background: var(--bg-sidebar); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px; gap: 16px; z-index: 100; }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: var(--sidebar-w); }
.topbar-center { flex: 1; max-width: 500px; }
.topbar-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon { width: 30px; height: 30px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; color: #fff; }
.logo-text { font-size: 15px; font-weight: 700; color: var(--text); }
.logo-sub { color: var(--text-secondary); font-weight: 400; }

.sidebar-toggle { background: none; border: none; color: var(--text-secondary); font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px; display: none; }
.sidebar-toggle:hover { background: var(--border); color: var(--text); }

.search-box { position: relative; display: flex; align-items: center; gap: 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 12px; height: 36px; }
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-box input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 100%; font-family: var(--font); }
.search-box input::placeholder { color: var(--text-muted); }
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); max-height: 320px; overflow-y: auto; z-index: 200; display: none; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.search-results.active { display: block; }
.search-result-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item.highlighted { background: var(--border); }
.search-result-item .search-result-title { font-weight: 600; font-size: 13px; }
.search-result-item .search-result-snippet { font-size: 11px; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-no-results { padding: 12px 14px; color: var(--text-muted); font-size: 13px; }

.topbar-link { color: var(--text-secondary); text-decoration: none; font-size: 13px; font-weight: 500; }
.topbar-link:hover { color: var(--text); }
.btn-api { background: var(--primary); color: #fff; padding: 7px 14px; border-radius: 6px; text-decoration: none; font-size: 12px; font-weight: 600; }
.btn-api:hover { background: var(--primary-hover); }

/* ── LAYOUT ── */
.layout { display: flex; margin-top: var(--topbar-h); min-height: calc(100vh - var(--topbar-h)); }

/* ── SIDEBAR ── */
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--bg-sidebar); border-right: 1px solid var(--border); position: fixed; top: var(--topbar-h); bottom: 0; overflow-y: auto; padding: 20px 0 40px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidenav { padding: 0 12px; }
.nav-section { margin-bottom: 24px; }
.nav-group-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); padding: 0 8px; margin-bottom: 6px; }
.nav-link { display: block; padding: 6px 10px; border-radius: 6px; color: var(--text-secondary); text-decoration: none; font-size: 13px; font-weight: 500; transition: all 0.15s; margin-bottom: 1px; }
.nav-link:hover { background: var(--border); color: var(--text); }
.nav-link.active { background: rgba(59,130,246,0.12); color: var(--primary); }

/* ── MAIN CONTENT ── */
.content { margin-left: var(--sidebar-w); flex: 1; padding: 48px 60px 80px; max-width: 900px; }

/* ── PAGE SECTIONS ── */
.page-section { margin-bottom: 60px; }
.page-title { font-size: 32px; font-weight: 800; color: var(--text); margin-bottom: 12px; letter-spacing: -0.5px; }
.page-subtitle { font-size: 16px; color: var(--text-secondary); margin-bottom: 32px; line-height: 1.6; }
.section-title { font-size: 20px; font-weight: 700; color: var(--text); margin: 36px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.subsection-title { font-size: 16px; font-weight: 600; color: var(--text); margin: 24px 0 10px; }
p { color: var(--text-secondary); margin-bottom: 14px; line-height: 1.8; }
p strong { color: var(--text); }
ul, ol { color: var(--text-secondary); padding-left: 20px; margin-bottom: 14px; }
li { margin-bottom: 6px; line-height: 1.7; }
li strong { color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── CODE BLOCKS ── */
pre { background: var(--bg-code); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; overflow-x: auto; margin: 16px 0; position: relative; }
pre code { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; color: #e2e8f0; }
code { font-family: var(--font-mono); font-size: 12px; background: var(--bg-code); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; color: #93c5fd; }
.code-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.copy-btn { position: absolute; top: 10px; right: 10px; background: var(--border); border: none; color: var(--text-secondary); font-size: 11px; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-family: var(--font); }
.copy-btn:hover { background: var(--border-light); color: var(--text); }

/* ── SYNTAX COLORS ── */
.kw { color: #c084fc; } /* keywords */
.str { color: #86efac; } /* strings */
.num { color: #fdba74; } /* numbers */
.cmt { color: #475569; font-style: italic; } /* comments */
.prop { color: #93c5fd; } /* property names */
.val { color: #fca5a5; } /* values */
.url { color: #67e8f9; } /* urls */
.met { color: #6ee7b7; } /* methods */

/* ── CALLOUT BOXES ── */
.callout { border-radius: var(--radius); padding: 14px 18px; margin: 20px 0; display: flex; gap: 12px; }
.callout-icon { font-size: 16px; flex-shrink: 0; line-height: 1.7; }
.callout-body { flex: 1; font-size: 13px; line-height: 1.7; }
.callout-body strong { display: block; margin-bottom: 4px; font-size: 13px; }
.callout.info { background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.25); color: #93c5fd; }
.callout.tip { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.25); color: #6ee7b7; }
.callout.warning { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.25); color: #fcd34d; }
.callout.danger { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); color: #fca5a5; }

/* ── TABLES ── */
.doc-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 13px; }
.doc-table th { background: var(--bg-card); color: var(--text); font-weight: 600; padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); border-top: 1px solid var(--border); }
.doc-table th:first-child { border-left: 1px solid var(--border); border-radius: 6px 0 0 0; }
.doc-table th:last-child { border-right: 1px solid var(--border); border-radius: 0 6px 0 0; }
.doc-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: top; }
.doc-table td:first-child { border-left: 1px solid var(--border); }
.doc-table td:last-child { border-right: 1px solid var(--border); }
.doc-table tr:last-child td { border-bottom: 1px solid var(--border); }
.doc-table tr:last-child td:first-child { border-radius: 0 0 0 6px; }
.doc-table tr:last-child td:last-child { border-radius: 0 0 6px 0; }

/* ── BADGES ── */
.badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-get { background: rgba(16,185,129,0.15); color: #10b981; }
.badge-post { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-put { background: rgba(59,130,246,0.15); color: #3b82f6; }
.badge-delete { background: rgba(239,68,68,0.15); color: #ef4444; }
.badge-new { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.badge-required { background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }
.badge-optional { background: rgba(107,114,128,0.12); color: #9ca3af; border: 1px solid rgba(107,114,128,0.2); }

/* ── API ENDPOINT BLOCKS ── */
.api-endpoint { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin: 16px 0; display: flex; align-items: center; gap: 12px; }
.api-method { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 4px; font-family: var(--font-mono); flex-shrink: 0; }
.api-path { font-family: var(--font-mono); font-size: 13px; color: var(--text); }
.api-path span { color: #fdba74; }

/* ── PARAM TABLES ── */
.param-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px; }
.param-table th { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.param-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: top; }
.param-table td:first-child { color: var(--text); font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.param-table td code { font-size: 11px; }

/* ── FEATURE GRID ── */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 20px 0; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.feature-card .fc-icon { font-size: 20px; margin-bottom: 8px; }
.feature-card .fc-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.feature-card .fc-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* ── STEP LIST ── */
.step-list { counter-reset: steps; display: flex; flex-direction: column; gap: 14px; margin: 20px 0; }
.step { display: flex; gap: 14px; }
.step-num { counter-increment: steps; content: counter(steps); width: 28px; height: 28px; border-radius: 50%; background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); color: var(--primary); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.step-body .step-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.step-body p { margin: 0; font-size: 13px; }

/* ── DIVIDER ── */
hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* ── PAGER ── */
.pager { display: flex; justify-content: space-between; margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--border); }
.pager a { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); text-decoration: none; font-size: 13px; padding: 10px 16px; border-radius: var(--radius); border: 1px solid var(--border); transition: all 0.15s; }
.pager a:hover { border-color: var(--primary); color: var(--primary); }
.pager .pager-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); display: block; margin-bottom: 2px; }
.pager .pager-title { font-weight: 600; font-size: 13px; }
.pager a.next { text-align: right; margin-left: auto; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .content { padding: 32px 24px 60px; max-width: 100%; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s; z-index: 90; }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .topbar-left { min-width: auto; }
  .topbar-center { display: none; }
  .topbar-right { gap: 10px; }
  .topbar-link { display: none; }
  .page-title { font-size: 24px; }
}
@media (max-width: 480px) {
  .content { padding: 24px 16px 60px; }
  .feature-grid { grid-template-columns: 1fr; }
}

/* ── COLLAPSIBLE NAV GROUPS ── */
.nav-group-header { display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 0 8px; margin-bottom: 6px; user-select: none; }
.nav-group-header .nav-group-label { margin-bottom: 0; }
.nav-group-header:hover .nav-group-label { color: var(--text-secondary); }
.nav-group-chevron { color: var(--text-muted); font-size: 9px; transition: transform 0.2s ease; line-height: 1; }
.nav-section.collapsed .nav-group-chevron { transform: rotate(-90deg); }
.nav-section-links { overflow: hidden; max-height: 600px; transition: max-height 0.25s ease; }
.nav-section.collapsed .nav-section-links { max-height: 0; }

/* ── PLAN CARDS ── */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 24px 0; }
.plan-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 18px; transition: border-color 0.15s; }
.plan-card:hover { border-color: var(--border-light); }
.plan-card.featured { border-color: var(--primary); }
.plan-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.plan-badge.gray { background: rgba(107,114,128,0.15); color: #9ca3af; }
.plan-badge.blue { background: rgba(59,130,246,0.15); color: #3b82f6; }
.plan-badge.indigo { background: rgba(99,102,241,0.15); color: #818cf8; }
.plan-badge.purple { background: rgba(139,92,246,0.15); color: #a78bfa; }
.plan-badge.emerald { background: rgba(16,185,129,0.15); color: #34d399; }
.plan-badge.amber { background: rgba(245,158,11,0.15); color: #fbbf24; }
.plan-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.plan-price { font-size: 26px; font-weight: 800; color: var(--text); margin-bottom: 2px; line-height: 1; }
.plan-price sub { font-size: 13px; font-weight: 400; color: var(--text-secondary); vertical-align: baseline; }
.plan-meta { font-size: 12px; color: var(--text-muted); margin: 8px 0 14px; line-height: 1.6; border-top: 1px solid var(--border); padding-top: 10px; }
.plan-features { list-style: none; padding: 0; margin: 0; }
.plan-features li { font-size: 12px; color: var(--text-secondary); padding: 4px 0; display: flex; gap: 8px; align-items: flex-start; }
.plan-features li::before { content: '✓'; color: var(--green); font-weight: 700; flex-shrink: 0; margin-top: 1px; }

/* ── INTEGRATION STEPS ── */
.integration-step { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 12px; display: flex; gap: 16px; align-items: flex-start; }
.integration-step-num { width: 30px; height: 30px; border-radius: 50%; background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); color: var(--primary); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.integration-step-body h4 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.integration-step-body p { font-size: 13px; margin: 0; }

/* ── PAGE HEADER ── */
.page-header { margin-bottom: 36px; }
.page-header .breadcrumb { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 8px; }
.page-header h1 { font-size: 30px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; margin-bottom: 10px; }
.page-header .lead { font-size: 15px; color: var(--text-secondary); line-height: 1.7; margin: 0; }
h2 { font-size: 18px; font-weight: 700; color: var(--text); margin: 36px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
h3 { font-size: 15px; font-weight: 600; color: var(--text); margin: 24px 0 10px; }
h4 { font-size: 13px; font-weight: 600; color: var(--text); margin: 16px 0 8px; }
