.bottom-nav,
.bottom-nav * {
    transition: background 0.2s, color 0.2s, transform 0.1s;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    height: var(--app-bottom-nav-total-height);
    padding: 0 4px env(safe-area-inset-bottom);
    padding:
        0
        max(4px, var(--app-safe-right))
        var(--app-safe-bottom)
        max(4px, var(--app-safe-left));
    border-top: 1px solid rgba(248, 248, 250, 0.16);
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.28);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.bottom-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: var(--app-bottom-nav-content-height);
    min-height: var(--app-bottom-nav-content-height);
    color: #8a96a3;
    text-decoration: none;
}

.bottom-item:hover,
.bottom-item.active {
    color: #2f8cff;
}

.bottom-item:active {
    transform: scale(0.96);
}

.bottom-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bottom-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.bottom-label {
    max-width: 100%;
    font-size: 10px;
    line-height: 1.25;
    min-height: 1.25em;
    text-align: center;
    white-space: nowrap;
}

.bottom-item.active::after {
    content: "";
    width: 4px;
    height: 4px;
    margin-top: 1px;
    border-radius: 50%;
    background: #2f8cff;
}

@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
}

body.chat-mobile-open .bottom-nav {
    display: none !important;
}

/* --- Стили для Bottom Sheet (Всплывающее меню) --- */

.action-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000; /* Выше, чем bottom-nav */
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none; /* Чтобы не блокировать клики, пока скрыто */
}

/* Когда меню открыто */
.action-sheet-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.action-sheet {
    width: 100%;
    max-width: 480px;
    background: rgba(20, 20, 22, 0.95); /* Темная тема */
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1); /* Плавный "пружинный" эффект */
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.action-sheet-overlay.is-open .action-sheet {
    transform: translateY(0);
}

/* Ручка для свайпа (визуальная) */
.action-sheet__handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 99px;
    margin: 0 auto 16px;
}

.action-sheet__content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-sheet__item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.action-sheet__item:active {
    background: rgba(255, 255, 255, 0.1);
}

.action-sheet__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #2f8cff; /* Ваш акцентный цвет */
}

.action-sheet__icon svg {
    width: 22px;
    height: 22px;
}

/* Светлая тема для меню */
body[data-site-theme="white"] .action-sheet {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
}

body[data-site-theme="white"] .action-sheet__item {
    color: #111827;
}

body[data-site-theme="white"] .action-sheet__item:active {
    background: rgba(0, 0, 0, 0.05);
}

body[data-site-theme="white"] .action-sheet__handle {
    background: rgba(0, 0, 0, 0.15);
}

/* Скрываем на десктопе */
@media (min-width: 769px) {
    .action-sheet-overlay {
        display: none !important;
    }
}