/* Self-contained styles for /docs (the SPA bundle's CSS isn't on a stable path,
   so the docs page ships its own design tokens + base styles). Dark SaaS theme. */
:root {
  --bg: #0a0c11;
  --panel: #12161f;
  --panel-2: #0f131b;
  --border: #232a38;
  --border-soft: #1b212c;
  --text: #e8ecf5;
  --text-dim: #aeb6c6;
  --muted: #7b8497;
  --accent: #6c8cff;
  --accent-2: #9b6cff;
  --ok: #34d39b;
  --warn: #fbbd23;
  --bad: #f5707a;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
::selection { background: rgba(108,140,255,0.3); }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #1d2430; border-radius: 8px; border: 2px solid var(--bg); }

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-bottom: 1px solid var(--border-soft);
  background: rgba(10,12,17,0.85); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 700; letter-spacing: 0.2px; background: linear-gradient(90deg,var(--accent),var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; gap: 6px; }
.nav a { color: var(--text-dim); padding: 6px 12px; border-radius: 8px; font-size: 0.875rem; font-weight: 500; }
.nav a:hover { background: #161b26; color: var(--text); text-decoration: none; }
.nav a.active { background: rgba(108,140,255,0.14); color: #c7d0ff; }

/* inline code + code blocks */
code { font-family: var(--mono); background: #0e1118; border: 1px solid var(--border-soft); padding: 1px 5px; border-radius: 5px; font-size: 0.85em; color: #c9d3e6; }
pre.code, .code {
  font-family: var(--mono); background: #0b0e15; border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; overflow-x: auto; font-size: 0.83rem;
  line-height: 1.55; color: #d4dcec; margin: 12px 0; white-space: pre;
}
pre.code code, .code code { background: none; border: none; padding: 0; color: inherit; }

/* docs layout */
.docs-wrap {
  display: grid; grid-template-columns: 240px 1fr; gap: 30px;
  max-width: 1180px; margin: 0 auto; padding: 24px 22px 80px;
}
@media (max-width: 820px) {
  .docs-wrap { grid-template-columns: 1fr; }
  .toc { display: none; }
}
.toc { position: sticky; top: 70px; align-self: start; max-height: calc(100vh - 90px); overflow-y: auto; }
.toc nav { display: flex; flex-direction: column; gap: 2px; }
.toc a { color: var(--muted); font-size: 0.86rem; padding: 5px 10px; border-radius: 7px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--text); text-decoration: none; background: rgba(255,255,255,0.03); }
.toc a.active { color: var(--text); border-left-color: var(--accent); background: rgba(108,140,255,0.1); }

main.docs { min-width: 0; }
main.docs h1 { font-size: 1.9rem; margin: 0 0 6px; letter-spacing: -0.02em; }
main.docs h2 { font-size: 1.3rem; margin: 34px 0 10px; padding-top: 18px; border-top: 1px solid var(--border-soft); letter-spacing: -0.01em; }
main.docs h2:first-of-type { border-top: none; }
main.docs h3 { font-size: 1rem; margin: 18px 0 8px; color: var(--text); }
main.docs section { scroll-margin-top: 70px; }
main.docs p { line-height: 1.65; color: var(--text-dim); }

.m { font-size: 0.68rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; letter-spacing: 0.4px; }
.m.get { background: rgba(54,211,153,0.16); color: var(--ok); }
.m.post { background: rgba(108,140,255,0.18); color: var(--accent); }
.m.del { background: rgba(248,114,114,0.16); color: var(--bad); }

table.ep-table, table.params {
  width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.86rem;
  background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden;
}
.ep-table th, .ep-table td, .params th, .params td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: top;
}
.ep-table th, .params th { background: #11151e; color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.4px; }
.ep-table tr:last-child td, .params tr:last-child td { border-bottom: none; }

.docs-footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
