/* Telegram-like Messenger Styles */

.messenger-container {
    display: flex;
    height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* «Чаты (менеджер)»: растянуть блок чата на доступную ширину (убрать пустоту справа) */
#messengerPage[data-ms-scope="tg_manager"] .messenger-container {
    max-width: none;
    width: 100%;
}

#messengerPage[data-ms-scope="tg_manager"] .messenger-sidebar {
    width: min(24rem, 40vw);
    min-width: 300px;
    max-width: 440px;
    flex-shrink: 0;
}

/* Вертикальная лента папок (как в Telegram) */
.messenger-folders-rail {
    width: 56px;
    min-width: 56px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 4px;
    box-sizing: border-box;
    background: #2d3139;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100%;
}

.messenger-folder-rail__btn {
    width: 44px;
    min-height: 44px;
    padding: 4px 2px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #c8d0dc;
    cursor: pointer;
    font-size: 9.5px;
    line-height: 1.15;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}

.messenger-folder-rail__btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.messenger-folder-rail__btn--active {
    background: #3390ec;
    color: #fff;
}

.messenger-folder-rail__icon {
    font-size: 17px;
    line-height: 1;
}

.messenger-folder-rail__label {
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
    text-align: center;
}

.messenger-folder-rail__badge {
    position: absolute;
    top: 1px;
    right: 0;
    min-width: 16px;
    padding: 0 4px;
    height: 16px;
    border-radius: 8px;
    background: #e53935;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Контекстное меню по строке чата / папке */
.messenger-chatlist-ctx {
    position: fixed;
    z-index: 12000;
    min-width: 210px;
    max-width: 300px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    padding: 6px 0;
    display: none;
}

.messenger-chatlist-ctx button {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    color: #222;
    font-family: inherit;
}

.messenger-chatlist-ctx button:hover {
    background: #f4f4f5;
}

.messenger-chatlist-ctx__top {
    padding-bottom: 2px;
    margin-bottom: 2px;
}

.messenger-chatlist-ctx__sub {
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid #f0f0f0;
    margin-top: 2px;
    padding-top: 2px;
}

.messenger-chat-ref-block {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
    background: #eef6ff;
    border-radius: 10px;
    border: 1px solid #cfe4fc;
    margin: 2px 0;
}

.messenger-chat-ref-block__btn {
    border: none;
    background: #3390ec;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.messenger-chat-ref-block__btn:hover {
    filter: brightness(1.05);
}

@media (max-width: 768px) {
    #messengerPage .messenger-folders-rail {
        width: 100%;
        min-width: 0;
        flex-direction: row;
        flex-wrap: nowrap;
        max-height: 56px;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        order: -1;
    }

    #messengerPage .messenger-folder-rail__btn {
        flex: 0 0 auto;
        min-width: 44px;
    }
}

/* Left Sidebar - Chat List */
.messenger-sidebar {
    width: 320px;
    background: #ffffff;
    border-right: 1px solid #e4e4e4;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messenger-sidebar-header {
    padding: 12px 16px;
    background: #ffffff;
    border-bottom: 1px solid #e4e4e4;
    display: flex;
    align-items: center;
    gap: 12px;
}

.messenger-sidebar-search {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: #f4f4f5;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.messenger-sidebar-search::placeholder {
    color: #707579;
}

.messenger-chat-list {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
}

.messenger-chat-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.messenger-chat-item.is-muted .messenger-chat-title::after {
    content: ' 🔕';
    font-size: 12px;
    opacity: 0.8;
}

.messenger-chat-item.is-archived {
    opacity: 0.75;
}

.messenger-chat-item:hover {
    background: #f5f5f5;
}

.messenger-chat-item.active {
    background: #e8f4fd;
    border-left: 3px solid #3390ec;
}

.messenger-chat-avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
}

.messenger-chat-avatar img,
.messenger-chat-header-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.messenger-chat-info {
    flex: 1;
    min-width: 0;
}

.messenger-chat-title {
    font-size: 15px;
    font-weight: 600;
    color: #000000;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messenger-chat-preview {
    font-size: 14px;
    color: #707579;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messenger-chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.messenger-chat-time {
    font-size: 13px;
    color: #707579;
    white-space: nowrap;
}

.messenger-chat-badge {
    background: #3390ec;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.messenger-chat-unread-pill {
    background: #3390ec;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 22px;
    text-align: center;
    line-height: 1.3;
}

.messenger-chat-item.messenger-chat-item--has-unread {
    background: linear-gradient(90deg, rgba(51, 144, 236, 0.16) 0%, rgba(255, 255, 255, 0) 62%);
    border-left: 3px solid #3390ec;
    box-shadow: inset 0 0 0 1px rgba(51, 144, 236, 0.12);
}

.messenger-chat-item.messenger-chat-item--has-unread .messenger-chat-title {
    color: #0b4a8f;
}

.messenger-chat-item.messenger-chat-item--has-unread .messenger-chat-unread-pill {
    animation: jy-messenger-unread-pill-pulse 1.8s ease-in-out infinite;
}

@keyframes jy-messenger-unread-pill-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(51, 144, 236, 0.55);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(51, 144, 236, 0);
        transform: scale(1.04);
    }
}

/* Right Panel - Chat Area */
.messenger-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* Градиент как на скриншоте: от светло-зеленовато-серого сверху к темно-зеленому снизу */
    background: linear-gradient(to bottom, #DCE6D2 0%, #B0C89F 100%);
    position: relative;
    min-height: 400px;
    overflow: hidden;
}

/* Паттерн с дудлами для текстуры фона (как на скриншоте) */
.messenger-chat-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><g opacity="0.04" stroke="%23333" fill="none" stroke-width="1.5"><circle cx="30" cy="40" r="8"/><path d="M30 32 L30 48 M22 40 L38 40"/><circle cx="80" cy="35" r="6"/><path d="M70 35 Q75 30 80 35 Q85 40 90 35"/><path d="M150 30 L145 50 L155 50 Z"/><circle cx="170" cy="45" r="7"/><path d="M163 45 L177 45 M170 38 L170 52" stroke-width="1"/><rect x="25" y="80" width="10" height="15"/><circle cx="75" cy="88" r="6"/><path d="M69 88 Q75 82 81 88"/><path d="M125 85 L120 100 L130 100 Z"/><path d="M125 100 L125 115 M115 108 L135 108" stroke-width="1"/><circle cx="165" cy="90" r="8"/><path d="M158 90 Q165 82 172 90"/><path d="M35 135 L30 150 L40 150 Z"/><path d="M85 132 L80 152 L90 152 Z"/><circle cx="125" cy="140" r="7"/><path d="M118 140 Q125 133 132 140"/><rect x="150" y="130" width="12" height="20" rx="2"/><circle cx="40" cy="175" r="5"/><path d="M35 175 L45 175 M40 170 L40 180" stroke-width="1"/><path d="M90 170 L85 185 L95 185 Z"/><path d="M135 172 L130 187 L140 187 Z"/><path d="M175 170 L170 185 L180 185 Z"/></g></svg>');
    background-size: 300px 300px;
    background-position: 0 0;
    background-repeat: repeat;
    pointer-events: none;
    z-index: 0;
}

.messenger-chat-header {
    padding: 10px 16px;
    background: #ffffff;
    border-bottom: 1px solid #e4e4e4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.messenger-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.messenger-chat-header-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.messenger-chat-header-title {
    font-size: 16px;
    font-weight: 600;
    color: #000000;
}

.messenger-chat-header-textblock {
    min-width: 0;
}

.messenger-chat-header-subtitle {
    font-size: 12px;
    font-weight: 500;
    color: #707579;
    margin-top: 2px;
    line-height: 1.35;
    word-break: break-word;
}

.messenger-tg-lead-actions {
    margin-top: 6px;
    max-width: min(36rem, 92vw);
}

.messenger-tg-lead-actions-inner {
    font-size: 11px;
    line-height: 1.45;
    color: #5c6470;
}

.messenger-tg-action-link {
    color: #3390ec;
    font-weight: 600;
    text-decoration: none;
}

.messenger-tg-action-link:hover {
    text-decoration: underline;
}

.messenger-tg-lead-popover {
    position: relative;
    min-width: 200px;
    max-width: min(22rem, calc(100vw - 24px));
    padding: 12px 32px 12px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
    font-size: 13px;
    line-height: 1.45;
    color: #334155;
}

.messenger-tg-popover-meta {
    margin: 0 0 8px;
    word-break: break-word;
}

.messenger-tg-popover-link {
    margin: 0;
}

.messenger-tg-popover-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}

.messenger-tg-popover-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.messenger-tg-mirror-ok {
    font-size: 11px;
    font-weight: 600;
    color: #229ed9;
}

.messenger-tg-mirror-fail {
    font-size: 11px;
    font-weight: 600;
    color: #c0392b;
}

.messenger-tg-from,
.messenger-tg-in-badge {
    font-size: 11px;
    font-weight: 600;
    color: #229ed9;
}

.messenger-chat-header-actions {
    display: flex;
    gap: 8px;
}

.messenger-chat-tools {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid #eef1f4;
}

.messenger-chat-tools-btn {
    border: 1px solid #d7e0ea;
    background: #f7fafc;
    color: #36506b;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.messenger-chat-tools-btn.active {
    background: #e9f3ff;
    border-color: #a9c8ea;
    color: #225ea2;
    font-weight: 600;
}

.messenger-header-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #707579;
    transition: background 0.2s;
}

.messenger-header-btn:hover {
    background: #f0f0f0;
}

.messenger-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 1;
    /* Прозрачный фон, чтобы был виден градиент чата */
    background: transparent;
}

.messenger-message {
    display: flex;
    flex-direction: column;
    max-width: 65%;
    align-self: flex-start;
    animation: messageSlideIn 0.2s ease-out;
}

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

.messenger-message.own {
    align-self: flex-end;
}

/* Разделитель календарного дня в ленте (как в Telegram) */
.messenger-day-divider {
    align-self: center;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 12px 0 8px;
    flex-shrink: 0;
    pointer-events: none;
}

.messenger-day-divider span {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.06);
    color: #707579;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.3;
    max-width: 90%;
    text-align: center;
}

#messengerChatContainer {
    position: relative;
}

.messenger-scroll-bottom-btn {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 6;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    color: #8b95a0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.messenger-scroll-bottom-btn--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.messenger-scroll-bottom-btn:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    color: #3390ec;
}

.messenger-scroll-bottom-btn:active {
    transform: translateY(1px);
}

/* messenger.html: поле ввода внутри того же #messengerChatContainer */
.messenger-scroll-bottom-btn--above-inner-input {
    bottom: 78px;
}

/* Закреплённые сообщения — полоса под шапкой чата (как в Telegram) */
.messenger-pinned-bar {
    display: flex;
    flex-direction: row;
    flex-shrink: 0;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #e4e4e4;
}

.messenger-pinned-bar[hidden] {
    display: none !important;
}

.messenger-pinned-bar__accent {
    width: 4px;
    flex-shrink: 0;
    background: #3390ec;
}

.messenger-pinned-bar__body {
    flex: 1;
    min-width: 0;
    text-align: left;
    border: none;
    background: transparent;
    padding: 8px 14px 8px 10px;
    cursor: pointer;
    font: inherit;
}

.messenger-pinned-bar__body:hover {
    background: rgba(51, 144, 236, 0.07);
}

.messenger-pinned-bar__title {
    font-size: 13px;
    font-weight: 600;
    color: #3390ec;
    margin-bottom: 2px;
}

.messenger-pinned-bar__preview {
    font-size: 13px;
    color: #707579;
    line-height: 1.35;
    max-height: 2.75em;
    overflow: hidden;
    word-break: break-word;
}

.messenger-message--highlight {
    animation: messengerPinHighlight 2.1s ease-out;
}

@keyframes messengerPinHighlight {
    0% {
        box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.55);
    }
    35% {
        box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.35);
    }
    100% {
        box-shadow: none;
    }
}

.messenger-message-bubble {
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.messenger-message.own .messenger-message-bubble {
    background: #dcf8c6;
}

.messenger-message-text {
    font-size: 15px;
    line-height: 1.4;
    color: #000000;
    margin: 0;
    word-wrap: break-word;
}

.messenger-message-text a.messenger-linkified {
    color: #3390ec;
    text-decoration: underline;
    word-break: break-all;
}

.messenger-message-time {
    font-size: 11px;
    color: #707579;
    margin-top: 4px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    order: 999;
}

.messenger-message-sender {
    font-size: 13px;
    font-weight: 600;
    color: #3390ec;
    margin-bottom: 4px;
}

.messenger-message-attachments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.messenger-attachment {
    border-radius: 8px;
    overflow: hidden;
    max-width: 300px;
}

.messenger-attachment img {
    width: 100%;
    height: auto;
    display: block;
}

.messenger-attachment-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f0f0f0;
    border-radius: 8px;
}

.messenger-attachment-icon {
    width: 40px;
    height: 40px;
    background: #3390ec;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.messenger-attachment-info {
    flex: 1;
    min-width: 0;
}

.messenger-attachment-name {
    font-size: 14px;
    font-weight: 500;
    color: #000000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messenger-attachment-size {
    font-size: 12px;
    color: #707579;
}

.messenger-input-area {
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #e4e4e4;
    display: flex !important;
    flex-direction: column;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: stretch;
    gap: 8px;
    flex-shrink: 0;
    min-height: 60px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

/* Мини-превью вложений над строкой ввода (админка) */
.messenger-attachment-preview {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    max-height: 120px;
    overflow-y: auto;
}

.messenger-attachment-preview.messenger-attachment-preview--visible {
    display: flex;
}

.messenger-att-prev-item {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dfe3e8;
    background: #f4f4f5;
    flex-shrink: 0;
}

.messenger-att-prev-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.messenger-att-prev-doc {
    width: auto;
    min-width: 120px;
    max-width: 220px;
    height: auto;
    min-height: 44px;
    padding: 6px 28px 6px 8px;
    display: flex;
    align-items: center;
    font-size: 12px;
    line-height: 1.25;
    word-break: break-all;
}

.messenger-att-prev-x {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.messenger-att-prev-x:hover {
    background: rgba(0, 0, 0, 0.72);
}

.messenger-quick-emojis {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.messenger-quick-emoji-btn {
    border: 1px solid #d9e3f0;
    background: #f7fbff;
    border-radius: 14px;
    min-width: 32px;
    height: 28px;
    line-height: 1;
    font-size: 17px;
    cursor: pointer;
    padding: 0 8px;
    transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.messenger-quick-emoji-btn:hover {
    background: #eaf3ff;
    border-color: #b9d0ef;
    transform: translateY(-1px);
}

.messenger-quick-emoji-btn:active {
    transform: translateY(0);
}

.messenger-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #e4e4e4;
    border-radius: 24px;
    padding: 8px 12px 8px 14px;
    min-height: 48px;
    box-sizing: border-box;
}

.messenger-attach-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #707579;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    flex-shrink: 0;
}

.messenger-attach-btn:hover {
    background: #f0f0f0;
}

.messenger-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    line-height: 1.4;
    resize: none;
    max-height: 120px;
    min-height: 24px;
    font-family: inherit;
    color: #000000;
}

.messenger-input::placeholder {
    color: #707579;
}

.messenger-send-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent url('../img/messenger-send-icon.png') center center / 92% 92% no-repeat;
    box-shadow: none;
    color: transparent;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
    text-indent: -9999px;
    transition: opacity 0.2s, transform 0.12s ease, filter 0.2s ease;
}

.messenger-send-btn:hover {
    opacity: 0.9;
    filter: brightness(1.06);
}

.messenger-send-btn:active {
    transform: scale(0.96);
}

.messenger-send-btn:disabled {
    opacity: 0.4;
    filter: grayscale(1);
    cursor: not-allowed;
}

.messenger-empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #707579;
    font-size: 16px;
    position: relative;
    z-index: 1;
    /* Прозрачный фон, чтобы был виден градиент чата */
    background: transparent;
}

/* Modal Styles for Creating Chat/Group/Channel */
.messenger-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(32, 40, 48, 0.45);
    align-items: center;
    justify-content: center;
}

.messenger-modal.active {
    display: flex;
}

.messenger-modal-content {
    font-family: 'Nunito Sans', system-ui, sans-serif;
    background: linear-gradient(165deg, #fefdfb 0%, #f6f3ee 55%, #f0ebe3 100%);
    background-color: #f6f3ee;
    border: 1px solid rgba(180, 160, 130, 0.35);
    box-shadow:
        0 24px 48px rgba(28, 24, 20, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    border-radius: 18px;
    padding: 24px 22px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.messenger-modal-header {
    margin-bottom: 20px;
}

.messenger-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c2824;
    margin: 0;
}

.messenger-modal-close {
    float: right;
    font-size: 28px;
    font-weight: 300;
    color: #8a8075;
    cursor: pointer;
    line-height: 1;
    border: none;
    background: transparent;
    border-radius: 10px;
}

.messenger-modal-close:hover {
    color: #4a433a;
    background: rgba(0, 0, 0, 0.06);
}

.messenger-modal-body {
    margin-bottom: 20px;
}

.messenger-form-group {
    margin-bottom: 16px;
}

.messenger-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #4a433a;
    margin-bottom: 8px;
}

.messenger-form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.messenger-form-input:focus {
    border-color: #3390ec;
}

.messenger-form-textarea {
    min-height: 80px;
    resize: vertical;
}

.messenger-users-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    padding: 8px;
}

.messenger-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.messenger-user-item:hover {
    background: #f5f5f5;
}

.messenger-user-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.messenger-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.messenger-user-info {
    flex: 1;
}

.messenger-user-name {
    font-size: 15px;
    font-weight: 500;
    color: #2c2824;
}

.messenger-user-email {
    font-size: 13px;
    color: #707579;
}

.messenger-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.messenger-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.messenger-btn-primary {
    background: linear-gradient(180deg, #24b065, #1b9e58);
    color: white;
    box-shadow: 0 4px 14px rgba(27, 158, 88, 0.35);
    border-radius: 12px;
    font-weight: 700;
}

.messenger-btn-primary:hover {
    filter: brightness(1.05);
}

.messenger-btn-secondary {
    background: rgba(255, 255, 255, 0.65);
    color: #4a433a;
    border: 2px solid rgba(120, 110, 98, 0.35);
    border-radius: 12px;
    font-weight: 600;
}

.messenger-btn-secondary:hover {
    background: #e0e0e0;
}

/* Action buttons in sidebar */
.messenger-actions {
    padding: 12px 16px;
    border-bottom: 1px solid #e4e4e4;
    display: flex;
    gap: 8px;
}

.messenger-action-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e4e4e4;
    background: #ffffff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #000000;
}

.messenger-action-btn:hover {
    background: #f5f5f5;
    border-color: #3390ec;
}

.messenger-action-btn.primary {
    background: #3390ec;
    color: white;
    border-color: #3390ec;
}

.messenger-action-btn.primary:hover {
    background: #2b7dd8;
}

/* Chat type badges */
.messenger-chat-type {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 6px;
}

.messenger-chat-type.group {
    background: #e8f4fd;
    color: #3390ec;
}

.messenger-chat-type.channel {
    background: #fff3cd;
    color: #ff9800;
}

.messenger-chat-type.private {
    background: #f0f0f0;
    color: #707579;
}

/* Scrollbar styling */
.messenger-chat-list::-webkit-scrollbar,
.messenger-messages::-webkit-scrollbar,
.messenger-users-list::-webkit-scrollbar {
    width: 6px;
}

.messenger-chat-list::-webkit-scrollbar-track,
.messenger-messages::-webkit-scrollbar-track,
.messenger-users-list::-webkit-scrollbar-track {
    background: transparent;
}

.messenger-chat-list::-webkit-scrollbar-thumb,
.messenger-messages::-webkit-scrollbar-thumb,
.messenger-users-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.messenger-chat-list::-webkit-scrollbar-thumb:hover,
.messenger-messages::-webkit-scrollbar-thumb:hover,
.messenger-users-list::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Реакции на сообщения */
.messenger-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    align-items: center;
}

.messenger-reaction {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.messenger-reaction:hover {
    background: #e0e0e0;
}

.messenger-reaction-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #e4e4e4;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    margin-top: 8px;
}

.messenger-reaction-btn:hover {
    background: #f0f0f0;
}

.messenger-reaction-picker {
    position: fixed;
    background: white;
    border: 1px solid #e4e4e4;
    border-radius: 20px;
    padding: 8px;
    display: flex;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
}

/* Комментарии */
.messenger-comments {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.messenger-comment {
    padding: 6px 8px;
    margin-bottom: 4px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
}

.messenger-comment strong {
    color: #3390ec;
    margin-right: 6px;
}

.messenger-comment-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #e4e4e4;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    margin-left: 8px;
    margin-top: 8px;
    padding: 0;
}

.messenger-comment-btn:hover {
    background: #f0f0f0;
}

.messenger-comment-input-container {
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
}

.messenger-comment-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #e4e4e4;
    border-radius: 6px;
    resize: vertical;
    font-size: 14px;
    margin-bottom: 8px;
    font-family: inherit;
}

/* Кнопка удаления сообщения */
.messenger-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(0,0,0,0.1);
    border-radius: 12px;
    cursor: pointer;
    font-size: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    opacity: 0.7;
}

.messenger-message-bubble {
    position: relative;
}

.messenger-message:hover .messenger-delete-btn {
    display: flex;
}

.messenger-delete-btn:hover {
    background: rgba(244, 67, 54, 0.2);
    opacity: 1;
}

/* Контекстное меню как в Telegram */
.messenger-context-menu {
    position: fixed;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.18), 0 0 2px rgba(0,0,0,0.06);
    z-index: 10000;
    padding: 6px 0;
    min-width: 220px;
    max-width: 280px;
    overflow: hidden;
    animation: tgMenuIn 0.12s ease-out;
}

@keyframes tgMenuIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.messenger-context-reactions {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    justify-content: flex-start;
    overflow-x: auto;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 2px;
    box-sizing: border-box;
}

.messenger-context-reaction {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.messenger-context-reaction:hover {
    background: #f0f0f0;
    transform: scale(1.08);
}

.messenger-context-reaction:active {
    transform: scale(0.9);
}

.messenger-context-separator {
    height: 1px;
    background: #f0f0f0;
    margin: 2px 0;
}

.messenger-context-action {
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #222;
    border-radius: 0;
    transition: background 0.12s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.messenger-context-action:hover {
    background: #f4f4f5;
}

.messenger-context-action--danger {
    color: #f44336 !important;
}

.messenger-context-action--danger:hover {
    background: #ffebee !important;
    color: #d32f2f !important;
}

/* Reply / Edit bar above input */
.messenger-reply-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #e8f4fd;
    border-left: 3px solid #3390ec;
    border-radius: 6px 6px 0 0;
    font-size: 13px;
    color: #333;
    gap: 8px;
}

.messenger-reply-bar__text {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.messenger-reply-bar__close {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.messenger-reply-bar__close:hover {
    background: rgba(0,0,0,0.08);
}

/* Reply quote inside message bubble */
.messenger-reply-quote {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    margin-bottom: 6px;
    background: rgba(51, 144, 236, 0.08);
    border-left: 3px solid #3390ec;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    overflow: hidden;
}

.messenger-reply-quote b {
    color: #3390ec;
    font-weight: 600;
}

.messenger-reply-quote span {
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Read eyes */
.messenger-read-eyes {
    font-size: 11px;
    color: #999;
    margin-right: 4px;
    cursor: default;
}

/* Отображение реакций (без кнопок) */
.messenger-reactions-display {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    align-items: center;
}

.messenger-reaction-display {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #e3f2fd;
    border-radius: 12px;
    font-size: 14px;
    cursor: default;
}

/* Убрать старые кнопки реакций и комментариев */
.messenger-reaction-btn,
.messenger-comment-btn {
    display: none !important;
}

.messenger-delete-btn {
    display: none !important;
}

/* Поле ввода для админки */
#messengerInputAreaAdmin {
    flex-shrink: 0 !important;
    min-height: 60px !important;
    padding: 12px 16px !important;
    background: #ffffff !important;
    border-top: 1px solid #e4e4e4 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 100 !important;
}

/* Модальное окно для просмотра изображений */
.messenger-image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.messenger-image-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.messenger-image-modal-content {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

.messenger-image-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e4e4e4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    flex-shrink: 0;
}

.messenger-image-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #000000;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 16px;
}

.messenger-image-modal-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.messenger-image-modal-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.messenger-image-modal-btn:hover {
    background: #e0e0e0;
}

.messenger-image-modal-body {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    flex: 1;
    min-height: 0;
}

.messenger-image-modal-body img {
    max-width: 100%;
    max-height: calc(90vh - 120px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.messenger-image-clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.messenger-image-clickable:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Поле ввода для участников (вне контейнера чата) */
#messengerInputArea {
    flex-shrink: 0 !important;
    min-height: 60px !important;
    padding: 12px 16px !important;
    background: #ffffff !important;
    border-top: 1px solid #e4e4e4 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 100 !important;
}

/* ЛК: поле ввода снаружи #messengerChatContainer — нельзя задавать контейнеру height:100%, иначе строка ввода уезжает/обрезается */
@media (min-width: 769px) {
    #messengerPage .messenger-chat-area {
        min-height: 0;
    }

    #messengerPage #messengerChatContainer {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
    }

    #messengerPage #messengerChatContainer .messenger-messages {
        flex: 1 1 auto !important;
        min-height: 0 !important;
    }
}

/* «Избранное» в списке чатов (как в Telegram) */
.messenger-chat-item--saved .messenger-chat-avatar {
    border-radius: 12px;
    background: linear-gradient(145deg, #6ab4f0 0%, #3390ec 100%);
    color: #fff;
    font-size: 22px;
}

.messenger-saved-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
}

.messenger-mobile-back-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 6px 0 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: #f0f0f0;
    color: #3390ec;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.messenger-mobile-back-btn:active {
    background: #e0e0e0;
}

@media (max-width: 768px) {
    #messengerPage .messenger-container {
        flex-direction: column;
        width: 100%;
        min-height: calc(100vh - 110px);
        min-height: calc(100dvh - 110px);
    }
    #messengerPage .messenger-sidebar,
    #messengerPage .messenger-chat-area {
        width: 100% !important;
        max-width: none !important;
    }
    #messengerPage .messenger-container:not(.messenger-mobile--chat-open) .messenger-chat-area {
        display: none !important;
    }
    #messengerPage .messenger-container.messenger-mobile--chat-open {
        position: fixed;
        inset: 0;
        z-index: 2000;
        border-radius: 0;
        margin: 0;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
        height: 100vh;
        height: 100dvh;
        height: 100svh;
        max-height: 100dvh;
        max-height: 100svh;
    }
    #messengerPage .messenger-container.messenger-mobile--chat-open .messenger-sidebar {
        display: none !important;
    }
    #messengerPage .messenger-container.messenger-mobile--chat-open .messenger-chat-area {
        display: flex !important;
        flex-direction: column;
        flex: 1 1 0;
        min-height: 0 !important;
        max-height: none !important;
        height: auto;
        border-radius: 0;
        overflow: hidden;
    }
    #messengerPage .messenger-container.messenger-mobile--chat-open .messenger-chat-header {
        flex-wrap: nowrap;
        align-items: center;
        border-radius: 0;
    }
    #messengerPage .messenger-container.messenger-mobile--chat-open .messenger-mobile-back-btn {
        display: inline-flex;
    }
    #messengerPage .messenger-container.messenger-mobile--chat-open .messenger-messages {
        flex: 1 1 auto;
        min-height: 0;
    }
    #messengerPage .messenger-container.messenger-mobile--chat-open .messenger-input-area {
        width: 100%;
        border-radius: 0;
    }

    /* Иначе #messengerInputArea / Admin с !important перебивают safe-area снизу */
    #messengerInputArea,
    #messengerInputAreaAdmin {
        padding: 10px 12px !important;
        padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)) !important;
    }
    .messenger-quick-emojis {
        max-width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }
    .messenger-quick-emoji-btn {
        flex: 0 0 auto;
    }
    .messenger-chat-header-actions {
        gap: 4px;
    }
    .messenger-header-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    .messenger-chat-tools {
        padding: 6px 8px;
        gap: 4px;
    }
    .messenger-chat-tools-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    /* Строка ввода в стиле Telegram: крупные зоны нажатия, кнопка отправки заметнее */
    .messenger-input-area {
        padding: 10px 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    }
    .messenger-input-wrapper {
        min-height: 54px;
        padding: 6px 8px 6px 12px;
        gap: 10px;
        border-radius: 28px;
        border-color: #dfe4ea;
    }
    .messenger-attach-btn {
        width: 46px;
        height: 46px;
        font-size: 22px;
    }
    .messenger-send-btn {
        width: 52px;
        height: 52px;
        min-width: 52px;
        background-size: 92% 92%;
    }
    .messenger-input {
        font-size: 16px;
        min-height: 32px;
        padding: 8px 4px;
    }
}

/* Отдельная страница messenger.html (без #messengerPage) — те же размеры на телефоне */
@media (max-width: 768px) {
    .main-content .messenger-input-area {
        padding: 10px 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    }
    .main-content .messenger-input-wrapper {
        min-height: 54px;
        padding: 6px 8px 6px 12px;
        gap: 10px;
        border-radius: 28px;
        align-items: center;
    }
    .main-content .messenger-send-btn {
        width: 52px;
        height: 52px;
        min-width: 52px;
        background-size: 92% 92%;
    }
    .main-content .messenger-attach-btn {
        width: 46px;
        height: 46px;
        font-size: 22px;
    }
    .main-content .messenger-input {
        font-size: 16px;
        min-height: 32px;
    }
}

/* Полоса загрузки над списком чатов (админка, ЛК, messenger.html) */
.messenger-load-progress.messenger-load-progress--inline {
    margin: 0 10px 10px;
    padding: 0 2px 2px;
    max-width: none;
    box-sizing: border-box;
}

.messenger-load-progress.messenger-load-progress--inline .messenger-load-progress__track {
    height: 8px;
    border-radius: 5px;
    background: #e8edef;
    overflow: hidden;
    border: 1px solid #c5ccd4;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.messenger-load-progress.messenger-load-progress--inline .messenger-load-progress__bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #3390ec 0%, #5cb3ff 50%, #7cc4ff 100%);
}

.messenger-load-progress.messenger-load-progress--inline .messenger-load-progress__bar--indeterminate {
    width: 40%;
    animation: messengerInlineLoadSlide 1.1s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(51, 144, 236, 0.35);
}

@keyframes messengerInlineLoadSlide {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(320%);
    }
}

.messenger-load-progress.messenger-load-progress--inline .messenger-load-progress__label {
    margin: 6px 0 0;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #546778;
    letter-spacing: 0.01em;
}

/* Модалка «Группа / канал»: список участников */
.messenger-gc-members {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
}

.messenger-gc-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    background: #fafafa;
}

.messenger-gc-member-meta {
    font-size: 0.85rem;
    color: #555;
    margin-top: 2px;
}
