/* ODBUK API reference. Light reading surface; code panels share the dashboard's navy. */
:root {
  --paper: #f2f5f7;
  --surface: #ffffff;
  --ink: #13222e;
  --muted: #55687a;
  --line: #d6dfe6;
  --accent: #1a6db3;
  --accent-soft: #e2eef9;
  --code-bg: #101820;
  --code-line: #263a4a;
  --code-ink: #d9e5ee;
  --code-dim: #7d94a6;
  --code-key: #8acbff;
  --code-str: #a9dca3;
  --code-num: #f2c27a;
  --clear: #23704d; --clear-soft: #e1f2e8;
  --review: #965800; --review-soft: #fdf0dc;
  --strong: #a3401f; --strong-soft: #fbe6de;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1820; --surface: #15222d; --ink: #e5edf3; --muted: #9db0bf; --line: #2a3c4b;
    --accent: #6bb8f5; --accent-soft: #16304a; --code-bg: #0a1117; --code-line: #22323f;
    --clear: #6fd0a0; --clear-soft: #123023; --review: #f0b45a; --review-soft: #3a2a12; --strong: #f39a7a; --strong-soft: #3d1e14;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.65 var(--sans); font-feature-settings: "tnum" 0; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code { font-family: var(--mono); font-size: .86em; background: var(--accent-soft); color: var(--ink); padding: .08em .35em; border-radius: 4px; overflow-wrap: anywhere; }
em { font-style: italic; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: 8px; }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar-inner { max-width: 1240px; margin: 0 auto; padding: .7rem 24px; display: flex; align-items: center; gap: 1.25rem; }
.brand { font-weight: 800; letter-spacing: .02em; color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.brand span { color: var(--accent); }
.version { font: 600 .75rem/1 var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .55rem; margin-right: auto; }
.bar-link { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; }
.bar-link:hover { color: var(--ink); }

/* Hero: the screening call itself */
.hero { max-width: 1240px; margin: 0 auto; padding: 72px 24px 64px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); line-height: 1.04; letter-spacing: -.035em; font-weight: 800; margin: 0 0 1.1rem; max-width: 13ch; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 44ch; margin: 0 0 1.75rem; }
.hero-links { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; }
.btn { display: inline-block; padding: .7rem 1.15rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #06121c; } }
.console { margin: 0; background: var(--code-bg); border-radius: 14px; box-shadow: 0 24px 60px -24px #0a172299, 0 0 0 1px var(--code-line); overflow: hidden; }
.console-pane { padding: 18px 20px 6px; }
.console-pane + .console-pane { border-top: 1px solid var(--code-line); }
.console-label { margin: 0 0 .35rem; font-size: .78rem; font-weight: 600; color: var(--code-dim); display: flex; justify-content: space-between; align-items: center; }
.console .code { margin: 0 0 12px; border: 0; padding: 0; background: none; box-shadow: none; }
.console-response .tk-outcome { background: #4dabf726; border-radius: 4px; padding: 0 .2em; }

/* Layout */
.layout { max-width: 1240px; margin: 0 auto; padding: 0 24px 80px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; }
main { max-width: 820px; min-width: 0; }

/* Section index */
.toc { position: sticky; top: 76px; font-size: .9rem; }
.toc summary { font-weight: 700; cursor: pointer; padding: .25rem 0 .6rem; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc ol ol { padding-left: .85rem; margin: .15rem 0 .35rem; }
.toc a { display: block; padding: .28rem .7rem; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

/* Sections */
section { padding: 52px 0 8px; border-top: 1px solid var(--line); }
section:first-child { border-top: 0; padding-top: 8px; }
h2 { font-size: 1.85rem; letter-spacing: -.02em; line-height: 1.2; margin: 0 0 1rem; font-weight: 800; }
h3 { font-size: 1.15rem; margin: 2rem 0 .6rem; font-weight: 700; letter-spacing: -.01em; }
p, ul, ol { max-width: 68ch; }
p { margin: 0 0 1rem; }
.small { font-size: .9rem; color: var(--muted); }

/* Quick start: a real sequence, so it is numbered */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; max-width: none; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 1.25rem 3.25rem; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: .1rem; width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-weight: 700; font-size: .95rem; }
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 1.03rem; top: 2.5rem; bottom: .35rem; width: 2px; background: var(--line); }
.steps h3 { margin: .2rem 0 .4rem; }

/* Endpoints */
.endpoint { margin: 1.75rem 0 2.25rem; }
.endpoint-line { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .9rem; }
.endpoint-line code { font-size: 1rem; background: none; padding: 0; font-weight: 600; }
.method { font: 700 .75rem/1 var(--mono); padding: .4rem .55rem; border-radius: 6px; letter-spacing: .03em; }
.method.get { background: var(--clear-soft); color: var(--clear); }
.method.post { background: var(--accent-soft); color: var(--accent); }

/* Code */
.code { position: relative; margin: 1rem 0 1.25rem; padding: 18px 20px; background: var(--code-bg); color: var(--code-ink); border-radius: 10px; overflow-x: auto; font: 400 .84rem/1.6 var(--mono); tab-size: 2; box-shadow: 0 0 0 1px var(--code-line); }
.code code { background: none; color: inherit; padding: 0; font-size: inherit; overflow-wrap: normal; white-space: pre; }
.code-block { margin: 1rem 0 1.25rem; border-radius: 10px; overflow: hidden; background: var(--code-bg); box-shadow: 0 0 0 1px var(--code-line); }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 7px 10px 7px 20px; border-bottom: 1px solid var(--code-line); font: 600 .75rem/1 var(--sans); color: var(--code-dim); }
.code-block .code { margin: 0; border-radius: 0; box-shadow: none; }
.tabs [role="tabpanel"] .code-block { margin-top: .9rem; }
.copy { font: 600 .75rem/1 var(--sans); color: var(--code-dim); background: #ffffff0d; border: 1px solid var(--code-line); border-radius: 6px; padding: .4rem .6rem; cursor: pointer; }
.copy:hover, .copy:focus-visible { color: var(--code-ink); border-color: var(--code-dim); }
.copy[data-done] { color: var(--code-str); }
.tk-key { color: var(--code-key); }
.tk-str { color: var(--code-str); }
.tk-num { color: var(--code-num); }
.tk-kw { color: #f59ab8; }
.tk-com { color: var(--code-dim); font-style: italic; }

/* Tabs */
.tabs { margin: 1rem 0 1.5rem; }
.tab-list { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: -.25rem; overflow-x: auto; }
.tab-list button { font: 600 .9rem/1 var(--sans); color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: .7rem .85rem; cursor: pointer; white-space: nowrap; }
.tab-list button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Reference tables */
.ref { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: .92rem; background: var(--surface); border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.ref th, .ref td { text-align: left; vertical-align: top; padding: .75rem 1rem; border-top: 1px solid var(--line); }
.ref thead th { border-top: 0; font-size: .82rem; color: var(--muted); font-weight: 600; background: color-mix(in srgb, var(--paper) 60%, var(--surface)); }
.ref tbody th { font-weight: 600; width: 34%; }
.fields td:first-child { white-space: nowrap; }
.fields td:first-child code { background: none; padding: 0; font-weight: 600; font-size: .85rem; }
.req, .rec { display: block; font-size: .72rem; font-weight: 600; margin-top: .2rem; }
.req { color: var(--strong); }
.rec { color: var(--review); }

/* Outcome scale: three steps of increasing evidence */
.scale { list-style: none; padding: 0; margin: 1rem 0 2rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; max-width: none; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); background: var(--surface); }
.scale li { padding: 1.1rem 1.15rem 1.2rem; border-top: 6px solid; font-size: .92rem; }
.scale li + li { border-left: 1px solid var(--line); }
.scale p { margin: 0 0 .6rem; }
.scale-name code { font-size: .95rem; font-weight: 600; background: none; padding: 0; }
.scale-clear { border-top-color: var(--clear) !important; }
.scale-possible { border-top-color: var(--review) !important; }
.scale-match { border-top-color: var(--strong) !important; }
.scale-do { font-weight: 700; margin-bottom: 0 !important; }
.scale-clear .scale-do { color: var(--clear); }
.scale-possible .scale-do { color: var(--review); }
.scale-match .scale-do { color: var(--strong); }

.plain { padding-left: 1.2rem; }
.plain li { margin-bottom: .55rem; }

/* Notes */
.note { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 1rem 1.25rem; border-radius: 0 10px 10px 0; margin: 1.5rem 0; }
.note p:last-child, .note ul:last-child { margin-bottom: 0; }
.note-strong { border-left-color: var(--review); background: var(--review-soft); margin-top: 2.25rem; }
.note-strong h3 { margin-top: .2rem; }

/* Status codes */
.status { font: 700 .8rem/1 var(--mono); padding: .3rem .45rem; border-radius: 5px; display: inline-block; }
.s4 { background: var(--review-soft); color: var(--review); }
.s5 { background: var(--strong-soft); color: var(--strong); }
.errors-table td:first-child { white-space: nowrap; }

.foot { border-top: 1px solid var(--line); margin-top: 56px; padding-top: 1.5rem; color: var(--muted); font-size: .88rem; }

/* Responsive */
@media (max-width: 1023px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 44px 24px 40px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: static; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: .6rem 1rem; margin-bottom: 1.5rem; }
  .toc summary { padding: .2rem 0; }
  .toc details[open] summary { padding-bottom: .6rem; }
}
@media (max-width: 640px) {
  .bar-inner, .hero, .layout { padding-left: 16px; padding-right: 16px; }
  .bar-link:not(.bar-home) { display: none; }
  .scale { grid-template-columns: minmax(0, 1fr); }
  .scale li + li { border-left: 0; border-top-width: 6px; }
  .ref { font-size: .86rem; }
  .ref th, .ref td { padding: .6rem .7rem; }
  .fields td:first-child { white-space: normal; }
  .ref tbody th { width: auto; }
  .fields thead th:nth-child(2), .fields td:nth-child(2):not(:last-child) { display: none; }
}
