#imgm-dialog.imgm-dialog {
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    width: max-content;
    height: max-content;
    max-width: calc(100vw - 40px);
    max-height: none;
    margin: auto;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    z-index: 2147483000;
}
#imgm-dialog::backdrop {
    background: rgba(5, 10, 22, .82);
}
#imgm-dialog .imgm-frame {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0;
}
#imgm-dialog .imgm-visual {
    position: relative;
    margin: 0;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}
#imgm-dialog .imgm-image {
    display: block;
    box-sizing: border-box;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    max-width: min(90vw, 760px);
    max-height: calc(100vh - 112px);
    max-height: calc(100dvh - 112px);
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 12px;
    object-fit: contain;
    filter: none;
    opacity: 1;
}
#imgm-dialog .imgm-link {
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    text-decoration: none;
}
#imgm-dialog .imgm-close {
    appearance: none;
    box-sizing: border-box;
    position: absolute;
    top: -12px;
    right: -12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #fff;
    color: #14213a;
    font: 32px/1 Arial, sans-serif;
    font-weight: 400;
    letter-spacing: 0;
    text-indent: 0;
    text-transform: none;
    box-shadow: 0 3px 16px rgba(0, 0, 0, .3);
    cursor: pointer;
    z-index: 2;
}
#imgm-dialog .imgm-close span {
    display: block;
    margin: -2px 0 0;
    padding: 0;
    line-height: 1;
    pointer-events: none;
}
#imgm-dialog .imgm-close:hover {
    background: #e7edff;
    color: #14213a;
}
#imgm-dialog .imgm-close:focus-visible,
#imgm-dialog .imgm-link:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 4px;
}
#imgm-dialog .imgm-description {
    margin: 12px 0 8px;
    padding: 0;
    color: #fff;
    font: 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: .15px;
    text-align: center;
}
#imgm-dialog .imgm-progress {
    width: 100%;
    height: 3px;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(255, 255, 255, .22);
}
#imgm-dialog .imgm-progress-bar {
    display: block;
    width: 100%;
    height: 100%;
    background: #fff;
    transform-origin: left center;
    animation: imgm-countdown 5s linear forwards;
}
#imgm-dialog.imgm-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 24px;
    background: rgba(5, 10, 22, .82);
}
@keyframes imgm-countdown {
    to { transform: scaleX(0); }
}
@media (prefers-reduced-motion: reduce) {
    #imgm-dialog .imgm-progress-bar { animation: none; }
}
