/* ==========================================================================
   SatsRail developer docs — surface stylesheet
   ==========================================================================

   The docs shell: the dark sidebar, the light reading column with "On this
   page" beside it, every component a guide is written with, and the API
   reference's Swagger UI drawn to match. Everything here is specific to this
   surface. Anything that must look the same across SatsRail lives in
   app/assets/stylesheets — the brand tokens in brand_tokens.css and the
   navbar in navbar.css, both copied in beside this file by api-docs/build.rb
   and linked ahead of it.

   The guides are plain HTML (a section, a heading, a paragraph, a <pre>); the
   build adds the code frames, heading links, the contents and the pager
   (api-docs/page.rb). So a component here is styled by what it is, not by
   utility classes in the guide. See docs/api-docs.md § How a guide is drawn.

   Surface tokens are prefixed --docs-* so they cannot collide with a brand
   token; build.rb fails the build if this file and brand_tokens.css ever
   declare the same name. See docs/api-docs.md.
   ========================================================================== */

:root {
  /* Height of the shared navbar. The sidebar and "On this page" stick below
     it, and a linked heading stops below it, so they have to know. Measured
     at runtime by the script in _head.html because the real value derives
     from tokens (logo height, padding) any surface may change; this is the
     fallback for the moment before that runs, and for a reader with
     JavaScript off. */
  --docs-nav-h: 64px;

  --docs-sidebar-w: 264px;
  --docs-toc-w: 13.5rem;
  --docs-toc-gap: 4rem;
  /* The reading column: about 75 characters of body text a line. */
  --docs-measure: 46rem;
  --docs-lede-w: 42rem;

  --docs-font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;

  /* The reading surface. Light content under a dark shell — the app's dual
     design system, same split the portal's own pages use. */
  --docs-paper: #ffffff;
  --docs-canvas: #f6f8fa;
  --docs-text: #1f2328;
  --docs-text-strong: #0d1117;
  --docs-text-muted: #59636e;
  --docs-text-faint: #6e7781;     /* 4.6:1 on white: small print, labels */
  /* Links in the light reading column. The brand's dark gold (#b8860b)
     read at 3.25:1 on white; these clear WCAG AA (5.4:1, 7.6:1). */
  --docs-link: #8a6508;
  --docs-link-hover: #6b4e06;
  --docs-link-line: rgba(138, 101, 8, 0.35);
  --docs-hairline: #e3e6ea;
  --docs-hairline-soft: #eef0f3;

  /* The dark sidebar, keyed to the navbar above it so the two read as one
     shell rather than two panels that happen to both be dark. */
  --docs-rail-bg: var(--ink);
  --docs-rail-text: rgba(255, 255, 255, 0.62);
  --docs-rail-text-hover: rgba(255, 255, 255, 0.92);
  --docs-rail-heading: rgba(255, 255, 255, 0.52);   /* 0.38 read at 3.5:1 */
  --docs-rail-rule: rgba(255, 255, 255, 0.1);

  /* Code. The one near-black surface inside the light column, because a
     JSON payload reads best on it. Every token colour clears 4.5:1 on it. */
  --docs-code-bg: #11151a;
  --docs-code-bar: #161b21;
  --docs-code-border: #222831;
  --docs-code-text: #e6edf3;
  --docs-tok-comment: #8b949e;
  --docs-tok-string: #e8c27a;
  --docs-tok-key: #79c0ff;
  --docs-tok-number: #56d4bc;
  --docs-tok-keyword: #ff7b72;
  --docs-tok-function: #ffa657;
  --docs-tok-tag: #7ee787;
  --docs-tok-variable: #a5d6ff;
  --docs-tok-punct: #9da7b3;

  /* Inline code on the light column: neutral, so gold stays the accent. */
  --docs-inline-code-bg: #f1f3f5;
  --docs-inline-code-border: #e4e7eb;

  /* Not shared: brand_tokens.css deliberately leaves --radius-sm to each
     surface (the portal uses 0.375rem, the outward-facing sides 0.25rem).
     navbar.css reads it, so the navbar renders unrounded without this. */
  --radius-sm: 0.25rem;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ==========================================================================
   Shell
   ========================================================================== */

.docs-body {
  margin: 0;
  background: var(--docs-paper);
  color: var(--docs-text);
  font-family: var(--docs-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* The navbar is sticky-top from the shared partial; the sidebar and the
   reading column sit side by side beneath it. align-items: flex-start is
   what lets the sidebar be sticky — a stretched flex item cannot be. */
.docs-shell {
  display: flex;
  align-items: flex-start;
}

.docs-main {
  flex: 1 1 auto;
  min-width: 0;            /* without this a wide <pre> stretches the column */
  background: var(--docs-paper);
  min-height: calc(100vh - var(--docs-nav-h));
}

/* A linked heading or section stops below the sticky navbar, not under it. */
.docs-main [id] { scroll-margin-top: calc(var(--docs-nav-h) + 1.5rem); }

::selection { background: rgba(232, 181, 60, 0.3); }

/* ==========================================================================
   Sidebar

   A Bootstrap collapse at narrow widths; from 992px up the toggle is hidden
   and the list is forced open. See the head of _sidebar.html for why this is
   a collapse and not a <details>.
   ========================================================================== */

.docs-nav {
  background: var(--docs-rail-bg);
  color: var(--docs-rail-text);
  font-family: var(--font-mono);
}

.docs-nav-summary {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.75rem 1.25rem;
  font-family: inherit;
  font-size: var(--nav-fs);
  text-transform: uppercase;
  letter-spacing: var(--nav-tracking);
  color: var(--docs-rail-text-hover);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--docs-rail-rule);
  cursor: pointer;
}

.docs-nav-summary::after {
  content: "";
  margin-left: auto;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  /* Bootstrap toggles .collapsed on the button, so the caret follows the
     list's real state rather than a click count. */
  transform: rotate(-135deg);
  transition: transform var(--t-fast) var(--ease-out);
}

.docs-nav-summary.collapsed::after { transform: rotate(45deg); }

.docs-nav-body { padding: 1.5rem 0.75rem 2rem; }

.docs-nav-section { margin-bottom: 1.5rem; }

.docs-nav-heading {
  margin: 0 0 0.5rem;
  padding: 0 0.625rem;
  font-size: var(--nav-fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--nav-tracking);
  color: var(--docs-rail-heading);
}

.docs-nav-link {
  display: block;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: var(--nav-fs);
  line-height: 1.45;
  color: var(--docs-rail-text);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out);
}

.docs-nav-link:hover {
  color: var(--docs-rail-text-hover);
  background: rgba(255, 255, 255, 0.05);
}

.docs-nav-link:focus-visible {
  outline: 2px solid var(--bitcoin-orange);
  outline-offset: -2px;
}

/* Gold is the current page, never hover — the same rule the navbar follows,
   so the two halves of the shell agree on what gold means. */
.docs-nav-link.active {
  color: var(--nav-active-color);
  background: var(--nav-active-bg);
}

.docs-nav-rule {
  margin: 1.25rem 0.625rem;
  border: 0;
  border-top: 1px solid var(--docs-rail-rule);
}

@media (min-width: 992px) {
  .docs-nav {
    position: sticky;
    top: var(--docs-nav-h);
    flex: 0 0 var(--docs-sidebar-w);
    width: var(--docs-sidebar-w);
    height: calc(100vh - var(--docs-nav-h));
    overflow-y: auto;
    border-right: 1px solid var(--docs-rail-rule);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
  }

  .docs-nav-summary { display: none; }

  /* Force the list open whatever state Bootstrap left it in: the toggle is
     hidden here, so a reader who collapsed it on a narrow window and then
     widened it would have no way to get it back. Specificity, not
     !important — this is 0,4,0 against Bootstrap's 0,2,0 `.collapse:not
     (.show)`. */
  .docs-nav .docs-nav-body.collapse:not(.show) { display: block; }
}

@media (max-width: 991.98px) {
  .docs-shell { display: block; }
}

/* ==========================================================================
   Page: the reading column, "On this page" beside it
   ========================================================================== */

/* One container for every page, guide or reference: the same width, the
   same left edge, so the header never moves when the reader changes page.
   A guide fills it with the article and "On this page"; the reference with
   Swagger UI, under a header, lede and footer kept to the article's width. */
.docs-page,
.docs-reference {
  max-width: calc(var(--docs-measure) + var(--docs-toc-gap) + var(--docs-toc-w) + 6rem);
  margin: 0 auto;
  padding: 3rem 3rem 0;
}

.docs-page {
  display: flex;
  align-items: flex-start;
  gap: var(--docs-toc-gap);
}

.docs-article {
  flex: 1 1 auto;
  min-width: 0;
  max-width: var(--docs-measure);
}

/* The header: where the page sits, its actions, its title. */
.docs-page-header { margin-bottom: 0.5rem; }

.docs-page-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2rem;
  margin-bottom: 0.75rem;
}

.docs-eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--docs-link);
}

.docs-page-header h1 {
  margin: 0 0 0.875rem;
  font-size: 2.375rem;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--docs-text-strong);
}

.docs-page-actions {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}

.docs-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 1.875rem;
  padding: 0 0.625rem;
  font: 500 0.8125rem/1 var(--docs-font);
  color: var(--docs-text-muted);
  background: var(--docs-paper);
  border: 1px solid var(--docs-hairline);
  border-radius: 0.5rem;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out);
}

.docs-action:hover {
  color: var(--docs-text);
  background: var(--docs-canvas);
  border-color: #cfd5dc;
}

.docs-action:focus-visible,
.docs-code-copy:focus-visible,
.docs-code pre:focus-visible,
.docs-table:focus-visible,
.docs-pager-link:focus-visible,
.docs-toc a:focus-visible {
  outline: 2px solid var(--docs-link);
  outline-offset: 2px;
}

.docs-action .bi { font-size: 0.875rem; }
.docs-action.is-copied { color: #1a7f37; border-color: #b7e1c3; background: #f0faf3; }

/* Copy page needs JavaScript; _head.html marks the page .js before it
   paints, so the button never flashes in and out. */
.docs-copy-page { display: none; }
.js .docs-copy-page { display: inline-flex; }

/* The page's first paragraph: what it is for, in a sentence. */
.docs-lede {
  margin: 0 0 2.5rem;
  max-width: var(--docs-lede-w);
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--docs-text-muted);
}

/* On this page — a column beside the article from 1280px up; below that a
   disclosure above it (page.rb writes both). */
.docs-toc {
  display: none;
  flex: 0 0 var(--docs-toc-w);
  width: var(--docs-toc-w);
  align-self: stretch;
}

.docs-toc-inner {
  position: sticky;
  top: calc(var(--docs-nav-h) + 3rem);
  max-height: calc(100vh - var(--docs-nav-h) - 5rem);
  overflow-y: auto;
  padding: 0.25rem 0 1rem;
  scrollbar-width: thin;
}

.docs-toc-title {
  margin: 0 0 0.875rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--docs-text-faint);
}

.docs-toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--docs-hairline);
}

.docs-toc-item a {
  display: block;
  margin-left: -1px;
  padding: 0.3rem 0 0.3rem 0.875rem;
  border-left: 2px solid transparent;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--docs-text-muted);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}

.docs-toc-sub a { padding-left: 1.625rem; font-size: 0.78125rem; }

.docs-toc-item a:hover { color: var(--docs-text-strong); }

/* Gold marks where the reader is, as it marks the current page in the
   sidebar and the navbar. */
.docs-toc-item a.is-active {
  color: var(--docs-text-strong);
  font-weight: 500;
  border-left-color: var(--bitcoin-orange);
}

.docs-toc-top {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--docs-text-faint);
  text-decoration: none;
}

.docs-toc-top:hover { color: var(--docs-text); }

.docs-toc-mobile {
  margin: 0 0 2.5rem;
  border: 1px solid var(--docs-hairline);
  border-radius: 0.625rem;
  background: var(--docs-canvas);
}

.docs-toc-mobile summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--docs-text);
  cursor: pointer;
  list-style: none;
}

.docs-toc-mobile summary::-webkit-details-marker { display: none; }

.docs-toc-mobile summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--t-fast) var(--ease-out);
}

.docs-toc-mobile[open] summary::after { transform: rotate(-135deg); }

.docs-toc-mobile .docs-toc-list {
  padding: 0 1rem 0.875rem;
  border-left: 0;
}

.docs-toc-mobile .docs-toc-item { margin: 0; padding: 0; }
.docs-toc-mobile .docs-toc-item a { border-left: 0; padding-left: 0; margin-left: 0; }
.docs-toc-mobile .docs-toc-sub a { padding-left: 0.875rem; }

@media (min-width: 1280px) {
  .docs-toc { display: block; }
  .docs-toc-mobile { display: none; }
}

/* Previous and Next, in the sidebar's order. */
.docs-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 4.5rem;
}

.docs-pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.25rem 1.05rem;
  border: 1px solid var(--docs-hairline);
  border-radius: 0.75rem;
  text-decoration: none;
  transition: border-color var(--t-base) var(--ease-out),
              background var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
}

.docs-pager-next { grid-column: 2; align-items: flex-end; text-align: right; }

.docs-pager-label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--docs-text-faint);
}

.docs-pager-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--docs-text-strong);
}

.docs-pager-link:hover {
  border-color: rgba(184, 134, 11, 0.5);
  background: #fffcf3;
  box-shadow: 0 6px 20px rgba(16, 24, 40, 0.05);
}

.docs-pager-link:hover .docs-pager-title { color: var(--docs-link-hover); }

/* The foot of the page. */
.docs-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-top: 3.5rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--docs-hairline);
  font-size: 0.875rem;
  color: var(--docs-text-muted);
}

.docs-footer p { margin: 0; }
.docs-footer-title { font-weight: 600; color: var(--docs-text); margin-bottom: 0.2rem !important; }

.docs-footer-text a {
  color: var(--docs-link);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--docs-link-line);
  text-underline-offset: 0.2em;
}

.docs-footer-text a:hover { color: var(--docs-link-hover); text-decoration-color: currentColor; }

.docs-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1.125rem;
  font-size: 0.8125rem;
  color: var(--docs-text-faint);
}

.docs-footer-links a { color: var(--docs-text-faint); text-decoration: none; }
.docs-footer-links a:hover { color: var(--docs-text); }

@media (max-width: 991.98px) {
  .docs-page,
  .docs-reference { padding: 2rem 1.5rem 0; }
  .docs-page-header h1 { font-size: 2rem; }
  .docs-lede { font-size: 1.0625rem; margin-bottom: 2rem; }
}

@media (max-width: 575.98px) {
  .docs-page,
  .docs-reference { padding: 1.5rem 1.125rem 0; }
  .docs-page-header h1 { font-size: 1.75rem; }
  /* The icons say it on a phone; the words stay for a screen reader. */
  .docs-action span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .docs-action { padding: 0 0.5rem; }
  .docs-pager { grid-template-columns: minmax(0, 1fr); }
  .docs-pager-next { grid-column: 1; }
}

/* ==========================================================================
   Prose: what a guide is written with
   ========================================================================== */

.docs-prose {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--docs-text);
}

/* A section is a part of the page: a rule and air between two. */
.docs-prose > section + section,
.docs-prose > .docs-steps + section {
  margin-top: 3.25rem;
  padding-top: 2.75rem;
  border-top: 1px solid var(--docs-hairline-soft);
}

.docs-prose h2,
.docs-prose h3,
.docs-prose h4 {
  color: var(--docs-text-strong);
  scroll-margin-top: calc(var(--docs-nav-h) + 1.5rem);
}

.docs-prose h2 {
  margin: 3rem 0 1rem;
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.018em;
}

.docs-prose h3 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.docs-prose h4 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.docs-prose section > h2:first-child,
.docs-prose section > h3:first-child { margin-top: 0; }

/* The link beside each heading, written by page.rb: shown on hover and to
   the keyboard. */
.docs-anchor {
  margin-left: 0.4em;
  font-weight: 400;
  color: #b4bcc6 !important;
  text-decoration: none !important;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}

h2:hover > .docs-anchor,
h3:hover > .docs-anchor,
.docs-anchor:focus-visible { opacity: 1; }

.docs-anchor:hover { color: var(--docs-link) !important; }

.docs-prose p { margin: 0 0 1.125rem; }
.docs-prose p:last-child,
.docs-prose ul:last-child,
.docs-prose ol:last-child,
.docs-prose dl:last-child { margin-bottom: 0; }

.docs-prose strong { font-weight: 600; color: var(--docs-text-strong); }

.docs-prose a:not(.btn):not(.docs-anchor):not(.docs-toc-link) {
  color: var(--docs-link);
  text-decoration: underline;
  text-decoration-color: var(--docs-link-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--t-fast) var(--ease-out), text-decoration-color var(--t-fast) var(--ease-out);
}

.docs-prose a:not(.btn):not(.docs-anchor):not(.docs-toc-link):hover {
  color: var(--docs-link-hover);
  text-decoration-color: currentColor;
}

.docs-prose ul,
.docs-prose ol {
  margin: 0 0 1.25rem;
  padding-left: 1.375rem;
}

.docs-prose li { margin: 0.4rem 0; padding-left: 0.125rem; }
.docs-prose li::marker { color: #8c959f; }
.docs-prose ol > li::marker { font-variant-numeric: tabular-nums; font-weight: 500; }
.docs-prose li > ul,
.docs-prose li > ol { margin: 0.4rem 0 0; }

.docs-prose dl { margin: 0 0 1.25rem; }
.docs-prose dt { margin-top: 1rem; font-weight: 600; color: var(--docs-text-strong); }
.docs-prose dt:first-child { margin-top: 0; }
.docs-prose dd { margin: 0.25rem 0 0; padding-left: 1rem; border-left: 2px solid var(--docs-hairline-soft); }

.docs-prose hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--docs-hairline); opacity: 1; }

/* Small print under a table or a list. */
.docs-aside {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--docs-text-muted);
}

/* Inline code. Neutral on the light column: gold is for links and the
   current place, and a guide shows a lot of code. */
.docs-prose :not(pre) > code,
.docs-static-reference :not(pre) > code {
  padding: 0.12em 0.36em;
  font-family: var(--font-mono);
  font-size: 0.84em;
  color: var(--docs-text-strong);
  background: var(--docs-inline-code-bg);
  border: 1px solid var(--docs-inline-code-border);
  border-radius: 0.3125rem;
  overflow-wrap: break-word;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.docs-prose a code { color: inherit; }

.docs-prose .btn { margin: 0.25rem 0; }

.btn-bitcoin {
  background: var(--bitcoin-orange);
  border: 1px solid var(--bitcoin-orange);
  color: var(--ink);
  font-weight: 600;
  transition: background var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out);
}

.btn-bitcoin:hover,
.btn-bitcoin:focus {
  background: var(--bitcoin-orange-dark);
  border-color: var(--bitcoin-orange-dark);
  color: var(--ink);
}

/* ── Callouts ──────────────────────────────────────────────────────────────
   The guides write them as Bootstrap alerts, which the Markdown twin reads as
   block quotes; drawn here as quiet notes with an icon of their own. */
.docs-prose .alert {
  position: relative;
  margin: 1.5rem 0;
  padding: 0.9rem 1.125rem 0.9rem 2.875rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  border: 1px solid;
  border-radius: 0.625rem;
}

.docs-prose .alert::before {
  position: absolute;
  left: 1.05rem;
  top: 0.95rem;
  font-family: "bootstrap-icons";
  font-size: 1rem;
  line-height: 1.5;
}

.docs-prose .alert-warning {
  color: #3d3000;
  background: #fffaeb;
  border-color: #f1dc9c;
}

.docs-prose .alert-warning::before { content: "\f33b"; color: #a3770a; }

.docs-prose .alert-info {
  color: #0c2d57;
  background: #f3f8fe;
  border-color: #cddff6;
}

.docs-prose .alert-info::before { content: "\f431"; color: #1d6fc0; }

.docs-prose .alert strong { color: inherit; }
.docs-prose .alert :not(pre) > code { background: rgba(255, 255, 255, 0.7); border-color: rgba(0, 0, 0, 0.08); }

/* ── Steps ─────────────────────────────────────────────────────────────────
   Numbered steps on a rail. The number stays a separate element before the
   heading, which is how the Markdown twin keeps "### 1. Create your account". */
.docs-steps { margin: 0 0 0.5rem; }

.docs-step {
  position: relative;
  padding: 0 0 2.75rem 3.25rem;
}

.docs-step::before {
  content: "";
  position: absolute;
  left: 0.9375rem;
  top: 2.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: linear-gradient(var(--docs-hairline), var(--docs-hairline-soft));
}

.docs-step:last-child { padding-bottom: 0.5rem; }
.docs-step:last-child::before { display: none; }

.docs-step-number {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 1.875rem;
  height: 1.875rem;
  font: 600 0.8125rem/1 var(--font-mono);
  color: var(--bitcoin-orange);
  background: var(--ink);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--docs-paper), 0 0 0 5px rgba(232, 181, 60, 0.35);
}

.docs-prose .docs-step > h3 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  line-height: 1.875rem;
}

/* ── Cards and figures ───────────────────────────────────────────────────── */
.docs-grid {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

.docs-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.docs-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 767.98px) {
  .docs-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 479.98px) {
  .docs-grid-3 { grid-template-columns: minmax(0, 1fr); }
}

.docs-card {
  padding: 1.25rem 1.25rem 1.125rem;
  background: var(--docs-paper);
  border: 1px solid var(--docs-hairline);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.docs-prose .docs-card h3 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.625rem;
  font-size: 1rem;
  line-height: 1.4;
}

.docs-card h3 .bi {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.9375rem;
  color: var(--docs-link);
  background: rgba(232, 181, 60, 0.14);
  border-radius: 0.5rem;
  flex-shrink: 0;
}

.docs-card p { font-size: 0.9375rem; line-height: 1.6; }
.docs-card p + p { color: var(--docs-text-muted); }

.docs-shots figure { margin: 0; }

.docs-shots img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--docs-hairline);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px rgba(16, 24, 40, 0.07);
}

.docs-shots figcaption {
  margin-top: 0.625rem;
  font-size: 0.8125rem;
  text-align: center;
  color: var(--docs-text-muted);
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.docs-table {
  margin: 1.5rem 0 1.75rem;
  overflow-x: auto;
  border: 1px solid var(--docs-hairline);
  border-radius: 0.625rem;
}

.docs-table table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.55;
}

.docs-table th {
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: left;
  color: var(--docs-text-muted);
  background: var(--docs-canvas);
  border-bottom: 1px solid var(--docs-hairline);
}

.docs-table td {
  padding: 0.7rem 0.875rem;
  vertical-align: top;
  border-top: 1px solid var(--docs-hairline-soft);
}

.docs-table tbody tr:first-child td { border-top: 0; }
.docs-table tbody tr:hover td { background: #fbfcfd; }
.docs-table td:first-child { color: var(--docs-text-strong); }
.docs-table td > code:only-child { white-space: nowrap; }

.docs-table + .docs-aside { margin-top: -0.75rem; }

/* ── Code samples ────────────────────────────────────────────────────────────
   page.rb puts each <pre> in a frame with its language and a Copy button,
   and colours it (highlight.rb). A <pre> it did not frame — the reference's
   fallback — still gets the dark block. */
.docs-code {
  margin: 1.25rem 0 1.625rem;
  background: var(--docs-code-bg);
  border: 1px solid var(--docs-code-border);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.docs-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.375rem;
  padding: 0 0.375rem 0 1rem;
  background: var(--docs-code-bar);
  border-bottom: 1px solid var(--docs-code-border);
}

.docs-code-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: #9da7b3;
}

.docs-code-copy {
  display: none;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.55rem;
  font: 500 0.75rem/1 var(--docs-font);
  color: #9da7b3;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.4375rem;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}

.js .docs-code-copy { display: inline-flex; }
.docs-code-copy:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.docs-code-copy.is-copied { color: var(--bitcoin-orange); }

.docs-prose pre,
.docs-static-reference pre {
  margin: 0 0 1.5rem;
  padding: 1rem 1.125rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--docs-code-text);
  background: var(--docs-code-bg);
  border-radius: 0.75rem;
  overflow-x: auto;
  tab-size: 2;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.docs-code pre {
  margin: 0;
  padding: 1rem 1.125rem 1.125rem;
  border-radius: 0;
}

.docs-prose pre code,
.docs-static-reference pre code { font-size: inherit; color: inherit; background: none; padding: 0; border: 0; }

.tok-cm { color: var(--docs-tok-comment); font-style: italic; }
.tok-s  { color: var(--docs-tok-string); }
.tok-k  { color: var(--docs-tok-key); }
.tok-n,
.tok-c  { color: var(--docs-tok-number); }
.tok-kw { color: var(--docs-tok-keyword); }
.tok-f,
.tok-a  { color: var(--docs-tok-function); }
.tok-t  { color: var(--docs-tok-tag); }
.tok-v,
.tok-u  { color: var(--docs-tok-variable); }
.tok-p  { color: var(--docs-tok-punct); }

/* ==========================================================================
   The API reference

   Swagger UI, rendered with BaseLayout into the same page as a guide: the
   layout's header, then Swagger's overview as prose, then the operations.
   Drawn to read as one product with the guides — their type, their inline
   code, their code blocks — rather than Swagger's: its sans-serif, its
   purple code and its green, blue and red slabs.
   ========================================================================== */

/* The container is .docs-page's (§ Page). The header and the footer keep
   a guide's width and place; the operations between them take the rest. */
.docs-reference > .docs-page-header,
.docs-reference > .docs-footer { max-width: var(--docs-measure); }

.docs-reference > .docs-lede { margin-bottom: 1.5rem; }

/* From 1280px a guide's article gives "On this page" its column and narrows
   while the window is short of the container; the reference's header
   narrows with it, though it has no such column, so it stays in place. */
@media (min-width: 1280px) {
  .docs-reference > .docs-page-header,
  .docs-reference > .docs-footer {
    max-width: min(var(--docs-measure), 100% - var(--docs-toc-gap) - var(--docs-toc-w));
  }

  .docs-reference > .docs-lede {
    max-width: min(var(--docs-lede-w), 100% - var(--docs-toc-gap) - var(--docs-toc-w));
  }
}

/* Swagger's sans-serif, everywhere it names one, becomes the docs' face;
   its monospace becomes the brand's. */
.swagger-ui,
.swagger-ui .btn,
.swagger-ui button,
.swagger-ui input,
.swagger-ui select,
.swagger-ui label,
.swagger-ui .info li,
.swagger-ui .info p,
.swagger-ui .info table,
.swagger-ui .info a,
.swagger-ui .info h1,
.swagger-ui .info h2,
.swagger-ui .info h3,
.swagger-ui .info h4,
.swagger-ui .opblock-tag,
.swagger-ui .opblock-tag small,
.swagger-ui .opblock .opblock-summary-description,
.swagger-ui .opblock .opblock-section-header h4,
.swagger-ui .opblock .opblock-section-header > label,
.swagger-ui .opblock-description-wrapper,
.swagger-ui .opblock-description-wrapper p,
.swagger-ui .opblock-description-wrapper h4,
.swagger-ui .opblock-title_normal,
.swagger-ui .opblock-title_normal p,
.swagger-ui .parameter__name,
.swagger-ui .response-col_status,
.swagger-ui .responses-inner h4,
.swagger-ui .responses-inner h5,
.swagger-ui .servers > label,
.swagger-ui .tab li,
.swagger-ui table thead tr th,
.swagger-ui table thead tr td,
.swagger-ui section h3,
.swagger-ui section.models h4,
.swagger-ui section.models h5,
.swagger-ui .model-title,
.swagger-ui .dialog-ux .modal-ux-content p,
.swagger-ui .dialog-ux .modal-ux-content h4,
.swagger-ui .dialog-ux .modal-ux-header h3 {
  font-family: var(--docs-font);
}

.swagger-ui code,
.swagger-ui pre,
.swagger-ui kbd,
.swagger-ui samp,
.swagger-ui textarea,
.swagger-ui .model,
.swagger-ui .parameter__type,
.swagger-ui .parameter__in,
.swagger-ui .opblock .opblock-summary-path,
.swagger-ui .opblock .opblock-summary-method,
.swagger-ui .markdown code,
.swagger-ui .renderedMarkdown code {
  font-family: var(--font-mono);
}

.swagger-ui { color: var(--docs-text); }
.swagger-ui .wrapper { max-width: none; padding: 0; }
.swagger-ui .information-container.wrapper { padding: 0; }
.swagger-ui .block.col-12 { padding: 0; }

/* Swagger's title block (name, version badges, the spec's URL): the page's
   header says all of it. */
.swagger-ui .info hgroup.main { display: none; }
.swagger-ui .info { margin: 0 0 2.5rem; }

/* The overview, from the spec's info.description, as a guide's prose. */
.swagger-ui .info .description,
.swagger-ui .info .renderedMarkdown {
  max-width: var(--docs-measure);
}

.swagger-ui .info .renderedMarkdown p,
.swagger-ui .info .renderedMarkdown li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--docs-text);
}

.swagger-ui .info .renderedMarkdown p { margin: 0 0 1rem; }
.swagger-ui .info .renderedMarkdown ul { margin: 0 0 1.125rem; padding-left: 1.375rem; }
.swagger-ui .info .renderedMarkdown li { margin: 0.35rem 0; }
.swagger-ui .info .renderedMarkdown li::marker { color: #8c959f; }

.swagger-ui .info .renderedMarkdown strong { font-weight: 600; color: var(--docs-text-strong); }

.swagger-ui .info a,
.swagger-ui .renderedMarkdown a {
  color: var(--docs-link);
  text-decoration: underline;
  text-decoration-color: var(--docs-link-line);
  text-underline-offset: 0.2em;
}

.swagger-ui .info a:hover,
.swagger-ui .renderedMarkdown a:hover { color: var(--docs-link-hover); }

/* Swagger's purple, bold inline code, made the guides' quiet grey. */
.swagger-ui .markdown code,
.swagger-ui .renderedMarkdown code {
  padding: 0.12em 0.36em;
  font-size: 0.84em;
  font-weight: 400;
  color: var(--docs-text-strong);
  background: var(--docs-inline-code-bg);
  border: 1px solid var(--docs-inline-code-border);
  border-radius: 0.3125rem;
  overflow-wrap: break-word;
}

.swagger-ui .renderedMarkdown pre,
.swagger-ui .markdown pre {
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.125rem;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--docs-code-text);
  background: var(--docs-code-bg);
  border: 1px solid var(--docs-code-border);
  border-radius: 0.75rem;
  white-space: pre;
  overflow-x: auto;
}

.swagger-ui .renderedMarkdown pre code,
.swagger-ui .markdown pre code {
  padding: 0;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
}

/* The overview's samples, framed in the browser as a guide's are at build
   time (docs.js): the frame draws the box, so the <pre> drops its own. */
.swagger-ui .renderedMarkdown .docs-code pre {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.swagger-ui .docs-code-copy { font-size: 0.75rem; }
.swagger-ui .docs-code-copy .bi { font-size: 0.8125rem; }

/* Servers and Authorize: one quiet row, not a shadowed slab. */
.swagger-ui .scheme-container {
  margin: 0 0 1.5rem;
  padding: 1rem 0;
  background: transparent;
  border-top: 1px solid var(--docs-hairline);
  border-bottom: 1px solid var(--docs-hairline);
  box-shadow: none;
}

.swagger-ui .scheme-container .schemes { align-items: center; }

.swagger-ui .servers-title {
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--docs-text-faint);
}

.swagger-ui .servers > label { margin: 0.25rem 0 0; }

.swagger-ui .servers > label select,
.swagger-ui select {
  min-width: 15rem;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--docs-text);
  background-color: var(--docs-paper);
  border: 1px solid var(--docs-hairline);
  border-radius: 0.5rem;
  box-shadow: none;
}

.swagger-ui .btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--docs-text);
  background: var(--docs-paper);
  border: 1px solid #cfd5dc;
  border-radius: 0.5rem;
  box-shadow: none;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}

.swagger-ui .btn:hover { background: var(--docs-canvas); box-shadow: none; }

.swagger-ui .btn.authorize {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--docs-link);
  border-color: rgba(138, 101, 8, 0.45);
}

.swagger-ui .btn.authorize span { padding: 0; }
.swagger-ui .btn.authorize svg { fill: currentColor; margin: 0; }
.swagger-ui .btn.authorize:hover { background: #fffaeb; border-color: var(--docs-link); }

.swagger-ui .btn.execute {
  color: var(--ink);
  background: var(--bitcoin-orange);
  border-color: var(--bitcoin-orange);
}

.swagger-ui .btn.execute:hover {
  background: var(--bitcoin-orange-dark);
  border-color: var(--bitcoin-orange-dark);
}

.swagger-ui .btn.cancel { color: #b42318; border-color: #f1b8b2; }

/* Filter by tag: a search field. */
.swagger-ui .filter-container { margin: 0 0 1.5rem; }
.swagger-ui .filter-container .filter { padding: 0; }

.swagger-ui .filter .operation-filter-input {
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.9rem 0.65rem 2.5rem;
  font-size: 0.9375rem;
  color: var(--docs-text);
  background: var(--docs-canvas) no-repeat 0.9rem center / 1rem 1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236e7781'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E");
  border: 1px solid var(--docs-hairline);
  border-radius: 0.625rem;
  transition: border-color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}

.swagger-ui .filter .operation-filter-input::placeholder { color: var(--docs-text-faint); }

.swagger-ui .filter .operation-filter-input:focus {
  outline: none;
  background-color: var(--docs-paper);
  border-color: var(--docs-link);
  box-shadow: 0 0 0 3px rgba(232, 181, 60, 0.22);
}

/* A section of the reference: its name, its line, then its calls. */
.swagger-ui .opblock-tag-section { margin-bottom: 0.5rem; }

.swagger-ui .opblock-tag {
  align-items: center;
  margin: 0;
  padding: 1.75rem 0 0.75rem;
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--docs-text-strong);
  border-bottom: 0;
  transition: none;
}

.swagger-ui .opblock-tag:hover { background: transparent; }
.swagger-ui .opblock-tag a.nostyle { color: var(--docs-text-strong); }

.swagger-ui .opblock-tag small {
  flex: 1;
  padding: 0 0 0 1rem;
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--docs-text-muted);
}

.swagger-ui .opblock-tag small .renderedMarkdown p { margin: 0; color: var(--docs-text-muted); }

.swagger-ui .expand-operation svg,
.swagger-ui .opblock-control-arrow svg,
.swagger-ui .models-control svg { fill: #8c959f; }

.swagger-ui .opblock-tag-section .no-margin { padding-bottom: 0.75rem; }

/* An operation: one neutral row, the method a tinted pill. Swagger tints the
   whole row by its verb, which made the reference a wall of colour. */
.swagger-ui .opblock {
  margin: 0 0 0.5rem;
  background: var(--docs-paper);
  border: 1px solid var(--docs-hairline);
  border-radius: 0.625rem;
  box-shadow: none;
  overflow: hidden;
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}

.swagger-ui .opblock:hover { border-color: #cfd5dc; }

.swagger-ui .opblock.is-open {
  border-color: #cfd5dc;
  box-shadow: 0 4px 18px rgba(16, 24, 40, 0.06);
}

.swagger-ui .opblock .opblock-summary {
  padding: 0.5rem 0.75rem;
  border-bottom: 0;
}

.swagger-ui .opblock.is-open .opblock-summary { border-bottom: 1px solid var(--docs-hairline); }

.swagger-ui .opblock .opblock-summary-method {
  min-width: 4.25rem;
  padding: 0.3rem 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: none;
  border-radius: 0.375rem;
}

.swagger-ui .opblock .opblock-summary-path {
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--docs-text-strong);
}

.swagger-ui .opblock .opblock-summary-path a { color: inherit; }

.swagger-ui .opblock .opblock-summary-description {
  font-size: 0.875rem;
  color: var(--docs-text-muted);
}

/* The verbs: each a tinted pill whose text clears 4.5:1 on its tint. POST
   keeps the brand's gold, as it has on this page since the docs joined the
   app. */
.swagger-ui .opblock.opblock-get .opblock-summary-method    { color: #0b5cad; background: #e7f0fb; }
.swagger-ui .opblock.opblock-post .opblock-summary-method   { color: #6b4e06; background: #fbefcc; }
.swagger-ui .opblock.opblock-put .opblock-summary-method    { color: #9a4a06; background: #fdeedd; }
.swagger-ui .opblock.opblock-patch .opblock-summary-method  { color: #0c6b63; background: #e1f4f1; }
.swagger-ui .opblock.opblock-delete .opblock-summary-method { color: #b42318; background: #fdeceb; }

/* Swagger's own verb rules are 0,3,0, so these name the verbs too (:is()
   counts as its one class). */
.swagger-ui .opblock:is(.opblock-get, .opblock-post, .opblock-put, .opblock-patch, .opblock-delete) {
  background: var(--docs-paper);
  border-color: var(--docs-hairline);
}

.swagger-ui .opblock:is(.opblock-get, .opblock-post, .opblock-put, .opblock-patch, .opblock-delete):hover,
.swagger-ui .opblock:is(.opblock-get, .opblock-post, .opblock-put, .opblock-patch, .opblock-delete).is-open {
  border-color: #cfd5dc;
}

.swagger-ui .opblock:is(.opblock-get, .opblock-post, .opblock-put, .opblock-patch, .opblock-delete) .opblock-summary {
  border-color: var(--docs-hairline);
}

/* The row's own focus ring only for the keyboard; Swagger draws one on
   every click. */
.swagger-ui .opblock .opblock-summary-control:focus { outline: none; }
.swagger-ui .opblock .opblock-summary-control:focus-visible {
  outline: 2px solid var(--docs-link);
  outline-offset: 2px;
  border-radius: 0.375rem;
}

/* Copy the path: a quiet icon, not Swagger's grey block. Its icon is a white
   background image, inverted to grey on the light row. */
.swagger-ui .opblock-summary .copy-to-clipboard {
  position: static;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0 0.25rem;
  background: transparent;
  border-radius: 0.375rem;
}

.swagger-ui .opblock-summary .copy-to-clipboard button { filter: invert(0.55); }
.swagger-ui .opblock-summary .copy-to-clipboard:hover { background: var(--docs-canvas); }

.swagger-ui .opblock .opblock-summary .view-line-link,
.swagger-ui .authorization__btn { opacity: 0.55; }

.swagger-ui .opblock .opblock-summary:hover .view-line-link,
.swagger-ui .authorization__btn:hover { opacity: 1; }

/* An open operation's body. */
.swagger-ui .opblock-body { background: var(--docs-paper); }

.swagger-ui .opblock-description-wrapper,
.swagger-ui .opblock-external-docs-wrapper,
.swagger-ui .opblock-title_normal {
  padding: 1.125rem 1.25rem 0.25rem;
}

.swagger-ui .opblock-description-wrapper p,
.swagger-ui .opblock-description-wrapper li {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--docs-text);
}

.swagger-ui .opblock .opblock-section-header {
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  background: var(--docs-canvas);
  border-top: 1px solid var(--docs-hairline-soft);
  border-bottom: 1px solid var(--docs-hairline-soft);
  box-shadow: none;
}

.swagger-ui .opblock .opblock-section-header h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--docs-text-muted);
}

.swagger-ui .opblock:is(.opblock-get, .opblock-post, .opblock-put, .opblock-patch, .opblock-delete) .tab-header .tab-item.active h4 span::after {
  background: var(--bitcoin-orange);
}

.swagger-ui .parameters-container,
.swagger-ui .responses-inner { padding: 1rem 1.25rem; }

.swagger-ui .table-container { padding: 0; }

.swagger-ui table thead tr th,
.swagger-ui table thead tr td {
  padding: 0.5rem 0.75rem 0.5rem 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--docs-text-faint);
  border-bottom: 1px solid var(--docs-hairline);
}

.swagger-ui table tbody tr td { padding: 0.75rem 0.75rem 0.75rem 0; }

.swagger-ui .parameter__name { font-size: 0.875rem; font-weight: 600; color: var(--docs-text-strong); }
.swagger-ui .parameter__name.required span { color: #b42318; }
.swagger-ui .parameter__name.required::after { color: #b42318; }
.swagger-ui .parameter__type { font-size: 0.75rem; color: var(--docs-text-muted); }
.swagger-ui .parameter__in { font-size: 0.75rem; font-style: normal; color: var(--docs-text-faint); }

.swagger-ui .parameters-col_description input,
.swagger-ui .parameters-col_description select,
.swagger-ui textarea.body-param__text,
.swagger-ui input[type="text"],
.swagger-ui input[type="password"] {
  font-size: 0.875rem;
  border: 1px solid var(--docs-hairline);
  border-radius: 0.5rem;
  box-shadow: none;
}

/* Responses: the status a quiet mono figure, its example a guide's code. */
.swagger-ui .response-col_status {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--docs-text-strong);
}

.swagger-ui .response-col_description { font-size: 0.875rem; }

.swagger-ui .responses-inner h4,
.swagger-ui .responses-inner h5 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--docs-text-muted);
}

.swagger-ui .tab li {
  font-size: 0.8125rem;
  color: var(--docs-text-muted);
}

.swagger-ui .tab li:first-of-type::after { background: var(--docs-hairline); }
.swagger-ui .tab li.active,
.swagger-ui .tab li button.tablinks { color: var(--docs-text-strong); font-weight: 600; }

.swagger-ui .highlight-code > .microlight,
.swagger-ui .opblock-body pre.microlight,
.swagger-ui .microlight {
  padding: 1rem 1.125rem !important;
  font-family: var(--font-mono) !important;
  font-size: 0.8125rem !important;
  line-height: 1.65 !important;
  color: var(--docs-code-text) !important;
  background: var(--docs-code-bg) !important;
  border: 1px solid var(--docs-code-border);
  border-radius: 0.625rem !important;
}

/* Swagger colours its examples with inline styles (the "agate" theme):
   matched by the colour each writes and given the guides' palette, so a
   response here looks like a response in a guide. */
.swagger-ui .microlight .hljs-attr { color: var(--docs-tok-key); }
.swagger-ui .microlight [style*="162, 252, 162"] { color: var(--docs-tok-string) !important; }
.swagger-ui .microlight [style*="211, 99, 99"],
.swagger-ui .microlight [style*="252, 194, 140"] { color: var(--docs-tok-number) !important; }

.swagger-ui .highlight-code .copy-to-clipboard {
  right: 0.75rem;
  bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 0.375rem;
}

.swagger-ui .model-box,
.swagger-ui .model-example .model-box {
  padding: 0.75rem 1rem;
  background: var(--docs-canvas);
  border-radius: 0.5rem;
}

.swagger-ui .model { font-size: 0.8125rem; }
.swagger-ui .model-title { font-size: 0.9375rem; font-weight: 600; color: var(--docs-text-strong); }
.swagger-ui .prop-type { color: #0b5cad; }
.swagger-ui .prop-format { color: var(--docs-text-faint); }

/* Schemas, at the foot of the page. */
.swagger-ui section.models {
  margin: 2.5rem 0 0;
  border: 1px solid var(--docs-hairline);
  border-radius: 0.75rem;
}

.swagger-ui section.models h4 {
  padding: 0.25rem 0.5rem;
  font-size: 1.125rem;
  font-weight: 650;
  color: var(--docs-text-strong);
}

.swagger-ui section.models.is-open h4 { border-bottom: 1px solid var(--docs-hairline); }

.swagger-ui section.models .model-container {
  margin: 0.5rem 1rem;
  background: var(--docs-paper);
  border-radius: 0.5rem;
}

.swagger-ui section.models .model-container:hover { background: var(--docs-canvas); }

/* The Authorize dialog. */
.swagger-ui .dialog-ux .modal-ux {
  border: 1px solid var(--docs-hairline);
  border-radius: 0.875rem;
  box-shadow: 0 24px 64px rgba(16, 24, 40, 0.2);
  overflow: hidden;
}

.swagger-ui .dialog-ux .modal-ux-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--docs-hairline); }
.swagger-ui .dialog-ux .modal-ux-header h3 { font-size: 1.125rem; font-weight: 650; }
.swagger-ui .dialog-ux .backdrop-ux { background: rgba(10, 10, 10, 0.55); }

/* Schemas. An OpenAPI 3.1 spec is drawn by Swagger's JSON Schema 2020-12
   viewer, which brings its own grey slabs, Arial and purple: the guides'
   face, the reference's type blue, and no slabs. */
.swagger-ui [class*="json-schema-2020-12"] { font-family: var(--docs-font); }

.swagger-ui .json-schema-2020-12,
.swagger-ui .json-schema-2020-12-accordion,
.swagger-ui .json-schema-2020-12-expand-deep-button { background: transparent; }

.swagger-ui section.models .model-container > .json-schema-2020-12 {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--docs-hairline-soft);
  border-radius: 0.5rem;
}

.swagger-ui .json-schema-2020-12__title { color: var(--docs-text-strong); font-weight: 600; }
.swagger-ui .json-schema-2020-12-accordion__icon { color: #8c959f; }
.swagger-ui .json-schema-2020-12-accordion__icon svg { fill: #8c959f; }

/* Swagger's "expand all" in a schema read at 1.9:1. */
.swagger-ui .json-schema-2020-12-expand-deep-button { color: var(--docs-text-muted); }

.swagger-ui .json-schema-2020-12-property .json-schema-2020-12__title,
.swagger-ui .json-schema-2020-12__attribute,
.swagger-ui .json-schema-2020-12__constraint,
.swagger-ui [class*="json-schema-2020-12-keyword__value"] {
  font-family: var(--font-mono);
}

.swagger-ui .json-schema-2020-12__attribute--primary { color: #0b5cad; }
.swagger-ui .json-schema-2020-12__attribute--muted,
.swagger-ui [class*="json-schema-2020-12-keyword__name"],
.swagger-ui [class*="json-schema-2020-12-keyword__value"] { color: var(--docs-text-muted); }

/* A schema's example and constant values: Swagger draws them in a dashed
   box; the guides' inline code instead. */
.swagger-ui .json-schema-2020-12-keyword__value--const {
  padding: 0.25rem 0.5rem;
  color: var(--docs-text);
  background: var(--docs-inline-code-bg);
  border: 1px solid var(--docs-inline-code-border);
  border-radius: 0.375rem;
}

.swagger-ui .json-schema-2020-12__constraint {
  color: var(--docs-text-muted);
  background: var(--docs-inline-code-bg);
  border-radius: 0.3125rem;
}

/* Try it out: the request body is edited where the examples are read, so it
   looks like one of them. */
.swagger-ui textarea.body-param__text,
.swagger-ui textarea.curl {
  min-height: 12rem;
  padding: 1rem 1.125rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--docs-code-text);
  background: var(--docs-code-bg);
  border: 1px solid var(--docs-code-border);
  border-radius: 0.625rem;
}

.swagger-ui input[type="text"]:focus,
.swagger-ui input[type="password"]:focus,
.swagger-ui textarea:focus,
.swagger-ui select:focus {
  outline: none;
  border-color: var(--docs-link);
  box-shadow: 0 0 0 3px rgba(232, 181, 60, 0.22);
}

/* The Authorize dialog: each key's name in the guides' code, not magenta. */
.swagger-ui .auth-container h4,
.swagger-ui .auth-container h5 { font-family: var(--docs-font); color: var(--docs-text-strong); }

.swagger-ui .auth-container h4 code {
  padding: 0;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--docs-text-strong);
  background: none;
  border: 0;
}

.swagger-ui .auth-container .renderedMarkdown p,
.swagger-ui .auth-container label { font-size: 0.875rem; color: var(--docs-text-muted); }

/* Every answer is JSON and no operation has links: the reference showed a
   "Links / No links" column and a media-type picker under every response.
   Hidden, so a response is its status, its words and its example. */
.swagger-ui .response-col_links,
.swagger-ui .responses-inner .response-control-media-type { display: none; }

@media (max-width: 767.98px) {
  .swagger-ui .opblock-tag { flex-wrap: wrap; font-size: 1.25rem; }
  .swagger-ui .opblock-tag small { flex-basis: 100%; padding: 0.25rem 0 0; order: 3; }
  .swagger-ui .opblock-tag .expand-operation { order: 2; margin-left: auto; }
  .swagger-ui .opblock .opblock-summary-description { display: none; }
  .swagger-ui .opblock .opblock-summary-path { font-size: 0.8125rem; padding: 0 0.5rem; }
  .swagger-ui .opblock .opblock-summary-method { min-width: 3.75rem; }
}

/* ==========================================================================
   The reference without JavaScript

   src/index.html puts a plain endpoint list inside #swagger-ui for readers
   that never run Swagger UI — AI agents, most crawlers, a browser with
   scripts off. Swagger UI replaces it when it renders; until then it is
   hidden on any page _head has marked .js, so a browser never flashes it.
   ========================================================================== */

.js .docs-static-reference { display: none; }

.docs-static-reference {
  max-width: var(--docs-measure);
  font-size: 1rem;
  line-height: 1.7;
}

.docs-static-reference h2 {
  font-size: 1.25rem;
  font-weight: 650;
  margin: 2.5rem 0 0.75rem;
}

.docs-static-reference a { color: var(--docs-link); }

.docs-static-table { width: 100%; font-size: 0.875rem; }
.docs-static-table th { font-size: 0.8125rem; color: var(--docs-text-muted); }
.docs-static-table code { white-space: nowrap; }
