/* Felles native skjemakontroller. Ingen JavaScript-initialisering eller ekstra DOM. */
@media screen {
    :root {
        --ppv-checkbox-surface: #FFFFFF;
        --ppv-checkbox-accent: #00A67E;
        --ppv-checkbox-locked: #00866A;
        --ppv-checkbox-focus: #00A67E;
    }
    :is(html[data-ppv-menu-theme="dark"], #PpvBot[data-ppv-theme="dark"], #PpvBot[data-ppv-theme="dark"] ~ #modalPromptLibrary) {
        --ppv-checkbox-surface: #202C33;
        --ppv-checkbox-focus: #93DDC6;
    }
    input[type="checkbox"]:not(.toggle, .make-switch, [role="switch"]) {
        -webkit-appearance: none;
        appearance: none;
        box-sizing: border-box;
        position: static;
        float: none;
        flex: 0 0 22px;
        width: 22px;
        height: 22px;
        margin: 0 !important;
        padding: 0;
        border: 2px solid var(--ppv-checkbox-accent);
        border-radius: 5px !important;
        background-color: var(--ppv-checkbox-surface);
        background-image: none;
        background-position: center;
        background-repeat: no-repeat;
        opacity: 1;
        filter: none;
        cursor: pointer;
        vertical-align: middle;
    }
    label > input[type="checkbox"]:not(.toggle, .make-switch, [role="switch"]) {
        margin-right: 5px !important;
    }
    input[type="checkbox"]:not(.toggle, .make-switch, [role="switch"]):checked {
        background-color: var(--ppv-checkbox-accent);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='m4 9 3 3 7-7' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }
    input[type="checkbox"]:not(.toggle, .make-switch, [role="switch"]):indeterminate {
        background-color: var(--ppv-checkbox-accent);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M4 9h10' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
    }
    input[type="checkbox"]:not(.toggle, .make-switch, [role="switch"]):focus {
        outline: none;
        box-shadow: none;
    }
    input[type="checkbox"]:not(.toggle, .make-switch, [role="switch"]):focus-visible {
        outline: 2px solid var(--ppv-checkbox-focus);
        outline-offset: 2px;
    }
    input[type="checkbox"]:not(.toggle, .make-switch, [role="switch"]):disabled {
        background-color: var(--ppv-checkbox-surface) !important;
        opacity: .45;
        cursor: not-allowed;
    }
    input[type="checkbox"]:not(.toggle, .make-switch, [role="switch"]):disabled:is(:checked, :indeterminate) {
        background-color: var(--ppv-checkbox-locked) !important;
        border-color: var(--ppv-checkbox-locked);
    }

    /* Radiovalg beholder native gruppering/tastatur; samme størrelse i begge temaer. */
    input[type="radio"]:not(.toggle, .star, .make-switch, [role="switch"]) {
        -webkit-appearance: auto;
        appearance: auto;
        box-sizing: border-box;
        position: static;
        float: none;
        flex: 0 0 22px;
        width: 22px;
        height: 22px;
        padding: 0;
        margin: 0 5px 0 0 !important;
        vertical-align: middle;
        opacity: 1;
        filter: none;
        cursor: pointer;
    }
    :where(html[data-ppv-menu-theme="dark"], #PpvBot[data-ppv-theme="dark"], #PpvBot[data-ppv-theme="dark"] ~ #modalPromptLibrary) input[type="radio"]:not(.toggle, .star, .make-switch, [role="switch"]) {
        -webkit-appearance: none;
        appearance: none;
        border: 2px solid var(--ppv-checkbox-accent);
        border-radius: 50% !important;
        background-color: var(--ppv-checkbox-surface);
        background-image: none;
        background-position: center;
        background-repeat: no-repeat;
        box-shadow: none;
    }
    :where(html[data-ppv-menu-theme="dark"], #PpvBot[data-ppv-theme="dark"], #PpvBot[data-ppv-theme="dark"] ~ #modalPromptLibrary) input[type="radio"]:not(.toggle, .star, .make-switch, [role="switch"]):checked {
        background-color: var(--ppv-checkbox-accent);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='4' fill='white'/%3E%3C/svg%3E");
    }
    input[type="radio"]:not(.toggle, .star, .make-switch, [role="switch"]):focus-visible {
        outline: 2px solid var(--ppv-checkbox-focus) !important;
        outline-offset: 2px;
    }
    input[type="radio"]:not(.toggle, .star, .make-switch, [role="switch"]):disabled {
        cursor: not-allowed;
    }
    :where(html[data-ppv-menu-theme="dark"], #PpvBot[data-ppv-theme="dark"], #PpvBot[data-ppv-theme="dark"] ~ #modalPromptLibrary) input[type="radio"]:not(.toggle, .star, .make-switch, [role="switch"]):disabled {
        background-color: var(--ppv-checkbox-surface) !important;
        opacity: .45;
    }
    :where(html[data-ppv-menu-theme="dark"], #PpvBot[data-ppv-theme="dark"], #PpvBot[data-ppv-theme="dark"] ~ #modalPromptLibrary) input[type="radio"]:not(.toggle, .star, .make-switch, [role="switch"]):disabled:checked {
        background-color: var(--ppv-checkbox-locked) !important;
        border-color: var(--ppv-checkbox-locked);
    }

}
