/* ============================================================
   Bottom Toolbar — мобильная фиксированная панель навигации
   Видна только на ≤991px. Скрывается при скролле вниз.
   ============================================================ */

.fr-bt { display: none; }

@media (max-width: 991px) {
    .fr-bt {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 998;
        display: flex;
        background: #fff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
        padding: 6px 0 calc(8px + env(safe-area-inset-bottom, 0px));
        justify-content: space-around;
        align-items: stretch;
        transition: transform 0.28s ease-out;
        will-change: transform;
    }
    .fr-bt--hidden { transform: translateY(110%); }

    .fr-bt__item {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 4px 2px;
        color: #6b7280;
        text-decoration: none;
        background: transparent;
        border: 0;
        cursor: pointer;
        font-family: inherit;
        font-size: inherit;
        min-width: 0;
        -webkit-tap-highlight-color: rgba(54, 94, 186, 0.1);
    }
    .fr-bt__item:hover,
    .fr-bt__item:focus,
    .fr-bt__item:active { color: #365eba; outline: none; }
    .fr-bt__item--active { color: #365eba; }

    .fr-bt__icon {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }
    .fr-bt__label {
        font-size: 10px;
        font-weight: 500;
        letter-spacing: 0.2px;
        line-height: 1;
        color: inherit;
        text-transform: none;
        white-space: nowrap;
    }

    /* Чтобы контент не залезал под toolbar */
    body { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
}

/* ============================================================
   Bottom Sheet (Меню)
   ============================================================ */
.fr-sheet {
    position: fixed;
    inset: 0;
    z-index: 1000;
    visibility: hidden;
    pointer-events: none;
}
.fr-sheet--open {
    visibility: visible;
    pointer-events: auto;
}

.fr-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    transition: opacity 0.25s ease-out;
}
.fr-sheet--open .fr-sheet__backdrop { opacity: 1; }

.fr-sheet__panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 18px 18px 0 0;
    padding: 12px 18px calc(22px + env(safe-area-inset-bottom, 0px));
    max-height: 92vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
    -webkit-overflow-scrolling: touch;
}
.fr-sheet--open .fr-sheet__panel { transform: translateY(0); }

.fr-sheet__handle {
    width: 44px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 0 auto 14px;
    cursor: grab;
}

.fr-sheet__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.fr-sheet__title {
    font-size: 18px;
    font-weight: 500;
    color: #1f2937;
    margin: 0;
    font-family: inherit;
}
.fr-sheet__close {
    background: #f3f4f6;
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.fr-sheet__close:hover { background: #e5e7eb; color: #1f2937; }

/* Сетка 4 в ряд */
.fr-sheet__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}
.fr-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    background: #f7f8fa;
    border-radius: 12px;
    color: #1f2937;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s, transform 0.1s;
}
.fr-tile__badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #f76c16;
    color: #fff;
    font-size: 8px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 4px;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.fr-tile:hover,
.fr-tile:active {
    background: #eef3fc;
    color: #1f2937;
}
.fr-tile:active { transform: scale(0.96); }

.fr-tile__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #365eba;
}
.fr-tile__icon svg { width: 22px; height: 22px; }

.fr-tile__label {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.1;
    color: #4b5563;
}

/* Список */
.fr-sheet__list {
    border-top: 1px solid #f3f4f6;
    padding-top: 4px;
}
.fr-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 4px;
    border-bottom: 0.5px solid #f3f4f6;
    color: #1f2937;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.fr-list-item:hover { color: #365eba; }
.fr-list-item:last-child { border-bottom: 0; }
.fr-list-item__chev {
    color: #9ca3af;
    font-size: 18px;
    font-weight: 400;
}

/* Курсы валют */
.fr-sheet__currency {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}
.fr-sheet__currency-label {
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    margin-bottom: 8px;
}
.fr-sheet__currency-row {
    display: inline-block;
    justify-content: space-between;
    font-size: 14px;
    color: #1f2937;
}
.fr-sheet__currency-row span { margin-right: 10px; }
.fr-sheet__currency-row b {
    color: #365eba;
    font-weight: 500;
}

/* Футер-ссылки */
.fr-sheet__footer-links {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}
.fr-footer-link {
    display: block;
    padding: 5px 2px;
    color: #6b7280;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    border-bottom: 0.5px solid #f3f4f6;
}
.fr-footer-link:last-child { border-bottom: 0; }
.fr-footer-link:hover { color: #365eba; }

/* Блок скролла когда sheet открыт */
body.fr-sheet-no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
}