/* Keep native checkbox semantics, form values and existing change handlers. */
html body input[type="checkbox"]:not([hidden]) {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    flex: 0 0 54px;
    width: 54px;
    min-width: 54px;
    max-width: 54px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    margin: 4px 6px 4px 0;
    border: 3px solid #68737d;
    border-radius: 18px;
    background-color: #68737d;
    background-image: radial-gradient(circle at center, #fff 0, #fff 11px, transparent 11.8px);
    background-repeat: no-repeat;
    background-size: 24px 24px;
    background-position: left center;
    box-shadow: none;
    vertical-align: middle;
    cursor: pointer;
    transition: background-position .18s ease, background-color .18s ease, border-color .18s ease;
}

html body input[type="checkbox"]:checked {
    background-color: #137a39;
    border-color: #137a39;
    background-position: right center;
}

html body input[type="checkbox"]:indeterminate {
    background-color: #896316;
    border-color: #896316;
    background-position: center;
}

html body input[type="checkbox"]:focus-visible {
    outline: 3px solid #245fba;
    outline-offset: 3px;
    box-shadow: none;
}

html body input[type="checkbox"]:disabled:not([hidden]) {
    opacity: .5;
    cursor: not-allowed;
}

/* Bootstrap normally hides the input and draws a second box on its label. */
html body input[type="checkbox"].custom-control-input,
html body input[type="checkbox"].form-check-input {
    position: relative;
    inset: auto;
    z-index: auto;
    opacity: 1;
}

html body .custom-control:not([hidden]):has(> input[type="checkbox"]),
html body .form-check:not([hidden]):has(> input[type="checkbox"]) {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-height: 44px;
    padding-left: 0;
}

html body .custom-control input[type="checkbox"],
html body .form-check input[type="checkbox"] {
    margin: 4px 0;
}

html body input[type="checkbox"] ~ .custom-control-label,
html body input[type="checkbox"] ~ .form-check-label {
    min-width: 0;
    padding-top: 8px;
    padding-bottom: 8px;
    cursor: pointer;
}

html body input[type="checkbox"] ~ .custom-control-label::before,
html body input[type="checkbox"] ~ .custom-control-label::after,
html body input[type="checkbox"]::before,
html body input[type="checkbox"]::after {
    content: none;
    display: none;
}

html body input[type="checkbox"][hidden] {
    display: none;
}

.ByteBoxCheckboxColumn {
    flex: 0 0 84px;
    max-width: 84px;
}

@media (prefers-reduced-motion: reduce) {
    html body input[type="checkbox"]:not([hidden]) { transition: none; }
}

@media (forced-colors: active) {
    html body input[type="checkbox"]:not([hidden]) {
        -webkit-appearance: auto;
        appearance: auto;
        background: none;
        border: revert;
    }
}

@media print {
    html body input[type="checkbox"] {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
