/* ========== МОБИЛЬНАЯ АДАПТАЦИЯ ========== */
@media screen and (max-width: 768px) {
    


    /* СБРАСЫВАЕМ ВСЕ СТИЛИ ИЗ ОСНОВНОГО CSS */
    .app {
        all: unset;
        display: block !important;
        height: auto !important;
        min-height: 100vh !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 0 !important;
    }

    body {
        overflow-x: hidden;
        background: rgba(0, 0, 0, 0.973);
        padding-bottom: 0 !important;
    }


    /* Скрываем мини-профиль */
    .mini-profile {
        display: none !important;
    }

    /* ===== ОСНОВНОЙ КОНТЕНТ ===== */
    .content {
        all: unset;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 0 100px 0 !important;
        margin: 0 !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    /* Секции */
    .section {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
    }

    /* Список постов */
    #postsList,
    #profilePosts {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* ===== ПОСТЫ ===== */
    .post {
        width: 100% !important;
        padding: 16px 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .post-header {
        display: flex !important;
        align-items: center !important;
        margin-bottom: 8px !important;
        gap: 10px !important;
        padding: 0 16px !important;
    }

    .post-avatar {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        margin: 0 !important;
    }

    .post-user {
        display: flex !important;
        flex-direction: column !important;
    }

    .post-name {
        font-size: 15px !important;
        font-weight: 600 !important;
        color: white !important;
    }

    .post-handle {
        font-size: 12px !important;
        color: rgba(255,255,255,0.5) !important;
    }

    .post-text {
        margin-left: 0 !important;
        padding-left: 58px !important;
        padding-right: 16px !important;
        font-size: 15px !important;
        line-height: 1.5 !important;
        margin-top: 8px !important;
        word-break: break-word !important;
    }

    .post-image {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 12px !important;
        max-width: 100% !important;
        height: auto !important;
        border-radius: 0 !important;
    }

    .post-stats {
        margin-left: 58px !important;
        margin-right: 16px !important;
        margin-top: 12px !important;
    }

    /* ===== ДИАЛОГИ НА ВЕСЬ ЭКРАН ===== */
@media screen and (max-width: 768px) {
#mainsite3 {
    width: 100vw !important; /* Вместо 100% используем 100vw */
    max-width: 100vw !important;
    min-width: 100vw !important;
    height: calc(100vh - 80px) !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    background: #0a0a0a !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
    box-sizing: border-box !important;}

/* Исправляем родительские контейнеры */
.content, 
.section,
.app {
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: hidden !important;
}


    .dialogs-container {
        height: 100% !important;
        width: 100% !important;
        background: rgba(255,255,255,0);
        border-radius: 0 !important;
        border: none !important;
        margin: 0 !important;
    }

    .users-column {
        width: 100% !important;
        height: 690px !important;
        border-right: none !important;
        border-radius: 30px;
        border-bottom: 0px solid rgba(255,255,255,0);
    }

    .chat-column {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: url('https://i.pinimg.com/originals/2a/c6/f1/2ac6f19e8331b63616aef2d3844e780d.jpg?nii=t') !important;
        z-index: 2000 !important;
        display: none !important;
    }

    body.dialog-active .chat-column {
        display: flex !important;
    }


/* Вся нижняя панель (делаем прозрачной) */

.dialog-input {
    background: transparent !important; 
    bottom: 20px !important;
    margin: 0 10px !important;
    border: none !important;
    position: fixed !important;
    width: calc(100% - 20px) !important;
    left: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    z-index: 100 !important;
    padding: 0 !important;
    background: rgba(30, 30, 30, 0.95) !important;
    border-radius: 30px !important;
    padding: 6px !important;
}

/* Шапка диалога */
.dialog-header {
    background: rgba(10, 10, 10, 0.5) !important; 
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    position: absolute !important; 
    top: 10px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    border-radius: 24px !important;  
    height: 60px !important;
    z-index: 2010 !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 15px !important;
    box-sizing: border-box !important;
    gap: 12px !important;
}

/* Кнопка "назад" */
.dialog-back-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    color: white !important;
    transition: background 0.2s !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.dialog-back-btn:active {
    background: rgba(255, 255, 255, 0.1) !important;
}

.dialog-back-btn svg {
    width: 24px !important;
    height: 24px !important;
}

/* Аватар и информация о пользователе */
.dialog-header-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
}

.dialog-header-info {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

.dialog-header-name {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: white !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.dialog-header-status {
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Кнопка меню */
.dialog-menu-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    color: white !important;
    transition: background 0.2s !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.dialog-menu-btn:active {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Dropdown меню */
.dialog-menu-dropdown {
    position: absolute !important;
    top: 70px !important;
    right: 10px !important;
    background: rgba(20, 20, 20, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-radius: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 8px !important;
    min-width: 200px !important;
    z-index: 2020 !important;
    display: none !important;
}

.dialog-menu-dropdown.active {
    display: block !important;
}

.dialog-menu-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 16px !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    color: white !important;
    font-size: 15px !important;
    transition: background 0.2s !important;
}

.dialog-menu-item:active {
    background: rgba(255, 255, 255, 0.1) !important;
}

.dialog-menu-item svg {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
}

/* Кнопка смайликов */
.dialog-emoji-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    background: transparent !important;
    border-radius: 50% !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    font-size: 24px !important;
    transition: all 0.2s !important;
    margin-left: 4px !important;
}

.dialog-emoji-btn:active {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: scale(0.95) !important;
}

/* Обертка поля ввода */
.dialog-input-wrapper {
    flex: 1 !important;
    background: transparent !important;
    border-radius: 0 !important;
    border: none !important;
    padding: 0 8px !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    min-height: 40px !important;
}

/* Само поле ввода текста */
#dialogMessageInput {
    background: transparent !important;
    border: none !important;
    color: white !important;
    flex: 1 !important;
    padding: 10px 4px !important;
    font-size: 16px !important;
    outline: none !important;
    min-height: 40px !important;
    max-height: 120px !important;
    resize: none !important;
}

#dialogMessageInput::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Кнопка микрофона / отправки */
.voice-record-btn,
#dialogSendBtn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    background: white !important;
    border-radius: 50% !important;
    border: none !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    color: #333 !important;
    transition: all 0.2s !important;
    margin-right: 4px !important;
}

/* Кнопка отправки */
#dialogSendBtn {
    background: white !important;
    border: none !important;
}

.voice-record-btn:active,
#dialogSendBtn:active {
    background: rgba(255, 255, 255, 0.85) !important;
    transform: scale(0.95) !important;
}

.voice-record-btn svg,
#dialogSendBtn svg {
    width: 22px !important;
    height: 22px !important;
}

/* Контейнер для кнопок микрофона/отправки - на одном месте */
.dialog-action-btn-container {
    position: relative !important;
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0 !important;
}

.dialog-action-btn-container .voice-record-btn,
.dialog-action-btn-container .dialog-send-btn,
.dialog-action-btn-container #voiceRecordBtn,
.dialog-action-btn-container #dialogSendBtn {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 44px !important;
    height: 44px !important;
    margin: 0 !important;
    opacity: 0 !important;
    transform: scale(0.8) !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
    pointer-events: none !important;
}

/* Показываем активную кнопку */
.dialog-action-btn-container .voice-record-btn[style*="display: flex"],
.dialog-action-btn-container #voiceRecordBtn[style*="display: flex"] {
    opacity: 1 !important;
    transform: scale(1) !important;
    pointer-events: auto !important;
}

.dialog-action-btn-container .dialog-send-btn[style*="display: flex"],
.dialog-action-btn-container #dialogSendBtn[style*="display: flex"] {
    opacity: 1 !important;
    transform: scale(1) !important;
    pointer-events: auto !important;
}
    /* ===== ДРУЗЬЯ ===== */
    #FriendSite {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .friends-container {
        height: auto !important;
        border-radius: 30 !important;
        border: none !important;
        padding: 16px !important;
    }

    .friends-layout {
        grid-template-columns: 1fr !important;
    }

    /* ===== SAFARI FIX ===== */
    @supports (-webkit-touch-callout: none) {
        .sidebar {
            padding-bottom: constant(safe-area-inset-bottom) !important;
            padding-bottom: env(safe-area-inset-bottom) !important;
        }
        .content {
            padding-bottom: calc(100px + constant(safe-area-inset-bottom)) !important;
            padding-bottom: calc(100px + env(safe-area-inset-bottom)) !important;
        }
    }
}
/* Находим контейнер, где отображаются сами сообщения (например, .dialog-messages) */
.dialog-messages, .messages-container { 
    padding-bottom: 120px !important; /* Создаем пустое место внизу списка */
    display: flex !important;
    flex-direction: column !important;
}


}
/* ===== МАЛЕНЬКИЕ ЭКРАНЫ ===== */
@media screen and (max-width: 480px) {
    

    .post-avatar {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
    }

    .post-text {
        padding-left: 44px !important;
    }

    .post-image {
        width: calc(100% - 44px) !important;
        margin-left: 44px !important;
    }

    .post-stats {
        margin-left: 44px !important;
    }
}

/* ===== ЛАНДШАФТ ===== */
@media screen and (max-width: 768px) and (orientation: landscape) {


    
    .content {
        padding-bottom: 80px !important;
    }
}
@media screen and (max-width: 768px) {
/* Баннер профиля */
#profileContent .profile-banner {
  width: 100%;
  height: 180px;
  background: #161616;
  position: relative;
  border-radius: 30px;
}
#profileContent .profile-avatar {
  display: block !important;      /* Обязательно для центрирования через margin: auto */
  width: 130px !important;
  height: 130px !important;
  border-radius: 50% !important;
  border: 7px solid #070707 !important;
  
  /* ЦЕНТРИРОВАНИЕ */
  margin-left: auto !important;   
  margin-right: auto !important;
  
  /* НАЕЗД НА БАННЕР */
  margin-top: -65px !important;   /* Можно подправить под высоту вашего баннера */
  margin-bottom: 8px !important;
  
  object-fit: cover !important;
  position: relative !important;
  z-index: 10 !important;
}
#profileContent .profile-display-name {
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin-bottom: 2px;
  padding: 0 16px;
  max-width: 600px;
  
  /* ЦЕНТРИРОВАНИЕ БЛОКА */
  margin-left: auto !important;
  margin-right: auto !important;
  
  /* ЦЕНТРИРОВАНИЕ ТЕКСТА И ИКОНОК ВНУТРИ */
  display: flex !important;
  justify-content: center !important; /* Выравнивает содержимое по горизонтали */
  align-items: center !important;     /* Выравнивает содержимое по вертикали */
  text-align: center !important;
  gap: 8px;
}
/* Юзернейм - ЦЕНТРИРОВАНИЕ */
#profileContent .profile-username {
  color: #888 !important;
  font-size: 15px !important;
  margin-bottom: 12px !important;
  padding: 0 16px !important;
  max-width: 600px !important;
  
  /* Убираем смещение влево и центрируем блок */
  margin-left: auto !important;
  margin-right: auto !important;
  
  /* Выравниваем текст внутри блока по центру */
  text-align: center !important;
  
  /* Если используется flex, центрируем содержимое */
  display: block !important; 
}
/* Статистика (подписчики/подписки) - ЦЕНТРИРОВАНИЕ */
#profileContent .profile-stats {
  display: flex !important;
  justify-content: center !important; /* Центрирует элементы в ряд */
  align-items: center !important;
  gap: 30px !important;               /* Расстояние между Подписчиками и Подписками */
  margin-bottom: 12px !important;
  padding: 0 16px !important;
  max-width: 600px !important;
  
  /* Убираем смещение влево */
  margin-left: auto !important;
  margin-right: auto !important;
  
  color: #888 !important;
  font-size: 14px !important;
  text-align: center !important;
}

#profileContent .stat-number {
  color: white !important;
  font-weight: 700 !important;
  display: block !important; /* Число будет НАД текстом, как в приложениях */
  font-size: 18px !important;
  margin-bottom: 2px !important;
}

/* Дата регистрации - ЦЕНТРИРОВАНИЕ */
#profileContent .profile-joined {
  color: #888 !important;
  font-size: 14px !important;
  margin-bottom: 20px !important;
  padding: 0 16px !important;
  max-width: 600px !important;
  
  /* Центрируем блок и текст */
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center !important;
  
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 6px !important;
}

}
/* ========== МОБИЛЬНЫЕ ДИАЛОГИ / СПИСОК ПОЛЬЗОВАТЕЛЕЙ ========== */
@media screen and (max-width: 768px) {

    /* Контейнер списка (например, #FriendSite или #mainsite3) */
    #FriendSite, #mainsite3 {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 15px !important;
        margin-top: 20px !important;
    }

    /* Заголовок "ПОЛЬЗОВАТЕЛИ" */
    #FriendSite h2 {
        text-align: center !important;
        font-size: 14px !important;
        letter-spacing: 2px !important;
        color: #666 !important;
        text-transform: uppercase !important;
        margin-bottom: 25px !important;
    }

    /* Элемент списка (один пользователь) */
    .friend-item, .user-item { /* замените на ваш класс элемента */
        display: flex !important;
        align-items: center !important;
        gap: 15px !important;
        padding: 12px 10px !important;
        background: rgba(255, 255, 255, 0.03) !important;
        border-radius: 18px !important;
        margin-bottom: 10px !important;
        transition: background 0.2s !important;
        width: 100% !important;
    }

    .friend-item:active {
        background: rgba(255, 255, 255, 0.08) !important;
    }

    /* Аватар в списке */
    .friend-item img, .user-avatar {
        width: 45px !important;
        height: 45px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
    }

    /* Имя пользователя в списке */
    .friend-name {
        font-size: 16px !important;
        font-weight: 500 !important;
        color: #fff !important;
        flex: 1 !important; /* Растягивает имя, чтобы иконки были справа */
    }

    /* Убираем лишние отступы, если список центрировался через margin: auto */
    #FriendSite .content-list {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important; /* Растягиваем на всю ширину */
    }

}
    /* Если открыт профиль, скрываем секцию друзей/диалогов */
#mainsite:not(.hidden) ~ #FriendSite, 
#mainsite:not(.hidden) ~ #mainsite3 {
    display: none !important;
}
#mainsite2:not(.hidden) ~ #FriendSite, 
#mainsite2:not(.hidden) ~ #mainsite3 {
    display: none !important;
}
/* Или просто принудительно для мобилок, если они накладываются */
@media screen and (max-width: 768px) {
    .section.hidden {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}
@media screen and (max-width: 768px) {
/* ===== НИЖНЕЕ МЕНЮ - КОНТЕЙНЕР ===== */






.nav-btn.active span {
    color: #fff !important;
    font-weight: bold !important;
}

.mini-profile span, 
.nav-btn.profile span,
.nav-btn:first-child span {  /* Добавлено: скрываем текст только у первой кнопки */
    display: none !important;
}
}


@media screen and (max-width: 768px) {
    /* ===== НИЖНЕЕ МЕНЮ - КОНТЕЙНЕР ===== */
    .sidebar {
        position: fixed !important;
        bottom: 20px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 95% !important;
        max-width: 450px !important;
        height: 83px !important;
        background: rgba(255, 255, 255, 0.08) !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        align-items: center !important;
        border-radius: 30px !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        z-index: 1000 !important;
        box-sizing: border-box !important;
        padding: 5px !important;
    }

    /* Скрываем логотип, аватар и кнопки сворачивания на мобильных ВСЕГДА */
    .sidebar .sidebar-logo,
    .sidebar.collapsed .sidebar-logo,
    .sidebar .mini-profile,
    .sidebar.collapsed .mini-profile,
    #miniProfile,
    .sidebar-collapse-arrow,
    #sidebarCollapseBtn2 {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    /* Отменяем свернутое состояние на мобильных - ПОЛНОЕ ПЕРЕОПРЕДЕЛЕНИЕ */
    .sidebar.collapsed {
        width: 95% !important;
        max-width: 450px !important;
        height: 83px !important;
        padding: 5px !important;
        transform: translateX(-50%) !important;
        position: fixed !important;
        bottom: 20px !important;
        left: 50% !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        align-items: center !important;
        border-radius: 30px !important;
    }



    /* СТИЛИ ДЛЯ ВСЕХ КНОПОК НАВИГАЦИИ */
    .nav-btn,
    .sidebar.collapsed .nav-btn {
        font-size: 100px !important;
        all: unset;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 1 !important;
        height: 60px !important;
        cursor: pointer !important;
        gap: 4px !important;
        margin: 0 2px !important;
        padding: 4px 2px !important;
        border-radius: 30px !important;
        box-sizing: border-box !important;
        transition: background 0.2s ease !important;
        width: auto !important;
        min-width: auto !important;
    }

    /* УБИРАЕМ ЛЮБЫЕ ОСОБЫЕ СТИЛИ ДЛЯ ПЕРВОЙ КНОПКИ */
    .nav-btn:first-child {
        margin-left: 2px !important;
        padding-left: 4px !important;
        background: transparent !important;
    }

    /* ТЕКСТ КНОПОК - ВСЕГДА ВИДИМЫЙ НА МОБИЛЬНЫХ */
    .nav-btn span,
    .sidebar.collapsed .nav-btn span {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        font-size: 12px !important;
        color: rgba(255, 255, 255, 0.7) !important;
        font-weight: 400 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    /* ИКОНКИ (если используются псевдоэлементы) */
    .nav-btn[data-tab]::before {
        font-size: 20px !important;
        line-height: 1 !important;
        display: block !important;
    }

    /* АКТИВНАЯ КНОПКА */
    .nav-btn.active {
        background: rgba(255, 255, 255, 0.15) !important;
    }

    .nav-btn.active span {
        color: #fff !important;
        font-weight: 600 !important;
    }

    /* УБИРАЕМ ВОЗМОЖНЫЕ ПРОБЛЕМЫ С ПОЗИЦИОНИРОВАНИЕМ */
    .nav-btn:hover,
    .nav-btn:focus,
    .nav-btn:active {
        outline: none !important;
        background: rgba(255, 255, 255, 0.1) !important;
    }


}
/* ===== ИСПРАВЛЕНИЕ ПЕРЕКЛЮЧЕНИЯ ВКЛАДОК ===== */
@media screen and (max-width: 768px) {
    /* Скрываем все секции по умолчанию */
    .section {
        display: none !important;
    }
    
    /* Показываем только активную секцию */
    .section:not(.hidden) {
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Принудительно скрываем неактивные секции */
    .section.hidden {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        width: 0 !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: absolute !important;
        overflow: hidden !important;
    }
    
    /* Убеждаемся, что контент не перекрывается */
    .content {
        position: relative !important;
        min-height: 100vh !important;
    }
    
    /* Каждая секция занимает всю ширину */
    #mainsite3.section,
    #FriendSite.section,
    #mainsite.section,
    #mainsite2.section {
        border-radius: 30px;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 16px 12px 16px 12px !important;
        box-sizing: border-box !important;
    }
    
    /* Если у секции есть класс hidden - она скрыта */
    #mainsite3.hidden,
    #FriendSite.hidden,
    #mainsite.hidden,
    #mainsite2.hidden {
        display: none !important;
    }
}

/* Дополнительные правила для надежности */
@media screen and (max-width: 768px) {
    /* Сбрасываем возможные конфликты */
    .section.hidden,
    #FriendSite.hidden,
    #mainsite3.hidden {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
        position: fixed !important;
        top: -9999px !important;
        left: -9999px !important;
    }
    
    /* Показываем только активную секцию */
    #FriendSite:not(.hidden),
    #mainsite3:not(.hidden),
    #mainsite:not(.hidden),
    #mainsite2:not(.hidden) {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        height: auto !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        pointer-events: auto !important;
    }
}
/* МОБИЛЬНЫЕ НАСТРОЙКИ */
@media screen and (max-width: 768px) {
    .settings-avatar-container {
        position: absolute;
        left: auto;
          display: block !important;      /* Обязательно для центрирования через margin: auto */
  
  /* ЦЕНТРИРОВАНИЕ */
  margin-left: auto !important;   
  margin-right: auto !important;
  

    }
    #editProfileModal.modal-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: none !important;
        z-index: 10000;
        align-items: flex-end;
    }
    
    #editProfileModal.modal-overlay.active {
        display: flex !important;
    }
        .settings-menu {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
          gap: 18px;
    }
    /* Скрываем текст "Аккаунт", "Профиль" и т.д. */
    .settings-menu span,
    .settings-menu button span,
    .settings-menu a span {
        display: none !important;
    }
    .settings-sidebar {
    width: auto;
}
    /* Фиксим сами пункты меню */
    .settings-menu-item {
        width: auto !important;
        min-width: unset !important;
    }
    #editProfileModal .modal-container {
        width: 100%;
        height: calc(100vh - 60px);
        background: #0a0a0a;
        border-radius: 30px 30px 0 0;
        overflow-y: auto;
        animation: slideUp 0.3s ease;
        display: flex;
        flex-direction: column;
        z-index: 10001;
        padding: 0 !important;
    }
    
    #editProfileModal .settings-sidebar {
        display: none !important;
    }
    
    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
}

/* ===== СКРЫТЬ КРЕСТИК В BOTTOM SHEET ===== */
@media screen and (max-width: 768px) {
    /* Полоска для свайпа */
    #editProfileModal .modal-header {
        position: relative;
        padding: 20px 16px 8px;
        border-bottom: none;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    #editProfileModal .modal-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 5px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 10px;
    }
    
    #editProfileModal .modal-close-btn {
        display: none !important;
    }
    
    #editProfileModal .modal-title {
        font-size: 20px;
        font-weight: 700;
        color: white;
        text-align: center;
        margin: 0;
    }
}


/* ===== КНОПКА СОЗДАНИЯ ПОСТА (ПЛЮСИК) ===== */
@media screen and (max-width: 768px) {
    /* Скрываем стандартный блок создания поста */
    .create-post,
    .profile-create-post,
    .post-form,
    .create-post-container,
    .post-box,
    #profilePostBox,
    .hide-in-foreign-profile {
        display: none !important;
    }
    
    /* Кнопка плюсика в нижнем меню */
    .create-post-btn {
        position: fixed !important;
        bottom: 120px !important;
        right: 20px !important;
        width: 56px !important;
        height: 56px !important;
        background: rgba(255, 255, 255, 0.08) !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        cursor: pointer !important;
        z-index: 999 !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
        transition: all 0.2s !important;
    }
    
    /* Скрываем плюсик на странице друзей и диалогов */
    #FriendSite:not(.hidden) ~ .create-post-btn,
    #mainsite3:not(.hidden) ~ .create-post-btn {
        display: none !important;
    }
    
    .create-post-btn svg {
        width: 28px !important;
        height: 28px !important;
        color: rgba(255, 255, 255, 0.9) !important;
    }
    
    .create-post-btn:active {
        transform: scale(0.95) !important;
        background: rgba(255, 255, 255, 0.12) !important;
    }
    
    .create-post-btn svg {
        width: 28px !important;
        height: 28px !important;
        color: white !important;
    }
}

/* ===== BOTTOM SHEET ДЛЯ СОЗДАНИЯ ПОСТА ===== */
@media screen and (max-width: 768px) {
    .post-bottom-sheet {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        z-index: 10000;
        align-items: flex-end;
    }
    
    .post-bottom-sheet.active {
        display: flex !important;
    }
    
    .post-sheet-container {
        width: 100%;
        height: calc(100vh - 60px);
        background: #0a0a0a;
        border-radius: 30px 30px 0 0;
        overflow-y: auto;
        animation: slideUp 0.3s ease;
        z-index: 10001;
        display: flex;
        flex-direction: column;
    }
    
    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    
    /* Полоска для свайпа */
    .post-sheet-header {
        position: relative;
        padding: 20px 16px 16px;
        border-bottom: none;
    }
    
    .post-sheet-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 5px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 10px;
    }
    
    .post-sheet-title {
        font-size: 20px;
        font-weight: 700;
        color: white;
        text-align: center;
        margin: 0;
    }
    
    /* Контент */
    .post-sheet-content {
        padding: 12px 16px;
    }
    
    .post-sheet-user {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .post-sheet-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: cover;
    }
    
    .post-sheet-username {
        font-size: 15px;
        font-weight: 600;
        color: white;
    }
    
    /* Поле ввода */
    .post-sheet-textarea {
        width: 100%;
        min-height: 60px;
        max-height: 400px;
        background: transparent;
        border: none;
        color: white;
        font-size: 17px;
        line-height: 1.5;
        resize: none;
        outline: none;
        padding: 0;
        margin-bottom: 8px;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    }
    
    .post-sheet-textarea::placeholder {
        color: rgba(255, 255, 255, 0.4);
    }
    
    /* Превью изображения */
    .post-sheet-preview {
        margin-bottom: 16px;
        position: relative;
    }
    
    .post-sheet-preview img {
        width: 100%;
        border-radius: 16px;
        max-height: 300px;
        object-fit: cover;
    }
    
    .post-sheet-preview-remove {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(10px);
        border-radius: 50%;
        border: none;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
    
    /* Панель инструментов */
    .post-sheet-toolbar {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        border-top: none;
        margin-top: auto;
        background: #0a0a0a;
        position: sticky;
        bottom: 0;
    }
    
    .post-sheet-content {
        flex: 1;
        overflow-y: auto;
    }
    
    .post-sheet-tool-btn {
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.05);
        border: none;
        border-radius: 50%;
        color: rgba(255, 255, 255, 0.7);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .post-sheet-tool-btn:active {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .post-sheet-tool-btn svg {
        width: 20px;
        height: 20px;
    }
    
    /* Кнопка публикации */
    .post-sheet-submit {
        margin-left: auto;
        padding: 10px 24px;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        border-radius: 20px;
        color: white;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .post-sheet-submit:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
    
    .post-sheet-submit:active:not(:disabled) {
        background: rgba(255, 255, 255, 0.15);
    }
    
    /* Скрытый input для файлов */
    .post-sheet-file-input {
        display: none;
    }
}


/* Дополнительное скрытие блоков создания постов */
@media screen and (max-width: 768px) {
    /* Скрываем все элементы связанные с созданием постов */
    #mainsite .post-box,
    #mainsite2 .post-box,
    section .post-box,
    .post-input-area,
    .post-actions,
    #profilePostBox,
    #profilePostAvatar,
    #profilePostInput,
    #profilePreview,
    #profileUploadIcon,
    #profileCreatePostBtn,
    #postAvatar,
    #postInput,
    #feedPreview,
    #uploadIcon,
    #createPostBtn:not(#mobileCreatePostBtn) {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        width: 0 !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* Показываем только мобильную кнопку */
    #mobileCreatePostBtn {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}


/* Скрываем плюсик когда body имеет класс hide-create-btn */
@media screen and (max-width: 768px) {
    body.hide-create-btn .create-post-btn {
        display: none !important;
    }
}


/* Футер модального окна настроек на мобильных */
@media screen and (max-width: 768px) {
    #editProfileModal .modal-footer {
        margin-top: auto;
        padding: 12px 20px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        background: #0a0a0a;
        position: sticky;
        bottom: 0;
        border-top: none;
        display: flex;
        gap: 12px;
    }
    
    #editProfileModal .modal-content {
        flex: 1;
        overflow-y: auto;
        padding: 12px 16px;
    }
    
    /* Стили для кнопок в футере */
    #editProfileModal .modal-footer button {
        flex: 1;
        padding: 12px 24px;
        border-radius: 20px;
        font-size: 15px;
        font-weight: 600;
        border: none;
        cursor: pointer;
        transition: opacity 0.2s;
    }
    
    #editProfileModal .modal-footer button:active {
        opacity: 0.8;
    }
}


/* Меню настроек (иконки) на мобильных */
@media screen and (max-width: 768px) {
    .settings-menu {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 8px !important;
        padding: 12px 8px !important;
        border-bottom: none !important;
        background: #0a0a0a !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
    }
    
    .settings-sidebar {
        border-right: none !important;
        border-bottom: none !important;
    }
    
    .settings-menu-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 4px !important;
        padding: 10px 12px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border-radius: 16px !important;
        border: none !important;
        cursor: pointer !important;
        transition: background 0.2s !important;
        min-width: 60px !important;
        flex-shrink: 0 !important;
    }
    
    .settings-menu-item.active {
        background: rgba(255, 255, 255, 0.15) !important;
    }
    
    .settings-menu-item:active {
        background: rgba(255, 255, 255, 0.1) !important;
    }
    
    .settings-menu-item svg {
        width: 22px !important;
        height: 22px !important;
        color: rgba(255, 255, 255, 0.9) !important;
    }
    
    .settings-menu-item span {
        display: none !important;
    }
}

/* ===== ИСПРАВЛЕНИЕ ДИАЛОГОВ НА МОБИЛЬНЫХ ===== */
@media screen and (max-width: 768px) {
    /* Контейнер сообщений */
    .dialog-messages {
        padding: 20px 12px 140px 12px !important;
        gap: 12px !important;
    }
    
    /* Кнопка "опустить вниз" для мобильных */
    .scroll-to-bottom-btn {
        bottom: 94px !important;
        right: 25px !important;
        width: 44px !important;
        height: 44px !important;
        padding: 12px !important;
    }
    
    .scroll-to-bottom-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    /* Обертка сообщения */
    .dialog-msg-wrapper {
        display: flex !important;
        align-items: flex-end !important;
        gap: 8px !important;
        max-width: 85% !important;
        margin-bottom: 8px !important;
        clear: both !important;
    }
    
    .dialog-msg-wrapper.me {
        flex-direction: row-reverse !important;
        margin-left: auto !important;
        margin-right: 0 !important;
    }
    
    .dialog-msg-wrapper.them {
        flex-direction: row !important;
        margin-left: 0 !important;
        margin-right: auto !important;
    }
    
    /* Аватар */
    .dialog-msg-avatar {
        width: 32px !important;
        height: 32px !important;
        border-radius: 50% !important;
        flex-shrink: 0 !important;
        align-self: flex-end !important;
    }
    
    /* Само сообщение */
    .dialog-message {
        padding: 10px 14px !important;
        border-radius: 18px !important;
        max-width: 100% !important;
        display: inline-block !important;
        word-break: break-word !important;
    }
    
    .dialog-message.from-me {
        background: #2a2a2a !important;
    }
    
    .dialog-message.from-them {
        background: rgba(255, 255, 255, 0.123) !important;
    }
    
    /* Время сообщения */
    .msg-time {
        font-size: 10px !important;
        margin-top: 3px !important;
    }
    
    /* Голосовые сообщения */
    .voice-message {
        padding: 8px 12px !important;
        min-width: 240px !important;
        max-width: 280px !important;
        background: #2b2b2b !important;
        border-radius: 18px !important;
    }
    
    .voice-message.from-me {
        background: #2a2a2a !important;
    }
    
    .voice-message.from-them {
        background: #2b2b2b !important;
    }
    
    /* Плеер голосового сообщения */
    .voice-player {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
    }
    
    .voice-play-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        flex-shrink: 0 !important;
    }
    
    .voice-waveform {
        flex: 1 !important;
        min-width: 0 !important;
        height: 36px !important;
    }
    
    .voice-bar {
        width: 2px !important;
    }
    
    .voice-time {
        font-size: 11px !important;
        min-width: 40px !important;
        flex-shrink: 0 !important;
    }
    
    /* Убираем автора из сообщений */
    .msg-author {
        display: none !important;
    }
    
    /* Текст в сообщении */
    .msg-text {
        font-size: 15px !important;
        line-height: 1.4 !important;
    }
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ ИСПРАВЛЕНИЯ ДЛЯ МАЛЕНЬКИХ ЭКРАНОВ ===== */
@media screen and (max-width: 480px) {
    .dialog-msg-wrapper {
        max-width: 90% !important;
    }
    
    .voice-message {
        min-width: 200px !important;
        max-width: 240px !important;
    }
    
    .voice-play-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
    }
    
    .voice-waveform {
        height: 32px !important;
    }
}


/* ===== КОНТЕКСТНОЕ МЕНЮ ДЛЯ МОБИЛЬНЫХ ===== */

@media screen and (max-width: 768px) {
    .message-context-menu {
        min-width: 250px;
        border-radius: 16px;
        background: #2a2a2a;
    }
    
    .context-menu-item {
        padding: 16px 20px;
        font-size: 16px;
    }
    
    .menu-icon {
        font-size: 20px;
        width: 28px;
    }
    
    .menu-text {
        font-size: 16px;
    }
    
    /* Режим выделения на мобильных */
    
    .selection-mode .dialog-msg-wrapper::before {
        right: 12px;
        width: 24px;
        height: 24px;
        border-width: 2.5px;
    }
    
    .selection-mode .dialog-msg-wrapper.selected::after {
        right: 17px;
        font-size: 16px;
    }
    
    .selection-mode .dialog-msg-wrapper.me::before {
        right: auto;
        left: 12px;
    }
    
    .selection-mode .dialog-msg-wrapper.me.selected::after {
        right: auto;
        left: 17px;
    }
    
    /* Увеличиваем отступ на мобильных */
    .selection-mode .dialog-message {
        margin-right: 50px;
    }
    
    .selection-mode .dialog-msg-wrapper.me .dialog-message {
        margin-right: 0;
        margin-left: 50px;
    }
    
    .selection-panel {
        padding: 14px 16px;
        gap: 10px;
        min-height: 56px;
    }
    
    .selection-panel button {
        padding: 10px 14px;
        font-size: 15px;
    }
    
    .selection-cancel {
        padding: 10px 8px;
        font-size: 16px;
    }
    
    .selection-count {
        font-size: 15px;
    }
    
    /* Превью ответа на мобильных */
    
    .reply-preview {
        padding: 12px 16px;
        margin-bottom: 12px;
    }
    
    .reply-preview-content {
        font-size: 14px;
    }
    
    .reply-cancel {
        font-size: 20px;
        padding: 8px 12px;
    }
    
    /* Закрепленные сообщения на мобильных */
    
    .pinned-messages-container {
        top: 90px !important; /* На мобильных шапка может быть чуть меньше, отступ 20px */
        border-radius: 12px !important;
        max-height: 120px;
    }
    
    .pinned-message {
        padding: 14px 16px;
        min-height: 52px;
    }
    
    .pinned-icon {
        font-size: 18px;
    }
    
    .pinned-text {
        font-size: 15px;
    }
    
    .unpin-btn {
        font-size: 20px;
        padding: 6px 10px;
    }
    
    /* Уведомления на мобильных */
    
    .message-notification {
        top: 80px;
        padding: 14px 28px;
        font-size: 15px;
        max-width: 90%;
    }
}


/* ===== ЭМОДЗИ ПИКЕР НА МОБИЛЬНЫХ ===== */
@media screen and (max-width: 768px) {
    .emoji-picker {
        width: calc(100vw - 20px) !important;
        max-width: 350px !important;
        height: 350px !important;
        left: 10px !important;
        right: 10px !important;
        bottom: 90px !important;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(7, 1fr) !important;
    }
    
    .emoji-item {
        width: 32px !important;
        height: 32px !important;
        font-size: 20px !important;
    }
}

/* ===== МОДАЛЬНОЕ ОКНО ВЫХОДА (МОБИЛЬНАЯ ВЕРСИЯ) ===== */
@media screen and (max-width: 768px) {
  .logout-modal-container {
    border-radius: 24px 24px 0 0;
    max-height: 85vh;
  }
  
  .logout-modal-header {
    padding: 20px 24px;
  }
  
  .logout-modal-content {
    padding: 20px 24px;
  }
  
  .saved-account-item {
    padding: 14px;
  }
  
  .saved-account-avatar {
    width: 40px;
    height: 40px;
  }
  
  .logout-modal-btn {
    padding: 14px 18px;
    font-size: 14px;
  }
}

@media screen and (max-width: 480px) {
  .logout-modal-header h2 {
    font-size: 18px;
  }
  
  .saved-account-name {
    font-size: 14px;
  }
  
  .saved-account-username {
    font-size: 12px;
  }
}


/* ===== ФОРМА ВЕРИФИКАЦИИ НА МОБИЛЬНЫХ ===== */
@media screen and (max-width: 768px) {
    #verifyForm {
        padding: 0;
    }
    
    #verifyForm h2 {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    #verifyForm p {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .verify-code-inputs {
        gap: 6px;
        margin-bottom: 16px;
    }
    
    .verify-code-input {
        width: 44px !important;
        height: 52px !important;
        font-size: 22px !important;
        border-radius: 10px !important;
    }
}

@media screen and (max-width: 480px) {
    .verify-code-inputs {
        gap: 4px;
    }
    
    .verify-code-input {
        width: 40px !important;
        height: 48px !important;
        font-size: 20px !important;
    }
}

/* ===== АДАПТАЦИЯ AUTH CARD ===== */
@media screen and (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
        max-width: 100%;
    }
    
    .auth-card h1 {
        font-size: 28px;
        margin-bottom: 20px;
    }
}
