/* api.css - styles of the Portal API reference (api.js). Own classes carry the a- prefix. Colors come from tokens only.
   The report sheet (.rv) redefines the tokens to paper colors, so nothing here needs a report variant except the controls and the code blocks. */

/* ---------- frame and rhythm ---------- */
.a-view { min-width: 0; }
.a-view h4, .a-view pre { margin: 0; }
.a-view > .sec { margin-bottom: 36px; }
.a-part + .a-part { margin-top: 40px; }
.a-part:focus, .a-part:focus-visible { outline: none; }
.a-part > .sec > * + * { margin-top: 12px; }
.a-part > .sec > .a-h { margin-top: 28px; }
.a-part > .sec > .a-h + * { margin-top: 8px; }
.a-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- text pieces ---------- */
.a-lead { font-size: 14px; line-height: 22px; overflow-wrap: anywhere; }
.a-store { font-size: 13px; line-height: 18px; color: var(--muted); overflow-wrap: anywhere; }
.a-gap { margin-top: 14px; }
.a-h { font-size: 14px; line-height: 20px; font-weight: 600; break-after: avoid; }
.a-lab { display: block; margin: 16px 0 6px; font-size: 12px; line-height: 16px; letter-spacing: .06em; text-transform: uppercase; font-weight: 500; color: var(--muted); break-after: avoid; }
.a-fn { font-family: var(--font-mono); font-size: 12px; line-height: 16px; color: var(--fg); overflow-wrap: anywhere; }
.a-ty { font-family: var(--font-mono); font-size: 12px; line-height: 16px; color: var(--muted); }
.a-mv { font-weight: 500; overflow-wrap: anywhere; }
.a-fine { font-size: 12px; line-height: 16px; color: var(--muted); }
.a-ext { color: var(--accent); font-family: var(--font-mono); font-size: 12px; line-height: 16px; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.a-view .tbl td, .a-view .tbl th { overflow-wrap: anywhere; }
.a-view .tbl tr { break-inside: avoid; }
.a-view .kv-v { overflow-wrap: anywhere; }
.rv .a-ext { color: inherit; text-decoration: none; }

/* ---------- section index ---------- */
.a-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 32px; }
.a-idx-g { min-width: 0; }
.a-idx-g > .a-lab { margin-top: 0; }
.a-idx { padding-left: 28px; list-style: decimal; }
.a-idx > li { padding: 6px 0; border-top: 1px solid var(--line); break-inside: avoid; }
.a-idx > li::marker { color: var(--muted); font-size: 12px; }
.a-idx .lnk { display: block; }
.a-idx-d { display: block; margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--muted); }

/* ---------- endpoint blocks ---------- */
.a-eps > .a-ep + .a-ep { margin-top: 16px; }
.a-ep { min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); break-inside: avoid; }
.a-ep-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.a-path { min-width: 0; font-family: var(--font-mono); font-size: 13px; line-height: 20px; color: var(--fg); overflow-wrap: anywhere; }
.a-qs { color: var(--muted); }
.a-ep-d { margin-top: 8px; font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.a-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 10px; }
.a-who > .a-lab { margin: 0; }
.a-who-v { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.a-sc { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; font-family: var(--font-mono); font-size: 12px; line-height: 16px; }
.a-sc-l { font-family: var(--font-ui); color: var(--muted); }
.a-who-n { flex: 1 1 100%; font-size: 12px; line-height: 16px; color: var(--muted); }
.a-ep .tbl-wrap { border: 1px solid var(--line); border-radius: var(--r-sm); }
.a-bn { font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.a-bn-k { font-size: 11px; line-height: 16px; letter-spacing: .06em; text-transform: uppercase; font-weight: 500; color: var(--muted); }
.a-ex { margin-top: 12px; }
.a-ex + .a-ex { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); }
.a-ex-t { margin-top: 4px; font-size: 13px; line-height: 18px; font-weight: 600; }
.a-fx { padding-left: 18px; list-style: disc; font-size: 13px; line-height: 20px; }
.a-fx > li + li { margin-top: 2px; }
.a-errs > li { display: grid; grid-template-columns: 40px 104px minmax(0, 1fr); align-items: baseline; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 20px; break-inside: avoid; }
.a-errs > li:first-child { border-top: 0; }
.a-ec { font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 600; }
.a-et { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 599px) {
  .a-errs > li { grid-template-columns: 40px minmax(0, 1fr); }
  .a-errs .a-et { grid-column: 1 / -1; }
  .a-ep { padding: 12px; }
}

/* ---------- code blocks and the copy button ---------- */
.a-cb { min-width: 0; break-inside: avoid; }
.a-cb-one { margin-top: 12px; }
.a-cb-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 16px 0 6px; }
.a-cb-h > .a-lab { margin: 0; }
.a-cb-h .btn { height: 28px; padding: 0 12px; font-size: 12px; transition: border-color .12s, color .12s; }
.btn.a-copied { border-color: var(--ok); color: var(--ok); }
.a-code {
  padding: 12px 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2);
  color: var(--fg); font-family: var(--font-mono); font-size: 12px; line-height: 18px; white-space: pre; tab-size: 2; user-select: text;
}
.rv .a-code { white-space: pre-wrap; overflow-wrap: anywhere; overflow: visible; }

/* ---------- lists, steps and flows ---------- */
.a-steps { padding-left: 22px; list-style: decimal; font-size: 13px; line-height: 20px; }
.a-steps > li { padding-left: 4px; }
.a-steps > li + li { margin-top: 6px; }
.a-flow + .a-flow { margin-top: 12px; }
.a-fl { padding-left: 24px; list-style: decimal; }
.a-fl > li { padding-left: 6px; break-inside: avoid; }
.a-fl > li + li { margin-top: 14px; }
.a-fl > li::marker { font-weight: 600; }
.a-fl-t { font-size: 14px; line-height: 22px; overflow-wrap: anywhere; }
.a-calls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.a-call { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; max-width: 100%; padding: 4px 10px 4px 6px; border: 1px solid var(--line); border-radius: var(--r-sm); break-inside: avoid; }

@media (prefers-reduced-motion: reduce) {
  .a-cb-h .btn { transition: none; }
}
@media print {
  .a-code { white-space: pre-wrap; overflow-wrap: anywhere; overflow: visible; }
  .a-ep, .a-cb, .a-fl > li, .a-call, .a-errs > li { break-inside: avoid; }
  .a-h, .a-lab { break-after: avoid; }
}
