:root {
  --bg: #ffffff; --surface: #f7f7f8; --text: #101211; --muted: #4a4f4d; --border: #e3e3e6;
  --accent: #0066ff; --code-bg: #f4f5f7; --btn-bg: #0066ff; --btn-text: #ffffff;
  --logo-light: block; --logo-dark: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101211; --surface: #171918; --text: #f2f3f3; --muted: #b9bdbb; --border: #2a2d2c;
    --accent: #86b7ff; --code-bg: #0b0c0c; --btn-bg: #86b7ff; --btn-text: #0b1f3a;
    --logo-light: none; --logo-dark: block;
  }
}
:root[data-theme="dark"] {
  --bg: #101211; --surface: #171918; --text: #f2f3f3; --muted: #b9bdbb; --border: #2a2d2c;
  --accent: #86b7ff; --code-bg: #0b0c0c; --btn-bg: #86b7ff; --btn-text: #0b1f3a;
  --logo-light: none; --logo-dark: block;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 10px 20px;
  background: var(--bg); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; }
.brand img { height: 32px; width: auto; }
.brand .on-light { display: var(--logo-light); } .brand .on-dark { display: var(--logo-dark); }
.brand span { color: var(--muted); font-weight: 600; border-left: 1px solid var(--border); padding-left: 8px; }
nav.links { margin-left: auto; display: flex; gap: 18px; align-items: center; font-size: 15px; }
nav.links a { color: var(--text); }
nav.links a.cta { background: var(--btn-bg); color: var(--btn-text); padding: 7px 14px; border-radius: 8px; font-weight: 600; }
button.menu { display: none; margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 4px 10px; font-size: 18px; }
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 220px; max-width: 1360px; margin: 0 auto; }
/* Reference: Scalar owns the page below the header (its own sidebar + search), full width. */
body.reference { --scalar-custom-header-height: 61px; }
body.reference .layout { display: block; max-width: none; }
body.reference aside.side, body.reference aside.toc { display: none; }
aside.side, aside.toc { position: sticky; top: 61px; align-self: start; max-height: calc(100vh - 61px); overflow-y: auto; padding: 24px 16px; font-size: 14.5px; }
aside.side ul, aside.toc ul { list-style: none; margin: 0 0 16px; padding: 0; }
aside.side li a, aside.toc li a { display: block; padding: 4px 10px; border-radius: 6px; color: var(--muted); }
aside.side li a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 600; }
aside.toc li.sub a { padding-left: 22px; }
aside.toc li a.active { color: var(--text); font-weight: 600; }
.navhead { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 10px 6px; font-weight: 700; }
main.content { min-width: 0; padding: 32px 40px 80px; border-left: 1px solid var(--border); }
body.reference main.content { padding: 0; border-left: 0; }
article { max-width: 760px; }
h1 { font-size: 34px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 8px; }
p.lead { font-size: 18px; color: var(--muted); margin: 0 0 28px; }
h2 { font-size: 23px; margin: 40px 0 12px; padding-top: 8px; }
h3 { font-size: 18px; margin: 28px 0 8px; }
h2 .headerlink, h3 .headerlink { opacity: 0; margin-left: 6px; color: var(--muted); }
h2:hover .headerlink, h3:hover .headerlink { opacity: 1; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: var(--code-bg); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
pre { position: relative; background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.55; }
pre code { background: none; border: 0; padding: 0; font-size: inherit; }
pre .copy { position: absolute; top: 8px; right: 8px; font: 600 12px system-ui; padding: 4px 9px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; opacity: .85; }
table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
blockquote { margin: 16px 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 10px 10px 0; }
blockquote p { margin: 0; }
.tabs { margin: 16px 0; }
.tablist { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); }
.tablist button { font: 600 13.5px system-ui; padding: 7px 12px; border: 0; background: none; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.tablist button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs .pane { display: none; } .tabs .pane.on { display: block; }
.tabs pre { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: 0; }
a.tryit { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: 600 14px ui-monospace, Menlo, monospace; }
a.tryit:hover { border-color: var(--accent); text-decoration: none; }
a.tryit .arrow { color: var(--accent); }
.m { font: 700 11px system-ui; padding: 2px 6px; border-radius: 5px; color: #fff; }
.m-get { background: #2f7d32; } .m-post { background: #1f5fd6; } .m-delete { background: #c62828; }
.steps { counter-reset: step; }
@media (max-width: 1100px) { .layout { grid-template-columns: 230px minmax(0, 1fr); } aside.toc { display: none; } }
@media (max-width: 760px) {
  .layout, body.reference .layout { grid-template-columns: 1fr; }
  aside.side { display: none; position: static; max-height: none; border-bottom: 1px solid var(--border); }
  body.nav-open aside.side { display: block; }
  button.menu { display: block; }
  nav.links { display: none; }
  main.content { padding: 24px 16px 60px; border-left: 0; }
  .ref-intro { padding: 0 16px; }
  h1 { font-size: 28px; }
}
