/* Steerwise docs pages (site/docs.html, site/docs/**): the three-column layout, code panels,
   parameter lists and callouts, on top of style.css and its tokens. Loaded only by docs pages.
   No colours of its own: every colour is a style.css token, so light and dark come for free.
   No inline styles (the site's CSP forbids them). specs/ui-redesign/docs-pages.md. */

/* ---- Layout: nav | content | on this page ---------------------------------- */
.docs {
  max-width: 1360px; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; gap: 40px; align-items: flex-start;
}
.docs-side {
  flex: 0 0 232px; position: sticky; top: 0; max-height: 100vh; overflow-y: auto;
  padding: 28px 0 40px; font-size: 14px;
}
.docs-main { flex: 1 1 0; min-width: 0; padding: 40px 0 88px; }
.docs-body { max-width: 760px; display: flex; flex-direction: column; gap: 40px; }
.docs-body--wide { max-width: none; }
.docs-toc {
  flex: 0 0 200px; position: sticky; top: 0; padding: 44px 0 40px;
  display: flex; flex-direction: column; gap: 8px; font-size: 13px;
}
.docs-toc h2 { font-size: 13px; font-weight: 600; }
.docs-toc ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.docs-toc a { display: block; padding: 3px 0 3px 12px; border-left: 2px solid var(--border); color: var(--muted); }
.docs-toc a:hover { color: var(--text); border-left-color: var(--text); text-decoration: none; }

/* ---- Docs nav (left column, and the same list in the mobile menu) ---------- */
.docs-nav { display: flex; flex-direction: column; gap: 22px; }
.docs-nav__group { display: flex; flex-direction: column; gap: 2px; }
.docs-nav__label { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 10px 6px; }
.docs-nav ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.docs-nav a {
  min-height: 32px; display: flex; align-items: center; padding: 4px 10px; border-radius: var(--r-sm);
  color: var(--muted);
}
.docs-nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.docs-nav a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 600; }
.docs-nav__ref { border-top: 1px solid var(--border); padding-top: 16px; }
.docs-nav__ref a { gap: 8px; color: var(--text); font-weight: 500; }

/* Below the three-column width the nav moves into a native <details> above the content. */
.docs-menu { display: none; }
.docs-menu > summary {
  list-style: none; cursor: pointer; height: 44px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; border-radius: var(--r-control); border: 1px solid var(--border-control); font-weight: 600;
}
.docs-menu > summary::-webkit-details-marker { display: none; }
.docs-menu > summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 20px; }
.docs-menu[open] > summary::after { content: "\2212"; }
.docs-menu .docs-nav { padding: 16px 0 8px; }

@media (max-width: 1180px) { .docs-toc { display: none; } }
@media (max-width: 860px) {
  .docs { display: block; }
  .docs-side { display: none; }
  .docs-menu { display: block; margin-top: 20px; }
  .docs-main { padding-top: 24px; }
}

/* ---- Page head --------------------------------------------------------------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.crumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs [aria-current="page"] { color: var(--text); }
.docs-head { display: flex; flex-direction: column; gap: 14px; }
.docs-head h1 { font-size: clamp(30px, 4.4vw, 36px); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.docs-head .lede { font-size: 16px; }
.endpoint {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: var(--r-button); border: 1px solid var(--border); background: var(--code);
}
.endpoint code { font-size: 14px; overflow-wrap: anywhere; }
.method {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px;
  background: var(--text); color: var(--bg); font-family: var(--font-mono); font-size: 12px; font-weight: 500;
}
.method--get { background: var(--surface); color: var(--text); }
.facts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.facts li { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* ---- Prose -------------------------------------------------------------------- */
.prose { display: flex; flex-direction: column; gap: 14px; }
.prose h2 { font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; scroll-margin-top: 16px; }
.prose h3 { font-size: 16px; font-weight: 600; margin-top: 6px; scroll-margin-top: 16px; }
.prose p, .prose li { max-width: 72ch; }
.prose ul, .prose ol { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.prose a, .docs-head a { color: var(--link); text-decoration: underline; }
.docs-body :not(pre) > code {
  font-size: 0.88em; padding: 1px 6px; border-radius: 6px; background: var(--surface); overflow-wrap: anywhere;
}
.docs-body .data code, .docs-body .endpoint code { background: transparent; padding: 0; }

/* ---- Numbered steps (the quickstart is a sequence) -------------------------- */
.step { display: flex; gap: 16px; align-items: flex-start; }
.step__n {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border-control); font-size: 14px; font-weight: 600; margin-top: 2px;
}
.step > .prose { flex: 1 1 auto; min-width: 0; }

/* ---- Code panels ---------------------------------------------------------------- */
.panel { border-radius: var(--r-button); border: 1px solid var(--border); background: var(--code); overflow: hidden; }
.panel__bar {
  min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--border); background: var(--side);
}
.panel__title { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.panel__tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.panel pre {
  padding: 16px 18px; font-size: 13px; line-height: 1.7; overflow-x: auto; white-space: pre; color: var(--text);
  tab-size: 2;
}
.panel .c { color: var(--muted); }
.copy {
  height: 30px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: var(--r-sm);
  border: 1px solid var(--border-control); background: var(--card); font-size: 12px; font-weight: 500;
}
.copy:hover { background: var(--hover); }

/* Language tabs: one radio group per page; every sample on the page switches together. */
.langs { display: inline-flex; padding: 2px; border-radius: var(--r-sm); background: var(--surface); border: 0; margin: 0; min-width: 0; }
.langs input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.langs label { height: 28px; padding: 0 12px; border-radius: 6px; display: inline-flex; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer; }
.langs input:checked + label { background: var(--card); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border-control); }
.langs input:focus-visible + label { outline: 2px solid var(--link); outline-offset: 2px; }
.lang-python, .lang-node { display: none; }
body:has(#lang-python:checked) .lang-curl, body:has(#lang-node:checked) .lang-curl { display: none; }
body:has(#lang-python:checked) .lang-python, body:has(#lang-node:checked) .lang-node { display: revert; }

/* ---- Request and response field lists --------------------------------------- */
.fields { list-style: none; padding: 0; border-top: 1px solid var(--border); }
.fields > li { padding: 14px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.fields__name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.fields__name code { font-weight: 600; font-size: 14px; }
.fields__type { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.fields p { color: var(--muted); font-size: 14px; }
.req { font-size: 12px; font-weight: 600; color: var(--warn-fg); background: var(--warn-bg); padding: 0 8px; border-radius: 999px; }

/* Status pills in error tables: fix the request (4xx) or wait and retry (429, 5xx). */
.code-status { font-family: var(--font-mono); font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bad-bg); color: var(--bad-fg); white-space: nowrap; }
.code-status--retry { background: var(--warn-bg); color: var(--warn-fg); }
.docs-body .data th, .docs-body .data td { padding: 12px 16px; font-size: 14px; }
.data--docs { min-width: 640px; }
.data td.mono, .data th.mono { font-family: var(--font-mono); font-size: 13px; white-space: nowrap; }

/* ---- Callouts ------------------------------------------------------------------ */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-button); border: 1px solid var(--border); background: var(--side); font-size: 14px; }
.callout .i { margin-top: 2px; }
.callout > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.callout--warn { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.callout--warn a, .callout--warn code { color: inherit; }
.callout a { text-decoration: underline; }

/* ---- Home --------------------------------------------------------------------- */
.base-url {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 8px 6px 16px; min-height: 52px; border-radius: var(--r-button); border: 1px solid var(--border); background: var(--code);
}
.base-url pre { font-size: 14px; overflow-x: auto; }
.docs-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px; list-style: none; padding: 0; }
.link-list { list-style: none; padding: 0; border-top: 1px solid var(--border); }
.link-list a { display: flex; align-items: center; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--border); }
.link-list a:hover { text-decoration: none; background: var(--side); }
.link-list a > span:first-child { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.link-list .muted { font-size: 14px; }
.link-list .badge--outline { flex: none; }
.help { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-radius: var(--r-card); background: var(--side); border: 1px solid var(--border); }
.help > div { display: flex; flex-direction: column; gap: 4px; }
.help h2 { font-size: 16px; font-weight: 600; }

/* ---- Previous / next ----------------------------------------------------------- */
.pager { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; border-top: 1px solid var(--border); padding-top: 28px; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--r-button); border: 1px solid var(--border); }
.pager a:hover { text-decoration: none; border-color: var(--muted); }
.pager a > span:first-child { font-size: 12px; color: var(--muted); }
.pager a > span:last-child { font-weight: 600; }
.pager__next { text-align: right; grid-column: -2; }
.ref-link { font-size: 14px; color: var(--muted); }
.ref-link a { color: var(--link); text-decoration: underline; }
