/* Shared boolean control. Keep native checked/change/form/keyboard behaviour. */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  display: inline-block;
  position: relative;
  box-sizing: border-box;
  flex: 0 0 48px;
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 0;
  border: 1px solid #58778d;
  border-radius: 999px;
  background: #213545;
  background-image: none;
  vertical-align: middle;
  opacity: 1;
  cursor: pointer;
  transition: background-color .18s, border-color .18s, box-shadow .18s;
}
input[type="checkbox"]::before { content: none; }
input[type="checkbox"]::after {
  content: "";
  display: block;
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #adc2d1;
  box-shadow: 0 1px 4px #0005;
  transform: translateX(0);
  pointer-events: none;
  transition: transform .18s, background-color .18s;
}
input[type="checkbox"]:checked {
  border-color: #ffbf73;
  background: #b96e28;
  background-image: none;
  box-shadow: inset 0 0 8px #ffb34c20;
}
input[type="checkbox"]:checked::after { transform: translateX(20px); background: #fff1d5; }
input[type="checkbox"]:focus-visible { outline: 2px solid #8ce1e7; outline-offset: 4px; }
input[type="checkbox"]:disabled { opacity: .45; cursor: not-allowed; }
label:has(>input[type="checkbox"]) { cursor: pointer; }
label:has(>input[type="checkbox"]:disabled) { cursor: not-allowed; }
.module-switch { display: inline-flex !important; align-items: center; gap: 12px; flex-direction: row !important; }
.module-control-icon { flex-shrink: 0; }
.module-state { min-width: 0; font-size: 12px; max-width: 100px; overflow-wrap: anywhere; }
.check, .quest-builtin-switch { gap: 12px; min-height: 40px; }
.quest-builtin-switch { display: flex !important; flex-direction: row !important; align-items: center; cursor: pointer; }
.quest-template input[type="checkbox"] { align-self: center; }
.consent-check input[type="checkbox"] { margin-top: 2px; }
@media (prefers-reduced-motion: reduce) {
  input[type="checkbox"], input[type="checkbox"]::after { transition: none; }
}
@media (forced-colors: active) {
  input[type="checkbox"] { border-color: ButtonText; background: Canvas; }
  input[type="checkbox"]::after { background: ButtonText; }
  input[type="checkbox"]:checked { background: Highlight; }
  input[type="checkbox"]:checked::after { background: HighlightText; }
}
