/* ============================================
   MINI CHAT WIDGET - iOS 26 STYLE
   Версия: 4.0
   ============================================ */

:root {
    --ios-bg-page: #1a1a2e url("data:image/svg+xml,%3Csvg width=\"60\" height=\"60\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cpath d=\"M30 5 Q40 15 30 30 Q20 45 30 55\" stroke=\"rgba(255,255,255,.03)\" fill=\"none\"/%3E%3C/svg%3E") repeat;
    --ios-bg-header: #1e1b2e;
    --ios-bg-input: rgba(255,255,255,0.04);
    --ios-bg-message-incoming: #2a2a3a;
    --ios-bg-message-outgoing: #3a2f50;
    --ios-text-primary: #ffffff;
    --ios-text-secondary: #8e8e98;
    --ios-text-message-incoming: #e8e8f0;
    --ios-text-message-outgoing: #ffffff;
    --ios-border: rgba(255, 255, 255, 0.08);
    --ios-shadow: rgba(0, 0, 0, 0.4);
    --ios-accent: #5b6af0;
    --ios-danger: #ff3b30;
    --ios-success: #34c759;
    --ios-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --widget-width: 380px;
    --widget-height: 600px;
    --border-radius-lg: 24px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

body:not(.night-theme), body.day-theme {
    --ios-bg-page: #e8e8ec;
    --ios-bg-header: #f0edf4;
    --ios-bg-input: #ffffff;
    --ios-bg-message-incoming: #ffffff;
    --ios-bg-message-outgoing: #f5f0fa;
    --ios-text-primary: #1c1c1e;
    --ios-text-secondary: #8e8e93;
    --ios-text-message-incoming: #1c1c1e;
    --ios-text-message-outgoing: #1d1d1f;
    --ios-border: rgba(0, 0, 0, 0.06);
    --ios-shadow: rgba(0, 0, 0, 0.08);
    --ios-accent: #5b6af0;
}

/* Кнопка открытия чата */
#mini-chat-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    background: linear-gradient(135deg, #5b6af0, #8b5cf6); box-shadow: 0 0 16px rgba(139,92,246,0.4), 0 4px 20px rgba(0,0,0,0.3);
    box-shadow: 0 4px 16px var(--ios-shadow);
    transition: all var(--transition-normal);
}

#mini-chat-button i {
    color: white;
    font-size: 24px;
}

/* Виджет - фиксированная структура */
#mini-chat-widget {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: var(--widget-width);
    height: var(--widget-height);
    background: var(--ios-bg-page);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    box-shadow: 0 20px 60px var(--ios-shadow);
    overflow: hidden;
    transform: translateY(100%) scale(0.95);
    opacity: 0;
    transition: all var(--transition-slow);
    border: 1px solid var(--ios-border);
}

#mini-chat-widget.open {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Шапка - ВСЕГДА ВИДИМА, НЕ ПРОКРУЧИВАЕТСЯ */
#mini-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin: 4px 6px 0 6px;
    background: var(--ios-bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    height: 56px;
    min-height: 56px;
    flex-shrink: 0;
    border: 2px solid var(--ios-border);
    border-radius: 18px;
    position: relative;
    z-index: 10;
}

#mini-chat-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255,255,255,0.08);
    color: var(--ios-text-secondary);
    flex-shrink: 0;
}
#mini-chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    max-width: 140px;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--ios-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#mini-chat-status.status-online .status-dot { background: #34c759; }
#mini-chat-status.status-online .status-text { color: #34c759; }
#mini-chat-status.status-offline .status-dot { background: var(--ios-text-secondary); }
#mini-chat-close:hover { background: rgba(255,255,255,0.15);
    color: #ff3b30;
}

#mini-chat-header-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
#mini-chat-header-buttons button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    cursor: pointer;
    border: none;
    color: var(--ios-text-secondary);
    font-size: 16px;
    transition: all 0.2s;
}
#mini-chat-header-buttons button:hover {
    background: rgba(91,106,240,0.2);
    color: #8b5cf6;
}
#mini-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--ios-bg-page);
    min-height: 0;
    /* Пункт 9: Эффект затухания старых сообщений */
}

/* Сообщения - цвета поменяны местами */
.incoming-msg,
.outgoing-msg {
    max-width: 78%;
    padding: 10px 14px;
    font-size: 16px;
    line-height: 1.45;
    word-break: break-word;
    font-family: var(--ios-font);
    border-radius: 20px !important;
}

/* Входящие сообщения (слева) - тёмно-серые в ночной, светло-серые в дневной */
.incoming-msg {
    align-self: flex-start;
    background: var(--ios-bg-message-incoming);
    color: var(--ios-text-message-incoming);
}

/* Исходящие сообщения (справа) - тёмно-синие в ночной, синие в дневной */
.outgoing-msg {
    align-self: flex-end;
    background: var(--ios-bg-message-outgoing);
    color: var(--ios-text-message-outgoing);
}

/* Эмодзи */
.emoji-msg {
    background: transparent !important;
    padding: 4px 0 !important;
}

.emoji-msg .msg-text {
    font-size: 44px !important;
    line-height: 1.2 !important;
    background: transparent !important;
}

.emoji-msg.single-emoji .msg-text {
    font-size: 64px !important;
}

.incoming-msg.emoji-msg,
.outgoing-msg.emoji-msg {
    background: transparent !important;
}

/* Разделитель времени - без фона */
.msg-time-divider {
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    font-family: var(--ios-font);
    color: var(--ios-text-secondary);
    margin: 8px 0;
    padding: 3px 14px;
    background: transparent !important;
    border-radius: 50px;
    align-self: center;
}

/* Ссылки в сообщениях - без фона */
.msg-text a {
    color: var(--ios-accent);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.msg-text a:hover {
    text-decoration: underline;
}

/* Исходящие сообщения - ссылки белые */
.outgoing-msg .msg-text a {
    color: #ffffff;
}

/* Входящие сообщения - ссылки синие */
.incoming-msg .msg-text a {
    color: #007aff;
}

/* Дневная тема */
body.day-theme .outgoing-msg .msg-text a {
    color: #ffffff;
}

body.day-theme .incoming-msg .msg-text a {
    color: #007aff;
}

/* Блок ввода - ФИКСИРОВАННЫЙ ВНИЗУ, ВСЕ ЭЛЕМЕНТЫ В ОДНОЙ СТРОКЕ */
#mini-chat-input-block {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin: 0 6px 6px 6px;
    background: var(--ios-bg-header);
    border: 2px solid var(--ios-border);
    border-radius: 18px;
    height: 56px;
    min-height: 56px;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Кнопка прикрепления */
#mini-chat-add-file {
    width: 40px;
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    border: none;
    color: var(--ios-text-secondary);
    font-size: 20px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

#mini-chat-add-file:hover {
    background: rgba(128, 128, 128, 0.15);
}

/* Обертка поля ввода */
.input-wrapper {
    flex: 1;
    background: var(--ios-bg-input);
    border-radius: 18px;
    padding: 3px 14px;
    border: 0.5px solid var(--ios-border);
    min-width: 0;
    box-sizing: border-box;
}

/* Поле ввода */
#mini-chat-message {
    width: 100%;
    padding: 4px 0 2px 0;
    border: none;
    background: transparent;
    color: var(--ios-text-primary);
    font-size: 16px;
    font-family: var(--ios-font);
    line-height: 1.2;
    resize: none;
    outline: none;
    overflow-y: auto;
    min-height: 0;
    max-height: 100px;
    box-sizing: border-box;
}

#mini-chat-message::placeholder {
    color: var(--ios-text-secondary);
}

/* Кнопка отправки */
#mini-chat-send {
    width: 40px;
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    border: none;
    color: var(--ios-text-secondary);
    font-size: 20px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

#mini-chat-send:hover {
    background: rgba(128, 128, 128, 0.15);
}


/* Верхняя панель с кнопкой три точки */
.call-top-bar {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
}

/* Кнопка три точки в правом верхнем углу */
.call-more-btn-top {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(128, 128, 128, 0.3);
    backdrop-filter: blur(10px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
}

.call-more-btn-top:active {
    transform: scale(0.95);
}

/* Аватар (круг с инициалами) */
.call-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.call-avatar .initials {
    font-size: 48px;
    font-weight: 500;
    font-family: var(--ios-font);
    color: white;
}

/* Имя */
.call-name {
    font-size: 34px;
    font-weight: 600;
    font-family: var(--ios-font);
    color: white;
    margin-bottom: 8px;
    text-align: center;
}

/* Статус */
.call-status {
    font-size: 17px;
    font-family: var(--ios-font);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

/* Таймер звонка */
.call-timer {
    font-size: 48px;
    font-weight: 300;
    font-family: monospace;
    color: white;
    letter-spacing: 2px;
    margin: 10px 0;
}

/* Контейнер для кнопок */
.call-buttons-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 10;
    position: relative;
    margin-top: auto;
    margin-bottom: 40px;
}

/* Ряд кнопок */
.call-buttons-row {
    display: flex;
    justify-content: center;
    gap: 35px;
    width: 100%;
}

/* Кнопка звонка */
.call-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.call-btn:active {
    transform: scale(0.95);
}

.call-btn-icon {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(128, 128, 128, 0.3);
    backdrop-filter: blur(10px);
}

.call-btn-label {
    font-size: 11px;
    font-family: var(--ios-font);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    margin-top: 8px;
}

/* Кнопка принятия звонка */
.call-btn-accept .call-btn-icon {
    background: #34c759;
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.4);
}

.call-btn-accept .call-btn-label {
    color: #34c759;
}

/* Кнопка отклонения/завершения звонка - без текста */
.call-btn-decline .call-btn-icon,
.call-btn-end .call-btn-icon {
    background: #ff3b30;
    box-shadow: 0 4px 16px rgba(255, 59, 48, 0.4);
}

.call-btn-decline .call-btn-label,
.call-btn-end .call-btn-label {
    display: none;
}

/* Меню дополнительных опций */
.call-extra-menu {
    position: absolute;
    top: 70px;
    right: 20px;
    left: auto;
    transform: none;
    width: 280px;
    background: rgba(30, 30, 35, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 14px;
    padding: 12px 0;
    z-index: 15;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
}

.call-extra-menu.hidden {
    display: none;
}

.call-extra-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.call-extra-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.call-extra-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.call-extra-left i {
    width: 24px;
    color: white;
    font-size: 18px;
}

.call-extra-left span {
    color: white;
    font-size: 16px;
    font-family: var(--ios-font);
}

.call-extra-toggle {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
    cursor: pointer;
}

.call-extra-toggle.on {
    background: #34c759;
}

.call-extra-toggle .toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    transition: all 0.2s ease;
}

.call-extra-toggle.on .toggle-slider {
    left: calc(100% - 22px);
}



/* Видео контейнер */
#video-call-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2000;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
}

#video-call-container.hidden {
    display: none;
}

.remote-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

#remote-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remote-video-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 16px 24px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    font-family: var(--ios-font);
}

.remote-video-status.hidden {
    opacity: 0;
    visibility: hidden;
}

.local-video-container {
    position: absolute;
    bottom: 100px;
    right: 20px;
    width: 120px;
    height: 160px;
    border-radius: 18px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 3;
    background: #2a2a2a;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.local-video-container:hover {
    transform: scale(1.05);
}

#local-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.local-video-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-family: var(--ios-font);
    backdrop-filter: blur(5px);
}

.video-controls {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    z-index: 5;
}

.video-control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.video-control-btn.end-call {
    background: #ff3b30;
}

.video-call-info {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 5;
    pointer-events: none;
}

.video-call-timer {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    font-family: monospace;
}

.video-call-peer {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.9);
    padding: 3px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-family: var(--ios-font);
}

/* Адаптивность для iPhone */
@media only screen and (max-width: 428px) {
    #mini-chat-widget {
        width: calc(100vw - 20px) !important;
        height: 80vh !important;
        bottom: 70px !important;
        right: 8px !important;
    }
    
    #mini-chat-header {
        height: 52px !important;
        padding: 6px 12px !important;
    }
    
    #mini-chat-button {
        bottom: 20px !important;
        right: 20px !important;
        width: 52px !important;
        height: 52px !important;
    }
    
    #mini-chat-messages {
        padding: 10px 12px !important;
        /* Адаптация эффекта затухания для мобильных */
    }
    
    .incoming-msg,
    .outgoing-msg {
        max-width: 85% !important;
        font-size: 15px !important;
        padding: 8px 12px !important;
    }
    
    .emoji-msg .msg-text {
        font-size: 40px !important;
    }
    
    .emoji-msg.single-emoji .msg-text {
        font-size: 56px !important;
    }
    
    #mini-chat-input-block {
        padding: 8px 12px !important;
        min-height: 52px !important;
        gap: 6px !important;
    }
    
    #mini-chat-add-file,
    #mini-chat-send {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        max-width: 36px !important;
        font-size: 18px !important;
    }
    
    .input-wrapper {
        padding: 2px 14px !important;
    }
    
    #mini-chat-message {
    font-size: 15px !important;
    padding: 4px 0 2px 0 !important;
    min-height: 18px !important;
    }
    
    .call-more-btn-top {
        width: 36px;
        height: 36px;
    }
    
    .call-avatar {
        width: 100px !important;
        height: 100px !important;
        margin: 15px 0 !important;
    }
    
    .call-avatar .initials {
        font-size: 40px !important;
    }
    
    .call-name {
        font-size: 28px !important;
    }
    
    .call-status {
        font-size: 15px !important;
    }
    
    .call-timer {
        font-size: 40px !important;
    }
    
    .call-btn-icon {
        width: 58px !important;
        height: 58px !important;
    }
    
    .call-buttons-row {
        gap: 25px !important;
    }
    
    .call-extra-menu {
        width: 260px;
        top: 65px;
        right: 15px;
    }
    
    .local-video-container {
        width: 100px !important;
        height: 133px !important;
        bottom: 90px !important;
        right: 12px !important;
    }
    
    .video-control-btn {
        width: 45px !important;
        height: 45px !important;
        font-size: 18px !important;
    }
}

@media only screen and (max-width: 375px) {
    #mini-chat-header {
        height: 48px !important;
        padding: 4px 10px !important;
    }
    
    #mini-chat-status {
        max-width: 100px !important;
    }
    
    .status-text {
        font-size: 10px !important;
    }
    
    .incoming-msg,
    .outgoing-msg {
        font-size: 14px !important;
        padding: 6px 10px !important;
    }
    
    .emoji-msg .msg-text {
        font-size: 36px !important;
    }
    
    .emoji-msg.single-emoji .msg-text {
        font-size: 48px !important;
    }
    
    #mini-chat-input-block {
        padding: 6px 10px !important;
        min-height: 48px !important;
        gap: 5px !important;
    }
    
    #mini-chat-add-file,
    #mini-chat-send {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        font-size: 16px !important;
    }
    
    .input-wrapper {
        padding: 2px 8px !important;
    }
    
    #mini-chat-message {
    font-size: 14px !important;
    padding: 4px 0 2px 0 !important;
    min-height: 16px !important;
    }
    
    .call-more-btn-top {
        width: 32px;
        height: 32px;
    }
    
    .call-avatar {
        width: 85px !important;
        height: 85px !important;
    }
    
    .call-avatar .initials {
        font-size: 34px !important;
    }
    
    .call-name {
        font-size: 24px !important;
    }
    
    .call-timer {
        font-size: 36px !important;
    }
    
    .call-btn-icon {
        width: 52px !important;
        height: 52px !important;
    }
    
    .call-buttons-row {
        gap: 20px !important;
    }
    
    .call-extra-menu {
        width: 240px;
        top: 60px;
        right: 12px;
    }
    
    .local-video-container {
        width: 85px !important;
        height: 113px !important;
        bottom: 80px !important;
    }
    
    .video-control-btn {
        width: 42px !important;
        height: 42px !important;
        font-size: 16px !important;
    }
}

/* Убираем скроллбар */
#mini-chat-messages::-webkit-scrollbar {
    display: none;
}

#mini-chat-messages {
    scrollbar-width: none;
}

/* ============================================
   АНИМАЦИЯ ПОЯВЛЕНИЯ СООБЩЕНИЙ - iMessage STYLE
   Эффект "надувания" от маленького пузырька
   ============================================ */

.incoming-msg,
.outgoing-msg {
    animation: messagePopIn 0.35s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
    transform-origin: bottom;
}

@keyframes messagePopIn {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(8px);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02) translateY(-2px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Для эмодзи сообщений - более пружинистая анимация */
.emoji-msg {
    animation: emojiPopIn 0.3s cubic-bezier(0.34, 1.3, 0.64, 1) forwards !important;
    transform-origin: center;
}

@keyframes emojiPopIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    60% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Анимация для первого сообщения после паузы - более заметный эффект */
.first-message-after-pause {
    animation: messageBouncePop 0.45s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
}

@keyframes messageBouncePop {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(15px);
    }
    40% {
        transform: scale(1.05) translateY(-3px);
    }
    70% {
        transform: scale(0.98) translateY(1px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Анимация для новых сообщений при загрузке истории */
.history-message {
    animation: messageFadeIn 0.2s ease-out forwards;
}

@keyframes messageFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Анимация при исходящем звонке */
.call-orb-container.active .call-orb-1 {
    animation: orbPulse1 2s ease-in-out infinite;
    opacity: 0.6;
}

.call-orb-container.active .call-orb-2 {
    animation: orbPulse2 2s ease-in-out infinite 0.5s;
    opacity: 0.4;
}

@keyframes orbPulse1 {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.6;
    }
}

@keyframes orbPulse2 {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0.3;
    }
}

/* Дневная тема */
body.day-theme .call-orb {
    background: radial-gradient(circle, 
        rgba(139, 92, 246, 0.15) 0%, 
        rgba(91, 106, 240, 0.1) 50%, 
        rgba(59, 130, 246, 0.05) 100%);
}

body.day-theme .call-orb-container.active .call-orb-1 {
    opacity: 0.4;
}

body.day-theme .call-orb-container.active .call-orb-2 {
    opacity: 0.25;
}

/* Адаптивность */
@media only screen and (max-width: 428px) {
    .call-orb-1 {
        width: 160px;
        height: 160px;
    }
    
    .call-orb-2 {
        width: 220px;
        height: 220px;
    }
}

@media only screen and (max-width: 375px) {
    .call-orb-1 {
        width: 140px;
        height: 140px;
    }
    
    .call-orb-2 {
        width: 190px;
        height: 190px;
    }
}

/* ============================================
   МЕНЮ ДЕЙСТВИЙ С СООБЩЕНИЯМИ - iOS 26 STYLE
   Версия: 3.1
   ============================================ */

.message-actions-menu {
    position: fixed;
    background: rgba(28, 28, 30, 0.92);
    backdrop-filter: blur(60px);
    -webkit-backdrop-filter: blur(60px);
    border-radius: 18px;
    padding: 8px;
    min-width: 180px;
    z-index: 10001;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 0 0.5px rgba(255, 255, 255, 0.1);
    animation: menuFadeIn 0.2s ease-out;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@keyframes menuFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.message-action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--ios-font);
    font-size: 17px;
    font-weight: 500;
    background: transparent;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

.message-action-item i {
    width: 24px;
    font-size: 20px;
    text-align: center;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.message-action-item span {
    flex: 1;
    letter-spacing: -0.2px;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Специальные стили для каждой кнопки */
.message-action-item[data-action="edit"] {
    color: #0a84ff;
}

.message-action-item[data-action="delete"] {
    color: #ff3b30;
}

/* Эффект нажатия (iOS style) */
.message-action-item:active {
    background: rgba(128, 128, 128, 0.2);
    transform: scale(0.98);
}

/* Hover эффект для десктопа */
@media (hover: hover) {
    .message-action-item:hover {
        background: rgba(128, 128, 128, 0.1);
    }
}

/* Для десктопа - позиционирование с отступом от сообщения */
@media only screen and (min-width: 429px) {
    .message-actions-menu {
        margin-bottom: 12px;
        transform: translateY(-100%);
    }
}

/* Для мобильных устройств - центрированное меню */
@media only screen and (max-width: 428px) {
    .message-actions-menu {
        width: calc(100vw - 48px);
        max-width: 280px;
        min-width: auto;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        border-radius: 18px;
        padding: 10px;
        animation: menuModalIn 0.2s ease-out;
    }
    
    @keyframes menuModalIn {
        0% {
            opacity: 0;
            transform: translate(-50%, -50%) scale(0.95);
        }
        100% {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
    }
    
    .message-action-item {
        padding: 14px 20px;
        font-size: 17px;
    }
    
    .message-action-item i {
        width: 26px;
        font-size: 22px;
    }
    
    .message-action-item:active {
        background: rgba(128, 128, 128, 0.25);
    }
}

/* Дневная тема */
body.day-theme .message-actions-menu {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(60px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
}

body.day-theme .message-action-item:active {
    background: rgba(0, 0, 0, 0.08);
}

@media (hover: hover) {
    body.day-theme .message-action-item:hover {
        background: rgba(0, 0, 0, 0.05);
    }
}

/* Тёмная тема (дополнительно) */
body.dark-theme .message-actions-menu {
    background: rgba(28, 28, 30, 0.96);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 0 0.5px rgba(255, 255, 255, 0.08);
}

/* Анимация удаления сообщения - простое плавное исчезновение */
.incoming-msg.deleting,
.outgoing-msg.deleting {
    animation: messageFadeOut 0.25s ease-out forwards !important;
}

@keyframes messageFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.95);
        display: none;
    }
}

/* Стили для текстового поля редактирования */
.msg-text textarea {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    resize: none !important;
    width: 100% !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
    padding: 0 !important;
    margin: 0 !important;
    user-select: text !important;
    -webkit-user-select: text !important;
}

.msg-text textarea:focus {
    outline: none !important;
    background: transparent !important;
}

/* Для экранов с высоким разрешением */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .message-actions-menu {
        border-width: 0.5px;
    }
}

/* Адаптация для iPad */
@media only screen and (min-width: 429px) and (max-width: 1024px) {
    .message-actions-menu {
        min-width: 200px;
        padding: 10px;
    }
    
    .message-action-item {
        padding: 14px 18px;
        font-size: 18px;
    }
    
    .message-action-item i {
        width: 26px;
        font-size: 22px;
    }
}
/* ============================================
   ГОЛОСОВЫЕ СООБЩЕНИЯ - iOS 26 STYLE
   Версия: 1.0
   ============================================ */

/* ------------------------------
   КНОПКА МИКРОФОНА
------------------------------ */
.input-action-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    border: none;
    color: var(--ios-text-secondary);
    font-size: 20px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.input-action-btn:hover {
    background: rgba(128, 128, 128, 0.15);
}

.input-action-btn:active {
    transform: scale(0.95);
}

.input-action-btn.hidden {
    display: none;
}

/* Активное состояние при записи */
#mini-chat-voice.recording {
    color: #ff3b30;
    background: rgba(255, 59, 48, 0.2);
    animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ------------------------------
   ПАНЕЛЬ ЗАПИСИ (появляется при записи)
------------------------------ */
.voice-recording-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--ios-bg-header);
    border-top: 1px solid var(--ios-border);
    border-bottom: 1px solid var(--ios-border);
    animation: slideUp 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.voice-recording-panel.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Контейнер визуализации */
.voice-waveform-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    height: 44px;
    background: var(--ios-bg-input);
    border-radius: 18px;
    padding: 0 16px;
    border: 0.5px solid var(--ios-border);
}

/* Волны (бары) */
.voice-waveform-bars {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    height: 100%;
}

.voice-waveform-bar {
    flex: 1;
    min-width: 2px;
    max-width: 6px;
    background: var(--ios-accent);
    border-radius: 2px;
    transition: height 0.05s ease;
    opacity: 0.7;
}

/* Таймер записи */
.voice-recording-duration {
    font-family: monospace;
    font-size: 16px;
    font-weight: 500;
    color: var(--ios-text-primary);
    min-width: 48px;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Кнопки управления записью */
.voice-recording-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.voice-cancel-btn,
.voice-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.voice-cancel-btn {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.voice-cancel-btn:hover {
    background: rgba(255, 59, 48, 0.3);
    transform: scale(1.05);
}

.voice-send-btn {
    background: var(--ios-accent);
    color: white;
}

.voice-send-btn:hover {
    transform: scale(1.05);
}

.voice-cancel-btn:active,
.voice-send-btn:active {
    transform: scale(0.95);
}

/* ------------------------------
   ПРЕДПРОСМОТР ГОЛОСОВОГО СООБЩЕНИЯ
   (после записи, перед отправкой)
------------------------------ */
.voice-preview-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--ios-bg-header);
    border-top: 1px solid var(--ios-border);
    border-bottom: 1px solid var(--ios-border);
    animation: slideUp 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.voice-preview-panel.hidden {
    display: none;
}

.voice-preview-play {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ios-accent);
    border: none;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.voice-preview-play:hover {
    transform: scale(1.05);
}

.voice-preview-play:active {
    transform: scale(0.95);
}

.voice-preview-waveform {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    height: 44px;
    background: var(--ios-bg-input);
    border-radius: 18px;
    padding: 0 16px;
    border: 0.5px solid var(--ios-border);
}

.voice-preview-waveform-placeholder {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        var(--ios-text-secondary),
        var(--ios-text-secondary) 2px,
        transparent 2px,
        transparent 6px
    );
    opacity: 0.3;
    border-radius: 2px;
}

.voice-preview-duration {
    font-family: monospace;
    font-size: 14px;
    font-weight: 500;
    color: var(--ios-text-secondary);
    min-width: 48px;
    text-align: center;
}

.voice-preview-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.voice-preview-cancel,
.voice-preview-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.voice-preview-cancel {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.voice-preview-cancel:hover {
    background: rgba(255, 59, 48, 0.3);
    transform: scale(1.05);
}

.voice-preview-send {
    background: var(--ios-accent);
    color: white;
}

.voice-preview-send:hover {
    transform: scale(1.05);
}

/* ------------------------------
   ПУЗЫРЁК ГОЛОСОВОГО СООБЩЕНИЯ В ЧАТЕ
------------------------------ */
.voice-message {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
    max-width: 260px;
}

/* Кнопка воспроизведения */
.voice-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(128, 128, 128, 0.2);
    border: none;
    cursor: pointer;
    color: inherit;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.voice-play-btn:hover {
    transform: scale(1.05);
}

.voice-play-btn:active {
    transform: scale(0.95);
}

/* Визуализация волн в сообщении */
.voice-waveform-visual {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    height: 36px;
}

.voice-waveform-bars-mini {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    height: 100%;
}

.voice-waveform-bar-mini {
    flex: 1;
    min-width: 2px;
    max-width: 4px;
    background: currentColor;
    border-radius: 2px;
    opacity: 0.6;
    transition: height 0.1s ease;
}

/* Анимация при воспроизведении */
.voice-message.playing .voice-waveform-bar-mini {
    animation: voiceWavePlay 0.3s ease-in-out infinite alternate;
}

@keyframes voiceWavePlay {
    0% {
        opacity: 0.4;
        transform: scaleY(0.3);
    }
    100% {
        opacity: 1;
        transform: scaleY(1);
    }
}

/* Длительность голосового сообщения */
.voice-duration {
    font-family: monospace;
    font-size: 11px;
    font-weight: 500;
    opacity: 0.8;
    flex-shrink: 0;
    min-width: 40px;
    text-align: center;
}

/* Стили для исходящих голосовых сообщений */
.outgoing-msg .voice-play-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.outgoing-msg .voice-duration {
    color: rgba(255, 255, 255, 0.8);
}

/* Стили для входящих голосовых сообщений */
.incoming-msg .voice-play-btn {
    background: rgba(0, 0, 0, 0.1);
    color: var(--ios-text-primary);
}

.incoming-msg .voice-duration {
    color: var(--ios-text-secondary);
}

/* ------------------------------
   ДНЕВНАЯ ТЕМА
------------------------------ */
body.day-theme .voice-cancel-btn {
    background: rgba(255, 59, 48, 0.15);
}

body.day-theme .voice-preview-waveform {
    background: var(--ios-bg-input);
}

body.day-theme .incoming-msg .voice-play-btn {
    background: rgba(0, 0, 0, 0.08);
}

/* ------------------------------
   АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ
------------------------------ */
@media only screen and (max-width: 428px) {
    .input-action-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .voice-waveform-container {
        height: 40px;
        padding: 0 12px;
    }
    
    .voice-recording-duration {
        font-size: 14px;
        min-width: 44px;
    }
    
    .voice-cancel-btn,
    .voice-send-btn {
        width: 36px;
        height: 36px;
    }
    
    .voice-preview-play {
        width: 40px;
        height: 40px;
    }
    
    .voice-preview-play i {
        font-size: 18px;
    }
    
    .voice-message {
        min-width: 150px;
        max-width: 220px;
    }
    
    .voice-play-btn {
        width: 36px;
        height: 36px;
    }
    
    .voice-play-btn i {
        font-size: 16px;
    }
    
    .voice-duration {
        font-size: 11px;
        min-width: 36px;
    }
}

@media only screen and (max-width: 375px) {
    .input-action-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .voice-waveform-container {
        height: 36px;
        padding: 0 10px;
    }
    
    .voice-recording-duration {
        font-size: 13px;
        min-width: 40px;
    }
    
    .voice-cancel-btn,
    .voice-send-btn {
        width: 32px;
        height: 32px;
    }
    
    .voice-preview-play {
        width: 36px;
        height: 36px;
    }
    
    .voice-message {
        min-width: 130px;
        max-width: 200px;
        gap: 8px;
    }
    
    .voice-play-btn {
        width: 32px;
        height: 32px;
    }
    
    .voice-play-btn i {
        font-size: 14px;
    }
    
    .voice-duration {
        font-size: 10px;
        min-width: 32px;
    }
}
/* ============================================
   АНИМАЦИЯ "CONNECTING..." ДЛЯ ЗВОНКА - iOS 26 STYLE
   ============================================ */

.call-timer-container {
    position: relative;
    min-height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.call-connecting-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.call-connecting-animation.hidden {
    display: none;
}

.call-timer.hidden {
    display: none;
}

/* Контейнер для точек */
.connecting-dots {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: center;
}

/* Стили для точек - белые */
.connecting-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    animation: dotPulse 1.4s ease-in-out infinite;
    transition: background 0.3s ease;
}

.connecting-dots .dot:nth-child(1) {
    animation-delay: 0s;
}

.connecting-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.connecting-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
}

/* Текст "Соединение" */
.connecting-text {
    font-size: 15px;
    font-weight: 500;
    font-family: var(--ios-font);
    letter-spacing: -0.2px;
    transition: color 0.3s ease;
}

/* ========== НОЧНАЯ ТЕМА (по умолчанию) ========== */
.connecting-text {
    color: rgba(255, 255, 255, 0.7);
}

/* ========== ДНЕВНАЯ ТЕМА ========== */
body.day-theme .connecting-dots .dot {
    background: rgba(0, 0, 0, 0.7);
}

body.day-theme .connecting-text {
    color: rgba(0, 0, 0, 0.6);
}

/* ========== АЛЬТЕРНАТИВНЫЙ ВАРИАНТ: точки всегда белые, текст меняется ========== */
/*
body.day-theme .connecting-dots .dot {
    background: rgba(0, 0, 0, 0.6);
}
*/

/* Адаптивность для мобильных устройств */
@media only screen and (max-width: 428px) {
    .connecting-dots {
        gap: 10px;
    }
    
    .connecting-dots .dot {
        width: 8px;
        height: 8px;
    }
    
    .connecting-text {
        font-size: 13px;
    }
    
    .call-connecting-animation {
        gap: 12px;
    }
}

@media only screen and (max-width: 375px) {
    .connecting-dots {
        gap: 8px;
    }
    
    .connecting-dots .dot {
        width: 7px;
        height: 7px;
    }
    
    .connecting-text {
        font-size: 11px;
    }
}


/* Кнопка ПРИНЯТЬ (зелёная) */
.call-btn-accept .call-btn-icon {
    background: #34c759;
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.4);
}

.call-btn-accept .call-btn-icon svg {
    color: white;
}

.call-btn-accept .call-btn-label {
    color: #34c759;
}

/* Кнопка ОТКЛОНИТЬ/ЗАВЕРШИТЬ (красная) */
.call-btn-decline .call-btn-icon,
.call-btn-end .call-btn-icon {
    background: #ff3b30;
    box-shadow: 0 4px 16px rgba(255, 59, 48, 0.4);
}

.call-btn-decline .call-btn-icon svg,
.call-btn-end .call-btn-icon svg {
    color: white;
}

.call-btn-decline .call-btn-label,
.call-btn-end .call-btn-label {
    display: none;
}

/* Кнопки управления во время разговора */
.call-buttons-row .call-btn-icon {
    background: rgba(128, 128, 128, 0.3);
    box-shadow: none;
}

.call-buttons-row .call-btn-icon svg {
    color: white;
    width: 24px;
    height: 24px;
}

/* Эффекты нажатия */
.call-btn-accept:active .call-btn-icon {
    transform: scale(0.95);
    background: #2db84d;
}

.call-btn-decline:active .call-btn-icon,
.call-btn-end:active .call-btn-icon {
    transform: scale(0.95);
    background: #e63a2e;
}

/* Дневная тема */
body.day-theme .call-btn-label {
    color: rgba(0, 0, 0, 0.7);
}

body.day-theme .call-buttons-row .call-btn-icon {
    background: rgba(0, 0, 0, 0.1);
}

body.day-theme .call-buttons-row .call-btn-icon svg {
    color: #000000;
}

/* Адаптивность */
@media only screen and (max-width: 428px) {
    .call-btn-icon {
        width: 60px;
        height: 60px;
    }
    
    .call-btn-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .call-buttons-row .call-btn-icon svg {
        width: 20px;
        height: 20px;
    }
}

@media only screen and (max-width: 375px) {
    .call-btn-icon {
        width: 55px;
        height: 55px;
    }
    
    .call-btn-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .call-buttons-row .call-btn-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* Адаптивность для мобильных */
@media only screen and (max-width: 428px) {
    .call-btn-icon {
        width: 60px;
        height: 60px;
    }
    
    .call-btn-end .call-btn-icon i {
        font-size: 24px;
    }
    
    .call-btn-accept .call-btn-icon i,
    .call-btn-decline .call-btn-icon i {
        font-size: 24px;
    }
}

@media only screen and (max-width: 375px) {
    .call-btn-icon {
        width: 55px;
        height: 55px;
    }
    
    .call-btn-end .call-btn-icon i {
        font-size: 22px;
    }
    
    .call-btn-accept .call-btn-icon i,
    .call-btn-decline .call-btn-icon i {
        font-size: 22px;
    }
}
/* ============================================
   Пункт 10: АНИМАЦИЯ СТАТУСА ОНЛАЙН/ОФФЛАЙН
   ============================================ */

/* Пульсация точки статуса когда онлайн */
#mini-chat-status.status-online .status-dot {
    animation: statusPulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.4);
}

@keyframes statusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.6);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(52, 199, 89, 0);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
        transform: scale(1);
    }
}

/* Статус офлайн - без анимации */
#mini-chat-status.status-offline .status-dot {
    animation: none;
    box-shadow: none;
}

/* Плавное появление/исчезновение статуса */
#mini-chat-status {
    transition: all 0.3s ease;
}

.status-dot {
    transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Эффект при смене статуса */
#mini-chat-status.status-online {
    animation: statusFadeIn 0.3s ease;
}

#mini-chat-status.status-offline {
    animation: statusFadeOut 0.3s ease;
}

@keyframes statusFadeIn {
    0% {
        opacity: 0.5;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes statusFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

/* Принудительное использование системных эмодзи iOS */
body, .message-text, .chat-message, .msg-text, .preview-text {
    font-family: -apple-system, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* Для всех элементов с текстом */
* {
    font-family: -apple-system, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* Специально для эмодзи - гарантируем Apple шрифт */
.emoji, [class*="emoji"], [class*="Emoji"] {
    font-family: "Apple Color Emoji", -apple-system, sans-serif !important;
}

/* Для сообщений */
.mini-chat-message-item .message-content,
.mini-chat-message-item .message-text {
    font-family: -apple-system, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

/* ============================================
   КНОПКА СВОРАЧИВАНИЯ В ЛЕВОМ ВЕРХНЕМ УГЛУ
   ============================================ */
.call-top-bar {
    position: absolute;
    top: 20px;
    left: 20px;  /* ← должно быть так, не right */
    z-index: 20;
    width: auto;
    display: flex;
    justify-content: flex-start;
}

.call-minimize-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(128, 128, 128, 0.3);
    backdrop-filter: blur(10px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
}

.call-minimize-btn i {
    font-size: 20px;
}

.call-minimize-btn:active {
    transform: scale(0.95);
}

body.day-theme .call-minimize-btn {
    background: rgba(0, 0, 0, 0.15);
    color: #000000;
}

@media only screen and (max-width: 428px) {
    .call-top-bar {
        top: 16px;
        left: 16px;
    }
    
    .call-minimize-btn {
        width: 36px;
        height: 36px;
    }
    
    .call-minimize-btn i {
        font-size: 18px;
    }
}

/* ============================================
   МИНИ-ПЛЕЕР (поверх шапки)
   ============================================ */
.mini-call-player {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    animation: miniPlayerSlideIn 0.3s ease;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", sans-serif;
    pointer-events: none;
}

/* Дневная тема для мини-плеера */
.mini-call-player {
    background: rgba(255, 255, 255, 0.96);
    border: 0.5px solid rgba(0, 0, 0, 0.08);
}

/* Ночная тема для мини-плеера - более высокий приоритет */
.dark-mode .mini-call-player,
body.dark-theme .mini-call-player,
.night-theme .mini-call-player {
    background: rgba(28, 28, 30, 0.96) !important;
    border: 0.5px solid rgba(255, 255, 255, 0.08) !important;
}

/* Надпись "Служба поддержки" - слева */
.mini-call-name {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #1c1c1e;
    letter-spacing: -0.3px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
    pointer-events: none;
}

/* Ночная тема для надписи */
.dark-mode .mini-call-name,
body.dark-theme .mini-call-name,
.night-theme .mini-call-name {
    color: #ffffff !important;
}

/* Таймер - строго по центру, фиксированная ширина, радиус 20 */
.mini-call-timer {
    font-family: "SF Mono", "SF Pro Text", -apple-system, BlinkMacSystemFont, monospace;
    font-size: 15px;
    font-weight: 600;
    color: #34c759;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 18px;
    width: 70px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    pointer-events: none;
    box-sizing: border-box;
}

/* Ночная тема для таймера */
.dark-mode .mini-call-timer,
body.dark-theme .mini-call-timer,
.night-theme .mini-call-timer {
    color: #34c759;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Красная кнопка завершения звонка - справа */
.mini-call-end-btn {
    width: 36px;
    height: 36px;
    background: #ff3b30;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
    pointer-events: auto;
    z-index: 2;
}

.mini-call-end-btn:hover {
    background: #dc2626;
    transform: scale(1.02);
}

.mini-call-end-btn:active {
    transform: scale(0.96);
}

/* Ночная тема для кнопки */
.dark-mode .mini-call-end-btn,
body.dark-theme .mini-call-end-btn,
.night-theme .mini-call-end-btn {
    background: #ff3b30 !important;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.4) !important;
}

@keyframes miniPlayerSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивность для мобильных */
@media only screen and (max-width: 428px) {
    .mini-call-player {
        height: 52px;
        padding: 0 12px;
        border-radius: 24px;
    }
    
    .mini-call-name {
        font-size: 11px;
        max-width: 100px;
    }
    
    .mini-call-timer {
        font-size: 13px;
        width: 62px;
        height: 30px;
        line-height: 30px;
        border-radius: 18px;
    }
    
    .mini-call-end-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

@media only screen and (max-width: 375px) {
    .mini-call-player {
        height: 48px;
        padding: 0 10px;
        border-radius: 24px;
    }
    
    .mini-call-name {
        font-size: 11px;
        max-width: 85px;
    }
    
    .mini-call-timer {
        font-size: 11px;
        width: 56px;
        height: 28px;
        line-height: 28px;
        border-radius: 16px;
    }
    
    .mini-call-end-btn {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
}

/* ============================================
   ИНДИКАТОР СТАТУСА СООБЩЕНИЯ (SVG ГАЛОЧКИ)
   Версия: 8.1 — тоньше
   ============================================ */

.msg-status {
    position: absolute !important;
    bottom: 4px !important;
    right: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    line-height: 1 !important;
    pointer-events: none !important;
    z-index: 2 !important;
}

.msg-status-icon {
    display: inline-block !important;
    width: 18px !important;
    height: 18px !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
    background-position: center right !important;
}

/* Одна белая */
/* Одна серая (sent) */
body.night-theme .outgoing-msg[data-status="sent"] .msg-status-icon {
    width: 30px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='m2.394 13.742l4.743 3.62l7.616-8.704l-1.506-1.316l-6.384 7.296l-3.257-2.486z'/%3E%3C/svg%3E") !important;
    opacity: 0.8 !important;
}

/* Галочка + чёрточка (delivered) */
body.night-theme .outgoing-msg[data-status="delivered"] .msg-status-icon {
    width: 30px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='m2.394 13.742l4.743 3.62l7.616-8.704l-1.506-1.316l-6.384 7.296l-3.257-2.486zm19.359-5.084l-1.506-1.316l-6.369 7.279l-.753-.602l-1.25 1.562l2.247 1.798z'/%3E%3C/svg%3E") !important;
    opacity: 0.9 !important;
}

/* Галочка + чёрточка фиолетовые (read) */
body.night-theme .outgoing-msg[data-status="read"] .msg-status-icon {
    width: 30px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23f0a0c0' d='m2.394 13.742l4.743 3.62l7.616-8.704l-1.506-1.316l-6.384 7.296l-3.257-2.486zm19.359-5.084l-1.506-1.316l-6.369 7.279l-.753-.602l-1.25 1.562l2.247 1.798z'/%3E%3C/svg%3E") !important;
    opacity: 1 !important;
}

.outgoing-msg {
    position: relative !important;
    padding-bottom: 22px !important;
}

/* Светлая тема — галочки */
body:not(.night-theme) .outgoing-msg[data-status="sent"] .msg-status-icon {
    opacity: 0.5 !important;
}
body:not(.night-theme) .outgoing-msg[data-status="sent"] .msg-status-icon {
    opacity: 0.5 !important;
    width: 30px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23999999' d='m2.394 13.742l4.743 3.62l7.616-8.704l-1.506-1.316l-6.384 7.296l-3.257-2.486z'/%3E%3C/svg%3E") !important;
}
body:not(.night-theme) .outgoing-msg[data-status="delivered"] .msg-status-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23999999' d='m2.394 13.742l4.743 3.62l7.616-8.704l-1.506-1.316l-6.384 7.296l-3.257-2.486zm19.359-5.084l-1.506-1.316l-6.369 7.279l-.753-.602l-1.25 1.562l2.247 1.798z'/%3E%3C/svg%3E") !important;
}
body:not(.night-theme) .outgoing-msg[data-status="read"] .msg-status-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%238b5cf6' d='m2.394 13.742l4.743 3.62l7.616-8.704l-1.506-1.316l-6.384 7.296l-3.257-2.486zm19.359-5.084l-1.506-1.316l-6.369 7.279l-.753-.602l-1.25 1.562l2.247 1.798z'/%3E%3C/svg%3E") !important;
}

/* ============================================
   CALL UI — ОВЕРЛЕЙ И МИНИ-ПЛЕЕР (СТИЛИ)
   Версия: 6.0 — фикс оверлея
   ============================================ */

/* ── Разрешаем оверлею быть видимым ── */
#mini-chat-widget {
    overflow: visible !important; /* ← ВАЖНО: чтобы оверлей не обрезался */
}

/* ── Оверлей исходящего звонка ── */
.call-outgoing-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 100 !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.35s ease, visibility 0.35s ease !important;
}

.call-outgoing-overlay.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ── Фон с блюром ── */
.call-overlay-bg {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(20, 20, 35, 0.92) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    z-index: 0 !important;
}

/* ── Контент оверлея ── */
.call-overlay-content {
    position: relative !important;
    z-index: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 20px !important;
    padding: 40px 30px !important;
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
}

/* ── Пульсирующие круги ── */
.call-overlay-orbs {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 200px !important;
    height: 200px !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

.call-overlay-orb {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    border-radius: 50% !important;
}

.call-overlay-orb.orb-1 {
    width: 120px !important;
    height: 120px !important;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%) !important;
    animation: callOrbPulse 2.4s ease-in-out infinite !important;
    animation-delay: 0s !important;
}

.call-overlay-orb.orb-2 {
    width: 180px !important;
    height: 180px !important;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%) !important;
    animation: callOrbPulse 2.4s ease-in-out infinite !important;
    animation-delay: 0.4s !important;
}

.call-overlay-orb.orb-3 {
    width: 240px !important;
    height: 240px !important;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%) !important;
    animation: callOrbPulse 2.4s ease-in-out infinite !important;
    animation-delay: 0.8s !important;
}

/* ── Аватар ── */
.call-overlay-avatar {
    width: 90px !important;
    height: 90px !important;
    border-radius: 50% !important;
    background: rgba(139, 92, 246, 0.2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #a78bfa !important;
    position: relative !important;
    z-index: 3 !important;
    flex-shrink: 0 !important;
}

/* ── Имя ── */
.call-overlay-name {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif !important;
    font-size: 26px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    letter-spacing: -0.3px !important;
    position: relative !important;
    z-index: 3 !important;
    text-align: center !important;
}

/* ── Статус + точки ── */
.call-overlay-status-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    position: relative !important;
    z-index: 3 !important;
}

.call-overlay-dots {
    display: flex !important;
    gap: 8px !important;
}

.call-overlay-dots .dot {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.7) !important;
    animation: callDotPulse 1.4s ease-in-out infinite !important;
}

.call-overlay-dots .dot:nth-child(1) { animation-delay: 0s !important; }
.call-overlay-dots .dot:nth-child(2) { animation-delay: 0.2s !important; }
.call-overlay-dots .dot:nth-child(3) { animation-delay: 0.4s !important; }

.call-overlay-status {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.6) !important;
    letter-spacing: 0.1px !important;
}

/* ── Кнопки оверлея ── */
.call-overlay-buttons {
    display: flex !important;
    justify-content: center !important;
    gap: 20px !important;
    position: relative !important;
    z-index: 3 !important;
    margin-top: 10px !important;
}

.call-overlay-btn-end {
    width: 70px !important;
    height: 70px !important;
    border-radius: 50% !important;
    background: #ff3b30 !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 20px rgba(255, 59, 48, 0.5) !important;
    transition: transform 0.15s ease, background 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
}

.call-overlay-btn-end:hover {
    background: #e63a2e !important;
}

.call-overlay-btn-end:active {
    transform: scale(0.92) !important;
}

/* ── Мини-плеер (по умолчанию скрыт) ── */
.mini-call-player {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 100% !important;
    padding: 0 16px !important;
    background: rgba(28, 28, 30, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-radius: 18px !important;
    z-index: 50 !important;
    box-sizing: border-box !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

.mini-call-player:not(.hidden) {
    opacity: 1 !important;
    visibility: visible !important;
}

.mini-call-name {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #ffffff !important;
    letter-spacing: -0.3px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 110px !important;
    flex-shrink: 0 !important;
}

.mini-call-timer {
    font-family: "SF Mono", monospace !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #34c759 !important;
    letter-spacing: 0.5px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 14px !important;
    padding: 4px 12px !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    white-space: nowrap !important;
}

.mini-call-buttons {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}

.mini-call-mute,
.mini-call-speaker,
.mini-call-bluetooth {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    transition: transform 0.15s ease, background 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    flex-shrink: 0 !important;
}

.mini-call-mute:hover,
.mini-call-speaker:hover,
.mini-call-bluetooth:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

.mini-call-end {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    background: #ff3b30 !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.4) !important;
    transition: transform 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    flex-shrink: 0 !important;
}

.mini-call-end:active {
    transform: scale(0.92) !important;
}

/* ── Анимации ── */
@keyframes callOrbPulse {
    0%   { transform: translate(-50%, -50%) scale(0.7); opacity: 0.6; }
    50%  { transform: translate(-50%, -50%) scale(1.1); opacity: 0.9; }
    100% { transform: translate(-50%, -50%) scale(0.7); opacity: 0.6; }
}

@keyframes callDotPulse {
    0%   { transform: scale(0.6); opacity: 0.3; }
    50%  { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.6); opacity: 0.3; }
}

/* ── Дневная тема ── */
body.day-theme .call-overlay-bg {
    background: rgba(245, 245, 250, 0.92) !important;
}

body.day-theme .call-overlay-name {
    color: #1c1c1e !important;
}

body.day-theme .call-overlay-status {
    color: rgba(0, 0, 0, 0.5) !important;
}

body.day-theme .call-overlay-dots .dot {
    background: rgba(0, 0, 0, 0.4) !important;
}

body.day-theme .call-overlay-avatar {
    background: rgba(139, 92, 246, 0.1) !important;
    color: #8b5cf6 !important;
}

body.day-theme .mini-call-player {
    background: rgba(255, 255, 255, 0.96) !important;
}

body.day-theme .mini-call-name {
    color: #1c1c1e !important;
}

body.day-theme .mini-call-timer {
    background: rgba(0, 0, 0, 0.05) !important;
}

body.day-theme .mini-call-mute,
body.day-theme .mini-call-speaker,
body.day-theme .mini-call-bluetooth {
    background: rgba(0, 0, 0, 0.08) !important;
    color: #1c1c1e !important;
}

body.day-theme .mini-call-mute:hover,
body.day-theme .mini-call-speaker:hover,
body.day-theme .mini-call-bluetooth:hover {
    background: rgba(0, 0, 0, 0.15) !important;
}


/* Превью файлов */
.file-preview { margin-bottom: 6px; border-radius: 10px; overflow: hidden; max-width: 240px; }
.file-preview-image img { width: 100%; border-radius: 10px; display: block; }
.file-preview-video video { width: 100%; border-radius: 10px; }
.file-preview-audio audio { width: 100%; }
.file-preview-icon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.04); border-radius: 10px; color: #9090b0; }
.file-info { display: flex; flex-direction: column; gap: 2px; }
.file-name { font-size: 12px; color: #5b6af0; text-decoration: none; word-break: break-all; }
.file-name:hover { text-decoration: underline; }
.file-size { font-size: 10px; color: #9090b0; }

/* Reactions */
.msg-reactions-outer {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 4px;
    padding: 0 2px;
}
.msg-reaction-badge {
    display: inline-flex !important;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    background: rgba(91,106,240,0.12);
    border: 1px solid rgba(91,106,240,0.2);
    border-radius: 12px;
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.15s;
    animation: reactionPopIn 0.2s cubic-bezier(0.34,1.3,0.64,1);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.msg-reaction-badge:hover {
    background: rgba(91,106,240,0.22);
    border-color: rgba(91,106,240,0.35);
    transform: scale(1.08);
}
.emoji-msg .msg-reaction-badge {
    font-size: 10px;
    padding: 1px 6px;
}
.single-emoji .msg-reaction-badge {
    font-size: 10px;
    padding: 1px 5px;
}
@keyframes reactionPopIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.msg-divider {
    text-align: center;
    font-size: 11px;
    color: #9090b0;
    padding: 8px 0;
    opacity: 0.7;
}
.msg-status {
    font-size: 10px;
    color: #9090b0;
    margin-left: 6px;
}
