/* iOS WebKit rendering mitigation (also used by Chrome on iPhone).
   Keep scrolling histories and modal backdrops off unnecessary effect layers.
   This deliberately changes decoration only: no visibility, pointer events,
   stacking order, scroll position or dialog lifecycle overrides. */
@media screen {
    /* A modal backdrop covers the entire viewport. Nested document dialogs
       otherwise repeatedly filter the page and the previous backdrop. */
    :root.pakplan-ios dialog::backdrop,
    :root.pakplan-ios [popover]::backdrop,
    :root.pakplan-ios dialog,
    :root.pakplan-ios dialog *,
    :root.pakplan-ios .messenger-shell * {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    /* The final animation frames equal the resting styles. Do not retain
       a transform/opacity effect after the entrance animation has ended. */
    :root.pakplan-ios .messenger-dialog[open],
    :root.pakplan-ios .messenger-dialog[open]::backdrop,
    :root.pakplan-ios .messenger-attachment-sheet,
    :root.pakplan-ios .messenger-message-reactions.is-entering,
    :root.pakplan-ios .messenger-reaction-chip.is-entering {
        animation-fill-mode: backwards;
    }

    :root.pakplan-ios .messenger-reaction-emoji {
        filter: none;
    }

    @media (max-width: 680px) {
        /* Still interpolate the slide when opening/closing, but release
           its transform once open instead of retaining translateX(0). */
        :root.pakplan-ios .messenger-shell.chat-open .messenger-conversation {
            transform: none;
        }
    }
}
