/* Documentation page: same identity as the site, tuned for long reading */
:root {
  --docs-surface: #0b0b0e;
  --docs-line: #1d1d24;
  --docs-text: #d9d9de;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.docs-page { font-weight: 300; }
.docs-page .nav-links a.active { color: var(--color-bone-white); }

.docs {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 24px var(--gutter) 60px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 60px;
}

/* ---------- Sidebar ---------- */
.docs-toc nav {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding-bottom: 24px;
}
.toc-group {
  margin: 18px 0 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-saffron-spark);
}
.toc-group:first-child { margin-top: 0; }
.docs-toc a {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-ash-gray);
  padding: 5px 0 5px 12px;
  border-left: 1px solid var(--docs-line);
  transition: color .15s, border-color .15s;
}
.docs-toc a:hover { color: #fff; }
.docs-toc a.current { color: #fff; border-left-color: var(--color-electric-iris); }
.toc-toggle { display: none; }

/* ---------- Content ---------- */
.docs-content { max-width: 780px; color: var(--docs-text); font-size: 16px; line-height: 1.7; }
.docs-content section { padding: 0 0 56px; max-width: none; margin: 0; scroll-margin-top: 24px; }
.docs-content h1 { margin-bottom: 24px; color: #fff; }
.docs-content h2 { margin-bottom: 20px; color: #fff; }
.docs-content h3 { color: #fff; font-weight: 400; }
.docs-content p { margin-bottom: 16px; }
.docs-content strong { font-weight: 600; color: #fff; }
.docs-content em { font-style: normal; color: #fff; }
.docs-content a { color: var(--color-saffron-spark); text-decoration: underline; text-decoration-color: rgba(255, 184, 41, .35); text-underline-offset: 3px; }
.docs-content a:hover { text-decoration-color: currentColor; }
.docs-content a.btn { color: #fff; text-decoration: none; }
.docs-content a.ghost { text-decoration: none; }
.lead { font-size: 19px; color: #fff; font-weight: 300; }
.muted-note { font-size: 14px; color: var(--color-ash-gray); }
.sub { margin: 32px 0 12px; }

.docs-content :not(pre) > code {
  font-family: var(--font-mono);
  font-size: .86em;
  color: #fff;
  background: var(--docs-surface);
  border: 1px solid var(--docs-line);
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}

.facts { display: flex; flex-wrap: wrap; gap: 12px 36px; margin-top: 30px; }
.facts div { display: flex; flex-direction: column; gap: 6px; }
.fact-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--color-ash-gray); }

.bullets { list-style: none; display: grid; gap: 10px; margin: 0 0 16px; }
.bullets li { position: relative; padding-left: 20px; }
.bullets li::before { content: ''; position: absolute; left: 2px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--color-electric-iris); }

/* ---------- Code ---------- */
pre.code {
  position: relative;
  margin: 0 0 18px;
  padding: 16px 18px;
  background: var(--docs-surface);
  border: 1px solid var(--docs-line);
  border-radius: 12px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: #e6e6ef;
  tab-size: 2;
}
pre.code::before {
  content: attr(data-lang);
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #5d5d6b;
}
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font: 600 11px/1 var(--font-sans);
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-ash-gray);
  background: transparent;
  border: 1px solid var(--docs-line);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, color .15s;
}
pre.code:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover, .copy-btn.done { color: #fff; }
@media (hover: none) { .copy-btn { opacity: 1; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 18px; }
.docs-content table { width: 100%; border-collapse: collapse; font-size: 14px; }
.docs-content th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--color-ash-gray); padding: 10px 14px 10px 0; border-bottom: 1px solid var(--docs-line); }
.docs-content td { padding: 11px 14px 11px 0; border-bottom: 1px solid var(--docs-line); vertical-align: top; }
.docs-content td:first-child { white-space: nowrap; }

/* ---------- Environments ---------- */
.env-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 24px 0; }
.env { padding: 24px; border: 1px solid var(--docs-line); border-radius: 18px; background: var(--docs-surface); }
.env h3 { font-size: 20px; margin-bottom: 14px; letter-spacing: -.01em; }
.env ul { list-style: none; display: grid; gap: 8px; font-size: 15px; margin-bottom: 16px; }
.env li { padding-left: 16px; position: relative; }
.env li::before { content: '›'; position: absolute; left: 0; color: var(--color-ash-gray); }
.env-tag { display: inline-block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px; border-radius: 999px; margin-bottom: 14px !important; }
.env-sandbox .env-tag { background: rgba(255, 184, 41, .14); color: var(--color-saffron-spark); }
.env-prod .env-tag { background: rgba(128, 82, 255, .18); color: #b9a2ff; }
.env-how { font-size: 14px; margin: 0 !important; color: var(--color-ash-gray); }

.callout {
  margin: 0 0 18px;
  padding: 14px 18px;
  border-left: 2px solid var(--color-electric-iris);
  background: rgba(128, 82, 255, .07);
  border-radius: 0 12px 12px 0;
  font-size: 15px;
}

/* ---------- Steps ---------- */
.steps-list { list-style: none; counter-reset: step; display: grid; gap: 28px; margin-bottom: 18px; }
.steps-list > li { counter-increment: step; position: relative; padding-left: 52px; }
.steps-list > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 2px;
  font: 600 14px/1 var(--font-sans);
  letter-spacing: .03em;
  color: var(--color-electric-iris);
}
.steps-list h3 { font-size: 20px; margin-bottom: 10px; letter-spacing: -.01em; }

/* ---------- Tabs ---------- */
.tab-buttons { display: flex; gap: 4px; margin-bottom: 10px; }
.tab-buttons button {
  font: 600 13px/1 var(--font-sans);
  color: var(--color-ash-gray);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}
.tab-buttons button[aria-selected="true"] { color: #fff; border-color: var(--docs-line); background: var(--docs-surface); }

/* ---------- Reference ---------- */
.ref-intro { padding-bottom: 32px !important; }
.ref-title { margin-bottom: 14px; padding-top: 4px; }
.ref-desc { color: var(--color-ash-gray); font-size: 15px; }
.endpoint {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  column-gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--docs-line);
}
.endpoint > code { font-family: var(--font-mono); font-size: 14px; color: #fff; align-self: center; word-break: break-all; }
.endpoint p { grid-column: 2; margin: 6px 0 0; font-size: 15px; }
.method {
  align-self: center;
  justify-self: start;
  font: 600 11px/1 var(--font-mono);
  letter-spacing: .04em;
  padding: 5px 8px;
  border-radius: 6px;
}
.method.get { color: #5fe0c0; background: rgba(31, 199, 163, .12); }
.method.post { color: #b9a2ff; background: rgba(128, 82, 255, .18); }
.method.patch, .method.put { color: var(--color-saffron-spark); background: rgba(255, 184, 41, .13); }
.method.delete { color: #ff8fb0; background: rgba(255, 79, 140, .13); }
.req { color: var(--color-saffron-spark); font-weight: 600; margin-left: 1px; }

.support .actions { margin-top: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 8px; }
  .docs-toc { position: sticky; top: 0; z-index: 5; background: var(--color-void); padding: 8px 0; border-bottom: 1px solid var(--docs-line); }
  .toc-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    font: 600 13px/1 var(--font-sans); text-transform: uppercase; letter-spacing: .05em;
    color: #fff; background: transparent; border: 1px solid var(--docs-line); border-radius: 999px; padding: 10px 14px; cursor: pointer;
  }
  .docs-toc nav { display: none; position: static; max-height: 60vh; padding-top: 12px; }
  .docs-toc.open nav { display: flex; }
  .env-grid { grid-template-columns: minmax(0, 1fr); }
  .steps-list > li { padding-left: 36px; }
  .endpoint { grid-template-columns: 64px minmax(0, 1fr); }
  .docs-content :not(pre) > code { white-space: normal; word-break: break-word; }
}

/* Paths in the reference read as plain monospace, not inline-code chips */
.docs-content .endpoint > code { background: none; border: 0; padding: 0; white-space: normal; }
