/* Shared focus: inputs have no focus decoration; buttons and links retain borderless feedback.
   Bump v=20261015-focus-2 at every import/link when this policy changes. */
@layer oeeso-focus {
    :focus,
    :is(input[type="checkbox"], input[type="radio"]):focus + :is(label, span),
    label:has(> :is(input[type="checkbox"], input[type="radio"]):focus),
    .insight_item:has(:focus-visible) {
        outline: none !important;
    }

    :is(a[href], button, summary, [role="button"], [role="tab"], [role="link"]):focus-visible {
        text-decoration-line: underline !important;
        text-decoration-thickness: 2px !important;
        text-underline-offset: 4px !important;
    }

    :is(button[aria-label], button:empty, button:has(> :is(svg, img):only-child), a:has(> :is(svg, img):only-child), .sticker-area[href], .slider-area__item, .preview-slider-item, [role="separator"], .drag-box, .premium-comparison__scroll):focus-visible:not(.page_background_picker):not([data-page-background-preset]) {
        filter: brightness(.86) !important;
    }

    .preview-sticker:has(> a:focus-visible) {
        filter: brightness(.86) !important;
    }

    /* Color swatches keep their actual color while the surrounding control signals focus. */
    .page_background_picker:focus-visible {
        background-color: #e8f6f2 !important;
    }
    [data-page-background-preset]:focus-visible {
        transform: scale(.88) !important;
    }
    .page_background_sv:focus-visible [data-page-background-marker] {
        width: 20px !important;
        height: 20px !important;
    }
    /* Invisible image hit areas need a visible fill, including the preview srcdoc. */
    .public-demo__image-trigger:focus-visible,
    .drag-box.preview-tab-trigger:focus-visible,
    .contents_area .drag-box:not(.preview-sticker):not(.preview-spot):not(.preview-embed):not(.preview-slider):has(> a:focus-visible) {
        opacity: 1 !important;
        background-color: rgba(32, 188, 168, .18) !important;
    }

    /* Keep the static invalid-color outline that exists even without keyboard focus. */
    .page_background_hex input.is-error:focus {
        outline: 2px solid rgba(181, 68, 68, .18) !important;
    }
}
