/* ============================================================
   docs.css — v3 docs portal layout
   Loads AFTER site.css. Uses existing tokens (--bg, --text, --amber, etc.)
   Adds:    .docs-shell, .docs-sidebar, .docs-main, .docs-rightrail
            and all internal docs components.
   No tokens redefined here — purely layout + portal-specific styling.
   ============================================================ */

/* ───────── Layout shell — 3 columns desktop, stack on mobile ─────────
   At ≥1500px: equal-ish middle + code (~700px each)
   At 1180–1500px: code pane shrinks to ~480px (Stripe-style)
   Below 1180px: code pane hides, content goes full-width
*/
.docs-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 480px;
  max-width: 1680px;
  margin: 0 auto;
  min-height: calc(100vh - 100px);
  padding-bottom: 80px;  /* buffer before footer — keeps sidebar from butting against it */
  position: relative;
  align-items: start;
}
@media (min-width: 1500px) {
  .docs-shell {
    grid-template-columns: 280px minmax(0, 1fr) minmax(0, 1fr);
  }
}
.docs-shell:has(.docs-rightrail--toc) {
  grid-template-columns: 280px minmax(0, 1fr) 240px;
}
.docs-shell:not(:has(.docs-rightrail)) {
  grid-template-columns: 280px minmax(0, 1fr);
}

/* ───────── Sidebar ───────── */
.docs-sidebar {
  position: sticky;
  top: 64px;
  align-self: start;
  max-height: calc(100vh - 64px);
  overflow-y: scroll;              /* always-visible scrollbar — clear signal to user */
  overscroll-behavior: contain;    /* wheel events don't propagate to page */
  padding: 22px 18px 32px;
  border-right: 1px solid var(--border);
  background: var(--bg);
  z-index: 10;
}
.docs-sidebar::-webkit-scrollbar         { width: 8px; }
.docs-sidebar::-webkit-scrollbar-track   { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb   { background: var(--border-strong); border-radius: 4px; }
.docs-sidebar::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
/* Firefox */
.docs-sidebar { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

.docs-sidebar-head {
  padding: 0 4px 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Search trigger button in sidebar */
.docs-search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-3);
  font: 13px var(--font-body, system-ui);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.docs-search-trigger:hover {
  border-color: var(--text-3);
  background: var(--bg-2);
}
.docs-search-trigger kbd {
  margin-left: auto;
  padding: 2px 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font: 11px var(--font-mono);
  color: var(--text-3);
}
.docs-search-trigger svg { color: var(--text-3); flex-shrink: 0; }

/* Nav tree */
.docs-nav {
  font-size: 14px;
}
.docs-nav-group {
  margin-bottom: 2px;
}
.docs-nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 12px;
  background: transparent;
  border: 0;
  text-align: left;
  font: 700 14px var(--font-display, var(--font-body, system-ui));
  letter-spacing: -.005em;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
}
.docs-nav-group-toggle:hover { background: var(--bg-1); color: var(--text); }
.docs-nav-chev {
  transition: transform .18s;
  color: var(--text-2);
}
.docs-nav-group.is-expanded .docs-nav-chev { transform: rotate(180deg); }
.docs-nav-list {
  list-style: none;
  margin: 2px 0 8px;
  padding: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height .25s;
}
.docs-nav-group.is-expanded > .docs-nav-list {
  max-height: 8000px;
}
.docs-nav-item { margin: 0; }
.docs-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 24px;
  color: var(--text-2);
  text-decoration: none;
  border-left: 2px solid transparent;
  font-size: 13.5px;
  line-height: 1.4;
  border-radius: 0 6px 6px 0;
  margin-left: -2px;
  transition: color .12s, background .12s, border-color .12s;
}
.docs-nav-link:hover { color: var(--text); background: var(--bg-1); }
.docs-nav-item.is-active .docs-nav-link {
  color: var(--amber);
  background: var(--bg-1);
  border-left-color: var(--amber);
  font-weight: 600;
}
.docs-nav-item.is-disabled .docs-nav-link {
  color: var(--text-3);
  font-style: italic;
  cursor: default;
}

/* HTTP method pill in nav — uses centralized --method-* tokens from site.css */
.docs-nav-method {
  font: 700 9px var(--font-mono);
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: .04em;
  flex-shrink: 0;
  min-width: 32px;
  text-align: center;
}
.docs-nav-method--get    { background: var(--method-get-bg);    color: var(--method-get); }
.docs-nav-method--post   { background: var(--method-post-bg);   color: var(--method-post); }
.docs-nav-method--put    { background: var(--method-put-bg);    color: var(--method-put); }
.docs-nav-method--delete { background: var(--method-delete-bg); color: var(--method-delete); }
.docs-nav-method--patch  { background: var(--method-patch-bg);  color: var(--method-patch); }

/* ───────── Sub-group (level 2: e.g. Vedic > Natal Charts) ───────── */
.docs-nav-subgroup {
  list-style: none;
  margin: 0;
  padding: 0;
}
.docs-nav-subgroup-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 12px 5px 18px;
  background: transparent;
  border: 0;
  text-align: left;
  font: 600 13px var(--font-body, system-ui);
  color: var(--text-2);
  cursor: pointer;
  border-radius: 6px;
  transition: color .12s, background .12s;
}
.docs-nav-subgroup-toggle:hover {
  color: var(--text);
  background: var(--bg-1);
}
.docs-nav-chev-sub {
  flex-shrink: 0;
  color: var(--text-2);
  transition: transform .18s;
  margin-right: 2px;
}
.docs-nav-subgroup.is-expanded .docs-nav-chev-sub {
  transform: rotate(180deg);
}
.docs-nav-subgroup-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.docs-nav-subgroup-count {
  font: 10.5px var(--font-mono);
  color: var(--text-3);
  background: var(--bg-2);
  padding: 1px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}
.docs-nav-list--sub {
  margin: 1px 0 4px;
  padding: 0;
  list-style: none;
  overflow: hidden;
  max-height: 0;
  transition: max-height .25s;
}
.docs-nav-subgroup.is-expanded .docs-nav-list--sub {
  max-height: 2000px;
}
/* Endpoints inside a sub-group: deeper indent + smaller font + monospace */
.docs-nav-list--sub .docs-nav-link {
  padding: 4px 12px 4px 30px;
  font-size: 12.5px;
  font-family: var(--font-mono);
  color: var(--text-2);
  gap: 8px;
}
.docs-nav-list--sub .docs-nav-link:hover {
  color: var(--text);
}
.docs-nav-list--sub .docs-nav-item.is-active .docs-nav-link {
  color: var(--amber);
  font-weight: 500;
}
/* In sub-lists, badges are slightly tighter still */
.docs-nav-list--sub .docs-nav-method {
  font-size: 8.5px;
  padding: 1px 4px;
  min-width: 30px;
}

/* ───────── Main content ───────── */
.docs-main {
  padding: 40px 56px 24px;
  min-width: 0; /* allows children with overflow to behave */
}
.docs-article { max-width: 760px; }
.docs-eyebrow {
  font: 600 11.5px var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 14px;
}
.docs-title {
  font: 700 clamp(28px, 4vw, 40px) var(--font-display, system-ui);
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 0 0 18px;
  color: var(--text);
}

/* Article body — content typography */
.docs-body { font-size: 15px; line-height: 1.7; color: var(--text-2); }
.docs-body > * + * { margin-top: 0; }
.docs-body p { margin: 0 0 16px; max-width: 720px; }
.docs-body p:last-child { margin-bottom: 0; }
.docs-body h2 {
  font: 700 24px var(--font-display, system-ui);
  letter-spacing: -.015em;
  color: var(--text);
  margin: 56px 0 12px;
  scroll-margin-top: 80px;
}
.docs-body h3 {
  font: 600 18px var(--font-display, system-ui);
  color: var(--text);
  margin: 36px 0 10px;
  scroll-margin-top: 80px;
}
.docs-body h4 {
  font: 600 13.5px var(--font-mono);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 28px 0 8px;
}
.docs-body ul, .docs-body ol {
  margin: 0 0 16px 22px;
  padding: 0;
}
.docs-body li { margin-bottom: 6px; }
.docs-body strong { color: var(--text); font-weight: 600; }

/* Inline code in docs body */
.docs-body p code, .docs-body li code, .docs-body td code {
  font: 13px var(--font-mono);
  background: var(--code-bg, var(--bg-2));
  border: 1px solid var(--code-border, var(--border));
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--amber);
}

/* Code blocks INSIDE article body (not in code pane) */
.docs-body pre {
  background: var(--code-bg, #0f0f1e);
  border: 1px solid var(--code-border, var(--border));
  border-radius: 8px;
  padding: 18px 22px;
  overflow-x: auto;
  font: 13px/1.6 var(--font-mono);
  color: var(--text);
  margin: 14px 0 22px;
}
.docs-body pre code { color: inherit; background: transparent; border: 0; padding: 0; }

/* Tables in docs body */
.docs-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 24px;
  font-size: 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: table;  /* will be overridden on mobile */
}
/* On mobile, wrap tables in a horizontal-scroll context so they don't squeeze cells */
@media (max-width: 800px) {
  .docs-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .docs-body table td,
  .docs-body table th {
    white-space: nowrap;
  }
}
.docs-body th {
  background: var(--bg-2);
  color: var(--text-3);
  padding: 11px 16px;
  text-align: left;
  font: 600 11px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--border);
}
.docs-body td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}
.docs-body tr:last-child td { border-bottom: none; }

/* Callouts (info, warning, etc.) */
.docs-callout {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: 6px;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 14px;
  color: var(--text-2);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.docs-callout strong { display: block; margin-bottom: 4px; color: var(--text); }
.docs-callout code {
  /* Allow long URLs/paths inside callouts to wrap instead of overflowing */
  word-break: break-all;
  white-space: normal;
}
.docs-callout--green { border-left-color: var(--green, #10b981); }
.docs-callout--blue  { border-left-color: var(--blue, #2563eb); }
.docs-callout--rose  { border-left-color: var(--rose, #db2777); }

/* Article footer */
.docs-article-footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.docs-edit-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  text-decoration: none;
  font-size: 13px;
}
.docs-edit-link:hover { color: var(--amber); }

/* ───────── Right rail ───────── */
.docs-rightrail {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 40px 28px 80px 16px;
  border-left: 1px solid var(--border);
}
.docs-rightrail::-webkit-scrollbar { width: 6px; }
.docs-rightrail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Code pane */
.docs-codepane {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}
.docs-codepane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}
.docs-codepane-label {
  font: 700 10.5px var(--font-mono);
  letter-spacing: .12em;
  color: var(--text-2);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.docs-status {
  background: var(--green);
  color: #fff;
  padding: 2px 7px;
  border-radius: 3px;
  font: 700 10px var(--font-mono);
  letter-spacing: .04em;
}
.docs-lang-select {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font: 600 11.5px var(--font-mono);
  padding: 4px 24px 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 10px;
}
.docs-lang-select:hover  { border-color: var(--amber); }
.docs-lang-select:focus  { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber-soft); }
.docs-codeblock {
  margin: 0;
  padding: 14px 16px;
  font: 12.5px/1.65 var(--font-mono);
  color: var(--text);
  background: var(--code-bg);
  overflow-y: auto;
  max-height: 360px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.docs-codeblock code { color: inherit; background: transparent; border: 0; padding: 0; font: inherit; }
.docs-codeblock--response { color: var(--text-2); }

/* "On this page" TOC */
.docs-toc {
  font-size: 13px;
}
.docs-toc-head {
  font: 600 11px var(--font-mono);
  letter-spacing: .12em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.docs-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}
.docs-toc-link {
  display: block;
  padding: 6px 0 6px 14px;
  margin-left: -1px;
  color: var(--text-2);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .12s, border-color .12s;
  line-height: 1.5;
}
.docs-toc-link:hover { color: var(--text); }
.docs-toc-link.is-active {
  color: var(--amber);
  border-left-color: var(--amber);
  font-weight: 600;
}

/* ───────── Search modal ───────── */
.docs-search-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 1000;
  padding: 80px 20px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.docs-search-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.docs-search-modal-inner {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px -10px rgba(0,0,0,.5);
}
.docs-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.docs-search-input-wrap svg { color: var(--text-3); flex-shrink: 0; }
.docs-search-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font: 16px var(--font-body, system-ui);
}
.docs-search-input-wrap kbd {
  padding: 3px 7px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font: 11px var(--font-mono);
  color: var(--text-3);
}
.docs-search-results {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: 60vh;
  overflow-y: auto;
}
.docs-search-results:empty + .docs-search-footer { display: none; }
.docs-search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
}
.docs-search-result.is-active,
.docs-search-result:hover {
  background: var(--bg-1);
}
.docs-search-result-method {
  font: 700 10px var(--font-mono);
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.docs-search-result-label { flex: 1; font-size: 14px; }
.docs-search-result-category { font: 11px var(--font-mono); color: var(--text-3); }
.docs-search-empty {
  padding: 36px 18px;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
}
.docs-search-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-1);
  font: 11px var(--font-mono);
  color: var(--text-3);
}
.docs-search-footer kbd {
  padding: 2px 5px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-right: 6px;
}

/* ───────── Mobile bar (top toggle) ───────── */
.docs-mobile-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: fixed;
  top: 64px;  /* sits below your site header */
  left: 0;
  right: 0;
  z-index: 50;
}
.docs-mobile-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.docs-search-trigger--mobile {
  /* On mobile, search trigger looks like an input (full-width remaining space) */
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: 9px 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-3);
  font: 13.5px var(--font-body, system-ui);
  cursor: pointer;
  text-align: left;
  min-width: 0;
}
.docs-search-trigger--mobile svg { flex-shrink: 0; color: var(--text-3); }
.docs-search-trigger--mobile span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Hide the ⌘K kbd hint on the sidebar search trigger when sidebar is open on mobile */
@media (max-width: 800px) {
  .docs-sidebar .docs-search-trigger kbd { display: none; }
}
.docs-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
  opacity: 0;
  transition: opacity .2s;
}
.docs-sidebar-backdrop.is-open { display: block; opacity: 1; }

/* ───────── Responsive — tablet ───────── */
@media (max-width: 1180px) {
  .docs-shell,
  .docs-shell:has(.docs-rightrail--toc),
  .docs-shell:not(:has(.docs-rightrail)) {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .docs-rightrail { display: none; }
  .docs-main { padding: 36px 40px 60px; }
}

/* ───────── Responsive — mobile ───────── */
@media (max-width: 800px) {
  .docs-shell {
    display: block;
    /* Mobile bar height (~51px: 10+30+10+1) — clear it safely without gap */
    padding-top: 52px;
    padding-bottom: 0;  /* mobile sidebar is fixed-position, no buffer needed */
  }
  .docs-mobile-bar { display: flex; }
  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 80vw;
    max-width: 300px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .25s;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0,0,0,.2);
  }
  .docs-sidebar.is-open { transform: translateX(0); }
  .docs-main {
    padding: 14px 18px 40px;
  }
  .docs-title { font-size: clamp(24px, 6vw, 32px); }
  .docs-body { font-size: 14.5px; }
  .docs-body h2 { font-size: 22px; margin: 40px 0 10px; }
  .docs-body h3 { font-size: 17px; }
  .docs-search-modal { padding: 40px 14px 14px; }
}

/* ───────── Copy button on code panes (floating top-right INSIDE pane) ───────── */
.docs-codepane { position: relative; }  /* ensure copy button anchors here */
.docs-copy-btn {
  position: absolute;
  top: 6px;
  right: 22px;  /* clear scrollbar width when codeblock vertically scrolls */
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--text-2);
  font: 600 11px var(--font-mono);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s, box-shadow .15s;
  z-index: 5;
}
.docs-copy-btn:hover {
  color: var(--text);
  border-color: var(--amber);
  box-shadow: 0 0 0 2px var(--amber-soft);
}
.docs-copy-btn.is-copied {
  color: var(--green);
  border-color: var(--green);
  background: var(--green-soft);
}
.docs-copy-btn svg { width: 12px; height: 12px; }
/* Copy button positioned below the head bar (which contains REQUEST label + dropdown) */
.docs-codepane-head + .docs-copy-btn,
.docs-codepane .docs-copy-btn {
  /* Default top spot if no head bar */
  top: 6px;
}
.docs-codepane:has(.docs-codepane-head) .docs-copy-btn {
  /* When head bar present (always, in our markup), nudge below it */
  top: 46px;
}

/* ───────── Breadcrumbs ───────── */
.docs-breadcrumbs {
  margin: 0 0 14px;
}
.docs-breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.docs-breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.docs-breadcrumbs a,
.docs-breadcrumbs span {
  font-size: 13px;
  color: var(--text-3);
  text-decoration: none;
  font-family: var(--font-mono);
  letter-spacing: .02em;
}
.docs-breadcrumbs a:hover {
  color: var(--amber);
}
.docs-breadcrumbs [aria-current="page"] {
  color: var(--text-2);
}
.docs-breadcrumbs-sep {
  color: var(--text-3);
  opacity: .55;
  margin: 0 2px;
  font-family: var(--font-mono);
}
@media (max-width: 800px) {
  .docs-breadcrumbs { margin-bottom: 10px; }
  .docs-breadcrumbs a,
  .docs-breadcrumbs span { font-size: 12px; }
}

/* ───────── Wide layout — opt-in for overview/landing pages without right rail ───────── */
.docs-article.docs-article--wide { max-width: none; }
.docs-article.docs-article--wide .docs-body p { max-width: none; }

/* ───────── Category cards (overview pages with multiple sub-categories) ───────── */
.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
  margin: 24px 0 32px;
}
.docs-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .15s;
}
.docs-card:hover {
  border-color: var(--text-3);
}
.docs-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.docs-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.005em;
}
.docs-card-count {
  font: 11px var(--font-mono);
  color: var(--text-3);
  background: var(--bg-2);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.docs-card-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
}

/* Endpoint rows — Stripe-style HTTP method badges */
.docs-card-list {
  list-style: none;
  margin: 4px -20px -20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.docs-card-list li {
  margin: 0;
  border-bottom: 1px solid var(--border);
}
.docs-card-list li:last-child {
  border-bottom: 0;
  border-radius: 0 0 10px 10px;
  overflow: hidden;
}
.docs-card-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  text-decoration: none;
  color: var(--text-2);
  font: 12.5px var(--font-mono);
  transition: background .12s, color .12s;
}
.docs-card-list a:hover {
  background: var(--bg-2);
  color: var(--text);
}
.docs-card-method {
  display: inline-block;
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 3px;
  font: 600 9.5px var(--font-mono);
  letter-spacing: 0.05em;
  background: var(--method-get-bg);
  color: var(--method-get);
}
.docs-card-method--post   { background: var(--method-post-bg);   color: var(--method-post); }
.docs-card-method--put    { background: var(--method-put-bg);    color: var(--method-put); }
.docs-card-method--delete { background: var(--method-delete-bg); color: var(--method-delete); }
.docs-card-method--patch  { background: var(--method-patch-bg);  color: var(--method-patch); }
.docs-card-endpoint {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobile: single column cards */
@media (max-width: 700px) {
  .docs-cards {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .docs-card {
    padding: 16px 18px 18px;
  }
  .docs-card-list {
    margin: 4px -18px -18px;
  }
  .docs-card-list a {
    padding: 8px 18px;
  }
}

/* Docs nav group icons */
.docs-nav-icon { display: inline-flex; align-items: center; width: 14px; height: 14px; opacity: 0.5; margin-right: 6px; position: relative; top: 1px; }
.docs-nav-group.is-expanded > .docs-nav-group-toggle .docs-nav-icon { opacity: 0.9; }

/* Fix nav icon + label alignment */
.docs-nav-group-toggle { justify-content: flex-start; gap: 0; }
.docs-nav-group-toggle > .docs-nav-chev { margin-left: auto; }

/* Fill gap between main header and docs mobile bar so scrolling content doesn't bleed through */
@media (max-width: 768px) {
  .docs-mobile-bar::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: var(--docs-bg, #0d1117);
    z-index: -1;
  }
}

/* Fix status card overflow on long endpoint paths */
.st-card { overflow: hidden; min-width: 0; }
.st-info { min-width: 0; overflow: hidden; }
.st-right { flex-shrink: 0; }
