:root {
  color-scheme: dark;
  --bg: #0b0e12;
  --panel: #11161c;
  --panel-alt: #161d25;
  --surface: #1b232d;
  --border: rgba(220, 234, 244, 0.11);
  --border-strong: rgba(220, 234, 244, 0.2);
  --text: #eef4f7;
  --muted: #98a8b5;
  --faint: #677786;
  --accent: #3ee0a8;
  --accent-hover: #64ebb9;
  --accent-dim: rgba(62, 224, 168, 0.13);
  --accent-border: rgba(62, 224, 168, 0.42);
  --warn: #f5b856;
  --danger: #ff6e63;
  --sans: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, p, pre { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface);
  color: #cfece0;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  background: rgba(11, 14, 18, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.nav-logo { height: 28px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.btn-primary, .btn-secondary, .mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary {
  height: 36px;
  padding: 0 15px;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #051610;
  font-size: 13px;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  height: 36px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
}
.btn-secondary:hover { border-color: var(--accent-border); }
.mini-btn {
  height: 28px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 11px;
}
.mini-btn:hover { border-color: var(--accent-border); }

/* Clean natural-edge two-column documentation shell */
.api-layout {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: calc(100dvh - 64px);
}
.api-toc {
  position: sticky;
  top: 64px;
  height: calc(100dvh - 64px);
  overflow-y: auto;
  padding: 28px 18px 28px 24px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.toc-group { display: flex; flex-direction: column; gap: 6px; }
.toc-heading {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  padding-bottom: 4px;
}
.api-toc a {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0;
  transition: color 0.15s;
}
.api-toc a:hover { color: var(--accent); }

.api-main {
  padding: 36px 40px 80px;
  display: flex;
  flex-direction: column;
  gap: 48px;
  min-width: 0;
}

.api-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.status-strip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.mono-pill {
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--accent-border);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 11px;
}
.api-hero h1 { font-size: clamp(2rem, 3.2vw, 2.75rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; }
.lead { color: var(--muted); max-width: 66ch; font-size: 15.5px; }
.base-url-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}
.bar-label { font-family: var(--mono); font-size: 11px; color: var(--faint); text-transform: uppercase; }

.doc-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 84px;
}
.doc-section:last-child { border-bottom: 0; }
.doc-section h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.doc-section p { color: var(--muted); max-width: 72ch; }
.small-note { font-size: 12.5px; color: var(--faint); }
.inline-link { color: var(--accent); text-decoration: underline; }

/* BYOK callout table */
.byok-callout {
  border: 1px solid var(--accent-border);
  border-radius: 9px;
  background: rgba(62, 224, 168, 0.04);
  overflow: hidden;
}
.byok-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: 13px;
}
.byok-row:last-child { border-bottom: 0; }
.byok-row strong { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* Live Interactive Playground */
.playground-shell {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}
.playground-controls {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.pg-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.1fr) auto;
  gap: 10px;
  align-items: end;
}
.pg-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pg-field > span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.pg-field select, .pg-field input, .pg-field textarea, .pg-method-path input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--bg);
  padding: 0 10px;
  height: 36px;
  font-size: 13px;
}
.pg-field textarea {
  height: auto;
  padding: 10px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}
.pg-method-path {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pg-method-path input { font-family: var(--mono); font-size: 12.5px; }

.method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 24px;
  padding: 0 8px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  flex: none;
}
.method-badge.post { background: rgba(96, 165, 250, 0.14); color: #7cc0ff; border-color: rgba(96, 165, 250, 0.4); }
.method-badge.patch { background: rgba(245, 184, 86, 0.14); color: var(--warn); border-color: rgba(245, 184, 86, 0.4); }
.method-badge.del { background: rgba(255, 110, 99, 0.15); color: #ff9c94; border-color: rgba(255, 110, 99, 0.4); }

.playground-output { background: #090c10; }
.pg-output-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11.5px;
}
.pg-status { color: var(--accent); font-weight: 700; }
.pg-status.err { color: var(--danger); }
.pg-latency { color: var(--faint); margin-right: auto; }
#pg-response {
  padding: 14px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: #dce7ee;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Endpoint Reference List */
.endpoint-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.endpoint-row {
  display: grid;
  grid-template-columns: 64px minmax(200px, 280px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.endpoint-row span:last-child { color: var(--muted); }

/* Tabbed Code Samples */
.code-card {
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: #090c10;
  overflow: hidden;
}
.code-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.code-tab {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
}
.code-tab.active { background: var(--surface); color: var(--accent); }
.copy-code-btn { margin-left: auto; }
.code-pane {
  display: none;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  color: #dce7ee;
  overflow-x: auto;
}
.code-pane.active { display: block; }

@media (max-width: 960px) {
  .api-layout { grid-template-columns: 1fr; }
  .api-toc { display: none; }
  .api-main { padding: 24px 18px 60px; }
  .pg-row { grid-template-columns: 1fr; }
  .endpoint-row { grid-template-columns: 64px minmax(0, 1fr); }
  .endpoint-row span:last-child { grid-column: 1 / -1; }
  .byok-row { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 640px) {
  .nav-inner { padding: 0 14px; }
  .nav-links { display: none; }
  .nav-actions .btn-secondary { display: none; }
}
