/* ============================================
   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: #dfdbcf;
  --border-subtle: #ebe7dc;
  --border-active: #c8c2b3;

  /* Text — warm near-black */
  --text-primary: #2b2925;
  --text-secondary: #514d45;
  --text-muted: #6f6a5e;
  --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: 800px;
  --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: #3a3730;
  --border-subtle: #302d27;
  --border-active: #514c43;

  --text-primary: #ece9e1;
  --text-secondary: #c0b9aa;
  --text-muted: #9e9789;
  --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; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

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

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============ 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; z-index: 3; }

.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);
}

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 12px;
  right: 12px;
  max-height: min(560px, calc(100vh - var(--topbar-height) - 100px));
  overflow-y: auto;
  background: var(--bg-input);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
}
.search-results.visible { display: block; }
.search-result {
  display: block;
  width: 100%;
  padding: 10px;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
}
.search-result:hover,
.search-result.active { background: var(--accent-glow); }
.search-result-topline { display: flex; align-items: center; gap: 7px; min-width: 0; }
.search-result-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}
.search-result-kind {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 10.5px;
  flex-shrink: 0;
}
.search-result-meta {
  display: block;
  margin-top: 3px;
  color: var(--accent-dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-snippet {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.search-result mark {
  color: inherit;
  background: color-mix(in srgb, var(--warning) 28%, transparent);
  border-radius: 2px;
}
.search-empty {
  padding: 20px 14px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.sidebar-product-nav { display: none; }

.sidebar-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin: 2px 16px 10px;
  padding: 3px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sidebar-mode-tabs button {
  min-width: 0;
  padding: 6px 5px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
}
.sidebar-mode-tabs button:hover { color: var(--text-primary); }
.sidebar-mode-tabs button[aria-selected="true"] {
  color: var(--text-heading);
  background: var(--bg-input);
  box-shadow: var(--shadow-sm);
}

/* Nav */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 0 28px; }
.sidebar-pane { min-height: 100%; }
.nav-mode-home {
  margin: 0 12px 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.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: calc(var(--content-max-width) + var(--right-panel-width) + 112px);
  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: visible;
}
.main.has-panel .aside-right { width: var(--right-panel-width); }

/* TOC */
.toc {
  max-height: calc(100vh - var(--topbar-height) - 60px);
  overflow-y: auto;
  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;
  max-height: calc(100vh - var(--topbar-height) - 60px);
  overflow-y: auto;
  padding-right: 4px;
}

/* When the code panel is showing, hide the TOC and vice versa */
.main.has-panel .toc { display: none; }
.main.has-panel.panel-collapsed .aside-right { display: none; }
.main.has-panel.panel-collapsed .content-col { margin-left: auto; margin-right: auto; }

.panel-resize-handle {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: -22px;
  width: 12px;
  cursor: col-resize;
  touch-action: none;
}
.main.has-panel:not(.panel-collapsed) .panel-resize-handle { display: block; }
.panel-resize-handle::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 5px;
  width: 2px;
  border-radius: 2px;
  background: var(--border);
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}
.panel-resize-handle:hover::after,
.panel-resize-handle:focus-visible::after {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
body.resizing-panel {
  cursor: col-resize;
  user-select: 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;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.endpoint-identity,
.endpoint-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.endpoint-identity { flex: 1; }
.endpoint-actions { flex-shrink: 0; }
.main.has-panel .endpoint-header {
  position: sticky;
  top: var(--topbar-height);
  z-index: 20;
  margin-left: -12px;
  margin-right: -12px;
  padding: 11px 12px;
  background: var(--bg-topbar);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.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: 18px; line-height: 1.7; }

.endpoint-guide-link {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  margin: -4px 0 18px;
  padding: 6px 10px;
  color: var(--text-secondary);
  background: var(--accent-glow);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 12.5px;
}
.content .endpoint-guide-link { border-bottom: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border)); }
.endpoint-guide-link span { color: var(--text-muted); }
.endpoint-guide-link strong { color: var(--accent-dim); font-weight: 600; }
.endpoint-guide-link:hover { border-color: var(--accent); }

.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: 0;
}
.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; }

.endpoint-copy-url,
.endpoint-examples-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 9px;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.endpoint-copy-url:hover,
.endpoint-examples-toggle:hover { color: var(--text-primary); border-color: var(--border-active); }
.endpoint-copy-url.copied { color: var(--success); border-color: var(--success); }
.main:not(.has-panel) .endpoint-examples-toggle { display: none; }

/* Section labels */
.section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  margin-top: 32px;
  padding-bottom: 8px;
  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;
  letter-spacing: 0.02em;
}
.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; line-height: 1.6; }
.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-errors {
  margin-top: 8px;
  border-top: 1px solid var(--border-subtle);
}
.response-errors > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 7px 12px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  list-style: none;
}
.response-errors > summary::-webkit-details-marker { display: none; }
.response-errors > summary:hover { color: var(--text-primary); }
.response-error-count {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 400;
}
.response-errors > summary .chevron {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 10px;
  transition: transform var(--transition-fast);
}
.response-errors[open] > summary .chevron { transform: rotate(90deg); }
.response-errors:not([open]) > .response-errors-body { display: none; }
.response-errors-body { padding: 4px 0 2px; }

/* ============ 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-variant + .response-schema-variant { margin-top: 12px; }
.response-schema-variant > .schema-title {
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.response-schema-variant > .schema-title + .response-schema {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.response-schema-field { padding: 14px 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: 0;
  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: baseline; gap: 9px; 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: 6px; font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; }

/* ============ 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;
}
.mobile-examples-title { display: 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: grid;
  grid-template-columns: minmax(160px, 0.75fr) minmax(220px, 1.75fr);
  gap: 8px 20px;
  padding: 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  align-items: start;
}
.schema-field:last-child { border-bottom: none; }
.schema-field-main { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; min-width: 0; }
.schema-field-name { font-family: var(--font-mono); color: var(--text-primary); font-weight: 600; }
.schema-field-type { font-family: var(--font-mono); color: var(--text-muted); font-size: 11.5px; }
.schema-field-desc { color: var(--text-secondary); font-size: 13.5px; line-height: 1.6; min-width: 0; }

/* ============ Guide page ============ */
.guide-page { max-width: var(--content-max-width); }
.guide-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.guide-pagination a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
}
.content .guide-pagination a { border-bottom: 1px solid var(--border); }
.guide-pagination a.next { align-items: flex-end; text-align: right; }
.guide-pagination a:hover { border-color: var(--accent); }
.guide-pagination span { color: var(--text-muted); font-size: 11.5px; }
.guide-pagination strong { color: var(--text-primary); font-size: 13.5px; font-weight: 600; }

/* ============ 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); }

/* ============ Reference directories ============ */
.directory-page > .directory-heading { margin-top: 6px; }
.directory-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.directory-heading h1,
.directory-heading h2 { margin: 0 0 6px; }
.directory-heading p { margin: 0; color: var(--text-secondary); }
.directory-count {
  flex-shrink: 0;
  padding: 4px 9px;
  color: var(--text-muted);
  background: var(--bg-card);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.endpoint-index-filters {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) repeat(3, minmax(120px, auto));
  gap: 10px;
  margin-bottom: 28px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.endpoint-index-filters label { display: flex; flex-direction: column; gap: 4px; }
.endpoint-index-filters label > span:not(.visually-hidden) {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
}
.endpoint-index-filters input,
.endpoint-index-filters select {
  width: 100%;
  height: 36px;
  padding: 0 9px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12px;
}
.endpoint-index-filters input:focus,
.endpoint-index-filters select:focus { border-color: var(--accent); outline: none; }
.endpoint-filter-search { justify-content: flex-end; }

.endpoint-index-group { margin: 34px 0; scroll-margin-top: calc(var(--topbar-height) + 24px); }
.endpoint-index-group h3 {
  margin: 0 0 5px;
  color: var(--text-heading);
  font-family: var(--font-sans);
  font-size: 18px;
}
.endpoint-index-group > p { margin: 0 0 12px; font-size: 13.5px; }
.endpoint-index-rows {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.endpoint-index-row {
  display: grid;
  grid-template-columns: 64px minmax(190px, 0.8fr) minmax(220px, 1.5fr) 54px;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 9px 12px;
  color: var(--text-secondary);
  background: var(--bg-input);
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
}
.endpoint-index-row .method-badge {
  min-width: 60px;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}
.content .endpoint-index-row { border-bottom: 1px solid var(--border-subtle); }
.endpoint-index-row:last-child { border-bottom: none; }
.endpoint-index-row:hover { background: var(--accent-glow); }
.endpoint-index-row code {
  overflow: hidden;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.endpoint-index-summary {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.endpoint-index-access { color: var(--warning); font-size: 10.5px; font-weight: 600; text-align: right; }
.endpoint-index-access.public { color: var(--success); }
.endpoint-index-empty {
  padding: 48px 20px;
  color: var(--text-muted);
  text-align: center;
  font-size: 14px;
}

.model-index {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.model-index-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(260px, 1.5fr) 32px;
  align-items: center;
  gap: 16px;
  min-height: 54px;
  padding: 10px 14px;
  color: var(--text-secondary);
  background: var(--bg-input);
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
}
.content .model-index-row { border-bottom: 1px solid var(--border-subtle); }
.model-index-row:last-child { border-bottom: none; }
.model-index-row:hover { background: var(--accent-glow); }
.model-index-row code { color: var(--text-primary); font-family: var(--font-mono); font-size: 12.5px; }
.model-index-row span {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-index-row strong {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-align: right;
}

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

/* ============ 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-sans); }
.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, pre:focus-within .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; }

/* ============ Sidebar-less pages ============ */
/* OneFill is its own product: the guide/API sidebar does not describe it, so
   it is hidden there. Set by `SIDEBARLESS_ROUTES` in js/app.js. `.main` keeps
   its sidebar-width margin on purpose — the content stays exactly where it
   sits on every other page rather than sliding left as the sidebar goes. */
body.no-sidebar .sidebar,
body.no-sidebar .sidebar-overlay,
body.no-sidebar .mobile-nav-toggle { display: none; }

/* ============ 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) {
  .toc { display: none; }
  .main:not(.has-panel) .aside-right { display: none; }
  .main.has-panel .main-inner { display: block; }
  .main.has-panel .aside-right {
    display: block;
    position: static;
    width: auto;
    max-width: var(--content-max-width);
    max-height: none;
    overflow: visible;
    margin: 48px auto 0;
    padding-top: 30px;
    border-top: 1px solid var(--border);
  }
  .main.has-panel.panel-collapsed .aside-right { display: none; }
  .panel-resize-handle { display: none !important; }
  .right-panel.visible { max-height: none; overflow: visible; padding-right: 0; }
  .main.has-panel .content-col { max-width: var(--content-max-width); margin: 0 auto; }
  .mobile-examples-title {
    display: block;
    margin-bottom: 16px;
    color: var(--text-heading);
    font-size: 20px;
    font-weight: 600;
  }
  .main-inner { justify-content: center; }
}

@media (max-width: 1024px) {
  .topbar-nav { display: none; }
  .mobile-nav-toggle { display: flex; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-md); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .sidebar-product-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 2px 16px 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-product-nav a {
    padding: 7px 8px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 12.5px;
  }
  .sidebar-product-nav a:hover { color: var(--text-primary); background: var(--bg-card); }
  .mobile-nav-toggle,
  .theme-toggle,
  .topbar-cta { min-width: 44px; min-height: 44px; }
  .nav-section-toggle,
  .nav-item,
  .sidebar-product-nav a,
  .sidebar-mode-tabs button { min-height: 44px; }
  .main { margin-left: 0; }
  .main-inner { padding: 32px 40px 100px; }
}

@media (max-width: 860px) {
  .topbar-left { width: auto; }
  .logo-text-sub { display: none; }
  .main-inner { padding: 28px 22px 80px; }
  .content h1 { font-size: 30px; }
  .hero-section { padding: 24px; }
  .hero-section h1 { font-size: 30px; }
  .endpoint-index-filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .page-head { align-items: flex-start; }
  .copy-page-label { display: none; }
  .main.has-panel .endpoint-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .endpoint-identity { width: 100%; }
  .endpoint-actions { width: 100%; }
  .endpoint-copy-url { margin-left: auto; }
  .endpoint-copy-url,
  .endpoint-examples-toggle,
  .copy-page-btn,
  .code-tab,
  .response-status,
  .response-errors > summary,
  .schema-toggle-btn { min-height: 44px; }
  .endpoint-path { font-size: 14px; }
  .param-table thead { display: none; }
  .param-table tbody { display: block; }
  .param-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    padding: 14px 2px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .param-table td { padding: 0; border: none; }
  .param-table td:nth-child(3) { grid-column: 1 / -1; margin-top: 5px; }
  .schema-field { grid-template-columns: 1fr; gap: 6px; }
  .response-status { align-items: flex-start; }
  .response-status .status-desc { line-height: 1.45; text-align: left; }
  .directory-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .endpoint-index-filters { grid-template-columns: 1fr; }
  .endpoint-index-filters input,
  .endpoint-index-filters select { height: 44px; }
  .endpoint-index-row {
    grid-template-columns: 64px minmax(0, 1fr) 46px;
    gap: 8px;
    min-height: 58px;
  }
  .endpoint-index-summary {
    grid-column: 2 / -1;
    white-space: normal;
  }
  .model-index-row {
    grid-template-columns: minmax(0, 1fr) 28px;
    gap: 4px 10px;
  }
  .model-index-row span {
    grid-column: 1 / -1;
    white-space: normal;
  }
  .guide-pagination { grid-template-columns: 1fr; }
  .guide-pagination > span { display: none; }
}

@media (max-width: 480px) {
  .topbar { gap: 10px; padding: 0 14px; }
  .topbar-cta span, .logo-version { display: none; }
  .logo-text { font-size: 17px; }
  .endpoint-header { flex-wrap: wrap; }
  .main-inner { padding-left: 16px; padding-right: 16px; }
  .auth-badge { font-size: 10.5px; padding-left: 8px; padding-right: 8px; }
  .response-schema-field { padding-left: 12px; padding-right: 12px; }
}

@media (hover: none) {
  .copy-btn { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
