.group-message-avatar.group-member-profile-trigger,
.group-message-avatar {
    cursor: pointer;
}

.group-member-profile-modal {
    z-index: 3200;
}

.group-member-profile-content {
    width: min(760px, calc(100vw - 32px));
    max-width: 760px;
    max-height: min(760px, calc(100vh - 32px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 0 !important;
    border-radius: 16px;
}

.group-member-profile-close {
    position: absolute;
    right: 14px;
    top: 14px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--panel-bg);
    color: var(--muted-text-color);
    cursor: pointer;
    z-index: 2;
}

.group-member-profile-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(74,111,255,.12), rgba(74,111,255,.03));
}

.group-member-profile-avatar {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    border: 3px solid var(--panel-bg);
    box-shadow: 0 6px 18px rgba(0,0,0,.16);
}

.group-member-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.group-member-profile-main {
    min-width: 0;
    padding-right: 42px;
}

.group-member-profile-title {
    font-size: 21px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 6px;
}

.group-member-profile-subtitle {
    font-size: 13px;
    color: var(--muted-text-color);
}

.group-member-profile-form {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
}

.group-member-profile-form label {
    display: block;
    font-size: 13px;
    color: var(--muted-text-color);
    margin: 0 0 7px;
}

.group-member-profile-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.group-member-profile-row input[type="text"],
.group-member-profile-row input[type="file"] {
    flex: 1;
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-color);
}

.group-member-profile-tabs {
    display: flex;
    gap: 6px;
    padding: 12px 18px 0;
    background: var(--panel-bg);
    border-bottom: 1px solid var(--border-color);
}

.group-member-profile-tab {
    border: none;
    background: transparent;
    color: var(--muted-text-color);
    padding: 10px 12px;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
}

.group-member-profile-tab b {
    background: var(--hover-bg);
    color: var(--muted-text-color);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 11px;
}

.group-member-profile-tab.active {
    background: var(--hover-bg);
    color: var(--primary-color);
    font-weight: 700;
}

.group-member-profile-tab-panels {
    flex: 1;
    overflow: auto;
    padding: 18px;
    background: var(--panel-bg-soft);
}

.group-member-profile-panel {
    display: none;
}

.group-member-profile-panel.active {
    display: block;
}

.group-member-profile-media-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.group-member-profile-media-card {
    min-height: 112px;
    border: 1px solid var(--border-color);
    background: var(--panel-bg);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.group-member-profile-media-card img,
.group-member-profile-media-card video {
    width: 100%;
    height: 92px;
    object-fit: cover;
    display: block;
    background: #000;
}

.group-member-profile-media-card span {
    display: block;
    padding: 8px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-member-profile-media-card.file i {
    font-size: 34px;
    color: var(--primary-color);
    text-align: center;
    margin-top: 18px;
}

.group-member-profile-media-card.voice {
    padding: 10px;
}

.group-member-profile-media-card.voice audio {
    width: 100%;
}

.group-member-profile-empty {
    min-height: 170px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--muted-text-color);
}

.group-member-profile-empty i {
    font-size: 42px;
    opacity: .5;
}

@media (max-width: 768px) {
    .group-member-profile-content {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
    }
    .group-member-profile-header {
        padding: 18px;
    }
    .group-member-profile-row {
        flex-direction: column;
    }
    .group-member-profile-tabs {
        overflow-x: auto;
    }
    .group-member-profile-media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ==================== PROFILE MEDIA CONTEXT MENU / VIEWER ==================== */
.group-member-profile-media-card {
    cursor: pointer;
    user-select: none;
}
.group-member-profile-media-card:focus {
    outline: 2px solid var(--primary-color, #4a6fff);
    outline-offset: 2px;
}
.group-member-profile-media-context-menu {
    position: fixed;
    z-index: 100500;
    min-width: 220px;
    background: var(--menu-bg, #fff);
    color: var(--text-color, #1e293b);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 12px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, .22);
    padding: 6px;
}
.group-member-profile-media-context-menu button {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
}
.group-member-profile-media-context-menu button:hover {
    background: var(--hover-bg, #f5f7fb);
    color: var(--primary-color, #4a6fff);
}
.group-member-profile-media-viewer {
    position: fixed;
    inset: 0;
    z-index: 100400;
    background: rgba(15, 23, 42, .88);
    display: flex;
    flex-direction: column;
}
.group-member-profile-media-viewer-head {
    height: 56px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #fff;
}
.group-member-profile-media-viewer-name {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.group-member-profile-media-viewer-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.group-member-profile-media-viewer-close:hover {
    background: rgba(255,255,255,.22);
}
.group-member-profile-media-viewer-body {
    flex: 1;
    min-height: 0;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.group-member-profile-media-viewer-body img,
.group-member-profile-media-viewer-body video {
    max-width: 100%;
    max-height: 70vh;
}


/* Mail forward to dialog */
.mail-forward-dialog-overlay {
                position: fixed;
                inset: 0;
                display: none;
                align-items: center;
                justify-content: center;
                background: rgba(15, 23, 42, .35);
                z-index: 10020;
                padding: 16px;
            }
            .mail-forward-dialog-overlay.active {
                display: flex;
            }
            .mail-forward-dialog-modal {
                width: min(460px, 100%);
                max-height: min(620px, 92vh);
                background: #fff;
                border-radius: 18px;
                box-shadow: 0 22px 60px rgba(15, 23, 42, .28);
                overflow: hidden;
                display: flex;
                flex-direction: column;
            }
            .mail-forward-dialog-header {
                display: flex;
                justify-content: space-between;
                gap: 12px;
                padding: 16px 18px;
                border-bottom: 1px solid #e2e8f0;
            }
            .mail-forward-dialog-header strong {
                display: block;
                color: #1e293b;
                font-size: 16px;
            }
            .mail-forward-dialog-header span {
                display: block;
                margin-top: 4px;
                color: #64748b;
                font-size: 12px;
            }
            .mail-forward-dialog-close {
                width: 32px;
                height: 32px;
                border: none;
                border-radius: 50%;
                background: #f1f5f9;
                color: #64748b;
                font-size: 22px;
                cursor: pointer;
                flex-shrink: 0;
            }
            .mail-forward-dialog-search-wrap {
                position: relative;
                padding: 12px 16px;
                border-bottom: 1px solid #eef2f7;
            }
            .mail-forward-dialog-search-wrap i {
                position: absolute;
                left: 28px;
                top: 50%;
                transform: translateY(-50%);
                color: #94a3b8;
                font-size: 13px;
            }
            .mail-forward-dialog-search-wrap input {
                width: 100%;
                height: 38px;
                border: 1px solid #dbe3ef;
                border-radius: 12px;
                padding: 0 12px 0 36px;
                outline: none;
                font-size: 14px;
            }
            .mail-forward-dialog-list {
                overflow: auto;
                padding: 8px;
                min-height: 180px;
            }
            .mail-forward-dialog-item {
                width: 100%;
                border: none;
                background: #fff;
                border-radius: 14px;
                padding: 10px;
                display: flex;
                align-items: center;
                gap: 10px;
                text-align: left;
                cursor: pointer;
            }
            .mail-forward-dialog-item:hover,
            .mail-forward-dialog-item.active {
                background: #eef4ff;
            }
            .mail-forward-dialog-avatar {
                width: 38px;
                height: 38px;
                border-radius: 50%;
                background: #4a6fff;
                color: #fff;
                display: flex;
                align-items: center;
                justify-content: center;
                font-weight: 800;
                overflow: hidden;
                flex-shrink: 0;
            }
            .mail-forward-dialog-avatar img {
                width: 100%;
                height: 100%;
                object-fit: cover;
            }
            .mail-forward-dialog-name {
                color: #1e293b;
                font-weight: 800;
                font-size: 14px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }
            .mail-forward-dialog-meta {
                margin-top: 2px;
                color: #94a3b8;
                font-size: 11px;
            }
            .mail-forward-dialog-empty {
                padding: 28px 16px;
                color: #64748b;
                text-align: center;
                font-size: 14px;
            }
            .mail-forward-dialog-footer {
                display: flex;
                justify-content: flex-end;
                gap: 10px;
                padding: 14px 16px;
                border-top: 1px solid #e2e8f0;
                background: #f8fafc;
            }
            .mail-forward-dialog-cancel,
            .mail-forward-dialog-send {
                border: none;
                border-radius: 12px;
                padding: 10px 14px;
                font-weight: 800;
                cursor: pointer;
            }
            .mail-forward-dialog-cancel {
                background: #e2e8f0;
                color: #475569;
            }
            .mail-forward-dialog-send {
                background: #4a6fff;
                color: #fff;
            }
            .mail-forward-dialog-send:disabled {
                opacity: .5;
                cursor: not-allowed;
            }

/* ARHIV_19-06 — удаление / очистка истории (aura-message-delete-clean.js) */
.aura-msg-delete-clean-modal {
    z-index: 3100;
}

.aura-msg-delete-clean-content {
    max-width: 420px;
}

.aura-msg-delete-clean-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.aura-msg-delete-clean-title .fa-trash-alt {
    color: #dc3545;
}

.aura-msg-delete-clean-title .fa-broom {
    color: #6c757d;
}

.aura-msg-delete-clean-subtitle {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--muted-text-color);
}

.aura-msg-delete-clean-preview {
    margin: 0 0 12px;
    padding: 10px 12px;
    background: var(--panel-bg-soft, #f8f9fa);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-color);
    word-break: break-word;
    max-height: 100px;
    overflow-y: auto;
}

.aura-msg-delete-clean-hint {
    margin: 0 0 14px;
    font-size: 12px;
    color: var(--muted-text-color);
    line-height: 1.45;
}

.aura-msg-delete-clean-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aura-msg-delete-clean-btn {
    width: 100%;
    justify-content: center;
}

.aura-msg-delete-clean-btn--danger {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
}

@media (min-width: 480px) {
    .aura-msg-delete-clean-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .aura-msg-delete-clean-btn {
        width: auto;
        min-width: 120px;
    }
}

/* Приглушённые диалоги — серый счётчик непрочитанного (aura-dialog-notify-mute.js) */
.dialog-item.dialog-notifications-muted .unread-badge,
.unread-badge.unread-badge--muted {
    background-color: #94a3b8;
    color: #fff;
}

html[data-theme="dark"] .dialog-item.dialog-notifications-muted .unread-badge,
html[data-theme="dark"] .unread-badge.unread-badge--muted {
    background-color: #64748b;
}