/* The plain HTML API reference: docs.nrg.market/reference/, the pages
 * scripts/build-docs-reference.py writes out of docs/openapi.yaml.
 *
 * Its own small file rather than the design system: tokens.css and
 * components.css next to it are not published (scripts/build-site.sh copies
 * this file and the icons by name, nothing else from this directory). The
 * colours are the "Ledger mint" values of tokens.css, light and dark, the same
 * ones the Scalar shell inlines; keep them in step when the palette changes.
 * The fonts are the system stacks: these pages ask nobody for a font. */

:root {
  color-scheme: light dark;
  --ink: #0E1116;
  --ink-2: #3C464D;
  --muted: #5B666E;
  --accent: #0F6B5E;
  --bg: #FFFFFF;
  --bg-2: #F7F8F9;
  --bg-3: #EDF0F1;
  --accent-bg: #E7F1EF;
  --border: #D6DBDE;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E6EAEF;
    --ink-2: #A6B1BA;
    --muted: #7C8892;
    --accent: #3FC7AC;
    --bg: #0B0E12;
    --bg-2: #151A20;
    --bg-3: #1B2128;
    --accent-bg: #10322C;
    --border: #2A333B;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); }

code, pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  font-size: 0.875em;
}
code {
  background: var(--bg-3);
  border-radius: 4px;
  padding: 0.1em 0.3em;
  overflow-wrap: anywhere;
}
pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
}
pre code { background: none; padding: 0; overflow-wrap: normal; }

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  padding: 0.75rem 1rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.top .brand { color: var(--ink); font-weight: 600; text-decoration: none; }

.layout {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 2rem;
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
nav.pages ul { list-style: none; margin: 0; padding: 0; position: sticky; top: 1rem; }
nav.pages a {
  display: block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: var(--ink-2);
  text-decoration: none;
}
nav.pages a[aria-current="page"] { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
main { min-width: 0; }

h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 0.75rem; }
h2 { margin-top: 2.5rem; }
.lead, .summary { color: var(--ink-2); font-size: 1.1rem; }
.facts, .count { color: var(--muted); font-size: 0.9em; }
.method { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

section.op, section.schema { border-top: 1px solid var(--border); margin-top: 2.5rem; }
section.op > h2, section.schema > h2 { margin-top: 1.25rem; }
.response { border-left: 3px solid var(--bg-3); margin: 1rem 0; padding-left: 1rem; }
.toc ul.names { columns: 14rem; }

.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin: 0.75rem 0; font-size: 0.925rem; }
th, td { border: 1px solid var(--border); padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--bg-2); }
/* A field name or a schema name is read whole; prose code may break anywhere. */
td:first-child code { white-space: nowrap; overflow-wrap: normal; }
td a code { overflow-wrap: normal; }
td > :first-child { margin-top: 0; }
td > :last-child { margin-bottom: 0; }

footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
  padding: 1rem;
  text-align: center;
}

@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  nav.pages ul { position: static; display: flex; flex-wrap: wrap; gap: 0.25rem; }
}
