/* ============================================================
   KLIPPSTER DOCS
   The landing page's tokens, laid out for reading rather than
   for selling. Same canvas, same ink, same keycaps — a docs page
   should feel like the same product, not like a different site
   that happens to share a logo.

   Generated pages include this file; the shell lives in
   site/scripts/build-docs.mjs.
   ============================================================ */

:root {
  color-scheme: dark;

  /* canvas — identical to index.html */
  --bg:        #08080b;
  --bg-2:      #0c0c11;
  --surface:   rgba(255,255,255,0.028);
  --surface-2: rgba(255,255,255,0.05);
  --hairline:  rgba(255,255,255,0.09);
  --hairline-strong: rgba(255,255,255,0.16);

  /* ink */
  --ink:       #f5f5f8;
  --ink-2:     #b7b7c2;
  --ink-3:     #7c7c88;

  /* brand */
  --k-blue:    #4361ff;
  --k-cyan:    #23d3ee;
  --grad-k:    linear-gradient(135deg, #5a72ff 0%, #23d3ee 100%);

  --fan-amber: #ffb020;
  --fan-orange:#ff6a3c;
  --fan-mag:   #e0409a;
  --fan-violet:#8b5cf6;
  --fan-indigo:#4f46e5;
  --grad-fan:  linear-gradient(160deg, #ffb020 0%, #ff5e3a 26%, #e0409a 55%, #8b5cf6 80%, #4f46e5 100%);

  --radius:    18px;
  --radius-lg: 28px;

  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --font-mono:    "SFMono-Regular", ui-monospace, monospace;

  /* docs layout */
  --nav-h:      68px;
  --sidebar-w:  254px;
  --toc-w:      212px;
  --gutter:     44px;
  --docs-wrap:  1440px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  /* Anchored headings must clear the sticky nav, or clicking a TOC link parks the
     heading underneath it. This is why the JS scroller does not need an offset. */
  scroll-padding-top: calc(var(--nav-h) + 24px);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* The landing page's atmosphere, dialled down. At full strength the glows sit
   behind body text for the length of a long page, which is pretty for one screen
   and tiring for ten. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(70% 50% at 8% 0%, rgba(139,92,246,0.13), transparent 62%),
    radial-gradient(55% 45% at 96% 4%, rgba(224,64,154,0.08), transparent 64%),
    radial-gradient(60% 50% at 92% 100%, rgba(35,211,238,0.07), transparent 62%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; opacity: 0.4;
  pointer-events: none; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Every interactive thing gets the same ring. Keyboard users on a docs site are
   not an edge case — they are the audience for half of what is written here. */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--k-cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============================================================
   TOP BAR — the landing page's nav, minus the section anchors
   ============================================================ */
.dnav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(8,8,11,0.72);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--hairline);
}
.dnav-inner {
  max-width: var(--docs-wrap);
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex; align-items: center; gap: 20px;
}
/* The lockup itself is assets/site-nav.css, linked ahead of this file — the same one the landing
   page and every standalone page use. Only the tag beside it belongs to the docs. */
.dnav .brand .docs-tag {
  font-family: var(--font-mono); font-weight: 500; font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
  padding-left: 11px; margin-left: 1px;
  border-left: 1px solid var(--hairline-strong);
}
.dnav-links { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.dnav-links a { font-size: 14.5px; color: var(--ink-2); font-weight: 500; transition: color .2s; }
.dnav-links a:hover { color: var(--ink); }
.dnav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  letter-spacing: -0.01em; color: #06131a;
  padding: 9px 16px; border-radius: 10px;
  background: var(--grad-k);
  box-shadow: 0 10px 30px -12px rgba(35,211,238,0.5), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s;
}
.dnav-cta:hover { transform: translateY(-2px); box-shadow: 0 18px 42px -14px rgba(35,211,238,0.6); }
.dnav-cta small { font-family: var(--font-mono); font-weight: 400; font-size: 11px; opacity: 0.75; }

/* Hamburger — only ever visible where the sidebar is not */
.dnav-burger {
  display: none;
  width: 40px; height: 40px; margin-right: -6px;
  align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: 10px; color: var(--ink); cursor: pointer;
}
.dnav-burger svg { width: 18px; height: 18px; }

/* ============================================================
   SHELL — sidebar | article | table of contents
   ============================================================ */
.docs-shell {
  max-width: var(--docs-wrap);
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: var(--gutter);
  align-items: start;
}

/* ---------- sidebar ---------- */
.docs-sidebar {
  position: sticky;
  top: var(--nav-h);
  /* Its own scrollbar, so a long nav never drags the article with it. */
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 34px 12px 60px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.14) transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 8px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 8px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }

.side-group + .side-group { margin-top: 28px; }
.side-group h4 {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 10px; padding-left: 13px;
}
.side-link {
  position: relative;
  display: block;
  padding: 7px 13px;
  margin-bottom: 1px;
  font-size: 14.5px;
  color: var(--ink-2);
  border-radius: 9px;
  transition: color .18s, background .18s;
}
.side-link:hover { color: var(--ink); background: var(--surface-2); }
.side-link.is-current {
  color: var(--ink);
  font-weight: 600;
  background: linear-gradient(90deg, rgba(67,97,255,0.16), rgba(35,211,238,0.05));
}
/* The accent bar reads as "you are here" faster than the weight change does. */
.side-link.is-current::before {
  content: "";
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 2px; border-radius: 2px;
  background: var(--grad-k);
}

/* ---------- article column ---------- */
.docs-main { min-width: 0; padding: 34px 0 96px; }
.docs-article { max-width: 760px; }

/* breadcrumb */
.crumbs {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 18px;
}
.crumbs a { color: var(--ink-3); transition: color .2s; }
.crumbs a:hover { color: var(--ink-2); }
.crumbs .sep { opacity: 0.5; }
.crumbs .here { color: var(--ink-2); }

/* page header */
.docs-head { margin-bottom: 40px; }
.docs-head h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.4vw, 44px);
  font-weight: 800; letter-spacing: -0.025em; line-height: 1.08;
  margin: 0 0 14px;
}
.docs-head .lede {
  font-size: 19px; line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
  max-width: 60ch;
}
.docs-head .eyebrow {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.docs-head .eyebrow::before {
  content: ""; width: 22px; height: 1px;
  background: linear-gradient(90deg, var(--fan-mag), transparent);
}

/* ============================================================
   PROSE
   ============================================================ */
.prose { font-size: 16.5px; line-height: 1.72; color: var(--ink-2); }
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }

.prose h2, .prose h3, .prose h4 {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.18;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.prose h2 {
  font-size: 27px; font-weight: 800;
  margin: 56px 0 16px;
  padding-top: 26px;
  border-top: 1px solid var(--hairline);
}
/* An h2 that opens the article has nothing above it to be separated from. */
.prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.prose h3 { font-size: 20px; font-weight: 700; margin: 38px 0 12px; }
.prose h4 { font-size: 16.5px; font-weight: 700; margin: 28px 0 10px; }

.prose p { margin: 0 0 18px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { color: var(--ink-2); }

.prose a {
  color: var(--k-cyan);
  text-decoration: underline;
  text-decoration-color: rgba(35,211,238,0.35);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color .2s, color .2s;
}
.prose a:hover { color: #6ee7ff; text-decoration-color: currentColor; }

/* Links that are whole surfaces rather than words in a sentence — the cards on
   the docs index, the pager. Without this they inherit the underline and the
   cyan, and a card reads as a paragraph somebody linked by accident. */
.prose a.doc-card,
.prose a.doc-card:hover,
.prose a.dnav-cta,
.prose a.dnav-cta:hover {
  color: inherit;
  text-decoration: none;
}
.prose a.dnav-cta, .prose a.dnav-cta:hover { color: #06131a; }

/* anchor link — appears on hover, always reachable by keyboard */
.anchor {
  float: left;
  width: 24px; margin-left: -24px;
  color: var(--ink-3);
  opacity: 0;
  text-decoration: none;
  font-weight: 400;
  transition: opacity .18s, color .18s;
}
.prose h2:hover .anchor,
.prose h3:hover .anchor,
.anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--k-cyan); }
@media (max-width: 900px) { .anchor { display: none; } }

/* lists */
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 0; list-style: none; }
.prose ul > li, .prose ol > li { position: relative; padding-left: 26px; margin-bottom: 9px; }
.prose ul > li::before {
  content: "";
  position: absolute; left: 7px; top: 0.66em;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--fan-mag);
}
.prose ol { counter-reset: step; }
.prose ol > li { counter-increment: step; }
.prose ol > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0.16em;
  width: 19px; height: 19px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  color: var(--k-cyan);
  background: rgba(35,211,238,0.12);
  border-radius: 6px;
}
.prose li > ul, .prose li > ol { margin: 9px 0 0; }
.prose li > p { margin-bottom: 10px; }

/* numbered procedure — for "do this, then this" */
.steps { counter-reset: bigstep; margin: 26px 0; }
.step {
  position: relative;
  counter-increment: bigstep;
  padding: 0 0 26px 52px;
}
.step::before {
  content: counter(bigstep);
  position: absolute; left: 0; top: -2px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  color: #06131a;
  background: var(--grad-k);
  border-radius: 10px;
  box-shadow: 0 8px 20px -10px rgba(35,211,238,0.6);
}
/* the rail joining one step to the next */
.step::after {
  content: "";
  position: absolute; left: 15.5px; top: 38px; bottom: 4px;
  width: 1px;
  background: linear-gradient(180deg, var(--hairline-strong), transparent);
}
.step:last-child { padding-bottom: 0; }
.step:last-child::after { display: none; }
.step h3, .step h4 { margin-top: 0 !important; margin-bottom: 8px; }
.step > *:last-child { margin-bottom: 0; }

/* ---------- inline code ---------- */
.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--k-cyan);
  background: rgba(35,211,238,0.10);
  border: 1px solid rgba(35,211,238,0.16);
  padding: 1.5px 6px;
  border-radius: 6px;
  white-space: nowrap;
}
/* Paths and filenames are neutral facts, not API surface — the cyan is too loud
   for a sentence that mentions three of them. */
.prose code.path {
  color: var(--ink-2);
  background: rgba(255,255,255,0.05);
  border-color: var(--hairline);
  white-space: normal;
  word-break: break-word;
}

/* ---------- code blocks ---------- */
.codeblock {
  position: relative;
  margin: 24px 0;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: #0b0b10;
  overflow: hidden;
}
.codeblock-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px 9px 15px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(255,255,255,0.022);
}
.codeblock-lang {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3);
}
.codeblock-title {
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--ink-3);
  margin-left: auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.codeblock pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.72;
  color: #c9cde0;
  -webkit-overflow-scrolling: touch;
}
.codeblock pre code {
  font-size: inherit; color: inherit;
  background: none; border: none; padding: 0;
  white-space: pre;
}

/* copy button — parked in the header when there is one, floating when there is not */
.copy-btn {
  position: absolute; top: 8px; right: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3);
  background: rgba(20,20,26,0.9);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 5px 9px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .18s, color .18s, border-color .18s, background .18s;
}
.codeblock:hover .copy-btn,
.copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--ink); border-color: var(--hairline-strong); background: rgba(30,30,38,0.95); }
.copy-btn.copied { color: #34d399; border-color: rgba(52,211,153,0.4); opacity: 1; }
.codeblock.has-head .copy-btn { top: 7px; }
/* Touch has no hover, so the button would never appear. */
@media (hover: none) { .copy-btn { opacity: 1; } }

/* syntax highlighting — a handful of token classes, applied by build-docs.mjs */
.tok-comment { color: #5d6070; font-style: italic; }
.tok-string  { color: #8fd98f; }
.tok-key     { color: #23d3ee; }
.tok-number  { color: #ffb020; }
.tok-keyword { color: #e0409a; }
.tok-punct   { color: #7c7c88; }
.tok-flag    { color: #8b5cf6; }

/* ---------- callouts ---------- */
.callout {
  position: relative;
  margin: 24px 0;
  padding: 18px 22px 18px 52px;
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--callout-accent, var(--ink-3));
  border-radius: 12px;
  background: var(--surface);
  font-size: 15.5px;
}
.callout > *:first-child { margin-top: 0; }
.callout > *:last-child { margin-bottom: 0; }
.callout::before {
  content: var(--callout-glyph, "•");
  position: absolute; left: 19px; top: 17px;
  font-size: 15px; line-height: 1.4;
}
.callout-title {
  display: block;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: var(--ink);
  margin-bottom: 5px;
}
.callout.note    { --callout-accent: var(--k-cyan);    --callout-glyph: "→"; }
.callout.tip     { --callout-accent: #34d399;          --callout-glyph: "✦"; }
.callout.warn    { --callout-accent: var(--fan-amber); --callout-glyph: "!"; }
.callout.danger  { --callout-accent: var(--fan-orange);--callout-glyph: "⚠"; }
.callout.note::before   { color: var(--k-cyan); }
.callout.tip::before    { color: #34d399; }
.callout.warn::before   { color: var(--fan-amber); font-weight: 800; }
.callout.danger::before { color: var(--fan-orange); }

/* ---------- tables ---------- */
.table-wrap {
  margin: 24px 0;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.prose thead th {
  position: sticky; top: 0;
  text-align: left;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3);
  background: #101015;
  padding: 11px 16px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
.prose tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: top;
  color: var(--ink-2);
}
.prose tbody tr:last-child td { border-bottom: none; }
.prose tbody tr { transition: background .15s; }
.prose tbody tr:hover { background: rgba(255,255,255,0.022); }
.prose tbody td:first-child { color: var(--ink); font-weight: 500; }
.prose td code, .prose th code { white-space: nowrap; }

/* ---------- keycaps ---------- */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.9em; height: 1.9em;
  padding: 0 0.5em;
  font-family: var(--font-mono); font-weight: 500; font-size: 0.88em;
  color: #eaeaf0;
  background: linear-gradient(180deg, #26262e, #16161b);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.10);
  vertical-align: baseline;
  translate: 0 -1px;
}
.keys { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.keys .plus { color: var(--ink-3); font-size: 0.8em; }

/* ---------- HTTP method + endpoint ---------- */
.endpoint {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 6px;
  padding: 11px 15px;
  border: 1px solid var(--hairline);
  border-radius: 11px;
  background: var(--surface);
  font-family: var(--font-mono);
}
.method {
  font-size: 11px; font-weight: 700; letter-spacing: 0.09em;
  padding: 4px 9px; border-radius: 6px;
  color: #06131a;
}
.method.get    { background: var(--k-cyan); }
.method.post   { background: #34d399; }
.method.delete { background: var(--fan-orange); }
.endpoint .path { font-size: 14px; color: var(--ink); word-break: break-all; }
.endpoint .host { color: var(--ink-3); }

/* ---------- definition rows (params, fields) ---------- */
.fields { margin: 22px 0; border-top: 1px solid var(--hairline); }
.field {
  display: grid;
  grid-template-columns: minmax(140px, 190px) 1fr;
  gap: 4px 22px;
  padding: 15px 0;
  border-bottom: 1px solid var(--hairline);
}
.field-name { font-family: var(--font-mono); font-size: 13.5px; color: var(--ink); word-break: break-word; }
.field-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.field-type {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3);
}
.field-req {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px;
  border: 1px solid rgba(224,64,154,0.35);
  color: var(--fan-mag);
}
.field-opt {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--hairline);
  color: var(--ink-3);
}
.field-desc { font-size: 15px; color: var(--ink-2); }
.field-desc > *:first-child { margin-top: 0; }
.field-desc > *:last-child { margin-bottom: 0; }
@media (max-width: 640px) { .field { grid-template-columns: 1fr; } }

/* ---------- card grid (used on the docs index) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 16px;
  margin: 26px 0;
}
.doc-card {
  position: relative;
  display: block;
  padding: 22px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  overflow: hidden;
  transition: transform .2s cubic-bezier(.2,.8,.2,1), border-color .2s, background .2s;
}
.doc-card::before {
  content: "";
  position: absolute; inset: 0 0 auto; height: 1px;
  background: var(--grad-fan);
  opacity: 0.45;
  transition: opacity .2s;
}
.doc-card:hover {
  transform: translateY(-4px);
  border-color: var(--hairline-strong);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
}
.doc-card:hover::before { opacity: 1; }
.doc-card h3 {
  font-family: var(--font-display); font-size: 17px; font-weight: 700;
  color: var(--ink);
  margin: 0 0 7px; letter-spacing: -0.015em;
}
.doc-card p { font-size: 14px; color: var(--ink-3); margin: 0; line-height: 1.55; }
.doc-card .card-kicker {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--ink-3);
  display: block; margin-bottom: 11px;
}

/* ---------- format / fact chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.chip {
  font-family: var(--font-mono); font-size: 12px;
  padding: 5px 11px;
  border: 1px solid var(--hairline);
  border-radius: 100px;
  background: var(--surface);
  color: var(--ink-2);
}

/* ---------- figure / screenshot frame ---------- */
.figure { margin: 28px 0; }
.figure .frame {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 40px 90px -50px rgba(0,0,0,0.9);
}
.figure figcaption {
  margin-top: 11px;
  font-size: 13.5px; color: var(--ink-3);
  text-align: center;
}

/* ---------- horizontal rule ---------- */
.prose hr {
  height: 1px; border: none; margin: 44px 0;
  background: linear-gradient(90deg, var(--hairline), transparent);
}

/* ---------- blockquote ---------- */
.prose blockquote {
  margin: 24px 0;
  padding: 2px 0 2px 20px;
  border-left: 2px solid var(--fan-mag);
  color: var(--ink-2);
  font-size: 16px;
}
.prose blockquote > *:last-child { margin-bottom: 0; }

/* ============================================================
   TABLE OF CONTENTS
   ============================================================ */
.docs-toc {
  position: sticky;
  top: var(--nav-h);
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 40px 0 60px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.docs-toc::-webkit-scrollbar { width: 6px; }
.docs-toc::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 8px; }
.toc-title {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 12px; padding-left: 13px;
}
.toc-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--hairline); }
.toc-list a {
  display: block;
  padding: 5px 12px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  font-size: 13.5px; line-height: 1.45;
  color: var(--ink-3);
  transition: color .18s, border-color .18s;
}
.toc-list a:hover { color: var(--ink-2); }
.toc-list a.is-active {
  color: var(--ink);
  border-left-color: var(--k-cyan);
}
.toc-list .lvl-3 a { padding-left: 24px; font-size: 13px; }

/* ============================================================
   PREV / NEXT
   ============================================================ */
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 64px; padding-top: 32px;
  border-top: 1px solid var(--hairline);
  max-width: 760px;
}
.pager-link {
  display: block;
  padding: 16px 20px;
  border: 1px solid var(--hairline);
  border-radius: 13px;
  background: var(--surface);
  transition: border-color .2s, background .2s, transform .2s cubic-bezier(.2,.8,.2,1);
}
.pager-link:hover { border-color: var(--hairline-strong); background: var(--surface-2); transform: translateY(-2px); }
.pager-link .dir {
  display: block;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.pager-link .label {
  font-family: var(--font-display); font-weight: 700; font-size: 15.5px;
  color: var(--ink); letter-spacing: -0.015em;
}
.pager-link.next { text-align: right; grid-column: 2; }
@media (max-width: 640px) {
  .pager { grid-template-columns: 1fr; }
  .pager-link.next { grid-column: 1; text-align: left; }
}

/* feedback / help footer under the article */
.doc-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-top: 28px;
  font-size: 13.5px; color: var(--ink-3);
  max-width: 760px;
}
.doc-foot a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hairline-strong); }
.doc-foot a:hover { color: var(--ink); }

/* ============================================================
   MOBILE DRAWER
   ============================================================ */
.drawer-scrim {
  position: fixed; inset: 0; z-index: 190;
  background: rgba(4,4,7,0.6);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
body.drawer-open .drawer-scrim { opacity: 1; pointer-events: auto; }

/* ============================================================
   RESPONSIVE
   ------------------------------------------------------------
   Three states: full (sidebar + toc), medium (sidebar only, the
   toc folds into the article), narrow (both behind the burger).
   ============================================================ */
/* A page with no contents column must not leave a hole where one would be.
   Scoped to the widest breakpoint on purpose: an unscoped `.docs-shell.no-toc`
   outranks the plain `.docs-shell` inside the narrower media queries below, so
   the index would keep a two-column grid all the way down to a phone. */
@media (min-width: 1181px) {
  .docs-shell.no-toc { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .docs-shell.no-toc .docs-article { max-width: 880px; }
}

@media (max-width: 1180px) {
  .docs-shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .docs-toc { display: none; }
}

@media (max-width: 900px) {
  :root { --nav-h: 60px; }
  .docs-shell { grid-template-columns: minmax(0, 1fr); padding: 0 22px; }
  .dnav-links { display: none; }
  .dnav-burger { display: inline-flex; }
  .dnav-inner { padding: 0 22px; gap: 14px; }
  .dnav .brand { font-size: 17px; }
  .dnav-cta { margin-left: auto; }

  .docs-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    width: min(310px, 84vw);
    max-height: none;
    padding: 22px 18px 40px;
    background: #0c0c11;
    border-right: 1px solid var(--hairline);
    box-shadow: 0 0 80px rgba(0,0,0,0.7);
    transform: translateX(-102%);
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
    visibility: hidden;
  }
  body.drawer-open .docs-sidebar { transform: translateX(0); visibility: visible; }
  .docs-sidebar .drawer-close {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; margin: 0 0 18px auto;
    background: var(--surface-2); border: 1px solid var(--hairline);
    border-radius: 9px; color: var(--ink); cursor: pointer;
  }
  .docs-main { padding: 26px 0 72px; }
  .docs-head h1 { font-size: 31px; }
  .docs-head .lede { font-size: 17px; }
  .prose h2 { font-size: 23px; margin-top: 44px; }
  .prose h3 { font-size: 18.5px; }
}
@media (min-width: 901px) { .docs-sidebar .drawer-close { display: none; } }

@media (max-width: 560px) {
  .dnav-cta { padding: 8px 12px; }
  .dnav-cta small { display: none; }
  .docs-shell { padding: 0 18px; }
  .dnav-inner { padding: 0 18px; }
  .prose { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   PRINT — someone will print the activation page for a support call
   ============================================================ */
@media print {
  body { background: #fff; color: #000; }
  body::before, body::after { display: none; }
  .dnav, .docs-sidebar, .docs-toc, .pager, .copy-btn, .drawer-scrim, .doc-foot { display: none !important; }
  .docs-shell { display: block; max-width: none; padding: 0; }
  .docs-article, .prose { max-width: none; color: #000; }
  .prose h2, .prose h3, .prose h4, .docs-head h1 { color: #000; }
  .prose a { color: #00c; }
  .codeblock, .callout, .table-wrap { break-inside: avoid; border-color: #bbb; }
}
