@font-face { font-family: "Source Serif 4"; src: url("fonts/source-serif-4.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/source-sans-3.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Source Code Pro"; src: url("fonts/source-code-pro.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }

:root {
  --navy: #001668;
  --logo-navy: #224188;
  --green: #71ab00;
  --green-ink: #4d7a00;
  --paper: #ffffff;
  --mist: #f3f5fa;
  --line: #dce1ec;
  --ink: #1b2340;
  --muted: #5a6482;
  --accent: #001668;
  --link: #001668;
  --put: #3d56b8;
  --delete: #b42340;
  --warn: #9a5b00;
  --code-bg: #0e1838;
  --code-bar: #16224a;
  --code-ink: #e6eaf6;
  --code-muted: #9aa6c8;
  --code-key: #9fc3ff;
  --code-str: #b8e07a;
  --code-num: #ffcf7a;
  --code-com: #7d89ab;
  --topbar-h: 60px;
  --sidebar-w: 268px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --mono: "Source Code Pro", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --logo-navy: #ffffff;
    --paper: #0d1224;
    --mist: #151c34;
    --line: #26304f;
    --ink: #e2e7f4;
    --muted: #a3acc8;
    --accent: #c6d3ff;
    --link: #9fb4ff;
    --green-ink: #9bd24a;
    --put: #7d93f0;
    --delete: #f0708a;
    --warn: #f0b45a;
    --code-bg: #080c1a;
    --code-bar: #10172e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --logo-navy: #ffffff;
  --paper: #0d1224;
  --mist: #151c34;
  --line: #26304f;
  --ink: #e2e7f4;
  --muted: #a3acc8;
  --accent: #c6d3ff;
  --link: #9fb4ff;
  --green-ink: #9bd24a;
  --put: #7d93f0;
  --delete: #f0708a;
  --warn: #f0b45a;
  --code-bg: #080c1a;
  --code-bar: #10172e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--topbar-h) + 16px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
code { font: 500 0.86em/1 var(--mono); background: var(--mist); border: 1px solid var(--line); border-radius: 4px; padding: 0.12em 0.34em; color: var(--accent); overflow-wrap: anywhere; }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--accent); font-weight: 600; line-height: 1.2; }
ul, ol { padding-left: 1.3em; }
li { margin: 0.25em 0; }
li::marker { color: var(--green); }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--paper); padding: 8px 12px; border-radius: 6px; }

.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 20px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { width: 128px; height: auto; display: block; }
.brand svg [fill="#224188"] { fill: var(--logo-navy); }
.brand span { font: 600 18px/1 var(--serif); color: var(--accent); padding-left: 10px; border-left: 2px solid var(--green); }
.version { font: 500 12px/1 var(--mono); color: var(--muted); }
.lang-pick { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.lang-pick select { font: 500 14px/1 var(--sans); color: var(--ink); background: var(--mist); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.theme-button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--mist); cursor: pointer; display: grid; place-items: center; }
.theme-button span { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); border: 2px solid var(--accent); }
.menu-button { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--mist); cursor: pointer; }
.bars, .bars::before, .bars::after { display: block; width: 18px; height: 2px; background: var(--accent); margin: 0 auto; position: relative; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -6px; }
.bars::after { top: 6px; }

.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.sidebar { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 20px 14px 40px 20px; border-right: 1px solid var(--line); font-size: 14.5px; }
.sidebar ul { list-style: none; padding: 0; margin: 0 0 6px; }
.sidebar li { margin: 0; }
.nav-group { font: 700 12px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
.nav-sub { font: 600 14px/1.3 var(--serif); margin: 14px 0 4px; color: var(--accent); }
.nav-sub a { color: inherit; text-decoration: none; }
.nav-link { display: flex; align-items: center; gap: 8px; padding: 5px 8px; margin: 0 -8px; border-radius: 6px; color: var(--ink); text-decoration: none; line-height: 1.3; }
.nav-link:hover { background: var(--mist); }
.nav-link.is-current, .nav-link[aria-current] { background: var(--mist); color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--green); }
.nav-op .verb { flex: 0 0 auto; width: 4.4ch; text-align: center; font-size: 9.5px; padding: 3px 0 2px; }

.verb { display: inline-block; font: 600 11px/1 var(--mono); padding: 4px 6px 3px; border-radius: 4px; color: #fff; }
.verb-get { background: #4d7a00; }
.verb-post { background: #001668; }
.verb-put, .verb-patch { background: #3d56b8; }
.verb-delete { background: #b42340; }
:root[data-theme="dark"] .verb-post { background: #3d56b8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .verb-post { background: #3d56b8; } }

.content { min-width: 0; }
.foot { padding: 20px 32px 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

.home { max-width: 980px; padding: 48px 40px 24px; }
.hero h1 { font-size: 46px; margin: 0 0 14px; }
.lede { font-size: 19px; line-height: 1.55; color: var(--muted); max-width: 62ch; margin: 0 0 14px; }
.base { font-size: 15px; color: var(--muted); }
.home-part { margin-top: 44px; }
.home-part h2 { font-size: 26px; margin: 0 0 6px; padding-bottom: 8px; border-bottom: 3px solid var(--navy); }
:root[data-theme="dark"] .home-part h2 { border-color: var(--green); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .home-part h2 { border-color: var(--green); } }
.home-part h3 { font-size: 19px; margin: 18px 0 6px; }
.home-part h3 a { color: inherit; }
.cards { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cards li { margin: 0; }
.cards a { display: grid; grid-template-columns: 34px 1fr; gap: 2px 12px; height: 100%; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--mist); color: var(--ink); text-decoration: none; }
.cards a:hover { border-color: var(--green); }
.card-no { grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font: 600 15px/1 var(--serif); }
.cards strong { font: 600 17px/1.3 var(--serif); color: var(--accent); }
.cards span:last-child { font-size: 14.5px; color: var(--muted); }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.plain { list-style: none; padding: 0; }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); margin: 0; }
.muted { color: var(--muted); font-size: 14px; }

.ref { --pane-w: minmax(0, 0.92fr); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) var(--pane-w); border-bottom: 1px solid var(--line); }
.row > .prose { padding: 34px 40px 30px; min-width: 0; }
.row > .pane { background: var(--code-bg); padding: 34px 28px 30px; min-width: 0; }
.row > .pane > * { position: sticky; top: calc(var(--topbar-h) + 16px); }
.row > .pane > .response { position: static; }
.row-wide { grid-template-columns: minmax(0, 1fr); }
.prose.wide { max-width: 1100px; }
.row-intro > .prose { padding-top: 0; color: var(--muted); }
.row-head h1 { font-size: 38px; margin: 0 0 12px; }
.eyebrow { font: 700 12px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--green-ink); margin: 0 0 10px; }
.part { font-size: 30px; margin: 0; padding: 36px 40px 10px; border-bottom: 3px solid var(--navy); }
:root[data-theme="dark"] .part { border-color: var(--green); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .part { border-color: var(--green); } }
.prose h3 { font-size: 25px; margin: 0 0 10px; }
.prose h4 { font-size: 17px; margin: 24px 0 6px; }
.step h2 { font-size: 24px; margin: 0 0 10px; display: flex; align-items: center; gap: 12px; }
.step-no { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font: 600 16px/1 var(--serif); }
.route { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.route code { background: none; border: 0; padding: 0; font-size: 15px; color: var(--ink); }
.needs { font-size: 14px; color: var(--muted); }
.note { margin: 14px 0; padding: 10px 14px; border-left: 4px solid var(--green); background: var(--mist); border-radius: 0 8px 8px 0; }
.note p { margin: 0; }

.fields { width: 100%; border-collapse: collapse; font-size: 15px; }
.fields td { vertical-align: top; padding: 9px 0; border-bottom: 1px solid var(--line); }
.fields .f-name { width: 36%; padding-right: 16px; padding-left: calc(var(--d, 0) * 16px); }
.fields .f-name code { background: none; border: 0; padding: 0; font-size: 14px; font-weight: 600; }
.f-type { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.f-req { color: var(--green-ink); font-weight: 600; }
.f-desc p { margin: 0; }
.f-desc .limits { color: var(--muted); font-size: 14px; }

.errors { list-style: none; padding: 0; margin: 0; }
.errors li { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.errors li > span { vertical-align: top; }
.status { display: inline-block; font: 600 14px/1.6 var(--mono); width: 44px; }
.status.ok { color: var(--green-ink); }
.status.warn { color: var(--warn); }
.status.fail { color: var(--delete); }
details { margin: 6px 0 0 44px; }
summary { cursor: pointer; font-size: 14px; color: var(--muted); }

pre { margin: 0; font: 400 12.5px/1.6 var(--mono); white-space: pre; overflow-x: auto; tab-size: 2; }
pre code { background: none; border: 0; padding: 0; font: inherit; color: inherit; }
pre.block { padding: 12px 14px; background: var(--code-bg); color: var(--code-ink); border-radius: 8px; margin: 10px 0; }
.code { background: var(--code-bar); border: 1px solid #ffffff14; border-radius: 10px; overflow: hidden; }
.code-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid #ffffff14; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.tabs button, .copy { font: 600 12.5px/1 var(--sans); color: var(--code-muted); background: none; border: 0; border-radius: 6px; padding: 7px 9px; cursor: pointer; }
.tabs button[aria-selected="true"] { color: #fff; background: #ffffff1a; box-shadow: inset 0 -2px 0 var(--green); }
.tabs button:hover, .copy:hover { color: #fff; }
.copy { margin-left: auto; }
.code pre { padding: 14px 16px; color: var(--code-ink); max-height: 70vh; overflow: auto; }
.js .code pre[hidden] { display: none; }
.response { margin-top: 18px; }
.response-title { margin: 0 0 8px; color: var(--code-muted); font-size: 14px; }
.response .status { width: auto; margin-right: 6px; }
.response pre.json { padding: 14px 16px; background: var(--code-bar); color: var(--code-ink); border: 1px solid #ffffff14; border-radius: 10px; max-height: 60vh; overflow: auto; }
.response-empty, .pane .example-name { color: var(--code-muted); font-size: 14px; }
pre .k { color: var(--code-key); }
pre .s { color: var(--code-str); }
pre .n, pre .b { color: var(--code-num); }
pre .c { color: var(--code-com); font-style: italic; }

.next { display: flex; flex-wrap: wrap; gap: 14px; }
.next a { flex: 1 1 240px; display: block; padding: 16px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; background: var(--mist); }
.next a:hover { border-color: var(--green); }
.next span { display: block; font-size: 13px; color: var(--muted); }
.next strong { font: 600 18px/1.3 var(--serif); color: var(--accent); }

.value-list { padding-top: 22px; }
.value-list h3 { font-size: 21px; margin: 0 0 4px; }
.value-list h4 { font-size: 16px; margin: 16px 0 6px; }
.used-by { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.values { list-style: none; padding: 0; margin: 8px 0 0; columns: 3 210px; column-gap: 28px; font-size: 14px; }
.values li { display: flex; gap: 10px; margin: 0; padding: 3px 0; border-bottom: 1px solid var(--mist); break-inside: avoid; }
.value-id { flex: 0 0 5.2ch; text-align: right; font: 600 12.5px/1.6 var(--mono); color: var(--accent); }


@media (max-width: 1180px) {
  .row { grid-template-columns: minmax(0, 1fr); }
  .row > .pane { padding: 0 40px 28px; background: none; }
  .row > .pane:empty { display: none; }
  .row > .pane > * { position: static; }
  .response pre.json, .code { background: var(--code-bg); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .menu-button { display: block; }
  .sidebar { position: fixed; z-index: 15; left: 0; top: var(--topbar-h); width: min(86vw, 320px); background: var(--paper); transform: translateX(-102%); transition: transform 0.2s ease; box-shadow: 0 10px 30px #0004; }
  .nav-open .sidebar { transform: none; }
  .lang-pick span, .version { display: none; }
  .brand svg { width: 104px; }
  .home { padding: 32px 18px 16px; }
  .hero h1 { font-size: 34px; }
  .row > .prose { padding: 26px 18px 22px; }
  .row > .pane { padding: 0 18px 22px; }
  .part { padding: 28px 18px 8px; font-size: 26px; }
  .columns { grid-template-columns: 1fr; }
  .fields .f-name { width: 42%; }
  details { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
