.ipm-root[hidden],
.ipm-overlay[hidden] {
    display: none !important;
}

.ipm-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 12, 24, 0.72);
    padding: 24px;
    animation: ipm-fade 0.22s ease;
}

.ipm-dialog {
    position: relative;
    max-width: min(92vw, 720px);
    max-height: 88vh;
}

.ipm-dialog img {
    display: block;
    max-width: 92vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.ipm-image-link {
    display: block;
    line-height: 0;
}

.ipm-close {
    position: absolute;
    top: -12px;
    inset-inline-end: -12px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #111;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ipm-close:hover,
.ipm-close:focus {
    background: #e11d48;
    outline: none;
}

body.ipm-open {
    overflow: hidden;
}

@keyframes ipm-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 640px) {
    .ipm-close {
        top: -8px;
        inset-inline-end: -4px;
        width: 32px;
        height: 32px;
        font-size: 22px;
    }
}
