body { font-family: sans-serif; margin: 0; background: #eee; }
.container { display: flex; height: 100vh; max-width: 1200px; margin: 0 auto; background: white; }
.sidebar { 
    width: 300px; 
    border-right: 
        1px solid #ccc; 
    display: flex; 
    flex-direction: column; 
    background: #f9f9f9; 
    overflow-y: auto;          /* добавляем прокрутку */
    max-height: 100vh;         /* ограничиваем высоту */
}
.user-info { padding: 10px; border-bottom: 1px solid #ccc; display: flex; justify-content: space-between; }
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    position: relative;
}
#messages { flex: 1; border: 1px solid #ddd; overflow-y: auto; margin-bottom: 10px; padding: 10px; }
.chat-item { padding: 15px; cursor: pointer; border-bottom: 1px solid #eee; }
.chat-item.active { background: #d0e7ff; } /* светло-голубой */
.chat-item:hover { background: #e0e0e0; } /* более серый при наведении */
.hidden { display: none !important; }
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; }
.modal-content { background: white; padding: 20px; border-radius: 8px; width: 300px; }
.input-area {
    display: flex;
    gap: 5px;
    align-items: center;
}

#selected-file-name {
    font-size: 0.8em;
    color: #666;
    max-width: 150px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.message img {
    max-width: 400px;
    max-height: 400px;
    width: auto;
    height: auto;
    border-radius: 8px;
    margin-top: 5px;
    cursor: pointer; /* показывает, что картинка кликабельна */
}
/* Многострочное поле ввода */
#msg-input {
    flex: 1;
    padding: 8px;
    resize: vertical;
    min-height: 36px;
    max-height: 120px;
    font-family: inherit;
    line-height: 1.4;
}

/* Индикатор отправки по Enter */
.send-hint {
    font-size: 0.7em;
    color: #888;
    margin-left: 5px;
    font-style: italic;
}

/* Стили для вкладок */
.tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.tab-button { padding: 10px; cursor: pointer; border: 1px solid #ccc; background: #f0f0f0; }
.tab-button.active { background: #007bff; color: white; }
.auth-form { max-width: 300px; margin: auto; }
.auth-form input { display: block; width: 100%; margin-bottom: 10px; padding: 8px; }
#chat-header { display: flex; justify-content: space-between; align-items: center; }
#edit-group-btn { padding: 5px 10px; font-size: 0.8em; }

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #ccc;
}

.user-avatar {
    position: relative;
    width: 40px;
    height: 40px;
}

    .user-avatar img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid #ddd;
    }

.change-avatar-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    border: none;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Сообщения с аватарками */
.message {
    display: flex;
    align-items: flex-start; /* Выравнивание по верхнему краю */
    gap: 10px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.message-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

    .message-avatar img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
    }

.message-content {
    flex: 1;
    min-width: 0; /* Чтобы текст не выталкивал аватар */
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.message-sender {
    font-weight: bold;
    color: #333;
}

.message-time {
    font-size: 0.75em;
    color: #999;
}

.message-text {
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.5;
    margin-top: 4px;
}

.message-file {
    margin-top: 5px;
}

    .message-file img {
        max-width: 400px;
        max-height: 400px;
        border-radius: 8px;
        cursor: pointer;
    }

    .message-file a {
        color: #007bff;
        text-decoration: none;
    }

        .message-file a:hover {
            text-decoration: underline;
        }

.chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.chat-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.unread-badge {
    background-color: orange;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8em;
    margin-left: auto;
    min-width: 20px;
    text-align: center;
    font-weight: bold;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    position: relative;
}

    .chat-item .unread-badge {
        margin-left: auto;
    }

.version {
    position: fixed;
    bottom: 10px;
    right: 20px;
    font-size: 12px;
    color: #888;
    background: rgba(255, 255, 255, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    pointer-events: none; /* чтобы не мешать кликам */
}

#media-modal .modal-content.media-content {
    background: transparent;
    box-shadow: none;
    width: 95vw; /* почти вся ширина окна */
    height: 95vh; /* почти вся высота окна */
    max-width: 95vw;
    max-height: 95vh;
    padding: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#media-modal .close {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

#media-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* предотвращает появление полос прокрутки */
}

    #media-container img,
    #media-container video {
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: 4px;
        display: block;
    }

    /* Статус-доты */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 5px;
}

.status-dot.online {
    background-color: #19ff19; /* зелёный */
}

.status-dot.offline {
    background-color: #9e9e9e; /* серый */
}

/* Для чат-листа */
.chat-item .status-dot {
    margin-left: 5px;
}

/* Для списка участников группы */
.member-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.member-name {
    font-weight: 500;
}

/* Панель ответа */
.reply-bar {
    background: #e3f2fd;
    padding: 5px 10px;
    border-bottom: 1px solid #90caf9;
    font-size: 0.9em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cancel-reply {
    cursor: pointer;
    font-weight: bold;
    color: #f44336;
    margin-left: 10px;
}

/* Контекстное меню */
.context-menu {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    border-radius: 4px;
    z-index: 10000;
    min-width: 150px;
}

.context-menu-item {
    padding: 8px 12px;
    cursor: pointer;
    position: relative;
}

    .context-menu-item:hover {
        background: #f0f0f0;
    }

.context-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 120px;
}

/* Информация об ответе в сообщении */
.reply-info {
    font-size: 0.85em;
    color: #555;
    background: #f1f1f1;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 5px;
    border-left: 3px solid #2196F3;
}

/* Редактирование сообщения */
.edit-message-area {
    margin-top: 5px;
}

    .edit-message-area textarea {
        width: 100%;
        padding: 5px;
        border: 1px solid #ccc;
        border-radius: 4px;
        resize: vertical;
    }

    .edit-message-area button {
        margin-right: 5px;
        margin-top: 5px;
        padding: 4px 10px;
    }

.forwarded-info {
    font-size: 0.85em;
    color: #888;
    background: #f9f9f9;
    padding: 2px 5px;
    border-radius: 4px;
    margin-bottom: 5px;
    border-left: 3px solid #ff9800;
}

.big-button {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

    .big-button:hover {
        background-color: #0056b3;
    }

.subscribers-count {
    font-size: 0.8em;
    color: #666;
    margin-left: 5px;
}

.upload-progress {
        margin: 10px 0;
        padding: 10px;
        background: #f0f0f0;
        border-radius: 4px;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .progress-bar-container {
        flex: 1;
        height: 20px;
        background: #ddd;
        border-radius: 10px;
        overflow: hidden;
    }
    .progress-bar {
        height: 100%;
        background: #4CAF50;
        transition: width 0.3s ease;
    }
    #upload-progress-text {
        min-width: 50px;
        font-size: 0.9em;
        color: #666;
    }
	
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    min-width: 300px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1001;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

#media-modal {
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
}

#media-modal .modal-content.media-content {
    background: transparent;
    box-shadow: none;
    padding: 0;
    width: auto;
    min-width: auto;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#media-modal.hidden {
    display: none !important;
}

/* Стили для аватарок в списке участников */
.member-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.member-item:hover {
    background-color: #f5f5f5;
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.member-name {
    font-weight: 500;
    font-size: 1.1em;
}

/* Анимация для модальных окон */
.modal {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.modal.hidden {
    display: none !important;
}

/* Курсор для крестика */
.close {
    cursor: pointer !important;
}

.modal .close {
    cursor: pointer !important;
}

#media-container .close {
    position: absolute;
    top: -40px;
    right: -40px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    z-index: 10001;
    transition: background-color 0.2s;
}

#media-modal .close:hover {
    background: rgba(255, 0, 0, 0.7);
}

#media-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#media-container img,
#media-container video {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.chat-last-message {
    font-size: 0.8em;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* Для мобильных */
@media only screen and (max-width: 768px) {
    .chat-last-message {
        max-width: 200px;
        font-size: 0.9em;
    }
}


/* Мобильная адаптация */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        height: 100vh;
        max-width: 100%;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #ccc;
    }
    
    .main {
        height: 60vh;
        padding: 5px;
    }
    
    #messages {
        height: calc(60vh - 120px);
    }
    
    .chat-item {
        padding: 12px;
    }
    
    .chat-item-avatar {
        width: 40px;
        height: 40px;
    }
    
    .input-area {
        position: sticky;
        bottom: 0;
        background: white;
        padding: 5px 0;
    }
    
    #msg-input {
        font-size: 16px; /* Предотвращает зум на iPhone */
        padding: 10px;
    }
    
    .modal-content {
        width: 90%;
        max-width: 90%;
        margin: 20px;
    }
    
    .actions {
        flex-wrap: wrap;
    }
    
    .actions button {
        flex: 1 1 calc(50% - 5px);
        min-width: 120px;
        padding: 12px;
        font-size: 14px;
    }
    
    .message {
        padding: 8px;
    }
    
    .message-avatar {
        width: 35px;
        height: 35px;
    }
    
    .message img {
        max-width: 100%;
        max-height: 200px;
    }
    
    .user-info {
        padding: 8px;
    }
    
    .user-info h3 {
        font-size: 16px;
    }
    
    #chat-header {
        flex-wrap: wrap;
        gap: 5px;
        padding: 8px 0;
    }
    
    #chat-header button {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    /* Улучшаем тач-цели */
    button, 
    .chat-item,
    .close,
    .context-menu-item {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Контекстное меню для мобильных */
    .context-menu {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        border-radius: 15px 15px 0 0;
        transform: translateY(0);
    }
    
    .context-menu-item {
        padding: 15px;
        text-align: center;
        border-bottom: 1px solid #eee;
    }
    
    .context-submenu {
        position: static;
        box-shadow: none;
        border: none;
        margin-top: 5px;
    }
    
    /* Модальные окна на мобильных */
    .modal-content {
        max-height: 80vh;
        overflow-y: auto;
    }
    
    #group-members-list {
        max-height: 50vh !important;
    }
    
    /* Прогресс-бар загрузки */
    .upload-progress {
        flex-direction: column;
        align-items: stretch;
    }
    
    .progress-bar-container {
        width: 100%;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .actions button {
        flex: 1 1 100%;
        margin: 2px 0;
    }
    
    .user-info {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
    
    .user-avatar {
        margin: 0 auto;
    }
    
    .message-header {
        flex-wrap: wrap;
    }
    
    .message-time {
        margin-left: 0;
    }
    
    #chat-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    #chat-header button {
        width: 100%;
        margin: 2px 0;
    }
}

/* Мобильная адаптация - ВЕРТИКАЛЬНЫЙ РЕЖИМ */
@media orientation: portrait {
    .container {
        flex-direction: column;
        height: 100vh;
        max-width: 100%;
    }
    
    .sidebar {
        width: 100%;
        height: 35vh; /* Увеличиваем высоту сайдбара */
        max-height: 35vh;
        border-right: none;
        border-bottom: 1px solid #ccc;
        overflow-y: auto;
    }
    
    .main {
        height: 65vh; /* Увеличиваем высоту основной области */
        padding: 8px;
        display: flex;
        flex-direction: column;
    }
    
    #messages {
        flex: 1;
        height: auto;
        max-height: none;
        font-size: 16px; /* Увеличиваем размер шрифта */
        padding: 12px;
    }
    
    .message {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .message-avatar {
        width: 45px; /* Увеличиваем аватарки */
        height: 45px;
    }
    
    .message-sender {
        font-size: 16px;
    }
    
    .message-time {
        font-size: 13px;
    }
    
    .message-text {
        font-size: 16px;
        line-height: 1.5;
    }
    
    .chat-item {
        padding: 15px;
    }
    
    .chat-item-avatar {
        width: 45px; /* Увеличиваем аватарки в списке */
        height: 45px;
    }
    
    .chat-name {
        font-size: 16px;
        font-weight: 500;
    }
    
    .input-area {
        padding: 10px 0;
        gap: 8px;
    }
    
    #msg-input {
        font-size: 16px;
        padding: 12px;
        min-height: 45px;
        border-radius: 20px;
        background: #f5f5f5;
        border: 1px solid #ddd;
    }
    
    .input-area button {
        min-width: 50px;
        min-height: 50px;
        font-size: 20px;
        border-radius: 25px;
        background: #007bff;
        color: white;
        border: none;
    }
    
    .input-area button:active {
        background: #0056b3;
    }
    
    #selected-file-name {
        font-size: 14px;
        max-width: 120px;
    }
    
    .actions {
        padding: 12px;
        gap: 8px;
    }
    
    .actions button {
        flex: 1 1 calc(50% - 4px);
        min-height: 50px;
        font-size: 15px;
        border-radius: 25px;
        background: #e0e0e0;
        border: none;
        font-weight: 500;
    }
    
    .actions button:active {
        background: #d0d0d0;
    }
    
    .user-info {
        padding: 15px;
    }
    
    .user-info h3 {
        font-size: 18px;
        margin: 0;
    }
    
    .user-avatar {
        width: 50px;
        height: 50px;
    }
    
    .user-avatar img {
        border-width: 2px;
    }
    
    #chat-header {
        padding: 12px 0;
        gap: 8px;
        font-size: 18px;
        font-weight: bold;
    }
    
    #chat-header button {
        min-height: 44px;
        font-size: 14px;
        padding: 8px 15px;
        border-radius: 20px;
        background: #f0f0f0;
        border: 1px solid #ddd;
    }
    
    #chat-header button:active {
        background: #e0e0e0;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 20px;
    }
    
    .modal-content h4 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .modal-content input {
        font-size: 16px;
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 8px;
        border: 1px solid #ddd;
    }
    
    .modal-buttons {
        gap: 10px;
    }
    
    .modal-buttons button {
        flex: 1;
        min-height: 50px;
        font-size: 16px;
        border-radius: 25px;
        border: none;
    }
    
    .modal-buttons button:first-child {
        background: #007bff;
        color: white;
    }
    
    .modal-buttons button:last-child {
        background: #f0f0f0;
    }
    
    /* Увеличиваем крестик в модальных окнах */
    .close {
        width: 44px;
        height: 44px;
        font-size: 28px;
    }
    
    /* Список участников группы */
    .member-item {
        padding: 12px;
    }
    
    .member-avatar {
        width: 45px;
        height: 45px;
    }
    
    .member-name {
        font-size: 16px;
    }
    
    .status-dot {
        width: 12px;
        height: 12px;
    }
    
    /* Прогресс-бар загрузки */
    .upload-progress {
        padding: 15px;
    }
    
    .progress-bar-container {
        height: 25px;
    }
    
    #upload-progress-text {
        font-size: 14px;
    }
    
    /* Контекстное меню */
    .context-menu {
        font-size: 18px;
    }
    
    .context-menu-item {
        padding: 18px;
        border-bottom: 1px solid #eee;
    }
    
    /* Информация о пересланных сообщениях и ответах */
    .forwarded-info,
    .reply-info {
        font-size: 14px;
        padding: 6px 10px;
        margin-bottom: 8px;
    }
}

/* Для очень маленьких экранов в вертикальном режиме */
@media (max-width: 380px) and (orientation: portrait) {
    .sidebar {
        height: 30vh;
        max-height: 30vh;
    }
    
    .main {
        height: 70vh;
    }
    
    .actions button {
        flex: 1 1 100%;
    }
    
    .message-avatar {
        width: 40px;
        height: 40px;
    }
    
    .chat-item-avatar {
        width: 40px;
        height: 40px;
    }
    
    #chat-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    #chat-header button {
        width: 100%;
    }
}

/* Горизонтальный режим - оставляем как есть */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        width: 280px;
        height: 100vh;
        max-height: 100vh;
    }
    
    .main {
        flex: 1;
        height: 100vh;
    }
    
    #messages {
        height: calc(100vh - 140px);
    }
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    cursor: pointer;
    vertical-align: middle;
}

.unread-separator {
    text-align: center;
    margin: 10px 0;
    position: relative;
}

    .unread-separator span {
        background: #007bff;
        color: white;
        padding: 2px 10px;
        border-radius: 20px;
        font-size: 0.8em;
        font-weight: bold;
        display: inline-block;
    }

    .unread-separator::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        height: 1px;
        background: #007bff;
        z-index: -1;
    }

#scroll-to-bottom-btn {
    position: absolute;
    bottom: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: opacity 0.2s;
    z-index: 100;
}

    #scroll-to-bottom-btn.hidden {
        display: none;
    }

    #scroll-to-bottom-btn:hover {
        background-color: #0056b3;
    }

@media (max-width: 768px) {
    #scroll-to-bottom-btn {
        bottom: 100px;
        right: 15px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
}

.forward-chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.forward-chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.forward-chat-name {
    flex: 1;
    font-size: 14px;
}

.forward-chat-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

body.modal-open {
    overflow: hidden;
}

/* Drag & Drop индикация */
body.drag-over::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 123, 255, 0.1);
    border: 3px dashed #007bff;
    pointer-events: none;
    z-index: 9999;
}

/* Контейнер прикреплённых файлов */
.attached-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 8px;
}

    .attached-files.hidden {
        display: none;
    }

/* Отдельный файл в списке */
.attached-file-item {
    display: inline-flex;
    align-items: center;
    background: #e0e0e0;
    border-radius: 16px;
    padding: 4px 8px;
    font-size: 0.9em;
}

    .attached-file-item .file-name {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Крестик удаления */
    .attached-file-item .remove-file {
        margin-left: 6px;
        cursor: pointer;
        font-weight: bold;
        width: 18px;
        height: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #ccc;
        color: white;
        transition: background 0.2s;
    }

        .attached-file-item .remove-file:hover {
            background: #ff4444;
        }

.settings-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
    margin-left: auto; /* прижмёт к правому краю */
}

.role-badge {
    display: inline-block;
    font-size: 0.7em;
    font-weight: 600;
    padding: 2px 6px;
    margin-left: 6px;
    border-radius: 12px;
    color: white;
    text-transform: lowercase;
    vertical-align: middle;
}

    .role-badge.owner {
        background-color: #ffc107; /* золотой */
        color: #212529;
    }

    .role-badge.moderator {
        background-color: #17a2b8; /* бирюзовый */
        color: white;
    }

/* Для мобильных устройств можно увеличить размер */
@media (max-width: 768px) {
    .role-badge {
        font-size: 0.8em;
        padding: 3px 8px;
    }
}

.bugreport-corner {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000; /* выше всех модалок */
    padding: 8px 12px;
    background-color: #ff9800;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

    .bugreport-corner:hover {
        background-color: #f57c00;
    }

/* На мобильных устройствах */
@media (max-width: 768px) {
    .bugreport-corner {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 14px;
    }
}