/* UX12H — strictly scoped contrast / selected-state correction.
 * Only relation trigger and relation impulse buttons inside Complete Regulatie,
 * plus its mobile heading; no changes to other screens, light/dark global CSS,
 * strategy selection, Complete gate or app functionality. */
@media screen {
  /* Mobile dark: after UX12G removed the light outer frame, the old dark
     heading text was left on a dark parent. Repair exactly those two lines. */
  @media (max-width:800px) {
    html[data-reguspace-theme="dark"] body #regulationScreen #relationTriggerBox .mobile-complete-relation-title .qm-step,
    html[data-reguspace-theme="dark"] body #regulationScreen #relationTriggerBox .mobile-complete-relation-title h2 {
      color:#edf4f8!important;
      -webkit-text-fill-color:#edf4f8!important;
    }
  }

  /* Dark mode: stronger contrast so the four choices no longer fade away.
     Selected = clearly lighter with dark text.
     Not selected = still readable but distinctly darker. */
  html[data-reguspace-theme="dark"] body #regulationScreen #relationTriggerBox .relation-trigger-btn:not(.active),
  html[data-reguspace-theme="dark"] body #regulationScreen #relationImpulsePanel .relation-impulse-btn:not(.active) {
    background:#3b4f5f!important;
    border:1px solid #4f687a!important;
    color:#eef5fa!important;
    -webkit-text-fill-color:#eef5fa!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.04)!important;
    opacity:1!important;
  }
  html[data-reguspace-theme="dark"] body #regulationScreen #relationTriggerBox .relation-trigger-btn.active,
  html[data-reguspace-theme="dark"] body #regulationScreen #relationImpulsePanel .relation-impulse-btn.active {
    background:#d9edf9!important;
    border:1px solid #7faecc!important;
    color:#123b56!important;
    -webkit-text-fill-color:#123b56!important;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.18)!important, 0 0 0 1px rgba(127,174,204,.18)!important;
    opacity:1!important;
  }

  /* Light mode: retain accepted navy selected surface; make its edge explicit
     and mute neutral controls without reducing text readability. */
  html:not([data-reguspace-theme="dark"]) body #regulationScreen #relationTriggerBox .relation-trigger-btn:not(.active),
  html:not([data-reguspace-theme="dark"]) body #regulationScreen #relationImpulsePanel .relation-impulse-btn:not(.active) {
    background:#f2f6f9!important;
    color:#526475!important;
    -webkit-text-fill-color:#526475!important;
    border:1px solid #c8d6df!important;
    box-shadow:none!important;
    opacity:1!important;
  }
  html:not([data-reguspace-theme="dark"]) body #regulationScreen #relationTriggerBox .relation-trigger-btn.active,
  html:not([data-reguspace-theme="dark"]) body #regulationScreen #relationImpulsePanel .relation-impulse-btn.active {
    background:#173d55!important;
    color:#fff!important;
    -webkit-text-fill-color:#fff!important;
    border:1px solid #173d55!important;
    box-shadow:none!important;
    opacity:1!important;
  }

  /* Desktop four-choice cards: explicitly NO light/white frames, for every
     selected and unselected state. Selected stands out by fill, not outline. */
  @media (min-width:801px) {
    html[data-reguspace-theme="dark"] body #regulationScreen #relationImpulsePanel .relation-impulse-btn:is(.active,:not(.active)),
    html:not([data-reguspace-theme="dark"]) body #regulationScreen #relationImpulsePanel .relation-impulse-btn:is(.active,:not(.active)) {
      border:0!important;
      outline:none;
      box-shadow:none!important;
    }
    html body #regulationScreen #relationImpulsePanel .relation-impulse-btn:focus-visible {
      outline:3px solid #8bc6eb!important;
      outline-offset:3px!important;
    }
  }

  html body #regulationScreen #relationTriggerBox .relation-trigger-btn:focus-visible,
  html body #regulationScreen #relationImpulsePanel .relation-impulse-btn:focus-visible {
    outline:3px solid #a4dbfc!important;
    outline-offset:3px!important;
  }
}
