:root {
  --primary: #00d9ff;
  --secondary: #2f7dff;
  --accent: #7ff5ff;
  --bg-page: #05070c;
  --bg-sidebar: #0a0e16;
  --bg-surface: #10151f;
  --bg-surface-2: #161d2b;
  --bg-code: #0b1019;
  --text: #eef3fb;
  --text-muted: #96a3ba;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --get: #22c55e;
  --warn: #f59e0b;
  --danger: #f87171;
  --radius: 12px;
  --sidebar-width: 280px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-heading: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: rgba(0, 217, 255, 0.08);
  color: var(--accent);
  padding: 0.12em 0.4em;
  border-radius: 6px;
  word-break: break-word;
}

/* ---------- Sidebar ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 28px 18px 20px;
  z-index: 40;
  overflow-y: auto;
}

.brand {
  /* The logo has dark lettering, so it sits on a white card as on the website. */
  display: flex;
  justify-content: center;
  margin: 0 4px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.brand img {
  display: block;
  width: 150px;
  max-width: 100%;
  height: auto;
}

.brand-caption {
  margin: 14px 8px 26px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.version {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.16), rgba(47, 125, 255, 0.08));
  border: 1px solid rgba(0, 217, 255, 0.3);
  color: var(--primary);
  font-size: 11px;
  letter-spacing: 0;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nav-group-label {
  padding: 0 10px 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--text);
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.14), rgba(47, 125, 255, 0.08));
  border-color: rgba(0, 217, 255, 0.35);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  padding: 24px 10px 0;
  color: var(--text-muted);
  font-size: 12px;
}

/* ---------- Method badges ---------- */

.method {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.method-get {
  background: rgba(34, 197, 94, 0.14);
  color: var(--get);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

/* ---------- Main content ---------- */

.main {
  margin-left: var(--sidebar-width);
  padding: 48px 56px 32px;
  max-width: calc(var(--sidebar-width) + 1000px);
}

.page[hidden] {
  display: none;
}

.page-eyebrow {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  line-height: 1.25;
  color: #fff;
}

h1 {
  margin: 6px 0 12px;
  font-size: 34px;
  font-weight: 800;
}

h2 {
  margin: 40px 0 14px;
  font-size: 21px;
  font-weight: 700;
}

h3 {
  margin: 28px 0 12px;
  font-size: 16px;
  font-weight: 700;
}

.lead {
  max-width: 760px;
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 16px;
}

p {
  color: var(--text-muted);
}

/* ---------- Endpoint bar ---------- */

.endpoint {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

.endpoint .method {
  font-size: 12px;
  padding: 4px 10px;
}

.endpoint-url {
  flex: 1;
  min-width: 0;
  background: none;
  padding: 0;
  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 11px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg-surface-2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td {
  color: var(--text-muted);
}

td:first-child {
  color: var(--text);
}

/* Field names column in the response fields table. */
.fields-table th:first-child {
  width: 34%;
}

/* Parameter names, formats and examples never break mid-word. */
td code {
  white-space: nowrap;
  word-break: normal;
}

.req,
.opt,
.status {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.req {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
}

.opt {
  background: rgba(150, 163, 186, 0.14);
  color: var(--text-muted);
}

.status {
  font-family: var(--font-mono);
}

.s4 {
  background: rgba(245, 158, 11, 0.14);
  color: var(--warn);
}

.s5 {
  background: rgba(248, 113, 113, 0.14);
  color: var(--danger);
}

/* ---------- Code blocks ---------- */

.code-block {
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-code);
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 8px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.code-block pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
}

.code-block pre code {
  display: block;
  background: none;
  padding: 0;
  color: #d6e2f5;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre;
  word-break: normal;
}

.tok-key {
  color: #7ff5ff;
}

.tok-str {
  color: #a5e37d;
}

.tok-num {
  color: #f5b86c;
}

.tok-lit {
  color: #c792ea;
}

.copy-btn {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: 600 12px var(--font);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.copy-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.copy-btn.copied {
  border-color: var(--get);
  color: var(--get);
}

/* ---------- Callouts ---------- */

.callout {
  margin: 20px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 217, 255, 0.28);
  background: rgba(0, 217, 255, 0.06);
  color: var(--text-muted);
}

.callout strong {
  color: var(--text);
}

.callout-warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.07);
}

.page-footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- Mobile ---------- */

.topbar {
  display: none;
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 900px) {
  .topbar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 60px;
    padding: 0 16px;
    background: rgba(10, 14, 22, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 30;
  }

  .topbar-logo {
    height: 38px;
    width: auto;
    padding: 3px 10px;
    background: #fff;
    border-radius: 8px;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    padding: 0 9px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(2, 5, 10, 0.6);
    z-index: 35;
  }

  .main {
    margin-left: 0;
    padding: 28px 16px 24px;
  }

  h1 {
    font-size: 27px;
  }

  .endpoint {
    flex-wrap: wrap;
  }

  /* Tables scroll sideways inside their box instead of squashing. */
  .table-wrap table {
    min-width: 640px;
  }
}
