/* The current official widget no longer uses the theme's legacy markup. */
body.eadtran-vlibras-modern [vw] {
    display: none !important;
}

/* Empty legacy containers must not intercept taps, even before initialization. */
body [vw] {
    pointer-events: none !important;
}

body [vw] [vw-access-button].active,
body [vw] [vw-plugin-wrapper].active {
    pointer-events: auto !important;
}

body [vw] [vw-plugin-wrapper]:not(.active) {
    pointer-events: none !important;
}

/* Keep the legacy panel independent of the lesson toolbar and its vh offsets. */
@media (max-width: 767px) {
    body [vw].enabled {
        position: fixed !important;
        left: auto !important;
        right: var(--vlibras-right, 8px) !important;
        top: var(--vlibras-launcher-top, 62vh) !important;
        bottom: auto !important;
        margin-top: 0 !important;
        width: 40px !important;
        height: 40px !important;
        transform: none !important;
        overflow: visible !important;
        z-index: 2147483640 !important;
    }

    body [vw] [vw-access-button] {
        position: relative !important;
        left: 0 !important;
        right: auto !important;
        top: 0 !important;
        bottom: auto !important;
    }

    body [vw] [vw-plugin-wrapper] {
        position: fixed !important;
        left: auto !important;
        right: var(--vlibras-right, 8px) !important;
        top: var(--vlibras-center-y, 50%) !important;
        bottom: auto !important;
        margin: 0 !important;
        width: 300px !important;
        height: 450px !important;
        max-width: none !important;
        max-height: none !important;
        transform: translateY(-50%) scale(var(--vlibras-scale, 1)) !important;
        transform-origin: right center !important;
    }
}
