.mdp-dialog-popup-overlay {
    position: fixed !important;
    pointer-events: auto;
    left: 0 !important; top: 0 !important; right: 0 !important; bottom: 0 !important;
    min-width: 100vw !important; min-height: 100vh !important;
    width: 100vw !important; height: 100vh !important;
    z-index: 2147483647 !important;
    box-sizing: border-box;
    overflow-y: auto;
    align-items: center; justify-content: center;
}

.mdp-dialog-popup-box {
    position: relative !important;
    z-index: 2147483648 !important;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.28);
    margin: auto;
    background-clip: padding-box;
    word-break: break-word;
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    /* width e height sono gestiti inline/JS */
    overflow: hidden;
}

.mdp-dialog-header {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 10px;
    padding-right: 10px;
    margin-bottom: 20px;
    box-sizing: border-box;
    flex-shrink: 0;
    flex-grow: 0;
}

.mdp-dialog-close {
    color: #888;
    background: none !important;
    border: none !important;
    font-size: 2.1em !important;
    line-height: 1;
    cursor: pointer;
    outline: none;
    z-index: 2147483649 !important;
}

.mdp-dialog-content {
    width: 100%;
    min-width: 0;
    position: relative;
    word-break: break-word;
    overflow: auto;
    flex: 1 1 auto;
    z-index: 2 !important;
}

@media (max-width: 600px) {
    .mdp-dialog-popup-box {
        max-width: 99vw !important;
        min-width: 0;
    }
    .mdp-dialog-content {
        font-size: 1em;
    }
}

/* Overlay sempre sopra ogni altra cosa */
body > .mdp-dialog-popup-overlay {
    z-index: 2147483647 !important;
    pointer-events: auto !important;
}