  /* Black background palette for slide text and controls with fixed colours. */
  body.high-contrast .slide-card {
    --slide-answer-text: #8be8a7;
    --slide-answer-bg: #10291c;
    --slide-mark-scheme-text: #ffaaaa;
  }
  body.high-contrast :is(
    .slide-header-title, .slide-content p, .slide-content li,
    .miniwbs-question, .epp-col-body, .epp-col-body p,
    .questions-title, .questions-heading, .bq-title, .pattern-title,
    .scale-title, .scale-tick-label, .scale-tick.endpoint .scale-tick-label,
    .exam-title, .exam-q-num, .exam-q-text, .exam-q-text.revealed,
    .exam-total-marks, .gme-title, .gme-text
  ) {
    color: var(--text);
  }
  body.high-contrast :is(.slide-header-date, .exam-instructions, .exam-q-marks) {
    color: var(--muted);
  }
  body.high-contrast :is(.scale-tick-mark, .scale-line-wrap) {
    background-color: var(--muted);
  }
  body.high-contrast .exam-header {
    border-bottom-color: var(--border);
  }
  body.high-contrast :is(.exam-answer-box, .exam-answer-label) {
    color: var(--slide-mark-scheme-text);
  }
  body.high-contrast :is(.epp-reveal-btn, .questions-reveal-btn:not(.all-revealed, .questions-regenall-btn, .questions-restore-btn)) {
    background: #182230;
    border-color: #7389a6;
    color: #c3d7f4;
  }
  body.high-contrast :is(.epp-reveal-btn, .questions-reveal-btn:not(.all-revealed, .questions-regenall-btn, .questions-restore-btn)):is(:hover, :focus-visible) {
    background: #22334a;
    border-color: #c3d7f4;
  }
  body.high-contrast .slide-card :is(
    .question-cell.revealed, .blanks-table td.blanks-hide.blanks-revealed,
    .mc-cell.mc-correct, .pattern-ans-cell.pat-correct
  ) {
    background: var(--slide-answer-bg);
    color: var(--slide-answer-text);
  }
  body.high-contrast .slide-card :is(.shape-cell-answer, .qqs-ans-a) {
    color: var(--slide-answer-text);
  }
  body.high-contrast :is(.mc-cell:not(.mc-correct), .pattern-ans-cell:not(.pat-correct)) {
    border-color: var(--border);
  }
  body.high-contrast :is(.tb-nav-btn, .tb-zoom-btn, .tb-btn, .tb-fs-btn) img {
    filter: brightness(0) invert(1);
    opacity: 0.75;
  }
  body.high-contrast :is(.tb-nav-btn, .tb-zoom-btn, .tb-btn, .tb-fs-btn):is(:hover, :focus-visible, .active) img {
    opacity: 1;
  }


  body.high-contrast .title-slide {
    --title-dark-bar: var(--bg);
    --title-dark-ink: var(--text);
    --title-dark-rule: var(--border);
  }
  body.high-contrast .title-slide-middle {
    border-bottom-color: var(--title-dark-rule);
  }
  body.high-contrast .title-slide-curriculum-link {
    color: #a8c7f4;
  }
  body.high-contrast .title-slide-curriculum-link:is(:hover, :focus-visible) {
    background: #182230;
    opacity: 1;
  }
  body.high-contrast .question-btn-group {
    background: #182230;
  }
  body.high-contrast .question-row.highlighted .question-btn-group {
    opacity: 1;
  }
  body.high-contrast .question-btn-group :is(.question-eye-btn, .question-graph-btn, .question-regen-btn, .question-highlight-btn) {
    color: var(--muted);
    opacity: 1;
  }
  body.high-contrast .question-btn-group button:not(.question-ans-btn):is(:hover, :focus-visible),
  body.high-contrast .questions-slide.focus-mode .focus-row .question-eye-btn {
    color: #a8c7f4;
  }
  body.high-contrast .question-btn-group .question-graph-btn img {
    filter: brightness(0) invert(.8);
  }
  body.high-contrast .question-btn-group .question-ans-btn {
    background: #a8c7f4;
    color: #101826;
  }
  body.high-contrast .question-btn-group .question-ans-btn:is(:hover, :focus-visible) {
    background: #c3d7f4;
  }
  body.high-contrast .question-cell.revealed .question-ans-btn {
    background: var(--slide-answer-text);
  }
  body.high-contrast .question-row.highlighted .question-highlight-btn {
    color: var(--slide-mark-scheme-text);
  }


  /* Toolbar colours are independent of the lesson's decorative accent. */
  body.high-contrast :is(.slide-toolbar, .tb-popover) {
    --surface: #20242a;
    --accent: #a8c7f4;
    --accent-light: #25354a;
    --border: #606a76;
    --hover: var(--accent-light);
  }
  body.high-contrast .tb-popover {
    --tb-popover-bg: #15181d;
  }
  body.high-contrast :is(.tb-tile, .tb-weight-btn) {
    color: var(--text);
  }
  body.high-contrast .tb-tile img {
    filter: brightness(0) invert(1);
    opacity: 0.8;
  }
  body.high-contrast .tb-tile svg [stroke="#333"],
  body.high-contrast .tb-weight-btn line {
    stroke: currentColor;
  }
  body.high-contrast .tb-tile-tinted-red span {
    color: #ffaaaa;
  }
  body.high-contrast .tb-tile-tinted-blue span {
    color: var(--accent);
  }
  body.high-contrast .tb-tile:is(:hover, :active, :focus-visible) {
    background: var(--accent-light);
    border-color: var(--accent);
  }
  body.high-contrast .tb-btn.danger:hover {
    background: #48272c;
  }
  body.high-contrast :is(.tb-color-dot, .tb-color-swatch:not(.selected)) {
    border-color: var(--border);
  }
  body.high-contrast :is(.slide-toolbar, .tb-popover) :is(button, input):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

