div.m3.m3-switch
    gap: 20px
    margin: 4px
    height: 32px
    display: flex
    align-items: center
    justify-content: left
    box-sizing: content-box

    & > svg
        width: 52px
        height: 32px
        overflow: visible
        transition: .2s cubic-bezier(0.175, 0.885, 0.32, 1.275)

        & > g
            transform: translate(11.5%, 81%)
            transition: .2s cubic-bezier(0.175, 0.885, 0.32, 1.275)
            & > text
                font-size: 20px
                font-family: Material-Symbols-Outlined-Regular

        & > circle.m3.m3-switch-handler-state-layer, & > circle.m3.m3-switch-handler
            cy: 50%
            cx: 16px
            transition: .2s cubic-bezier(0.175, 0.885, 0.32, 1.275)

        & > circle.m3.m3-switch-handler-state-layer
            r: 20px
            fill-opacity: 0

        & > circle.m3.m3-switch-handler
            r: 8px

        & > rect.m3.m3-switch-track
            transition: fill .2s cubic-bezier(0.175, 0.885, 0.32, 1.275)
            stroke-width: 2px
            border-radius: 16px
            rx: 15px
            width: 50px
            height: 30px

    & > input.m3
        margin: 0
        width: 52px
        height: 32px
        cursor: pointer
        appearance: none
        position: absolute
        opacity: 0 !important

        &:disabled
            cursor: not-allowed

        &:not(:checked, :disabled) + svg
            & > circle.m3.m3-switch-handler
                fill: var(--md-sys-color-outline)

        &:checked:not(:disabled) + svg
            & > g
                transform: translate(50%, 81%)

            & > circle.m3.m3-switch-handler
                fill: var(--md-sys-color-on-primary)

        &:not(:disabled) + svg
            & > g > text.m3.m3-icon-unchecked
                fill: var(--md-sys-color-on-primary)

            & > g > text.m3.m3-icon-checked
                fill: var(--md-sys-color-on-primary-container)

        &:checked:disabled + svg > circle.m3.m3-switch-handler
            fill: var(--md-sys-color-surface)

        &:checked + svg > circle.m3.m3-switch-handler,
        & + svg:has(text.m3.m3-icon-unchecked) > circle.m3.m3-switch-handler
            r: 12px

        &:checked + svg
            & > g > text.m3.m3-icon-unchecked
                opacity: 0

            & > circle.m3:is(.m3-switch-handler, .m3-switch-handler-state-layer)
                cx: calc(100% - 16px)

        &:not(:checked) + svg
            & > g > text.m3.m3-icon-checked
                opacity: 0

        &:is(&:checked, &):not(:disabled):active + svg > circle.m3.m3-switch-handler
            r: 14px

        &:not(:checked):disabled + svg > circle.m3.m3-switch-handler
            fill-opacity: 38%
            fill: var(--md-sys-color-on-surface)

        &:hover:not(:disabled)
            &:checked + svg
                & > circle.m3.m3-switch-handler
                    fill: var(--md-sys-color-primary-container)

                & > circle.m3.m3-switch-handler-state-layer
                    fill-opacity: 8%
                    fill: var(--md-sys-color-primary)

            &:not(:checked) + svg
                & > circle.m3.m3-switch-handler
                    fill: var(--md-sys-color-on-surface-variant)

                & > circle.m3.m3-switch-handler-state-layer
                    fill-opacity: 8%
                    fill: var(--md-sys-color-on-surface)

        &:active:not(:disabled)
            &:checked + svg > circle.m3.m3-switch-handler-state-layer
                fill-opacity: 12%
                fill: var(--md-sys-color-primary)

            &:not(:checked) + svg > circle.m3.m3-switch-handler-state-layer
                fill-opacity: 12%
                fill: var(--md-sys-color-on-surface)

        &:is(:checked, :checked:disabled) + svg > rect.m3.m3-switch-track
            rx: 16px
            width: 52px
            height: 32px
            stroke-width: 0

        &:is(&:not(:checked), &:not(:checked):disabled) + svg > rect.m3.m3-switch-track
            x: 1px
            y: 1px

        &:not(:checked) + svg > rect.m3.m3-switch-track
            stroke: var(--md-sys-color-outline)
            fill: var(--md-sys-color-surface-container-highest)

        &:checked + svg > rect.m3.m3-switch-track
            fill: var(--md-sys-color-primary)
            stroke: var(--md-sys-color-primary)

        &:disabled + svg
            & > g > text.m3
                fill: color-mix(in srgb, var(--md-sys-color-surface-container-highest) 38%, transparent)

            & > rect.m3.m3-switch-track
                stroke: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent)
                fill: color-mix(in srgb, var(--md-sys-color-surface-variant) 12%, transparent)

        &:checked:disabled + svg
            & > g > text.m3
                transform: translateX(38.5%)
                fill: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent)

            & > rect.m3.m3-switch-track
                fill: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent)
                stroke: color-mix(in srgb, var(--md-sys-color-on-surface) 0%, transparent)