
/* =========================================================
   ASPIRIN AI V154
   HISTORY FIX
   ========================================================= */


/*
 * История всегда выше нижней навигации.
 */

.a153-history-overlay {
    z-index: 10000 !important;

    padding:
        105px
        14px
        calc(
            115px
            + env(safe-area-inset-bottom)
        ) !important;

    box-sizing: border-box !important;

    overflow: hidden !important;
}


/*
 * Больше не привязываем панель
 * к самому низу экрана.
 */

.a153-history-panel {
    position: relative !important;

    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    top: auto !important;

    width: 100% !important;

    max-height: 100% !important;
    height: auto !important;

    margin: 0 auto !important;

    display: flex !important;
    flex-direction: column !important;

    border-radius: 26px !important;

    overflow: hidden !important;
}


/*
 * Заголовок всегда остаётся сверху.
 */

.a153-history-head {
    flex: 0 0 auto !important;
}


/*
 * Список занимает свободное место
 * и прокручивается самостоятельно.
 */

.a153-history-list {
    flex: 1 1 auto !important;

    max-height:
        calc(
            100vh
            - 300px
        ) !important;

    min-height: 100px !important;

    overflow-y: auto !important;
    overscroll-behavior: contain !important;

    padding-bottom: 22px !important;

    -webkit-overflow-scrolling: touch;
}


/*
 * Нижняя навигация остаётся визуально
 * под затемнением истории.
 */

.a153-history-overlay.open {
    display: block !important;
}


/*
 * Для небольших экранов.
 */

@media (
    max-height: 700px
) {

    .a153-history-overlay {
        padding-top:
            80px !important;

        padding-bottom:
            calc(
                105px
                + env(safe-area-inset-bottom)
            ) !important;
    }


    .a153-history-list {
        max-height:
            calc(
                100vh
                - 245px
            ) !important;
    }
}

