.mm-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 999998;
    background: rgba(0, 0, 0, 0.72);
}

.mm-modal {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    box-sizing: border-box;
    padding: 24px;
    z-index: 999999;
}

.mm-dialog {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: min(760px, calc(100vw - 48px));
    max-height: 82vh;
}

.mm-link {
    display: block;
    color: inherit;
    line-height: 0;
    text-decoration: none;
}

.mm-link.is-clickable {
    cursor: pointer;
}

.mm-link.is-clickable:focus {
    border-radius: 10px;
    outline: 3px solid #2271b1;
    outline-offset: 4px;
}

.mm-modal img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(760px, calc(100vw - 48px));
    max-height: 82vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
}

.mm-close {
    position: absolute;
    top: -18px;
    right: -18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: #222;
    font: 700 26px/1 Arial, sans-serif;
    cursor: pointer;
    background: #fff;
    border: 2px solid #333;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.mm-close:hover,
.mm-close:focus {
    background: #f0f0f1;
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .mm-modal {
        padding: 16px;
    }

    .mm-modal img {
        max-width: calc(100vw - 32px);
        max-height: 86vh;
    }

    .mm-dialog {
        max-width: calc(100vw - 32px);
        max-height: 86vh;
    }

    .mm-close {
        top: -12px;
        right: -12px;
    }
}
