/* The API guide (/api-tokens, written by scripts/api-docs-gen.py). */
:root {
  --bg: #f3efe6; --panel: rgba(255, 255, 255, .72); --line: rgba(22, 26, 43, .1); --text: #161a2b; --muted: #5f6070;
  --accent: #a87414; --accent-soft: rgba(168, 116, 20, .12);
  --code-bg: #12162a; --code-head: #0c1020; --code-line: rgba(255, 255, 255, .08); --code-text: #dfe3f2; --code-muted: #8a91b0;
  --t-s: #a5d98a; --t-p: #8cc6ff; --t-k: #f2a7d4; --t-n: #f6c177; --t-c: #6c7394; --t-f: #f6d58b; --t-m: #9fe4ef;
  --get: #2f9e6a; --post: #3a7bd5; --delete: #d64545;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070a16; --panel: rgba(22, 27, 52, .66); --line: rgba(255, 255, 255, .09); --text: #eef0f8; --muted: #a2a8c2;
    --accent: #e6b85c; --accent-soft: rgba(230, 184, 92, .13);
    --code-bg: #0d1124; --code-head: #090c1a;
    --get: #4cc38a; --post: #6aa1ff; --delete: #ff6b6b;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; color: var(--text); font: 15.5px/1.6 -apple-system, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 85% -10%, var(--accent-soft), transparent 60%), var(--bg);
  background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .88em; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); }

/* top bar */
.top {
  position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 22px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.logo { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #f0cd7c; background: linear-gradient(135deg, #1f2a52, #0a0f22); }
.logo svg { width: 20px; height: 20px; }
.brand-sub { font-weight: 600; color: var(--accent); }
.top-links { margin-left: auto; display: flex; gap: 18px; font-size: 14px; }
.top-links a { color: var(--muted); }
.top-links a:hover { color: var(--text); text-decoration: none; }
.menu-btn { display: none; margin-left: auto; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); cursor: pointer; }
.menu-btn svg { width: 20px; height: 20px; }

/* layout */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); max-width: 1440px; margin: 0 auto; }
.side { position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; padding: 22px 12px 40px 22px; border-right: 1px solid var(--line); }
.nav-group { margin-bottom: 18px; }
.nav-label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px 8px; }
.side a { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; font-size: 13.5px; color: var(--text); transition: background .15s, color .15s; }
.side a:hover { background: var(--accent-soft); text-decoration: none; }
.side a.here { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side a span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { min-width: 0; padding: 36px 40px 80px; }

/* method badges */
.m { flex: none; display: inline-block; min-width: 50px; text-align: center; font: 700 10.5px/1 var(--mono); letter-spacing: .04em; padding: 4px 6px; border-radius: 6px; color: #fff; }
.side .m { min-width: 46px; font-size: 9.5px; padding: 3px 4px; }
.m-get { background: var(--get); }
.m-post { background: var(--post); }
.m-delete { background: var(--delete); }

/* hero */
.hero { max-width: 860px; margin-bottom: 48px; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
h1 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.1; letter-spacing: -.025em; margin: 6px 0 14px; }
.lead { font-size: 17.5px; color: var(--muted); margin: 0 0 22px; }
.steps { padding-left: 22px; margin: 0 0 18px; }
.steps li { margin-bottom: 6px; }
h2 { font-size: 26px; letter-spacing: -.015em; margin: 0 0 16px; padding-top: 8px; }
h3 { font-size: 19px; margin: 0 0 8px; letter-spacing: -.01em; }
h3 a { color: var(--text); }
h4 { margin: 18px 0 8px; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.doc { max-width: 860px; margin: 0 0 52px; }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 6px; }
.doc h3 { margin-top: 26px; }
.group { margin-bottom: 30px; }
.group > h2 { padding-bottom: 10px; border-bottom: 1px solid var(--line); }

/* endpoints */
.ep { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; padding: 26px 0 30px; border-bottom: 1px solid var(--line); }
.ep:last-child { border-bottom: 0; }
.route { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.route code { background: none; padding: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.ep-text p { margin: 0 0 6px; }
.note { font-size: 14px; color: var(--muted); margin-top: 12px !important; }
.ep-code { display: grid; gap: 12px; align-content: start; min-width: 0; }
.ep:target .ep-text h3 a { color: var(--accent); }

/* tables */
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); }
td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
tr:first-child td { border-top: 0; }
td:first-child { white-space: nowrap; }
td.ty { font: 12.5px var(--mono); color: var(--muted); white-space: nowrap; }
.req { margin-left: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; color: var(--delete); text-transform: uppercase; }
.code-n { font: 700 13px var(--mono); }

/* code */
.snippet { border-radius: 14px; overflow: hidden; background: var(--code-bg); border: 1px solid var(--code-line); box-shadow: 0 12px 30px rgba(5, 8, 20, .18); }
.snip-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; background: var(--code-head); border-bottom: 1px solid var(--code-line); }
.snip-tabs { display: flex; gap: 2px; }
.snip-tabs button { font: 600 12.5px -apple-system, system-ui, sans-serif; color: var(--code-muted); background: none; border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer; transition: background .15s, color .15s; }
.snip-tabs button:hover { color: var(--code-text); }
.snip-tabs button[aria-selected="true"] { color: #fff; background: rgba(255, 255, 255, .09); }
.snip-title { font: 600 12.5px -apple-system, system-ui, sans-serif; color: var(--code-muted); padding: 6px 8px; }
.ok { color: #4cc38a; margin-left: 4px; font-family: var(--mono); }
.copy { margin-left: auto; font: 600 12px -apple-system, system-ui, sans-serif; color: var(--code-muted); background: rgba(255, 255, 255, .05); border: 1px solid var(--code-line); border-radius: 8px; padding: 5px 10px; cursor: pointer; transition: color .15s, background .15s; }
.copy:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.copy.done { color: #4cc38a; }
pre.code { margin: 0; padding: 14px 16px; overflow-x: auto; color: var(--code-text); font: 13px/1.6 var(--mono); tab-size: 2; }
pre.code code { background: none; padding: 0; font-size: inherit; border-radius: 0; }
.reply pre.code { max-height: 340px; }
.doc > pre.code { border-radius: 14px; background: var(--code-bg); margin: 0 0 14px; }
.pane { animation: pane .25s ease both; }
@keyframes pane { from { opacity: 0; transform: translateY(3px); } }
.t-s { color: var(--t-s); }
.t-p { color: var(--t-p); }
.t-k { color: var(--t-k); }
.t-n { color: var(--t-n); }
.t-c { color: var(--t-c); font-style: italic; }
.t-f { color: var(--t-f); }
.t-m { color: var(--t-m); }
.hero .snippet { margin: 0 0 14px; }

/* colours */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.swatch { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.swatch i { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.swatch code { background: none; padding: 0; }
.foot { color: var(--muted); font-size: 14px; padding-top: 20px; border-top: 1px solid var(--line); }

/* arrival */
main > section, main > .group { animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
main > :nth-child(2) { animation-delay: .05s; }
main > :nth-child(3) { animation-delay: .1s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { main > section, main > .group, .pane, .side { animation: none !important; transition: none !important; } }

/* narrower */
@media (max-width: 1180px) { .ep { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .top-links { display: none; }
  .menu-btn { display: grid; place-items: center; }
  .side {
    position: fixed; z-index: 15; top: 60px; left: 0; bottom: 0; height: auto; width: min(300px, 86vw); padding: 18px 14px 40px;
    background: var(--bg); border-right: 1px solid var(--line); box-shadow: 20px 0 50px rgba(0, 0, 0, .25);
    transform: translateX(-105%); visibility: hidden; transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s .3s;
  }
  .side.open { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
  main { padding: 26px 16px 60px; }
  td:first-child { white-space: normal; }
}

/* the permission an endpoint needs */
.perm { font: 600 11px/1 var(--mono); padding: 4px 8px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.perm::before { content: "needs "; color: var(--muted); font-weight: 500; }
.perm:hover { text-decoration: none; filter: brightness(1.1); }
.snip-tabs { flex-wrap: wrap; }
