/*
 * Swagger UI contrast overrides.
 *
 * The default Swashbuckle UI renders inline <code> elements (produced from
 * <c>...</c> XML doc tags) with a very light grey background that browser
 * dark-mode extensions (Dark Reader, etc.) invert poorly — leaving near-black
 * text on a near-black pill and making the API descriptions unreadable. The
 * same happens to the HTTP status-code badges in the Responses table.
 *
 * Fix: pin explicit colors for these specific elements using high-contrast
 * pairs in both light and dark contexts, with !important so a dark-mode
 * extension's post-processing can't flatten the pair into the background.
 */

:root {
  color-scheme: light dark;
}

/*
 * Markdown prose inside endpoint descriptions (operation bodies).
 * The default Swagger UI palette gives list items and secondary prose a muted grey
 * (~#555) that Dark Reader inverts to a dim grey on dark grey — unreadable.
 * Pin an explicit, high-contrast foreground so the text stays legible regardless
 * of the extension's inversion pass, plus set line-height so inline <code> pills
 * never collide with adjacent lines.
 */
.swagger-ui .markdown p,
.swagger-ui .markdown li,
.swagger-ui .markdown ul,
.swagger-ui .markdown ol,
.swagger-ui .renderedMarkdown p,
.swagger-ui .renderedMarkdown li,
.swagger-ui .renderedMarkdown ul,
.swagger-ui .renderedMarkdown ol,
.swagger-ui .opblock-description-wrapper p,
.swagger-ui .opblock-description-wrapper li {
  color: #0b1220 !important;
  line-height: 1.7 !important;
}

.swagger-ui .markdown strong,
.swagger-ui .markdown em,
.swagger-ui .renderedMarkdown strong,
.swagger-ui .renderedMarkdown em {
  color: #0b1220 !important;
}

/*
 * Inline <code> pills — both in top-level description and in operation bodies.
 * padding-block: 0 is critical. Any vertical padding pushes the pill's box taller than
 * its line-box, which causes pills on one line to overlap text on the line above/below
 * (observed on /swagger 2026-04-23: "Authorization: Bearer <YOUR_API_KEY>" pill visibly
 * bled into the Thread-lifecycle paragraph beneath it).
 */
.swagger-ui code,
.swagger-ui .markdown code,
.swagger-ui .renderedMarkdown code,
.swagger-ui p code,
.swagger-ui li code {
  background-color: #eef2f6 !important;
  color: #0b1220 !important;
  padding: 0 0.35em !important;
  border-radius: 3px !important;
  font-size: 0.9em !important;
  line-height: inherit !important;
  vertical-align: baseline !important;
}

/* HTTP status badges in the Responses table */
.swagger-ui .responses-inner td.response-col_status,
.swagger-ui .response-col_status {
  color: #0b1220 !important;
  font-weight: 600 !important;
}

/* Response example / schema preview panels */
.swagger-ui .highlight-code,
.swagger-ui .microlight {
  background-color: #0b1220 !important;
  color: #e6edf3 !important;
}

@media (prefers-color-scheme: dark) {
  .swagger-ui code,
  .swagger-ui .markdown code,
  .swagger-ui .renderedMarkdown code,
  .swagger-ui p code,
  .swagger-ui li code {
    background-color: #2b3546 !important;
    color: #e6edf3 !important;
  }

  .swagger-ui .responses-inner td.response-col_status,
  .swagger-ui .response-col_status {
    color: #e6edf3 !important;
  }

  .swagger-ui .markdown p,
  .swagger-ui .markdown li,
  .swagger-ui .markdown ul,
  .swagger-ui .markdown ol,
  .swagger-ui .renderedMarkdown p,
  .swagger-ui .renderedMarkdown li,
  .swagger-ui .renderedMarkdown ul,
  .swagger-ui .renderedMarkdown ol,
  .swagger-ui .opblock-description-wrapper p,
  .swagger-ui .opblock-description-wrapper li,
  .swagger-ui .markdown strong,
  .swagger-ui .markdown em,
  .swagger-ui .renderedMarkdown strong,
  .swagger-ui .renderedMarkdown em {
    color: #e6edf3 !important;
  }
}
