/* === БАЗОВЫЕ СТИЛИ === */
.fn-overlay { position: fixed !important; top: 0; left: 0; width: 100vw; height: 100dvh; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 2147483630 !important; opacity: 0; pointer-events: none; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.fn-overlay.active { opacity: 1; pointer-events: all; }
.hidden { display: none !important; }

/* === ГЛОБАЛЬНЫЙ КОНТЕЙНЕР НАВИГАЦИИ (ДЕРЖИТ СТЕКЛО И КНОПКУ ИИ) === */
.bottom-global-nav {
    position: fixed !important; 
    bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    left: 50% !important; 
    transform: translateX(-50%) !important;
    width: max-content !important; 
    max-width: 95vw !important;
    z-index: 999999 !important;
    display: flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
    gap: 15px !important;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1) !important;
    pointer-events: none !important; /* Пропускаем клики мимо кнопок */
}

/* Класс скрытия панели (JS) */
.bottom-global-nav.hidden-dock { 
    transform: translate(-50%, 150%) !important; 
}

/* === ПРЕМИАЛЬНАЯ ПОЛУПРОЗРАЧНАЯ ПАНЕЛЬ НАВИГАЦИИ (GLASSMORPHISM 2026) === */
.yazme-dock-wrapper {
    position: relative !important;
    pointer-events: auto !important; /* Возвращаем кликабельность стеклу */
    padding: 6px 12px !important;
    display: flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
    gap: 10px !important; /* Увеличен отступ для гармонии с центральной кнопкой */
    background: rgba(20, 20, 25, 0.4) !important;
    backdrop-filter: blur(20px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(160%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 40px !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.08) !important; 
}

/* Иконки внутри стекла */
.dock-item { 
    position: relative !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    display: flex !important; 
    flex-direction: column !important;
    justify-content: center !important; 
    align-items: center !important; 
    color: rgba(255, 255, 255, 0.65) !important; 
    font-size: 22px !important; 
    text-decoration: none !important; 
    background: transparent !important;
    border: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; 
    -webkit-tap-highlight-color: transparent !important; 
    cursor: pointer !important;
    outline: none !important;
}

.dock-item:active { transform: scale(0.85) !important; }
.dock-item:hover { 
    color: #ffffff !important; 
    transform: translateY(-4px) scale(1.1) !important;
    filter: drop-shadow(0 4px 10px rgba(255,255,255,0.2)) !important;
}

.dock-item.active { 
    color: #ffffff !important; 
    background: rgba(255, 255, 255, 0.1) !important;
}

.dock-item.active::after {
    content: '' !important;
    position: absolute !important;
    bottom: 4px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 5px !important;
    height: 5px !important;
    background: #ff2b54 !important;
    border-radius: 50% !important;
    box-shadow: 0 0 10px #ff2b54, 0 0 5px #ff2b54 !important;
}

/* === АВАТАРКА ПОЛЬЗОВАТЕЛЯ В МЕНЮ === */
.dock-profile-avatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid rgba(255, 255, 255, 0.15) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
}

.dock-item:hover .dock-profile-avatar {
    border-color: #ffffff !important;
    box-shadow: 0 6px 15px rgba(255, 255, 255, 0.3) !important;
}

.dock-item.active .dock-profile-avatar {
    border-color: #ff2b54 !important;
    box-shadow: 0 0 12px rgba(255, 43, 84, 0.6) !important;
}

/* === ОБНОВЛЕННАЯ СТРУКТУРА DOCK-МЕНЮ (РАЗДЕЛИТЕЛЬ И ГРУППИРОВКА) === */
.dock-nav-group { display: flex !important; align-items: center !important; gap: 10px !important; }
.dock-divider { width: 1px !important; height: 28px !important; background: rgba(255, 255, 255, 0.15) !important; margin: 0 6px !important; border-radius: 2px !important; }

/* === ПРЕМИАЛЬНАЯ КНОПКА ИИ В ЦЕНТРЕ === */
.dock-ai-btn { 
    pointer-events: auto !important; 
    flex-shrink: 0 !important;
    width: 50px !important;  /* Уменьшено с 56px до 50px */
    height: 50px !important; /* Уменьшено с 56px до 50px */
    border-radius: 50% !important; 
    background: #0d0e12 !important; 
    border: none !important; 
    cursor: pointer !important; 
    position: relative !important; 
    z-index: 2 !important; 
    display: flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
    padding: 0 !important; 
    outline: none !important; 
    -webkit-tap-highlight-color: transparent !important; 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important; 
    box-shadow: 0 8px 24px rgba(107, 72, 255, 0.35), 
                inset 0 1px 2px rgba(255, 255, 255, 0.12),
                inset 0 -1px 3px rgba(0, 0, 0, 0.6) !important;
    margin: 0 2px !important; /* Уменьшен отступ для центровки */
    overflow: hidden !important;
}

.dock-ai-btn::before {
    content: '' !important;
    position: absolute !important;
    inset: -1px !important;
    border-radius: 50% !important;
    background: conic-gradient(from 0deg, #6b48ff, #ff2b54, #6b48ff) !important;
    animation: aiDockRotate 3.5s linear infinite !important;
    z-index: -1 !important;
}

/* Внутренний слой градиентного преломления для эффекта глубокого 3D стекла */
.dock-ai-btn::after {
    content: '' !important;
    position: absolute !important;
    inset: 2px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, rgba(107, 72, 255, 0.18) 0%, rgba(255, 43, 84, 0.18) 100%) !important;
    z-index: 0 !important;
    pointer-events: none !important;
}

.dock-ai-btn:hover { 
    transform: translateY(-5px) scale(1.08) !important; 
    box-shadow: 0 14px 30px rgba(255, 43, 84, 0.4), 
                0 0 18px rgba(107, 72, 255, 0.45),
                inset 0 1px 3px rgba(255, 255, 255, 0.25) !important;
}

.dock-ai-btn:active { 
    transform: translateY(0) scale(0.94) !important; 
    box-shadow: 0 4px 12px rgba(107, 72, 255, 0.4) !important;
}

.dock-ai-btn.active { 
    box-shadow: 0 0 25px #ff2b54, 0 0 12px #6b48ff, inset 0 1px 3px rgba(255,255,255,0.4) !important; 
    background: linear-gradient(135deg, #181126 0%, #26111b 100%) !important;
}

.dock-ai-btn-inner { 
    display: flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
    width: 100% !important; 
    height: 100% !important; 
    z-index: 1 !important;
}

/* Высокотехнологичная неоновая типографика 2026 */
.ai-btn-text {
    font-family: 'Unbounded', 'Montserrat', sans-serif !important;
    font-weight: 900 !important;
    font-size: 12px !important; /* Чуть меньше для идеального вписывания в 50px */
    letter-spacing: 0.5px !important;
    background: linear-gradient(135deg, #ffffff 40%, #d8d0ff 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-block !important;
}

.dock-ai-btn:hover .ai-btn-text {
    background: linear-gradient(135deg, #ffffff 10%, #ffcbd5 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    text-shadow: 0 0 8px rgba(255, 43, 84, 0.75) !important;
    transform: scale(1.05) !important;
}

@keyframes aiDockRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================= */
/* ГЛОБАЛЬНЫЙ ИИ ОВЕРЛЕЙ БЁРЧИ               */
/* ========================================= */
.ai-overlay-modal {
    position: fixed;
    top: 100%;
    left: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 2147483640 !important;
    /* Делаем фон прозрачным, чтобы лента/сайт просвечивала */
    background: rgba(8, 9, 13, 0.45) !important;
    backdrop-filter: blur(40px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
    transition: top 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Закругление сверху и голографическая кромка */
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    box-shadow: 0 -10px 40px rgba(107, 72, 255, 0.2), 
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.ai-overlay-modal.active { top: 0; }

.ai-overlay-close-btn {
    position: absolute;
    top: calc(env(safe-area-inset-top, 10px) + 15px);
    left: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    z-index: 10000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.ai-overlay-close-btn:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.05); }
.ai-overlay-close-btn:active { transform: scale(0.9); background: rgba(255, 255, 255, 0.3); }

/* ХИРУРГИЧЕСКАЯ ОТМЕНА ФОНОВ (ЧТОБЫ РАБОТАЛО СТЕКЛО ОВЕРЛЕЯ) */
.ai-overlay-modal .google-habitat,
.ai-overlay-modal .gh-wrapper,
.ai-overlay-modal .gh-desktop-layout,
.ai-overlay-modal .gh-main-area,
.ai-overlay-modal .gh-chat-zone,
.ai-overlay-modal .gh-input-zone,
.ai-overlay-modal .gh-chat-history {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.ai-overlay-modal .gh-input-wrapper {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(15px) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
}

/* ========================================= */
/* ВОССТАНОВЛЕННЫЕ ГЛОБАЛЬНЫЕ СТИЛИ ЧАТА ИИ  */
/* ========================================= */
.gh-stats-wrapper { position: relative !important; width: 100% !important; z-index: 100 !important; }
.gh-top-actions { display: flex !important; gap: 10px !important; width: 100% !important; }
.gh-stats-toggle-btn { background: rgba(20, 20, 25, 0.8) !important; border: 1px solid rgba(255, 255, 255, 0.1) !important; color: #fff !important; padding: 10px 10px !important; border-radius: 20px !important; font-family: 'Inter', sans-serif !important; font-size: 13px !important; font-weight: 600 !important; display: flex !important; align-items: center !important; justify-content: center !important; gap: 8px !important; flex: 1 !important; cursor: pointer !important; backdrop-filter: blur(10px) !important; transition: background 0.2s, transform 0.2s !important; }
.gh-stats-toggle-btn:active { transform: scale(0.98) !important; background: rgba(40, 40, 50, 0.8) !important; }
.gh-stats-panel { max-height: 0 !important; opacity: 0 !important; overflow: hidden !important; transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease !important; }
.gh-stats-panel.active { max-height: 500px !important; opacity: 1 !important; margin-top: 10px !important; }
.gh-stats { display: flex !important; flex-direction: column !important; gap: 12px !important; background: rgba(20, 20, 25, 0.8) !important; padding: 16px !important; border-radius: 16px !important; border: 1px solid rgba(255, 255, 255, 0.05) !important; backdrop-filter: blur(10px) !important; width: 100% !important; box-sizing: border-box !important; }

.gh-stats::-webkit-scrollbar { width: 4px; }
.gh-stats::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 4px; }
.gh-stat-wrapper { display: flex !important; flex-direction: column !important; gap: 8px !important; width: 100% !important; background: rgba(0,0,0,0.2) !important; padding: 10px !important; border-radius: 12px !important; transition: all 0.2s ease !important; box-sizing: border-box !important; }
.gh-stat-label-container { display: flex !important; justify-content: space-between !important; align-items: center !important; width: 100% !important; margin-bottom: 4px !important; }
.gh-stat-label { font-size: 12px !important; font-weight: 800 !important; color: #E8EAED !important; text-transform: uppercase !important; letter-spacing: 1px !important; cursor: help !important; }
.stat-val-text { font-size: 14px !important; font-weight: 900 !important; width: 40px !important; text-align: right !important; }

.trait-slider { -webkit-appearance: none; width: 100%; height: 14px; background: #111; border-radius: 10px; outline: none; box-shadow: inset 0 2px 4px rgba(0,0,0,0.8); cursor: pointer; overflow: hidden; }
.trait-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; cursor: ew-resize; box-shadow: 0 0 5px rgba(0,0,0,0.5); box-shadow: -400px 0 0 392px var(--slider-color); }
.trait-slider::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; cursor: ew-resize; border: none; }
.trait-slider::-moz-range-progress { height: 14px; border-radius: 10px; background: var(--slider-color); }
#slider-vibe { --slider-color: #FF5252; }
#slider-delivery { --slider-color: #40C4FF; }
#slider-creative { --slider-color: #b388ff; }

.gh-switch { position: relative; display: inline-block; width: 42px; height: 22px; margin: 0; }
.gh-switch input { opacity: 0; width: 0; height: 0; }
.gh-slider-toggle { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #333; transition: .4s; border-radius: 22px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.8); }
.gh-slider-toggle:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.3); }
input:checked + .gh-slider-toggle { background-color: #F48FB1; }
input:checked + .gh-slider-toggle:before { transform: translateX(20px); }

.ch-msg-badges { display: flex !important; gap: 6px !important; margin-top: 10px !important; flex-wrap: wrap !important; }
.trait-badge { display: inline-flex !important; align-items: center !important; gap: 6px !important; padding: 4px 10px !important; border-radius: 12px !important; font-size: 11px !important; font-weight: 700 !important; background: rgba(0, 0, 0, 0.3) !important; border: 1px solid rgba(255, 255, 255, 0.1) !important; cursor: pointer !important; transition: all 0.2s ease !important; backdrop-filter: blur(5px) !important; }
.trait-badge:hover { transform: translateY(-2px) !important; background: rgba(255, 255, 255, 0.1) !important; }
.trait-badge.vibe { color: #FF5252 !important; border-color: rgba(255, 82, 82, 0.3) !important; }
.trait-badge.delivery { color: #40C4FF !important; border-color: rgba(64, 196, 255, 0.3) !important; }
.trait-badge.creative { color: #b388ff !important; border-color: rgba(179, 136, 255, 0.3) !important; }
.trait-badge .delta.pos { color: #00E676 !important; }
.trait-badge .delta.neg { color: #FF5252 !important; }
.trait-badge .delta.zero { color: #aaa !important; font-weight: normal !important; }

.ch-msg.bot .ch-msg-avatar-wrapper { background: linear-gradient(145deg, #2A2D3A, #1A1C24) !important; border: 2px solid var(--bot-color, #fff) !important; box-shadow: 0 0 12px var(--bot-color-glow, rgba(255,255,255,0.2)) !important; display: flex; align-items: center; justify-content: center; }
.ch-msg.bot .ch-avatar { font-size: 24px !important; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.bot-name-label { font-size: 11px !important; font-weight: 800 !important; text-transform: uppercase !important; color: var(--bot-color, #a8c7fa) !important; margin-bottom: 6px !important; display: inline-block !important; letter-spacing: 0.5px !important; border-bottom: 1px dashed var(--bot-color, #a8c7fa) !important; padding-bottom: 2px !important; }

.gh-bubble a[href^="messenger.php?u="] { display: inline-flex !important; align-items: center !important; gap: 4px !important; padding: 2px 8px !important; border-radius: 12px !important; font-size: 12px !important; font-weight: 700 !important; color: #fff !important; background: linear-gradient(145deg, rgba(107, 72, 255, 0.4), rgba(0, 229, 255, 0.4)) !important; border: 1px solid rgba(255, 255, 255, 0.2) !important; text-decoration: none !important; transition: all 0.2s ease !important; box-shadow: 0 2px 5px rgba(0,0,0,0.3) !important; margin: 0 2px; }
.gh-bubble a[href^="messenger.php?u="]:hover { transform: translateY(-1px) !important; background: linear-gradient(145deg, rgba(107, 72, 255, 0.6), rgba(0, 229, 255, 0.6)) !important; box-shadow: 0 4px 10px rgba(0,229,255,0.4) !important; border-color: rgba(255, 255, 255, 0.5) !important; }
.gh-bubble a[href^="messenger.php?u="]::before { content: '\f544'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 10px; }

.ch-action-btn { border: none; padding: 10px 16px; border-radius: 16px; color: white; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 13px; transition: all 0.2s ease; }
.ch-action-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.ch-action-btn:active { transform: translateY(1px); }

.history-item { background: rgba(0,0,0,0.2) !important; padding: 12px !important; border-radius: 12px !important; display: flex !important; flex-direction: column !important; gap: 6px !important; cursor: pointer !important; transition: background 0.2s ease !important; border: 1px solid transparent !important; }
.history-item:hover { background: rgba(255,255,255,0.05) !important; }
.history-item.active-session { background: rgba(255,255,255,0.08) !important; border-color: rgba(255,255,255,0.2) !important; }
.history-item-date { font-size: 10px !important; color: #888 !important; font-weight: 600 !important; text-transform: uppercase !important; }
.history-item-text { font-size: 13px !important; color: #E8EAED !important; line-height: 1.4 !important; font-weight: 600 !important; }

.ch-art-container { margin-top: 12px; position: relative; max-width: 280px; border-radius: 16px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.ch-art-img { width: 100%; display: block; border-radius: 16px; transition: transform 0.3s ease; cursor: zoom-in; }
.ch-art-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%); padding: 15px 10px 10px 10px; display: flex; gap: 8px; justify-content: flex-end; opacity: 0; transition: opacity 0.2s ease; }
.ch-art-container:hover .ch-art-overlay { opacity: 1; }
.ch-art-btn { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2); color: #fff; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(10px); transition: all 0.2s ease; font-size: 14px; }
.ch-art-btn:hover { background: rgba(255,255,255,0.3); transform: translateY(-2px); color: #d4af37; }
.ch-art-loading { display: flex; align-items: center; gap: 10px; padding: 10px 15px; background: rgba(212, 175, 55, 0.1); border: 1px dashed rgba(212, 175, 55, 0.4); border-radius: 12px; color: #d4af37; font-size: 13px; font-weight: 600; margin-top: 10px; width: fit-content; }

#ch-lightbox-overlay { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.95); z-index: 2147483645 !important; justify-content: center; align-items: center; backdrop-filter: blur(10px); }
#ch-lightbox-img { max-width: 95vw; max-height: 95vh; object-fit: contain; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.8); transition: transform 0.2s ease; }
.ch-lightbox-close { position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3); color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 20px; display: flex; align-items: center; justify-content: center; cursor: pointer; backdrop-filter: blur(5px); z-index: 2147483646 !important; transition: all 0.2s ease; }
.ch-lightbox-close:hover { background: rgba(255,255,255,0.3); transform: scale(1.1); color: #FF5252; }

.ch-avatar-container { position: relative; display: flex; justify-content: center; }
.ch-persona-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: #1E222D; border: 2px solid #fff; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 13px; z-index: 100; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 4px 10px rgba(0,0,0,0.5); pointer-events: auto; }

/* === ОПТИМИЗАЦИЯ ПОД МОБИЛЬНЫЕ УСТРОЙСТВА === */
@media (max-width: 800px) {
    /* Оверлей прилегает вплотную к краям */
    .ai-overlay-modal {
        border-top-left-radius: 0 !important;
        border-top-right-radius: 0 !important;
    }
    
    .ai-overlay-modal .gh-wrapper,
    .ai-overlay-modal .gh-desktop-layout,
    .ai-overlay-modal .gh-main-area {
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }
    .ai-overlay-modal .gh-input-zone {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 15px) !important;
        margin-bottom: 0 !important;
    }

    .gh-stats-wrapper { position: absolute !important; top: 15px !important; left: 0 !important; right: 0 !important; z-index: 1000 !important; pointer-events: none !important; }
    .gh-top-actions { justify-content: flex-end !important; padding: 0 15px !important; pointer-events: auto !important; width: auto !important; gap: 8px !important; }
    .gh-stats-toggle-btn { flex: none !important; background: rgba(30, 30, 40, 0.5) !important; backdrop-filter: blur(15px) !important; -webkit-backdrop-filter: blur(15px) !important; border: 1px solid rgba(255, 255, 255, 0.08) !important; padding: 8px 14px !important; font-size: 12px !important; border-radius: 20px !important; box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important; }
    .gh-stats-panel { position: absolute !important; top: 45px !important; left: 15px !important; right: 15px !important; pointer-events: none !important; z-index: 1001 !important; margin-top: 0 !important; }
    .gh-stats-panel.active { pointer-events: auto !important; margin-top: 0 !important; }
    .gh-stats { background: rgba(20, 20, 25, 0.85) !important; backdrop-filter: blur(25px) !important; -webkit-backdrop-filter: blur(25px) !important; box-shadow: 0 15px 40px rgba(0,0,0,0.7) !important; border-radius: 20px !important; border: 1px solid rgba(255, 255, 255, 0.1) !important; }
}

/* === АВТО-АДАПТАЦИЯ ТЕМ ДЛЯ ОСТАЛЬНЫХ ЭЛЕМЕНТОВ ИНТЕРФЕЙСА === */
@media (prefers-color-scheme: dark) {
    .bottom-sheet { background: #1a1a22 !important; box-shadow: 0 -10px 40px rgba(0,0,0,0.5); }
    .sheet-name, .sheet-menu-item { color: #ffffff !important; }
    .sheet-subtitle { color: #8e8e9e !important; }
    .sheet-profile-header { border-bottom-color: rgba(255,255,255,0.05) !important; }
    .sheet-menu-item:active { background: rgba(255,255,255,0.05) !important; }
}

/* ПРИНУДИТЕЛЬНАЯ ТЕМНАЯ ТЕМА ЧЕРЕЗ КЛАССЫ */
body.dark-theme .bottom-sheet, body.oled-theme .bottom-sheet, body.google-habitat:not(.light-theme) .bottom-sheet { background: #1a1a22 !important; box-shadow: 0 -10px 40px rgba(0,0,0,0.5); }
body.dark-theme .sheet-name, body.dark-theme .sheet-menu-item, body.oled-theme .sheet-name, body.oled-theme .sheet-menu-item, body.google-habitat:not(.light-theme) .sheet-name, body.google-habitat:not(.light-theme) .sheet-menu-item { color: #ffffff !important; }
body.dark-theme .sheet-subtitle, body.oled-theme .sheet-subtitle, body.google-habitat:not(.light-theme) .sheet-subtitle { color: #8e8e9e !important; }
body.dark-theme .sheet-profile-header, body.oled-theme .sheet-profile-header, body.google-habitat:not(.light-theme) .sheet-profile-header { border-bottom-color: rgba(255,255,255,0.05) !important; }
body.dark-theme .sheet-menu-item:active, body.oled-theme .sheet-menu-item:active, body.google-habitat:not(.light-theme) .sheet-menu-item:active { background: rgba(255,255,255,0.05) !important; }

/* === BOTTOM SHEET (ШТОРКА ПРОФИЛЯ) === */
.bottom-sheet { position: fixed; bottom: 0; left: 0; width: 100%; background: var(--bg-panel, #ffffff); border-radius: 32px 32px 0 0; z-index: 2147483642; transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1); padding: 16px 24px calc(24px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,0.2); }
.bottom-sheet.active { transform: translateY(0); }
.sheet-drag-handle { width: 40px; height: 5px; background: rgba(128,128,128,0.3); border-radius: 10px; margin: 0 auto 20px; }
.sheet-profile-header { display: flex; align-items: center; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--glass-border, rgba(128,128,128,0.2)); margin-bottom: 20px; cursor: pointer; }
.sheet-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--glass-border, rgba(128,128,128,0.2)); }
.sheet-name { font-size: 18px; font-weight: 800; color: var(--text-primary, #000); margin-bottom: 4px; }
.sheet-subtitle { font-size: 13px; color: var(--text-secondary, #888); display: flex; align-items: center; gap: 4px; }
.sheet-menu-list { display: flex; flex-direction: column; gap: 8px; }
.sheet-menu-item { display: flex; align-items: center; gap: 16px; width: 100%; padding: 12px; border-radius: 20px; background: transparent; border: none; cursor: pointer; transition: background 0.2s; color: var(--text-primary, #000); font-size: 16px; font-weight: 600; text-align: left; -webkit-tap-highlight-color: transparent; }
.sheet-menu-item:active { background: rgba(128,128,128,0.1); }
.sheet-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; }

/* === TIKTOK CAMERA FULLSCREEN === */
.full-screen-camera { position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh; background: #000 !important; z-index: 2147483647 !important; display: flex; flex-direction: column; justify-content: flex-start; opacity: 0; pointer-events: none; transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1), opacity 0.4s; }
.full-screen-camera.active { opacity: 1; pointer-events: all; transform: translateY(0); }
.camera-scale-wrapper { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; background: #111; overflow: hidden; }

.tk-wallpaper-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #111; background-size: cover; background-position: center;
    z-index: 0; transition: background-image 0.4s ease;
}

.tk-video-wrapper {
    position: absolute; z-index: 1; overflow: hidden;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    display: flex; justify-content: center; align-items: center;
}

#tk-camera-video { width: 100%; height: 100%; object-fit: cover !important; transform: scaleX(-1); }

.tk-context-menu {
    position: absolute; z-index: 2147483660; background: rgba(30, 30, 30, 0.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 16px; padding: 4px; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: scale(0.9); opacity: 0; pointer-events: none; transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1), opacity 0.2s;
}
.tk-context-menu.active { transform: scale(1); opacity: 1; pointer-events: all; }
.tk-context-btn { background: transparent; border: none; color: #fff; font-size: 15px; font-weight: 600; font-family: 'Inter', sans-serif; padding: 12px 20px; text-align: left; cursor: pointer; border-radius: 12px; transition: background 0.2s; display: flex; align-items: center; gap: 10px; }
.tk-context-btn:active { background: rgba(255,255,255,0.1); }
.tk-context-btn.danger { color: #ff3b30; }
.tk-context-btn.danger:active { background: rgba(255, 59, 48, 0.15); }
.tk-context-divider { height: 1px; background: rgba(255, 255, 255, 0.1); margin: 2px 8px; }

/* Оверлей публикации */
.tk-publish-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh; background: #111111; z-index: 2147483655; display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1); }
.tk-publish-overlay.active { transform: translateX(0); }
.tk-pub-header { display: flex; justify-content: space-between; align-items: center; padding: env(safe-area-inset-top, 20px) 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.tk-pub-body { flex: 1; padding: 20px; overflow-y: auto; }
.tk-pub-top-row { display: flex; gap: 15px; margin-bottom: 20px; }
.tk-pub-desc-wrapper { flex: 1; position: relative; }
#tk-pub-description { width: 100%; height: 140px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; padding: 15px; color: #fff; font-size: 15px; font-family: 'Inter', sans-serif; resize: none; outline: none; transition: border-color 0.2s; }
#tk-pub-description:focus { border-color: var(--p-accent, #6b48ff); background: rgba(255,255,255,0.08); }
#tk-pub-description::placeholder { color: rgba(255,255,255,0.4); }
.tk-pub-char-count { position: absolute; bottom: 10px; right: 15px; font-size: 12px; color: rgba(255,255,255,0.4); font-weight: 600; }
.tk-pub-cover-wrapper { width: 100px; height: 140px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px dashed rgba(255,255,255,0.2); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; position: relative; transition: 0.2s; flex-shrink: 0; }
.tk-pub-cover-wrapper:active { transform: scale(0.95); }
.tk-pub-cover-preview { width: 100%; height: 100%; background-size: cover; background-position: center; position: absolute; top: 0; left: 0; z-index: 1; }
.tk-pub-cover-label { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); color: #fff; font-size: 11px; font-weight: 700; text-align: center; padding: 6px 0; z-index: 2; }
.tk-pub-footer { padding: 20px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,0.1); }

.tk-top-bar { position: absolute; top: env(safe-area-inset-top, 20px); left: 0; width: 100%; padding: 16px 20px; display: flex; justify-content: space-between; z-index: 10; }
.tk-icon-btn { width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,0.4); color: #fff; border: none; font-size: 20px; cursor: pointer; backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; }

.tk-wallpapers-horizontal { position: absolute; bottom: 130px; left: 0; width: 100%; z-index: 15; background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%); padding: 15px 0; transition: opacity 0.3s, transform 0.3s; }
.tk-wallpapers-horizontal.hidden { opacity: 0 !important; pointer-events: none !important; transform: translateY(20px) !important; display: block !important; }
.tk-wallpapers-scroll { display: flex; gap: 15px; padding: 0 20px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; scroll-snap-type: x mandatory; }
.tk-wallpapers-scroll::-webkit-scrollbar { display: none; }
.tk-wp-item { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; flex-shrink: 0; scroll-snap-align: start; transition: transform 0.2s; }
.tk-wp-item:active { transform: scale(0.95); }
.tk-wp-thumb { width: 60px; height: 60px; border-radius: 50%; background-size: cover; background-position: center; background-color: rgba(255,255,255,0.1); border: 2px solid transparent; transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.tk-wp-item.active .tk-wp-thumb { border-color: #fff; transform: scale(1.1); box-shadow: 0 0 15px rgba(255,255,255,0.5); }
.tk-wp-label { font-size: 11px; color: rgba(255,255,255,0.8); font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.8); max-width: 70px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-wp-item.active .tk-wp-label { color: #fff; }

.tk-bottom-bar { position: absolute; bottom: 0; left: 0; width: 100%; padding: 0 0 calc(20px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, rgba(0,0,0,0.8), transparent); z-index: 10; display: flex; flex-direction: column; align-items: center; }
.tk-mode-selector { position: relative; width: 100%; height: 40px; display: flex; justify-content: center; align-items: center; margin-bottom: 20px; overflow: hidden; }
.tk-modes-track { display: flex; gap: 40px; transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1); } 
.tk-mode-item { color: rgba(255,255,255,0.5); font-size: 15px; font-weight: 700; cursor: pointer; transition: 0.3s; text-shadow: 0 1px 2px #000; }
.tk-mode-item.active { color: #fff; transform: scale(1.1); }
.tk-mode-indicator { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; background: #fff; border-radius: 50%; box-shadow: 0 0 4px #fff; }

.tk-record-zone { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 400px; padding: 0 30px; height: 80px; }
.tk-zone-side { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; color: white; font-size: 12px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.8); transition: opacity 0.3s, transform 0.3s; }
.tk-mini-btn { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 18px; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.3); transition: all 0.3s; }
.tk-zone-side:active .tk-mini-btn { transform: scale(0.9); }
.tk-zone-center { flex: 1; display: flex; justify-content: center; align-items: center; position: relative; }
.invisible-btn { opacity: 0 !important; pointer-events: none !important; transform: scale(0.8) !important; }

.tk-record-btn { width: 72px; height: 72px; border-radius: 50%; border: 4px solid rgba(255, 43, 84, 0.5); background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.tk-record-inner { width: 54px; height: 54px; border-radius: 50%; background: #ff2b54; transition: 0.3s; }
.tk-record-btn.recording { border-color: #ff2b54; }
.tk-record-btn.recording .tk-record-inner { border-radius: 12px; transform: scale(0.5); }

.tk-send-btn, .tk-retake-btn { 
    position: absolute; width: 64px; height: 64px; border-radius: 50%; border: none; color: #fff; font-size: 24px; cursor: pointer; 
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
}
.tk-send-btn { background: linear-gradient(135deg, #6b48ff, #ff2b54); box-shadow: 0 10px 30px rgba(107, 72, 255, 0.5), inset 0 2px 5px rgba(255,255,255,0.3); right: -40px; animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.tk-send-btn:active { transform: scale(0.9); box-shadow: 0 5px 15px rgba(107, 72, 255, 0.4); }
.tk-retake-btn { background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.3); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); left: -40px; animation: slideInLeft 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.tk-retake-btn:active { transform: scale(0.9); background: rgba(255, 255, 255, 0.3); }

@keyframes slideInRight { from { opacity: 0; transform: translateX(-30px) scale(0.5); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(30px) scale(0.5); } to { opacity: 1; transform: translateX(0) scale(1); } }

/* === СТИЛИ МОДАЛОК (ДАННЫЕ ПРОФИЛЯ) === */
.fn-modal-overlay { position: fixed !important; top: 0; left: 0; width: 100vw; height: 100dvh; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); z-index: 2147483650 !important; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.fn-modal-overlay.active { opacity: 1; pointer-events: all; }
.fn-modal-card { background: var(--bg-panel, var(--p-surface, #1e1f20)); width: 92%; max-width: 400px; border-radius: 32px; padding: 24px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); border: 1px solid var(--glass-border, rgba(255,255,255,0.08)); display: flex; flex-direction: column; transform: translateY(50px) scale(0.95); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.fn-modal-overlay.active .fn-modal-card { transform: translateY(0) scale(1); }
.fn-modal-header { display: flex; justify-content: space-between; align-items: center; font-size: 18px; font-weight: 800; margin-bottom: 16px; color: var(--text-primary, #fff); }
.fn-close-btn { background: color-mix(in srgb, var(--text-primary, #fff) 10%, transparent); border: none; color: var(--text-primary, #fff); width: 32px; height: 32px; border-radius: 50%; font-size: 16px; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.fn-close-btn:hover { background: #ef4444; color: #fff; }
.fn-label { display: block; color: var(--text-secondary, #8e8e9e); font-size: 12px; margin-bottom: 8px; font-weight: 600; }
.fn-custom-input { width: 100%; background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.1); padding: 14px; border-radius: 16px; color: #fff; font-family: 'Inter', sans-serif; font-size: 15px; box-sizing: border-box; transition: 0.3s; }
.fn-custom-input:focus { border-color: #ff2d85; outline: none; box-shadow: 0 0 0 3px rgba(255,45,133,0.15); background: rgba(0,0,0,0.4); }
.fn-submit-btn { width: 100%; border: none; padding: 14px; border-radius: 16px; font-weight: 700; font-size: 15px; cursor: pointer; transition: 0.3s; background: linear-gradient(135deg, #6b48ff, #ff2b54); color: #ffffff; display:flex; align-items:center; justify-content:center; gap:8px;}
.fn-submit-btn:hover { filter: brightness(1.1); transform: translateY(-2px); }
.fn-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

/* ========================================================================= */
/* ИДЕАЛЬНАЯ АДАПТАЦИЯ ДЛЯ ПК (ПО ЦЕНТРУ ЭКРАНА В ФОРМАТЕ МОБИЛЬНОГО 9:16)   */
/* ========================================================================= */
@media (min-width: 768px) {
    .full-screen-camera { background: rgba(0, 0, 0, 0.85) !important; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
    .camera-scale-wrapper, .tk-top-bar, .tk-wallpapers-horizontal, .tk-bottom-bar, .tk-publish-overlay { width: 100% !important; max-width: 414px !important; left: 50% !important; transform: translateX(-50%) !important; }
    .camera-scale-wrapper { height: 896px !important; max-height: 90vh !important; top: 50% !important; transform: translate(-50%, -50%) !important; border-radius: 40px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); background: #050505; }
    .tk-top-bar { top: calc(50% - min(45vh, 448px) + 20px) !important; }
    .tk-bottom-bar { bottom: calc(50% - min(45vh, 448px)) !important; border-bottom-left-radius: 40px; border-bottom-right-radius: 40px; background: linear-gradient(0deg, rgba(0,0,0,0.9), transparent) !important; }
    .tk-wallpapers-horizontal { bottom: calc(50% - min(45vh, 448px) + 130px) !important; }
    .tk-publish-overlay { height: 896px !important; max-height: 90vh !important; top: 50% !important; border-radius: 40px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); transform: translate(100vw, -50%) !important;  }
    .tk-publish-overlay.active { transform: translate(-50%, -50%) !important; }
}

/* === ВОЛНА ЗАПИСИ ИИ (МИКРОФОН) === */
@keyframes waveAnim { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }
@keyframes pulseOpacity { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

.ch-recording-wave { display: flex; flex: 1; align-items: center; padding: 0 10px; gap: 12px; }
.ch-wave-bars { display: flex; align-items: center; gap: 4px; height: 24px; }
.ch-bar { width: 4px; background: #ff2d85; border-radius: 2px; animation: waveAnim 1s ease-in-out infinite; }
.ch-bar:nth-child(1) { height: 40%; animation-delay: 0.0s; }
.ch-bar:nth-child(2) { height: 80%; animation-delay: 0.1s; }
.ch-bar:nth-child(3) { height: 100%; animation-delay: 0.2s; }
.ch-bar:nth-child(4) { height: 80%; animation-delay: 0.3s; }
.ch-bar:nth-child(5) { height: 40%; animation-delay: 0.4s; }
.ch-record-timer { color: #ff2d85; font-size: 15px; font-weight: 700; font-family: 'Inter', sans-serif; font-variant-numeric: tabular-nums; }
.ch-record-status { color: #8e8e9e; font-size: 13px; font-weight: 500; animation: pulseOpacity 1.5s infinite; }