/* SpiderGate API reference — monochrome.
   Stripe-class structure, no hue: hierarchy comes from weight, scale, opacity
   and hairlines. The only "colour" is white at varying alpha on near-black. */

:root{
  --sg-bg:#0A0A0B; --sg-panel:#0E0E10; --sg-panel-2:#131316;
  --sg-line:rgba(255,255,255,.08); --sg-line-2:rgba(255,255,255,.14);
  --sg-fg:rgba(255,255,255,.94); --sg-fg-2:rgba(255,255,255,.66); --sg-fg-3:rgba(255,255,255,.42);
  --sg-mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
  --sg-r:10px;
}

/* ── shell ─────────────────────────────────────────────────────────────── */
.sg-api-shell{max-width:1560px;width:100%}
.sg-api{display:flex;flex-direction:column;gap:2.5rem}

/* ── section toolbar ───────────────────────────────────────────────────── */
.sg-api-bar{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;
  padding-bottom:1.15rem;border-bottom:1px solid var(--sg-line)}
.sg-baseurl{display:flex;align-items:center;gap:.6rem;min-width:0}
.sg-baseurl-lbl{font-size:.7rem;text-transform:uppercase;letter-spacing:.09em;color:var(--sg-fg-3)}
.sg-baseurl code{font-family:var(--sg-mono);font-size:.82rem;color:var(--sg-fg);
  background:var(--sg-panel-2);border:1px solid var(--sg-line);border-radius:6px;padding:.3rem .55rem}
.sg-api-actions{display:flex;align-items:center;gap:.5rem}
.sg-mini{font:inherit;font-size:.75rem;line-height:1;color:var(--sg-fg-2);text-decoration:none;
  background:transparent;border:1px solid var(--sg-line-2);border-radius:6px;padding:.42rem .7rem;
  cursor:pointer;transition:color .15s,border-color .15s,background .15s;white-space:nowrap}
.sg-mini:hover{color:var(--sg-fg);border-color:rgba(255,255,255,.32);background:rgba(255,255,255,.04)}
.sg-mini.is-copied{color:#0A0A0B;background:#fff;border-color:#fff}

/* ── method badge: differentiated by FILL, never by hue ────────────────── */
.sg-badge,.ep-method{display:inline-block;font-family:var(--sg-mono);font-size:.66rem;font-weight:700;
  letter-spacing:.08em;text-transform:uppercase;padding:.26rem .5rem;border-radius:5px;
  border:1px solid var(--sg-line-2);color:var(--sg-fg-2);background:transparent;line-height:1;white-space:nowrap}
.sg-badge--post,.ep-method--post{background:#fff;color:#0A0A0B;border-color:#fff}          /* writes: solid */
.sg-badge--get,.ep-method--get{color:var(--sg-fg);border-color:rgba(255,255,255,.3)}        /* reads: outline */
.sg-badge--delete,.ep-method--delete{color:var(--sg-fg);border-color:rgba(255,255,255,.5);border-style:dashed}
.sg-badge--patch,.ep-method--patch,.sg-badge--put,.ep-method--put{color:var(--sg-fg-2);border-style:dashed}

/* ── endpoint index ────────────────────────────────────────────────────── */
.sg-index{border:1px solid var(--sg-line);border-radius:var(--sg-r);overflow:hidden;background:var(--sg-panel)}
.sg-index-row{display:grid;grid-template-columns:76px minmax(200px,auto) 1fr;align-items:center;gap:1rem;
  padding:.8rem 1.1rem;border-bottom:1px solid var(--sg-line);text-decoration:none;transition:background .14s}
.sg-index-row:last-child{border-bottom:0}
.sg-index-row:hover{background:rgba(255,255,255,.045)}
.sg-index-path{font-family:var(--sg-mono);font-size:.82rem;color:var(--sg-fg)}
.sg-index-sum{font-size:.84rem;color:var(--sg-fg-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ── endpoint card: the two-column core ────────────────────────────────── */
.ep-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(440px,520px);gap:3rem;
  padding:2.75rem 0;border-top:1px solid var(--sg-line);scroll-margin-top:5rem}
.ep-card:first-of-type{border-top:0}

.ep-head{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap;margin-bottom:1rem}
.ep-path{font-family:var(--sg-mono);font-size:.9rem;color:var(--sg-fg);word-break:break-all}
.ep-summary{font-size:1.32rem;font-weight:650;color:#fff;line-height:1.25;margin:.2rem 0 .85rem;letter-spacing:-.01em}
.ep-description{font-size:.92rem;line-height:1.72;color:var(--sg-fg-2);margin:0 0 2rem;
  white-space:pre-line;max-width:62ch}   /* pre-line keeps the • list structure */

.ep-label{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.1em;
  color:var(--sg-fg-3);margin:2rem 0 .9rem;padding-bottom:.5rem;border-bottom:1px solid var(--sg-line)}

/* params as a definition list, hairline-separated (Stripe's attribute list) */
.ep-params{display:flex;flex-direction:column}
.ep-param{padding:.95rem 0;border-bottom:1px solid var(--sg-line)}
.ep-param:last-child{border-bottom:0}
.ep-param-head{display:flex;align-items:baseline;gap:.55rem;flex-wrap:wrap}
.ep-param-name{font-family:var(--sg-mono);font-size:.86rem;font-weight:600;color:#fff}
.ep-param-type{font-size:.76rem;color:var(--sg-fg-3);font-style:normal}
.ep-param-loc{font-size:.62rem;text-transform:uppercase;letter-spacing:.08em;color:var(--sg-fg-3);
  border:1px solid var(--sg-line);border-radius:4px;padding:.12rem .34rem}
.ep-param-req{font-size:.62rem;text-transform:uppercase;letter-spacing:.08em;font-weight:700;
  color:#0A0A0B;background:rgba(255,255,255,.85);border-radius:4px;padding:.14rem .36rem}
.ep-param-desc{font-size:.86rem;line-height:1.62;color:var(--sg-fg-2);margin-top:.45rem;max-width:60ch}

.ep-responses{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.ep-responses li{display:flex;align-items:baseline;gap:.85rem;padding:.6rem 0;border-bottom:1px solid var(--sg-line);
  font-size:.86rem;color:var(--sg-fg-2)}
.ep-responses li:last-child{border-bottom:0}
.ep-status{font-family:var(--sg-mono);font-size:.78rem;font-weight:700;color:var(--sg-fg);
  border:1px solid var(--sg-line-2);border-radius:5px;padding:.16rem .45rem;min-width:3.1rem;text-align:center;flex:none}
.ep-status--2{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.3);color:#fff}
.ep-status--4,.ep-status--5{opacity:.72}

/* ── sticky code panel ─────────────────────────────────────────────────── */
.ep-code{min-width:0}
.ep-code-panel{position:sticky;top:5rem;border:1px solid var(--sg-line-2);border-radius:var(--sg-r);
  background:var(--sg-panel);overflow:hidden}
.ep-code-bar{padding:.7rem .9rem;border-bottom:1px solid var(--sg-line);background:var(--sg-panel-2)}
.ep-req-line{display:flex;align-items:center;gap:.6rem;min-width:0}
.ep-code-path{font-family:var(--sg-mono);font-size:.78rem;color:var(--sg-fg-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.ep-code-tabs{display:flex;align-items:center;gap:.15rem;padding:0 .5rem;border-bottom:1px solid var(--sg-line);background:var(--sg-panel-2)}
.ep-tab{font:inherit;font-size:.76rem;color:var(--sg-fg-3);background:none;border:0;border-bottom:2px solid transparent;
  padding:.6rem .6rem;cursor:pointer;transition:color .14s,border-color .14s}
.ep-tab:hover{color:var(--sg-fg-2)}
.ep-tab.is-active{color:#fff;border-bottom-color:#fff}
.ep-copy{margin-left:auto;background:none;border:0;color:var(--sg-fg-3);cursor:pointer;padding:.4rem;
  border-radius:5px;display:flex;transition:color .14s,background .14s}
.ep-copy:hover{color:#fff;background:rgba(255,255,255,.07)}
.ep-copy.is-copied{color:#fff}

.ep-code-bodies{max-height:26rem;overflow:auto}
.ep-code-body{display:none;margin:0;padding:1rem 1.1rem;background:transparent;overflow-x:auto}
.ep-code-body.is-active{display:block}
.ep-code-body code{font-family:var(--sg-mono);font-size:.78rem;line-height:1.68;color:var(--sg-fg);white-space:pre}

.ep-disclosure{border-top:1px solid var(--sg-line)}
.ep-disclosure summary{cursor:pointer;list-style:none;padding:.68rem .9rem;font-size:.7rem;text-transform:uppercase;
  letter-spacing:.09em;color:var(--sg-fg-3);transition:color .14s}
.ep-disclosure summary::-webkit-details-marker{display:none}
.ep-disclosure summary::before{content:'›';display:inline-block;margin-right:.5rem;transition:transform .16s}
.ep-disclosure[open] summary::before{transform:rotate(90deg)}
.ep-disclosure summary:hover{color:var(--sg-fg)}
.ep-json{margin:0;padding:0 1.1rem 1rem;max-height:18rem;overflow:auto}
.ep-json code{font-family:var(--sg-mono);font-size:.76rem;line-height:1.62;color:var(--sg-fg-2);white-space:pre}

/* ── Try it ────────────────────────────────────────────────────────────── */
.ep-tryit-wrap{padding:.9rem;border-top:1px solid var(--sg-line)}
.ep-tryit{width:100%;font:inherit;font-size:.82rem;font-weight:650;color:#0A0A0B;background:#fff;
  border:1px solid #fff;border-radius:7px;padding:.62rem 1rem;cursor:pointer;transition:opacity .14s}
.ep-tryit:hover{opacity:.87}
.ep-tryit-form{border-top:1px solid var(--sg-line);padding:1rem .9rem;display:flex;flex-direction:column;gap:.4rem}
.ep-tryit-lbl{font-size:.64rem;text-transform:uppercase;letter-spacing:.09em;color:var(--sg-fg-3);margin-top:.35rem}
.ep-tryit-in,.ep-tryit-ta{font-family:var(--sg-mono);font-size:.78rem;color:var(--sg-fg);
  background:var(--sg-bg);border:1px solid var(--sg-line-2);border-radius:6px;padding:.5rem .6rem;width:100%}
.ep-tryit-in:focus,.ep-tryit-ta:focus{outline:none;border-color:rgba(255,255,255,.42)}
.ep-tryit-ta{resize:vertical;line-height:1.55}
.ep-tryit-send{margin-top:.7rem;font:inherit;font-size:.8rem;font-weight:650;color:#0A0A0B;background:#fff;
  border:1px solid #fff;border-radius:7px;padding:.58rem 1rem;cursor:pointer}
.ep-tryit-send:disabled{opacity:.55;cursor:default}
.ep-tryit-result{margin-top:.9rem;display:flex;flex-direction:column;gap:.5rem}
.ep-tryit-status{display:inline-flex;align-items:center;gap:.5rem;font-family:var(--sg-mono);font-size:.74rem;color:var(--sg-fg-2)}
.ep-tryit-out{margin:0;padding:.8rem;background:var(--sg-bg);border:1px solid var(--sg-line);border-radius:7px;
  max-height:19rem;overflow:auto;font-family:var(--sg-mono);font-size:.75rem;line-height:1.6;color:var(--sg-fg-2);white-space:pre}

/* ── responsive ────────────────────────────────────────────────────────── */
@media (max-width:1180px){
  .ep-card{grid-template-columns:1fr;gap:1.75rem}
  .ep-code-panel{position:static}
  .ep-description,.ep-param-desc{max-width:none}
}
@media (max-width:720px){
  .sg-index-row{grid-template-columns:64px 1fr;row-gap:.35rem}
  .sg-index-sum{grid-column:1/-1;white-space:normal}
  .sg-api-bar{flex-direction:column;align-items:flex-start}
}

/* markdown viewer (client-side serialisation — the .md route 415s for docs) */
.sg-md-view{margin:0 0 1.5rem;padding:1.1rem 1.25rem;background:var(--sg-panel);border:1px solid var(--sg-line-2);
  border-radius:var(--sg-r);max-height:30rem;overflow:auto;font-family:var(--sg-mono);font-size:.76rem;
  line-height:1.66;color:var(--sg-fg-2);white-space:pre-wrap;word-break:break-word}

/* ── left nav: pin it, give it its own scroll ──────────────────────────────
   Was: the <aside> stretched to the flex container's full height (5,959px) and
   #docs-nav was `sticky top-8` with overflow:visible — so a 1,444px tree inside
   a 577px viewport simply scrolled away with the page and could never be
   reached at the bottom. Sticky can only pin within its parent's box, so the
   aside must stop stretching too. Header is 79px. */
/* Leave the aside STRETCHED (the flex default). A sticky child can only travel
   inside its parent's box, so shrink-wrapping the aside to the nav's own height
   gives the nav ~458px of travel and then it scrolls away. Don't make the aside
   sticky either — the nav would clamp to the parent's pinned edge and slide
   under the 79px header. The aside stays as-is; only #docs-nav is fixed. */

#docs-nav{
  position:sticky;
  top:calc(79px + 1.25rem);
  max-height:calc(100vh - 79px - 2.5rem);
  overflow-y:auto;
  overscroll-behavior:contain;          /* don't chain the scroll to the page */
  padding-right:.35rem;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.18) transparent;
}
#docs-nav::-webkit-scrollbar{width:8px}
#docs-nav::-webkit-scrollbar-track{background:transparent}
#docs-nav::-webkit-scrollbar-thumb{background:rgba(255,255,255,.14);border-radius:4px;
  border:2px solid transparent;background-clip:content-box}
#docs-nav:hover::-webkit-scrollbar-thumb{background:rgba(255,255,255,.26);background-clip:content-box}

/* the right ToC needs the same header offset on prose pages */
#doc-toc{top:calc(79px + 1.25rem);max-height:calc(100vh - 79px - 2.5rem);overflow-y:auto;
  overscroll-behavior:contain;scrollbar-width:thin}

/* the sticky code panel must clear the header too */
.ep-code-panel{top:calc(79px + 1.25rem)}
.ep-card{scroll-margin-top:calc(79px + 1.5rem)}
