@media (max-width: 767px) {
    #modal_form .modal-list {
        box-sizing: border-box;
        height: 100dvh;
    }

    #modal_form .modal-container.mobile-form-wizard[data-mobile-wizard-current-step="1"],
    #modal_form .modal-container.mobile-form-wizard[data-mobile-wizard-current-step="2"] {
        display: flex;
        flex-direction: column;
        height: calc(100dvh - 24px);
        max-height: calc(100dvh - 24px);
        box-sizing: border-box;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        overflow: hidden;
    }

    #modal_form .mobile-form-wizard[data-mobile-wizard-current-step="1"]
        > .mobile-form-wizard__step.is-active,
    #modal_form .mobile-form-wizard[data-mobile-wizard-current-step="2"]
        > .mobile-form-wizard__step.is-active {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    #modal_form .mobile-form-wizard[data-mobile-wizard-current-step="1"]
        > .modal-top > .modal-items,
    #modal_form .mobile-form-wizard[data-mobile-wizard-current-step="2"]
        > .modal-gray > .modal-gray__box > .modal-items {
        flex: 1 1 auto;
        min-height: 0;
        padding-right: 2px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        align-content: start;
        grid-auto-rows: max-content;
    }

    #modal_form .mobile-form-wizard[data-mobile-wizard-current-step="2"]
        > .modal-gray > .modal-gray__box {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    #modal_form .mobile-form-wizard__next {
        flex: 0 0 auto;
    }
}
