/* Swagger UI in the archive's palette.
 *
 * The docs are reached from a link on the home page, and every other page of this site is
 * dark — arriving at a white page is a seam that says "different thing, bolted on". Swagger
 * UI ships no theme hook, so this overrides its own stylesheet rather than configuring it;
 * it is loaded AFTER swagger-ui.css and wins on order, not on !important, except where
 * upstream uses inline-ish specificity of its own.
 *
 * Values are copied from build.py's STYLE :root rather than imported — this file is served
 * by the API container and the site's stylesheet is not on its path. If the palette there
 * changes, change it here too; there is no build step tying them together.
 */
:root {
  --bg: #0f1216;
  --bg2: #151a21;
  --panel: #1a2029;
  --panel2: #20272f;
  --line: #2a323c;
  --fg: #e6e9ee;
  --mut: #8b95a3;
  --acc: #e0954a;
  --link: #6ab0f0;
}

body { background: var(--bg); }
.swagger-ui { color: var(--fg); }

/* ---- header block: title, prose, the openapi.json link ---- */
.swagger-ui .info .title,
.swagger-ui .info h1, .swagger-ui .info h2,
.swagger-ui .info h3, .swagger-ui .info h4 { color: var(--fg); }
.swagger-ui .info p,
.swagger-ui .info li,
.swagger-ui .info table td,
.swagger-ui .info .base-url { color: var(--mut); }
.swagger-ui .info a,
.swagger-ui a.nostyle,
.swagger-ui a.nostyle:visited { color: var(--link); }
.swagger-ui .info .title small pre { background: var(--panel2); border-color: var(--line); }

/* Inline code in the description carries the grammar note, so it has to stay legible. */
.swagger-ui .info code,
.swagger-ui .renderedMarkdown code,
.swagger-ui .markdown code {
  background: var(--panel2);
  color: var(--acc);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ---- the Servers selector ---- */
.swagger-ui .scheme-container {
  background: var(--bg2);
  box-shadow: none;
  border-bottom: 1px solid var(--line);
}
.swagger-ui .scheme-container .schemes-title,
.swagger-ui .servers-title { color: var(--mut); }

/* ---- form controls ---- */
.swagger-ui select,
.swagger-ui input[type=text],
.swagger-ui input[type=search],
.swagger-ui input[type=email],
.swagger-ui input[type=password],
.swagger-ui textarea {
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--line);
  box-shadow: none;
}
.swagger-ui .parameter__name,
.swagger-ui .parameter__type,
.swagger-ui .parameter__in,
.swagger-ui .parameter__extension,
.swagger-ui table thead tr td,
.swagger-ui table thead tr th,
.swagger-ui .tab li,
.swagger-ui label { color: var(--fg); }
.swagger-ui .parameter__type,
.swagger-ui .parameter__in,
.swagger-ui .prop-format { color: var(--mut); }
.swagger-ui table thead tr th { border-bottom-color: var(--line); }

/* ---- operation rows ---- */
.swagger-ui .opblock-tag {
  color: var(--fg);
  border-bottom: 1px solid var(--line);
}
.swagger-ui .opblock-tag:hover { background: var(--panel); }
.swagger-ui .opblock-tag small { color: var(--mut); }

.swagger-ui .opblock {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: none;
}
.swagger-ui .opblock .opblock-summary { border-bottom-color: var(--line); }
.swagger-ui .opblock .opblock-summary-path,
.swagger-ui .opblock .opblock-summary-path__deprecated,
.swagger-ui .opblock .opblock-summary-operation-id { color: var(--fg); }
.swagger-ui .opblock .opblock-summary-description { color: var(--mut); }
.swagger-ui .opblock .opblock-section-header {
  background: var(--panel2);
  box-shadow: none;
  border-bottom: 1px solid var(--line);
}
.swagger-ui .opblock .opblock-section-header h4,
.swagger-ui .opblock .opblock-section-header > label { color: var(--fg); }
.swagger-ui .opblock-description-wrapper p,
.swagger-ui .opblock-external-docs-wrapper p,
.swagger-ui .opblock-title_normal p { color: var(--mut); }

/* Everything here is GET, so the one method colour that matters is the blue one; keep the
   chip saturated and let the row behind it go dark. */
.swagger-ui .opblock.opblock-get { background: var(--panel); border-color: var(--line); }
.swagger-ui .opblock.opblock-get .opblock-summary { border-color: var(--line); }
.swagger-ui .opblock.opblock-get .opblock-summary-method { background: #2b6cb0; }

/* ---- responses, models, code samples ---- */
.swagger-ui .responses-inner h4,
.swagger-ui .responses-inner h5,
.swagger-ui .response-col_status { color: var(--fg); }
.swagger-ui .response-col_links,
.swagger-ui .responses-inner td.response-col_description { color: var(--mut); }
.swagger-ui .responses-table .response-col_description__inner div.markdown,
.swagger-ui .responses-table .response-col_description__inner div.renderedMarkdown {
  background: var(--panel2);
  color: var(--fg);
  border: 1px solid var(--line);
}
.swagger-ui .model-box,
.swagger-ui section.models,
.swagger-ui section.models .model-container {
  background: var(--panel);
  border-color: var(--line);
}
.swagger-ui section.models.is-open h4 { border-bottom-color: var(--line); color: var(--fg); }
.swagger-ui .model-title,
.swagger-ui .model { color: var(--fg); }
.swagger-ui .prop-type { color: var(--link); }
.swagger-ui .microlight { background: var(--bg2) !important; color: var(--fg) !important; }
.swagger-ui .highlight-code > .microlight code { color: var(--fg) !important; }

/* ---- buttons ---- */
.swagger-ui .btn {
  background: var(--panel2);
  color: var(--fg);
  border-color: var(--line);
  box-shadow: none;
}
.swagger-ui .btn:hover { background: var(--line); }
.swagger-ui .btn.execute { background: var(--acc); color: #1a1206; border-color: var(--acc); }
.swagger-ui .btn.cancel { background: transparent; color: var(--acc); border-color: var(--acc); }

/* Swagger draws its expand/collapse chevrons as inline SVG that inherits nothing. */
.swagger-ui svg:not(:root) { fill: var(--mut); }
.swagger-ui .opblock-summary-control:focus { outline-color: var(--acc); }
.swagger-ui .expand-methods svg, .swagger-ui .expand-operation svg { fill: var(--mut); }

.swagger-ui hr { border-color: var(--line); }
.swagger-ui .dialog-ux .modal-ux { background: var(--panel); border-color: var(--line); }
.swagger-ui .dialog-ux .modal-ux-header h3,
.swagger-ui .dialog-ux .modal-ux-content h4,
.swagger-ui .dialog-ux .modal-ux-content p { color: var(--fg); }

/* Two upstream rules beat the generic ones above on specificity, so they are named here
   rather than fought with !important. Both were visibly light on an otherwise dark page. */
.swagger-ui .btn.try-out__btn {
  background: var(--panel2);
  color: var(--fg);
  border-color: var(--line);
}
.swagger-ui .info .title small { background: var(--panel2); }
.swagger-ui .info .title small pre { color: var(--fg); }
