/*
 * Filament modal viewport fix.
 *
 * The custom glass layout can render action modals inside the page layout. Keep
 * open modals attached to the browser viewport so the backdrop and card scroll
 * as one full-height layer, without moving Livewire DOM nodes.
 */
html.fi:has(.fi-modal.fi-modal-open) .fi-main-ctn,
html.fi:has(.fi-modal.fi-modal-open) .fi-main {
    overflow: visible !important;
    transform: none !important;
    animation: none !important;
}

html.fi .fi-modal.fi-modal-open {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

html.fi .fi-modal.fi-modal-open > .fi-modal-close-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    pointer-events: auto !important;
}

html.fi .fi-modal.fi-modal-open > .fi-modal-window-ctn {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1 !important;
    display: grid !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    place-items: start center !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding-block: 1rem !important;
    pointer-events: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch;
}

html.fi .fi-modal.fi-modal-open > .fi-modal-window-ctn > .fi-modal-window {
    max-height: none !important;
    overflow: visible !important;
}
