/* Black content text with readable exceptions for dark surfaces and controls. */
:root {
  --rpds-color-primary: #000000;
  --rpds-color-secondary: #000000;
  --rpds-color-muted: #000000;
  --text: #000000;
  --muted: #000000;
  --gb-ink: #000000;
  --gb-ink-soft: #000000;
  --bs-body-color: #000000;
  --bs-secondary-color: #000000;
}

/* Layered important rules also override older page styles with ID selectors. */
@layer rpds-text-colors {
body {
  color: #000000 !important;
}

/* Keep the existing contrast of filled controls and the colors of chart data. */
:is(body, #regression-content, #rpds-sidebar) :not(
  button, button *,
  .btn, .btn *,
  .gb-btn, .gb-btn *,
  .gb-mini-primary, .gb-mini-primary *,
  .gb-workspace-btn, .gb-workspace-btn *,
  .gb-button, .gb-button *,
  .gb-action-btn, .gb-action-btn *,
  svg, svg *
) {
  color: #000000 !important;
}

/* Preserve the semantic deviation colors inside the important text layer. */
:is(body, #regression-content, #rpds-sidebar) .gb-deviation-level {
  color: var(--gb-deviation-color) !important;
}

/* Restore contrast where the page deliberately uses a filled background. */
:is(body, #regression-content, #rpds-sidebar) :is(
  .text-white, .text-white *,
  .next-floating-btn, .next-floating-btn *,
  .reg-float-btn, .reg-float-btn *,
  .eda-tabs .nav-link.active, .eda-tabs .nav-link.active *,
  .gb-question-num,
  .test-size-badge:not(.empty):not(.custom),
  .badge:is(.text-bg-primary, .text-bg-secondary, .text-bg-success,
            .text-bg-danger, .text-bg-dark, .bg-primary, .bg-secondary,
            .bg-success, .bg-danger, .bg-dark):not([class*="bg-opacity-"]),
  .badge:is(.text-bg-primary, .text-bg-secondary, .text-bg-success,
            .text-bg-danger, .text-bg-dark, .bg-primary, .bg-secondary,
            .bg-success, .bg-danger, .bg-dark):not([class*="bg-opacity-"]) *
) {
  color: #ffffff !important;
}

/* All selection controls have an unmistakable outline and selected state. */
.form-check-input:is([type="checkbox"], [type="radio"]) {
  border: 2px solid #000000 !important;
  background-color: #ffffff;
}

.form-check-input:is([type="checkbox"], [type="radio"]):checked,
.form-check-input[type="checkbox"]:indeterminate {
  background-color: #000000 !important;
}

.form-check-input:is([type="checkbox"], [type="radio"]):focus-visible {
  outline: 2px solid #000000 !important;
  outline-offset: 2px;
}

/* Subtitles and explanatory copy retain normal weight; headings retain theirs. */
:is(.gb-subtitle, .reg-page-subtitle, .eda-subtitle, .tuning-subtitle,
    .clean-subtitle, .interp-subtitle, .viz-hero-subtitle, .hero-subtitle,
    .rpds-helper, .gb-field-help, .gb-hero-caption, .gb-step-hint,
    .gb-block-note, .gb-quick-guide-item span, .gb-help-text, .reactor-desc,
    .text-muted) {
  font-weight: 400 !important;
}

/* Also cover existing charts whose serialized layout predates this theme. */
.js-plotly-plot text,
.js-plotly-plot text tspan {
  fill: #000000 !important;
}
}
