/* ============================================
   KalqiX API Docs — Editorial light theme
   Claude-docs-inspired: warm paper, serif
   headings, scroll-spy TOC, top nav bar.
   Light is the default; [data-theme="dark"]
   overrides the palette.
   ============================================ */

:root {
  /* Background layers — warm paper */
  --bg-root: #faf9f5;
  --bg-sidebar: #faf9f5;
  --bg-content: #faf9f5;
  --bg-topbar: #faf9f5e6;
  --bg-card: #f1efe7;
  --bg-card-hover: #ebe8de;
  --bg-input: #fffefb;
  --bg-code: #ffffff;
  --bg-code-header: #f4f2ea;
  --bg-inline-code: #efece2;

  /* Borders */
  --border: #e6e2d6;
  --border-subtle: #efece2;
  --border-active: #d6d1c2;

  /* Text — warm near-black */
  --text-primary: #2b2925;
  --text-secondary: #5f5b51;
  --text-muted: #908b7e;
  --text-heading: #1c1a16;

  /* Accent — toned-down forest green */
  --accent: #157f57;
  --accent-dim: #0f6b48;
  --accent-strong: #0c5a3c;
  --accent-glow: rgba(21, 127, 87, 0.09);
  --accent-glow-strong: rgba(21, 127, 87, 0.16);
  --on-accent: #ffffff;

  /* HTTP method colors */
  --method-get: #0e7490;
  --method-get-bg: rgba(14, 116, 144, 0.09);
  --method-post: #157f57;
  --method-post-bg: rgba(21, 127, 87, 0.10);
  --method-put: #b45309;
  --method-put-bg: rgba(180, 83, 9, 0.10);
  --method-delete: #b91c1c;
  --method-delete-bg: rgba(185, 28, 28, 0.09);

  /* Status */
  --success: #15803d;
  --warning: #b45309;
  --error: #b91c1c;
  --info: #1d4ed8;

  /* Layout */
  --sidebar-width: 286px;
  --right-panel-width: 400px;
  --toc-width: 232px;
  --content-max-width: 768px;
  --topbar-height: 60px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-lg: 14px;

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', Consolas, monospace;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(28, 26, 22, 0.05);
  --shadow-md: 0 6px 24px rgba(28, 26, 22, 0.08);

  /* Transitions */
  --transition-fast: 120ms ease;
  --transition-normal: 200ms ease;
}

/* ============ Dark Theme ============ */
[data-theme="dark"] {
  --bg-root: #1b1a17;
  --bg-sidebar: #1b1a17;
  --bg-content: #1b1a17;
  --bg-topbar: #1b1a17e6;
  --bg-card: #262420;
  --bg-card-hover: #2e2c27;
  --bg-input: #221f1b;
  --bg-code: #16150f;
  --bg-code-header: #211f1a;
  --bg-inline-code: #2c2a24;

  --border: #322f29;
  --border-subtle: #2a2823;
  --border-active: #45413a;

  --text-primary: #ece9e1;
  --text-secondary: #b0aa9c;
  --text-muted: #837d70;
  --text-heading: #f7f4ec;

  --accent: #3ddc97;
  --accent-dim: #2fc585;
  --accent-strong: #5be3ab;
  --accent-glow: rgba(61, 220, 151, 0.12);
  --accent-glow-strong: rgba(61, 220, 151, 0.22);
  --on-accent: #0c1d15;

  --method-get: #38bdf8;
  --method-get-bg: rgba(56, 189, 248, 0.12);
  --method-post: #4ade80;
  --method-post-bg: rgba(74, 222, 128, 0.12);
  --method-put: #fbbf24;
  --method-put-bg: rgba(251, 191, 36, 0.12);
  --method-delete: #f87171;
  --method-delete-bg: rgba(248, 113, 113, 0.12);

  --success: #4ade80;
  --warning: #fbbf24;
  --error: #f87171;
  --info: #60a5fa;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.45);
}

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-root);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============ Scrollbar ============ */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-active); border-radius: 5px; border: 2px solid var(--bg-root); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============ Top bar ============ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  background: var(--bg-topbar);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(var(--sidebar-width) - 24px);
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-heading);
}

.logo-img { width: 28px; height: 28px; object-fit: contain; }

.logo-text {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.logo-text-sub { color: var(--text-muted); font-weight: 500; }

.logo-version {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-weight: 500;
}
.logo-version:empty { display: none; }

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.topbar-link {
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 20px;
  transition: all var(--transition-fast);
}

.topbar-link:hover { color: var(--text-primary); background: var(--bg-card); }
.topbar-link.active { color: var(--text-heading); background: var(--bg-card); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

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

.theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: block; }

.topbar-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 8px;
  text-decoration: none;
  transition: background var(--transition-fast);
  white-space: nowrap;
}
.topbar-cta:hover { background: var(--accent-dim); }
.topbar-cta svg { opacity: 0.85; }

/* ============ Layout shell ============ */
.layout { padding-top: var(--topbar-height); }

.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--topbar-height));
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-normal);
}

/* Search */
.sidebar-search { padding: 16px 16px 10px; position: relative; }

.sidebar-search input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.sidebar-search input::placeholder { color: var(--text-muted); }
.sidebar-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.search-icon {
  position: absolute;
  left: 28px;
  top: calc(50% + 3px);
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-kbd {
  position: absolute;
  right: 26px;
  top: calc(50% + 3px);
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 5px;
  font-family: var(--font-mono);
}

/* Nav */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 0 28px; }

.nav-section { margin-bottom: 2px; }

.nav-divider { height: 1px; background: var(--border); margin: 14px 20px; }

.nav-section-label {
  padding: 6px 20px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-heading);
  background: none;
  border: none;
  cursor: pointer;
  user-select: none;
  text-align: left;
  transition: color var(--transition-fast);
}
.nav-section-toggle:hover { color: var(--accent); }

.nav-section-toggle .toggle-chevron {
  font-size: 8px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}
.nav-section-toggle.collapsed .toggle-chevron { transform: rotate(-90deg); }

.nav-section-items { overflow: hidden; padding-bottom: 4px; }
.nav-section-items.collapsed { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 20px 6px 22px;
  margin: 1px 0;
  font-size: 13.5px;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
  border-left: 2px solid transparent;
  user-select: none;
}
.nav-item:hover { color: var(--text-primary); background: var(--bg-card); }
.nav-item.active {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-glow);
  border-left-color: var(--accent);
}

.nav-item .method-badge {
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  min-width: 38px;
  text-align: center;
}

.method-badge.get { color: var(--method-get); background: var(--method-get-bg); }
.method-badge.post { color: var(--method-post); background: var(--method-post-bg); }
.method-badge.put { color: var(--method-put); background: var(--method-put-bg); }
.method-badge.patch { color: var(--method-put); background: var(--method-put-bg); }
.method-badge.delete { color: var(--method-delete); background: var(--method-delete-bg); }

.nav-endpoint-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ============ Main ============ */
.main { margin-left: var(--sidebar-width); }

.main-inner {
  display: flex;
  align-items: flex-start;
  gap: 56px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 56px 120px;
}

.content-col { flex: 1 1 auto; min-width: 0; max-width: var(--content-max-width); }

/* Page head: breadcrumbs + copy-page */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  min-height: 28px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumbs a { color: var(--text-muted); text-decoration: none; transition: color var(--transition-fast); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .crumb-sep { color: var(--border-active); }
.breadcrumbs .crumb-current { color: var(--text-secondary); }

.copy-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}
.copy-page-btn:hover { color: var(--text-primary); border-color: var(--border-active); }
.copy-page-btn.copied { color: var(--accent); border-color: var(--accent); }

/* Right rail (holds either TOC or code panel) */
.aside-right {
  width: var(--toc-width);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--topbar-height) + 36px);
  align-self: flex-start;
  max-height: calc(100vh - var(--topbar-height) - 60px);
  overflow-y: auto;
}
.main.has-panel .aside-right { width: var(--right-panel-width); }

/* TOC */
.toc { padding-left: 18px; border-left: 1px solid var(--border); }
.toc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.toc-nav { display: flex; flex-direction: column; gap: 2px; }
.toc-link {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
  text-decoration: none;
  padding: 3px 0;
  transition: color var(--transition-fast);
}
.toc-link:hover { color: var(--text-primary); }
.toc-link.toc-h3 { padding-left: 14px; font-size: 12.5px; }
.toc-link.active { color: var(--accent); font-weight: 600; }
.toc:empty, .toc-nav:empty { display: none; }

.right-panel { display: none; }
.right-panel.visible { display: block; }

/* When the code panel is showing, hide the TOC and vice versa */
.main.has-panel .toc { display: none; }

/* ============ Content typography ============ */
.content h1, .content h2, .content h3, .content h4 {
  font-family: var(--font-serif);
  color: var(--text-heading);
  scroll-margin-top: calc(var(--topbar-height) + 24px);
}

.content h1 {
  font-size: 38px;
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.content h2 {
  font-size: 26px;
  font-weight: 600;
  margin-top: 52px;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.content h3 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 34px;
  margin-bottom: 10px;
}

.content h4 {
  font-size: 16.5px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
}

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

.content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.content a:hover { border-bottom-color: var(--accent); }

.content ul, .content ol { margin-bottom: 16px; padding-left: 22px; color: var(--text-secondary); }
.content li { margin-bottom: 6px; }
.content li::marker { color: var(--text-muted); }

.content strong { color: var(--text-primary); font-weight: 600; }

.content blockquote {
  margin: 0 0 16px;
  padding: 4px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-glow);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}
.content blockquote p:last-child { margin-bottom: 0; }

.content hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

.content img { max-width: 100%; border-radius: var(--radius-md); border: 1px solid var(--border); }

/* Inline code */
.content code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-inline-code);
  color: var(--text-primary);
  padding: 2px 6px;
  border-radius: 5px;
  font-weight: 500;
}

.content code, .right-panel code {
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0, "clig" 0;
}

/* Code blocks */
.content pre {
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  position: relative;
}

.content pre code {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  display: block;
  padding: 18px 20px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

/* Tables */
.content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.content th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  color: var(--text-heading);
  font-weight: 600;
  font-size: 12.5px;
}
.content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: top;
}
.content tr:last-child td { border-bottom: none; }
.content td code { font-size: 12.5px; }

/* ============ API Endpoint Card ============ */
.endpoint-card {
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border-subtle);
}
.endpoint-card:last-child { border-bottom: none; }

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

.endpoint-method {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.endpoint-method.get { color: var(--method-get); background: var(--method-get-bg); }
.endpoint-method.post { color: var(--method-post); background: var(--method-post-bg); }
.endpoint-method.put { color: var(--method-put); background: var(--method-put-bg); }
.endpoint-method.patch { color: var(--method-put); background: var(--method-put-bg); }
.endpoint-method.delete { color: var(--method-delete); background: var(--method-delete-bg); }

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--text-heading);
  word-break: break-all;
}
.endpoint-path .path-param { color: var(--accent); }

.endpoint-summary { font-size: 15px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.65; }

.endpoint-url-bar {
  display: flex;
  align-items: center;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  margin-bottom: 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  gap: 8px;
  overflow-x: auto;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.endpoint-url-bar .url-server { color: var(--text-muted); }
.endpoint-url-bar .url-path { color: var(--text-primary); }

/* Auth badge */
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--warning);
  background: var(--method-put-bg);
  border: 1px solid color-mix(in srgb, var(--warning) 22%, transparent);
  padding: 4px 11px;
  border-radius: 20px;
  margin-bottom: 18px;
}
.auth-badge.public {
  color: var(--success);
  background: var(--method-post-bg);
  border-color: color-mix(in srgb, var(--success) 22%, transparent);
}
.auth-badge svg { flex-shrink: 0; }

/* Section labels */
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 12px;
  margin-top: 28px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

/* Parameter table */
.param-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 22px; }
.param-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.param-table td { padding: 11px 12px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
.param-table tr:last-child td { border-bottom: none; }

.param-name { font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); font-size: 13px; }
.param-required { color: var(--error); font-size: 10px; font-weight: 700; margin-left: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.param-type { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); }
.param-desc { color: var(--text-secondary); font-size: 13.5px; }
.param-default { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent-dim); }
.param-enum { display: inline-flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.param-enum-value {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-inline-code);
  color: var(--text-secondary);
  padding: 2px 7px;
  border-radius: 4px;
}

/* Response section */
.response-group { margin-bottom: 18px; }

.response-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  width: 100%;
  transition: all var(--transition-fast);
  margin-bottom: 4px;
  color: var(--text-primary);
}
.response-status:hover { background: var(--bg-card-hover); }
.response-status.expanded { border-color: var(--border-active); }

.response-status .status-code { min-width: 30px; }
.response-status .status-code.s2xx { color: var(--success); }
.response-status .status-code.s4xx { color: var(--warning); }
.response-status .status-code.s5xx { color: var(--error); }

.response-status .status-desc { color: var(--text-secondary); font-family: var(--font-sans); font-weight: 400; font-size: 13px; }
.response-status .chevron { margin-left: auto; transition: transform var(--transition-fast); color: var(--text-muted); font-size: 10px; }
.response-status.expanded .chevron { transform: rotate(90deg); }

.response-body { display: none; padding: 6px 2px 10px; margin-bottom: 6px; }
.response-body.visible { display: block; }
.response-body pre { margin: 0; }
.response-body pre code { border: none; padding: 0; font-size: 12.5px; box-shadow: none; }

/* ============ Response Schema Fields ============ */
.response-schema {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-content);
}
.response-schema-nested {
  margin: 8px 14px 10px 22px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}
.response-schema-field { padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
.response-schema-field:last-child { border-bottom: none; }

.response-schema-field.has-children > .response-schema-nested { display: none; }
.response-schema-field.has-children.expanded > .response-schema-nested { display: block; }

.schema-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  margin-left: 12px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
}
.schema-toggle-btn:hover { color: var(--text-primary); border-color: var(--border-active); }
.schema-toggle-icon { font-size: 13px; font-weight: 600; line-height: 1; }

.response-schema-field-header { display: flex; align-items: center; gap: 9px; padding-left: 12px; flex-wrap: wrap; }
.response-schema-field-header .param-name { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--text-primary); }
.response-schema-field-header .param-type { font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono); }
.response-schema-field-desc { margin-top: 5px; padding-left: 12px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ============ Right Panel (Code Examples) ============ */
.code-example-card { margin-bottom: 24px; }

.code-example-tabs {
  display: flex;
  gap: 0;
  background: var(--bg-code-header);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow-x: auto;
}
.code-tab {
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-sans);
  white-space: nowrap;
  transition: all var(--transition-fast);
  border-bottom: 2px solid transparent;
}
.code-tab:hover { color: var(--text-secondary); }
.code-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.code-example-body {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.code-example-body pre { margin: 0; }
.code-example-body pre code {
  border: none;
  border-radius: 0;
  font-size: 12.5px;
  padding: 16px;
  max-height: 520px;
  overflow-y: auto;
  box-shadow: none;
}

/* Generic right-panel example wrappers */
.panel-example { margin-top: 18px; }
.panel-example-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding-left: 2px;
  margin-bottom: 8px;
}
.panel-example-body {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.panel-example-body pre { margin: 0; }
.panel-example-body pre code { border: none; border-radius: 0; font-size: 12.5px; padding: 16px; box-shadow: none; }

/* ============ Schema viewer ============ */
.schema-block { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 18px; }
.schema-title {
  padding: 9px 14px;
  background: var(--bg-card);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
}
.schema-field { display: flex; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); font-size: 13px; align-items: flex-start; flex-wrap: wrap; }
.schema-field:last-child { border-bottom: none; }
.schema-field-name { font-family: var(--font-mono); color: var(--text-primary); font-weight: 600; min-width: 150px; flex-shrink: 0; }
.schema-field-type { font-family: var(--font-mono); color: var(--text-muted); font-size: 11.5px; min-width: 64px; flex-shrink: 0; }
.schema-field-desc { color: var(--text-secondary); font-size: 13px; flex: 1; min-width: 180px; }

/* ============ Guide page ============ */
.guide-page { max-width: var(--content-max-width); }

/* ============ Hero / Intro ============ */
.hero-section {
  margin-bottom: 44px;
  padding: 36px 36px 32px;
  background: linear-gradient(150deg, var(--accent-glow), transparent 70%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.hero-section h1 {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.015em;
  color: var(--text-heading);
}
.hero-section p { font-size: 16px; color: var(--text-secondary); max-width: 580px; }

.hero-badges { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ============ Tag Group Header ============ */
.tag-group-header { margin-top: 56px; margin-bottom: 28px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.tag-group-header:first-child { margin-top: 0; }
.tag-group-header h2 { margin: 0; border: none; padding: 0; font-size: 28px; font-family: var(--font-serif); }
.tag-group-header p { margin-top: 8px; margin-bottom: 0; }

/* ============ Code copy button ============ */
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: all var(--transition-fast);
  opacity: 0;
  z-index: 2;
}
pre:hover .copy-btn, .endpoint-url-bar:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--success); border-color: var(--success); }

/* ============ Mobile nav toggle ============ */
.mobile-nav-toggle {
  display: none;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.sidebar-overlay { display: none; position: fixed; inset: var(--topbar-height) 0 0 0; background: rgba(20, 18, 14, 0.5); z-index: 90; }

/* ============ Loading / empty ============ */
.loading { display: flex; align-items: center; justify-content: center; height: 240px; color: var(--text-muted); font-size: 14px; }
.loading::after {
  content: '';
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.no-results { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* ============ Responsive ============ */
@media (max-width: 1180px) {
  .main.has-panel .aside-right,
  .toc { display: none; }
  .right-panel { position: static; }
  .main.has-panel .content-col { max-width: var(--content-max-width); }
  .main-inner { justify-content: center; }
}

@media (max-width: 1024px) {
  .topbar-nav { display: none; }
  .aside-right { display: none; }
  .main-inner { padding: 32px 40px 100px; }
}

@media (max-width: 860px) {
  .mobile-nav-toggle { display: flex; }
  .topbar-left { width: auto; }
  .logo-text-sub { display: none; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-md); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main { margin-left: 0; }
  .main-inner { padding: 28px 22px 80px; }
  .content h1 { font-size: 30px; }
  .hero-section { padding: 24px; }
  .hero-section h1 { font-size: 30px; }
}

@media (max-width: 480px) {
  .topbar { gap: 10px; padding: 0 14px; }
  .topbar-cta span, .logo-version { display: none; }
  .endpoint-header { flex-wrap: wrap; }
}
