/* Modal styles */
.vp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99998;
}
.vp-modal-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
.vp-modal-header {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.vp-modal-message {
    margin-bottom: 15px;
    font-size: 16px;
}
.vp-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.vp-modal-buttons button {
    font-size: 16px;
    padding: 8px 20px;
}
/* When the modal has 4+ buttons (e.g. the profile dropdown after the
   Reset App addition), drop into a 2x2 grid on phones and a 1x4 row on
   wider viewports. Scoped via :has() so 1-3 button modals are
   unaffected. iOS Safari supports :has() since 15.4. */
.vp-modal-buttons:has(button:nth-child(4)) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
}
/* Re-style the buttons themselves so the constrained grid cells get text
   that wraps cleanly to a second line and the button height grows to fit
   instead of clipping. Without these, the inherited `font-size: 16px;
   padding: 8px 20px` makes a single line of text overflow the cell. */
.vp-modal-buttons:has(button:nth-child(4)) button {
    white-space: normal;
    word-break: break-word;
    line-height: 1.2;
    padding: 10px 8px;
    min-height: 44px;
    text-align: center;
}
@media (min-width: 600px) {
    .vp-modal-buttons:has(button:nth-child(4)) {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
/* Bump modal width so a 1x4 row of buttons has room to breathe. Only
   takes effect on viewports wide enough to actually use it. */
@media (min-width: 640px) {
    .vp-modal-content:has(.vp-modal-buttons > button:nth-child(4)) {
        max-width: 620px;
    }
}
