.switchy {
    --track-off: rgba(255,255,255,.08);
    --knob: color-mix(in oklab, var(--acc, #6ecbff) 20%, var(--t-bg-elevated, #0c111b));
    --knob-border: color-mix(in oklab, var(--acc, #6ecbff) 26%, rgba(255,255,255,.22));
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    user-select: none;
}

    .switchy .state {
        display: inline-block;
        min-width: 34px;
        line-height: 1.1;
        font-weight: 800;
        letter-spacing: .2px;
        color: var(--muted);
        white-space: nowrap;
    }

    .switchy input[type="checkbox"] {
        appearance: none;
        -webkit-appearance: none;
        width: 3.25rem;
        height: 1.75rem;
        border-radius: 999px;
        background: var(--track-off);
        border: 1px solid var(--ring);
        outline: 0;
        cursor: pointer;
        position: relative;
        transition: background .2s, border-color .2s, box-shadow .2s;
        box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 2px 8px rgba(0,0,0,.35);
    }

        .switchy input[type="checkbox"]::after {
            content: "";
            position: absolute;
            top: 2px;
            left: 3px;
            width: 1.35rem;
            height: 1.35rem;
            border-radius: 999px;
            background: var(--knob);
            border: 1px solid var(--knob-border);
            box-shadow: 0 2px 8px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06);
            transition: transform .25s, background .2s, box-shadow .25s;
        }

        .switchy input[type="checkbox"]:checked {
            background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(0,0,0,.06)), var(--acc-soft);
            border-color: var(--acc);
            box-shadow: 0 0 0 3px var(--acc-soft);
        }

            .switchy input[type="checkbox"]:checked::after {
                transform: translateX(1.5rem);
                background: #fff;
                border-color: transparent;
                box-shadow: 0 0 16px var(--acc-soft), 0 6px 18px rgba(0,0,0,.35);
            }

            .switchy input[type="checkbox"]:checked + .state {
                color: var(--acc);
            }

    .switchy.flat input[type="checkbox"] {
        background: #1a2235;
        border-color: #24304b;
        box-shadow: none;
    }

        .switchy.flat input[type="checkbox"]::after {
            background: #e6e9ef;
            border: none;
            box-shadow: none;
        }

        .switchy.flat input[type="checkbox"]:checked {
            background: var(--acc);
            border-color: transparent;
            box-shadow: none;
        }

            .switchy.flat input[type="checkbox"]:checked::after {
                background: #0c111b;
                box-shadow: none;
            }

    .switchy.flat .state {
        color: #b4bccb;
    }

    .switchy.flat input[type="checkbox"]:checked + .state {
        color: #fff;
    }
