@media (prefers-color-scheme: light) {
    html {
        --ckb-checked-bg-color: white;
        --ckb-checked-text-color: red;
        --ckb-hovered-bg-color: #94d6eb;

        --radio-checked-bg-color: red;
        --radio-checked-text-color: white;
        --radio-hovered-bg-color: #f05665;
    }
    /* Dark theme colors */
    html.dark-theme {
        --ckb-checked-bg-color: #2752af;
        --ckb-checked-text-color: var(--main-text-color);
        --ckb-hovered-bg-color: #2073bc;

        --radio-checked-bg-color: #2752af;
        --radio-checked-text-color: var(--main-text-color);
        --radio-hovered-bg-color: #2073bc;
    }
}

/* Styles for users who prefer dark mode at the OS level */
@media (prefers-color-scheme: dark) {
    /* defaults to dark theme */
    html {
        --ckb-checked-bg-color: #2752af;
        --ckb-checked-text-color: var(--main-text-color);
        --ckb-hovered-bg-color: #2073bc;

        --radio-checked-bg-color: #2752af;
        --radio-checked-text-color: var(--main-text-color);
        --radio-hovered-bg-color: #2073bc;
    }
    /* Override dark mode with light mode styles if the user decides to swap */
    html.light-theme {
        --ckb-checked-bg-color: white;
        --ckb-checked-text-color: red;
        --ckb-hovered-bg-color: #94d6eb;

        --radio-checked-bg-color: red;
        --radio-checked-text-color: white;
        --radio-hovered-bg-color: #f05665;
    }
}

.checkbox3States {
    cursor: pointer;
}

input[type="checkbox"]:not(.ui-checkboxradio):disabled,
input[type="checkbox"].disabled:not(.ui-checkboxradio),
input[type="checkbox"].disabled:checked:not(.ui-checkboxradio),
input[type="radio"]:not(.ui-checkboxradio):disabled {
    cursor: default;
    background-color: var(--input-disabled-bg-color);
}
input[type="checkbox"]:not(.ui-checkboxradio):disabled + label,
input[type="radio"]:not(.ui-checkboxradio):disabled + label {
    color: gray;
}

input[type="checkbox"]:not(.ui-checkboxradio):enabled + label,
input[type="radio"]:not(.ui-checkboxradio):enabled + label {
    cursor: pointer;
}

input[type="checkbox"]:not(.ui-checkboxradio),
input[type="radio"]:not(.ui-checkboxradio) {
    -webkit-appearance: none;
    -moz-appearance: none;
    -ms-appearance: none;
    display: inline-block;
    cursor: pointer;
    border-radius: 2px;
    height: 16px;
    width: 16px;
    background: var(--input-bg-color);
    border: 1px solid var(--main-border-color);
    font-family: "icomoon";
    padding: 1.5px;
}
input[type="radio"]:not(.ui-checkboxradio) {
    border-radius: 20px;
    margin-right: 4px;
}
input[type="radio"]:not(.ui-checkboxradio) + label {
    margin-right: 15px;
}

input[type="checkbox"]:checked:not(.ui-checkboxradio) {
    background-color: var(--ckb-checked-bg-color);
}

input[type="checkbox"]:not(.ui-checkboxradio)::before {
    color: var(--ckb-checked-text-color);
    margin: -5px;
}
input[type="checkbox"]:indeterminate:not(.ui-checkboxradio)::before {
    content: "\ea0f";
}
input[type="checkbox"]:checked:not(.ui-checkboxradio)::before {
  content: "\ea14";
}
input[type="radio"]:checked:not(.ui-checkboxradio) {
    border: 5px solid var(--radio-checked-bg-color);
    background-color: var(--radio-checked-text-color);
}

input[type="checkbox"]:hover:not(.ui-checkboxradio):enabled {
    background-color: var(--ckb-hovered-bg-color);
    border-color: var(--main-border-color);
}

input[type="radio"]:hover:not(.ui-checkboxradio):enabled {
    background-color: var(--radio-hovered-bg-color);
    border-color: var(--main-border-color);
}

input[type="checkbox"]:checked:hover:not(.ui-checkboxradio) {
    background-color: var(--ckb-hovered-bg-color);
}
input[type="radio"]:checked:hover:not(.ui-checkboxradio) {
    border-color: var(--radio-hovered-bg-color);
}

input[type="radio"]:focus:not(.ui-checkboxradio) {
    outline-offset: 0px;
}

input.radio,
input[type="radio"] {
    display: inline;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    vertical-align: center;
}

input[type="radio"]:hover,
input[type="checkbox"]:hover {
    background-color: var(--ckb-hovered-bg-color);
}

input[type="radio"]:focus,
input[type="checkbox"]:focus {
    -webkit-box-shadow: 0 0 5px var(--main-shadow-color);
    -moz-box-shadow: 0 0 5px var(--main-shadow-color);
    box-shadow: 0 0 5px var(--main-shadow-color);
    outline: none;
}

input.checkbox,
input[type="checkbox"] {
    display: inline;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    vertical-align: center;
}

.ui-button {
    color: var(--main-text-color);
}
.ui-button:hover {
    color: var(--main-text-color);
}

label.ui-checkboxradio-label:not(.ui-checkboxradio-radio-label) .ui-icon {
  box-shadow:none;
  background-color: var(--input-bg-color);
    box-shadow: inset 0 0 2px 0px var(--main-shadow-color);
}
label.ui-checkboxradio-label:not(
        .ui-checkboxradio-radio-label
    ).ui-checkboxradio-checked
    .ui-icon {
  background-color: var(--ckb-checked-bg-color);
  color: var(--ckb-checked-text-color);
  background-image: url("img/ui-icons_ec3149_256x240.png");
    box-shadow: inset 0 0 2px 0px var(--main-shadow-color);
}
.dark-theme
    label.ui-checkboxradio-label:not(
        .ui-checkboxradio-radio-label
    ).ui-checkboxradio-checked
    .ui-icon {
  background-image: url("img/ui-icons_ffffff_256x240.png");
}
label.ui-checkboxradio-label:not(.ui-checkboxradio-radio-label):hover .ui-icon {
    background-color: var(--ckb-hovered-bg-color);
}
label.ui-checkboxradio-label:not(
        .ui-checkboxradio-radio-label
    ).ui-checkboxradio-checked:hover
    .ui-icon {
  background-color: var(--ckb-hovered-bg-color);
  color: var(--ckb-checked-text-color);
}

label.ui-checkboxradio-radio-label .ui-icon {
    box-shadow: none;
    background-color: var(--input-bg-color);
}
label.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon {
    border-color: var(--radio-checked-bg-color);
    background-color: var(--radio-checked-text-color);
}
label.ui-checkboxradio-radio-label:hover .ui-icon {
    background-color: var(--radio-hovered-bg-color);
}
label.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon {
    border-color: var(--radio-hovered-bg-color);
    background-color: var(--radio-checked-text-color);
}

.ui-checkboxradio-label,
.ui-checkboxradio-label * {
  -webkit-box-sizing: content-box;
  -moz-box-sizing: content-box;
  box-sizing: content-box;
}
.ui-checkboxradio-label,
.ui-checkboxradio-label:hover {
  background: none;
  border:none;
}
.ui-checkboxradio-label.ui-state-active,
.ui-checkboxradio-label.ui-state-active:hover,
.ui-checkboxradio-label.ui-state-active:active,
.ui-checkboxradio-label.ui-state-active:focus {
    background: none;
    border: none;
    color: var(--main-text-color);
}
.ui-checkboxradio-label.ui-visual-focus {
    box-shadow: none;
}
