/* PresenceBar — индикатор онлайн-юзеров и hover-preview. */

.presence-bar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.presence-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    overflow: hidden;
    cursor: default;
    user-select: none;
    transition: transform 0.12s ease;
}

.presence-avatar:hover {
    transform: scale(1.12);
    z-index: 2;
}

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

.presence-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    background: #22c55e;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid var(--bg-color, #1a1a1a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #000;
    font-weight: 700;
    line-height: 1;
}

.presence-overflow {
    font-size: 11px;
    opacity: 0.7;
    margin-left: 4px;
}

/* ── Hover-preview ───────────────────────────────────────────── */

.presence-preview {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
    background: var(--panel-bg, #222);
    color: var(--text-color, #eee);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 120px;
    max-width: 220px;
}

.presence-preview.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.presence-preview-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    flex-shrink: 0;
}

.presence-preview-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.presence-preview-login {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    word-break: break-word;
}

.presence-preview-status {
    font-size: 11px;
    opacity: 0.7;
    text-align: center;
}

/* ── Folder activity (аватарки в дереве) ─────────────────────── */

.folder-activity-avatars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
    vertical-align: middle;
}

.folder-activity-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    overflow: hidden;
    border: 1px solid;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px var(--bg-color, #1a1a1a);
}

.folder-activity-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.folder-activity-more {
    font-size: 9px;
    opacity: 0.6;
    margin-left: 2px;
}

/* ── Channel unread (бейдж непрочитанного канала на узле дерева) ── */

.folder-channel-unread {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    margin-left: 6px;
    border-radius: 8px;
    background: var(--accent, #6366f1);
    color: #0a0a0a;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    flex-shrink: 0;
}

