
/* container: label on left, switch on right */
.switch-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 9.3em;
}

/* the switch wrapper */
.switch-field .switch {
    margin-left: 1em;
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

/* hide the default checkbox */
.switch-field .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* the slider track */
.switch-field .slider {
    position: absolute;
    cursor: pointer;
    inset: 0; /* top:0; right:0; bottom:0; left:0; */
    background-color: #ccc;
    border-radius: 34px;
    transition: background-color 0.2s;
}

/* the knob */
.switch-field .slider::before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

/* checked state */
.switch-field .switch input:checked + .slider {
    background-color: var(--peony-pink-complement);
}

.switch-field .switch input:checked + .slider::before {
    transform: translateX(22px);
}

/* optional focus outline */
.switch-field .switch input:focus + .slider {
    box-shadow: 0 0 1px var(--peony-pink-complement);
}