.session-state-indicators {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    vertical-align: middle;
}

.session-pending-indicator {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 10px;
}

.session-pending-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.35;
    animation: sessionPendingPulse 1.2s infinite ease-in-out;
}

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

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

@keyframes sessionPendingPulse {
    0%, 80%, 100% {
        opacity: 0.25;
        transform: scale(0.85);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

.session-unread-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--primary-color, #3498db);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
    animation: sessionUnreadPulse 1.8s ease-in-out infinite;
}

body.dark-theme .session-unread-indicator {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

@keyframes sessionUnreadPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.58;
        transform: scale(0.78);
    }
}

@media (prefers-reduced-motion: reduce) {
    .session-unread-indicator {
        animation: none;
    }
}

/* Numeric badge shown when unread_count > 1 */
.session-unread-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--primary-color, #3498db);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

body.dark-theme .session-unread-count-badge {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* ── "…and you were named in it" ───────────────────────────────────────────────
   A MODIFIER ON THE UNREAD INDICATOR, never a second element beside it. Being
   mentioned is a property of unread — the server only ever flags a session it
   has already returned as unread — so a separate badge would be a second thing
   to clear, able to disagree with the first about whether you have caught up.

   It reads as a mention, not as a colour: a red "@" in a small circle. Red is
   what a message shows your own name in (`.mention-name--self`), so the list
   and the transcript use the same cue. The glyph is drawn by CSS (the node
   stays empty), and `title` / `aria-label` say it in words. */
.session-unread-indicator--mentioned,
.session-unread-count-badge--mentioned {
    --mention-self: #dc2626;
    background: var(--mention-self);
    color: #fff;
}

body.dark-theme .session-unread-indicator--mentioned,
body.dark-theme .session-unread-count-badge--mentioned {
    --mention-self: #f87171;
    color: #1a1a1a;
}

.session-unread-indicator--mentioned {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    animation: none;   /* a pulsing glyph shrinks below legibility */
}

.session-unread-indicator--mentioned::before,
.session-unread-count-badge--mentioned::before {
    content: "@";
}

.session-unread-count-badge--mentioned::before {
    margin-right: 1px;
    font-weight: 800;
}

/* ── "…and one of them is Important / Urgent" ─────────────────────────────────
   Another MODIFIER ON THE UNREAD INDICATOR (see the mention modifier above): a
   property of the unread row, cleared by the same watermark, never a second
   badge. It outranks the mention glyph. Important is an amber-red "!" in a
   circle; Urgent is solid red with a bell (the icon Urgent wears everywhere) and
   a slow pulsing ring, because it is the one that is still being re-announced
   and should be the hardest to miss. The "!" is drawn by CSS and the bell is an
   icon element; `title` / `aria-label` say it in words. */
.session-unread-indicator--important,
.session-unread-indicator--urgent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.session-unread-indicator--important {
    background: #e8590c;
    animation: none;
}
.session-unread-indicator--important::before { content: "!"; }

.session-unread-indicator--urgent {
    background: #c92a2a;
    border-radius: 50%;
    font-size: 10px;
    animation: session-urgent-pulse 1.6s ease-out infinite;
}

@keyframes session-urgent-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(201, 42, 42, 0.55); }
    70%  { box-shadow: 0 0 0 7px rgba(201, 42, 42, 0); }
    100% { box-shadow: 0 0 0 0 rgba(201, 42, 42, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .session-unread-indicator--urgent { animation: none; }
}

/* The Teams sidebar paints every unread badge amber; these keep their own colour. */
.sidebar[data-mode="teams"] .sessions-list-container .session-item.has-unread-assistant:not(.active)
    .session-unread-indicator--important { background: #e8590c; }
.sidebar[data-mode="teams"] .sessions-list-container .session-item.has-unread-assistant:not(.active)
    .session-unread-indicator--urgent { background: #c92a2a; }

/* ── "Unread messages" separator ───────────────────────────────────────────── */

.chat-unread-separator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 16px 12px;
    pointer-events: none;
    user-select: none;
}

.chat-unread-separator::before,
.chat-unread-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--primary-color, #3498db);
    opacity: 0.5;
}

.chat-unread-separator span {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary-color, #3498db);
    white-space: nowrap;
    padding: 2px 6px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary-color, #3498db) 12%, transparent);
}

body.dark-theme .chat-unread-separator span {
    background: color-mix(in srgb, var(--primary-color, #3498db) 20%, transparent);
}

.session-item.has-unread-assistant {
    background: #96ddf626;
}

.session-item.has-unread-assistant:hover {
    background: #96ddf640;
}

/* Unread @mention highlight — same visual weight as unread assistant */
.session-item.has-unread-mention {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.13), rgba(52, 152, 219, 0.08));
    border-left: 3px solid #dc2626;
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.10);
}

.session-item.has-unread-mention:hover {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.19), rgba(52, 152, 219, 0.12));
}
