/* ChannelsPanel — вкладка «Каналы» аккордеона (под «Эфиром»). */

.channels-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.accordion-section-title.has-mb-header .channels-notify.is-mentions {
    color: rgb(var(--accent-rgb));
}
.accordion-section-title.has-mb-header .channels-notify.is-muted {
    color: var(--text-muted, #9ca3af);
}

.channels-panel__host {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.channels-panel__host .comments-thread {
    flex: 1 1 auto;
    min-height: 0;
}

.channels-panel__thread {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* ── Агрегат каналов проекта (список дочерних folder-каналов) ─────── */
.channels-aggregate {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    max-height: 40%;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.1));
}
.channels-aggregate__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 6px;
}
.channels-aggregate__title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #9ca3af);
}
.channels-aggregate__total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    border-radius: 8px;
    background: var(--accent, #6366f1);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
}
.channels-aggregate__list {
    overflow-y: auto;
    padding: 0 6px 6px;
}
.channels-aggregate__list--loading,
.channels-aggregate__empty {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
}
.channels-aggregate__row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 5px 8px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--text, #e5e7eb);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}
.channels-aggregate__row:hover {
    background: rgba(var(--accent-rgb), 0.12);
}
.channels-aggregate__row i {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.6;
}
.channels-aggregate__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.channels-aggregate__row.has-unread .channels-aggregate__name {
    font-weight: 600;
}
.channels-aggregate__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    border-radius: 8px;
    background: var(--accent, #6366f1);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
}

.channels-empty {
    padding: 24px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.55));
}

/* ── Поповер участников канала ─────────────────────────────────────── */
.channels-members-popover {
    min-width: 220px;
    max-width: 300px;
    max-height: 360px;
    overflow-y: auto;
    background: var(--bg, #1f2937);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    padding: 6px;
    color: var(--text, #e5e7eb);
}
.channels-members-popover__header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #9ca3af);
    padding: 4px 8px 8px;
}
.channels-members-popover__online { color: #34d399; }
.channels-members-popover__loading {
    padding: 12px 8px;
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    text-align: center;
}
.channels-members-popover__list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.channels-members-popover__row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 8px;
    border-radius: 6px;
}
.channels-members-popover__row:hover {
    background: rgba(var(--accent-rgb), 0.12);
}
.channels-members-popover__avatar {
    position: relative;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.channels-members-popover__avatar.is-present::after {
    content: '';
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #34d399;
    border: 2px solid var(--bg, #1f2937);
}
.channels-members-popover__name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.channels-members-popover__role {
    font-size: 10px;
    color: var(--text-muted, #9ca3af);
    background: rgba(255, 255, 255, 0.07);
    padding: 1px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}
html.light .channels-members-popover {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
    color: #111827;
}

/* ── Режим ассистента (off/mention/ambient) ────────────────────────── */
.channels-ai-mode.is-off { color: var(--text-muted, #9ca3af); }
.channels-ai-mode.is-mention { color: #34d399; }
.channels-ai-mode.is-ambient { color: var(--accent, #6366f1); }
.channels-ai-mode-popover__item.is-active { color: #34d399; }
.channels-ai-mode-popover {
    min-width: 180px;
    background: var(--bg, #1f2937);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    padding: 4px;
    color: var(--text, #e5e7eb);
}
.channels-ai-mode-popover__item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 9px;
    border: none;
    background: none;
    color: inherit;
    font-size: 13px;
    text-align: left;
    border-radius: 6px;
    cursor: pointer;
}
.channels-ai-mode-popover__item:hover {
    background: rgba(var(--accent-rgb), 0.12);
}
.channels-ai-mode-popover__item.is-active {
    font-weight: 600;
}
.channels-ai-mode-popover__item i,
.channels-ai-mode-popover__item svg {
    width: 15px;
    height: 15px;
}
html.light .channels-ai-mode-popover {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
    color: #111827;
}
html.light .channels-members-popover__avatar.is-present::after {
    border-color: #fff;
}
