/* Toggle switch. Used by index.html (where the design tokens exist) and by the
   standalone retardedtext.html (where they don't), so every var() carries a
   literal fallback. */

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex: none;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--surface-2, #ccc);
    border: 1px solid var(--border, #bbb);
    transition: background-color .25s, border-color .25s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    transition: transform .25s;
}

input:checked + .slider {
    background-color: var(--accent, #00a2fe);
    border-color: var(--accent, #00a2fe);
}

input:focus-visible + .slider {
    outline: 2px solid var(--accent-hi, #0073b6);
    outline-offset: 2px;
}

input:checked + .slider:before {
    transform: translateX(18px);
}

/* Rounded sliders */
.slider.round { border-radius: 999px; }
.slider.round:before { border-radius: 50%; }

/* Switch + label pairing */
.f {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.non-editable {
    background-color: var(--surface-2, rgb(134, 134, 134));
}
