.modal {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.modal .modal-dialog {
    height: calc(100% - var(--bs-modal-margin, .5rem) * 2);
}

.modal .modal-content {
    max-height: 100%;
    overflow: hidden;
}

.modal .modal-content > form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.modal .modal-header,
.modal .modal-footer {
    flex-shrink: 0;
}

.modal .modal-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

@media (min-width: 576px) {
    .modal .modal-dialog {
        height: calc(100% - var(--bs-modal-margin, 1.75rem) * 2);
    }
}
