/* Every rule is confined to this plugin's dialog. Closed dialogs have no hit area. */
dialog.imu-popup:not([open]) { display: none !important; }
dialog.imu-popup {
    box-sizing: border-box;
    width: min(var(--imu-popup-width, 420px), calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    padding: 0;
    border: 1px solid #dce2eb;
    border-radius: 16px;
    background: #fff;
    color: #172033;
    box-shadow: 0 18px 60px rgb(15 23 42 / 20%);
    overflow: auto;
    font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
    text-align: start;
}
dialog.imu-popup--center { position: fixed; inset: 0; margin: auto; }
dialog.imu-popup--center::backdrop { background: rgb(15 23 42 / 48%); }
dialog.imu-popup--corner {
    position: fixed;
    inset: auto 16px 16px auto;
    bottom: max(16px, env(safe-area-inset-bottom));
    margin: 0;
    z-index: 1000;
}
.imu-popup .imu-popup__panel { padding: 28px; }
.imu-popup .imu-popup__title { margin: 0 40px 16px 0; color: inherit; font: 700 22px/1.3 system-ui, sans-serif; }
.imu-popup .imu-popup__close {
    position: absolute; top: 10px; right: 10px; display: grid; place-items: center;
    box-sizing: border-box; width: 38px; height: 38px; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 50%;
    background: transparent; box-shadow: none;
    color: #172033; cursor: pointer; font: 20px/1 system-ui, sans-serif;
}
.imu-popup .imu-popup__close:hover { background: transparent; color: #174cbd; }
.imu-popup :focus-visible { outline: 3px solid #245be8; outline-offset: 3px; }
.imu-popup .imu-popup__title:focus { outline: none; }
.imu-popup .imu-popup__content > :first-child { margin-top: 0; }
.imu-popup .imu-popup__content > :last-child { margin-bottom: 0; }
.imu-popup .imu-popup__content img { max-width: 100%; height: auto; }
.imu-popup .imu-popup__content a { color: #174cbd; text-decoration: underline; }
@media (max-width: 767px) {
    dialog.imu-popup--corner { right: 16px; }
    .imu-popup .imu-popup__panel { padding: 22px; }
}
