/* Halo Bento: styles moved out of inline component <style> blocks.
   They stay global (as they were) so selector reach is unchanged. */

/* -- ActiveCallsList -- */
.active-calls-list {
    display: flex;
    flex-direction: column;
    gap: var(--halo-1);
}

.active-calls-list__item {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 13px 14px;
    border: 1px solid var(--halo-hairline);
    border-radius: var(--halo-radius-md);
    background: var(--halo-surface);
    cursor: pointer;
    transition: background-color var(--halo-duration-1) var(--halo-ease-out), border-color var(--halo-duration-1) var(--halo-ease-out);
    user-select: none;
}

.active-calls-list__item:hover {
    background: var(--halo-surface-hover);
    border-color: var(--halo-hairline-strong);
}

.active-calls-list__item--selected {
    border-color: rgb(var(--halo-tone-brand) / .3);
    background: var(--halo-tint-brand);
}

.active-calls-list__item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--halo-1);
}

.active-calls-list__state-row {
    display: flex;
    align-items: center;
    gap: var(--halo-1);
}

/* Pulsing status dots */
.active-calls-list__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.active-calls-list__status-dot--inprogress {
    background-color: var(--halo-ink-success);
    animation: acl-pulse 1.5s ease-in-out infinite;
}

.active-calls-list__status-dot--ringing { background-color: var(--halo-action-info); }

.active-calls-list__status-dot--onhold {
    background-color: var(--halo-action-warning);
    animation: acl-pulse 1.5s ease-in-out infinite;
}

.active-calls-list__status-dot--initiating {
    background-color: var(--halo-ink-info);
    animation: acl-pulse 1.5s ease-in-out infinite;
}

.active-calls-list__status-dot--default {
    background-color: var(--halo-text-tertiary);
}

@keyframes acl-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.active-calls-list__elapsed-static {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--halo-ink-brand);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.active-calls-list__elapsed {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--halo-ink-brand);
}

.active-calls-list__item-primary {
    display: flex;
    align-items: center;
    gap: 6px;
}

.active-calls-list__numbers {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--halo-text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.active-calls-list__item-secondary {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--halo-text-tertiary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.active-calls-empty {
    min-height: 200px;
    box-shadow: none;
    background: transparent;
}

/* -- ActiveCallsPanel -- */
/* Shell fills the remaining viewport height and clips its children to the
   rounded border. The waiting band is pinned on top; the call table scrolls
   in the space that remains, so the panel stays the same height as Agent
   Status whether empty or full. */
.active-calls-shell {
    display: flex;
    flex-direction: column;
    height: var(--supervisor-panel-height, 360px);
    overflow: hidden;
    border: none;
    background: transparent;
}

.active-calls-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

/* ── Waiting to assign ── */
.active-calls-waiting {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: var(--halo-surface);
    border: 1px solid rgb(var(--halo-tone-critical) / 0.13);
    border-radius: var(--halo-radius-lg);
    margin-bottom: 10px;
}

.awaiting-queue {
    background: var(--halo-surface);
    border: 1px solid rgb(var(--halo-tone-critical) / 0.16);
    border-radius: var(--halo-radius-md);
    overflow: hidden;
}

.awaiting-queue__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
}

.awaiting-queue__pulse {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--halo-surface-sunken);
    color: var(--halo-ink-critical);
}

/* Soft expanding-ring "ringing" pulse — occasional + meaningful, so it earns
   the motion. Disabled under reduced-motion (handled globally in app.css). */
.awaiting-queue__pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgb(var(--halo-tone-critical) / 0.45);
    animation: awaiting-ring 1.6s var(--halo-ease) infinite;
}

@keyframes awaiting-ring {
    to {
        box-shadow: 0 0 0 12px rgb(var(--halo-tone-critical) / 0);
    }
}

.awaiting-queue__name {
    color: var(--halo-text);
    font-size: 0.86rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.awaiting-queue__count {
    color: var(--halo-ink-critical);
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.awaiting-queue__spacer {
    flex: 1;
}

/* Per-caller list: who is in line (number, position, wait). */
.awaiting-callers {
    list-style: none;
    margin: 0;
    padding: 4px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Wait urgency escalates with time on hold: soft blue → yellow (2 min) → red
   (5 min, pulsing). Color is never the only signal — the ticking timer and
   position number carry the same story. */
.awaiting-caller {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: var(--halo-surface-sunken);
    border-radius: var(--halo-radius-sm);
    font-size: 0.8rem;
    transition: background-color 0.4s ease;
}

.awaiting-caller--warm {
    background: var(--halo-soft-yellow);
}

.awaiting-caller--warm .awaiting-caller__wait { color: var(--halo-ink-warning); }

.awaiting-caller--hot {
    background: var(--halo-soft-red);
    animation: awaiting-hot 1.8s ease-in-out infinite;
}

.awaiting-caller--hot .awaiting-caller__wait { color: var(--halo-ink-critical); }

@keyframes awaiting-hot {
    0%, 100% { box-shadow: 0 0 0 0 rgb(var(--halo-tone-critical) / 0); }
    50% { box-shadow: none; }
}

.awaiting-caller__pos {
    flex: 0 0 auto;
    min-width: 28px;
    color: var(--halo-ink-critical);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.awaiting-caller__num {
    flex: 1;
    min-width: 0;
    color: var(--halo-text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.awaiting-caller__wait {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    color: var(--halo-text-secondary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.awaiting-row__agent {
    min-width: 0;
    max-width: 180px;
    min-height: 34px;
    padding: 0 8px;
    border: 1px solid var(--halo-hairline);
    border-radius: var(--halo-radius-md);
    background: var(--halo-surface);
    color: var(--halo-text);
    font-size: 0.78rem;
    font-weight: 600;
}

.awaiting-row__assign {
    min-height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--halo-radius-md);
    background: var(--halo-ink-critical);
    color: var(--halo-text-inverse);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 140ms ease;
}

.awaiting-row__assign:hover:not(:disabled) {
    filter: brightness(0.94);
}

.awaiting-row__assign:disabled {
    background: var(--halo-hairline);
    color: var(--halo-text-tertiary);
    cursor: not-allowed;
}

.active-calls-table {
    width: 100%;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.active-calls-table__direction-col {
    width: 13%;
}

.active-calls-table__numbers-col {
    width: 29%;
}

.active-calls-table__participants-col {
    width: 24%;
}

.active-calls-table__duration-col {
    width: 13%;
}

.active-calls-table__status-col {
    width: 14%;
}

.active-calls-table__details-col {
    width: 8%;
}

.active-calls-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 10px;
    border-bottom: 1px solid var(--halo-hairline);
    background: var(--halo-surface-sunken);
    color: var(--halo-text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: left;
    white-space: nowrap;
}

.active-calls-table td {
    padding: 10px;
    border-bottom: 1px solid var(--halo-hairline);
    color: var(--halo-text);
    vertical-align: middle;
}

.active-calls-table tbody tr:last-child td {
    border-bottom: 0;
}

.active-calls-table tbody tr:hover td {
    background: var(--halo-soft-navy);
}

.active-calls-table__direction {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--halo-text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.active-calls-table__direction-icon {
    color: var(--halo-text-tertiary);
    flex-shrink: 0;
}

.active-calls-table__numbers,
.active-calls-table__participants {
    display: block;
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-calls-table__numbers {
    color: var(--halo-text);
    font-size: 0.86rem;
    font-weight: 600;
}

.active-calls-table__participants,
.active-calls-table__empty-value {
    color: var(--halo-text-tertiary);
    font-size: 0.8rem;
    font-weight: 500;
}

.active-calls-table__empty-row {
    height: 48px;
    text-align: left;
}

.active-calls-table__empty-row span {
    color: var(--halo-text-tertiary);
    font-size: 0.82rem;
    font-weight: 600;
}

.active-calls-table__elapsed,
.active-calls-table__elapsed {
    color: var(--halo-ink-success);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.active-calls-table__actions-header {
    text-align: right !important;
}

.active-calls-table__actions {
    display: flex;
    justify-content: flex-end;
}

.active-calls-table__open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--halo-hairline);
    border-radius: var(--halo-radius-sm);
    background: var(--halo-surface);
    color: var(--halo-text-secondary);
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.active-calls-table__open-btn:hover {
    border-color: var(--halo-ink-brand);
    background: var(--halo-soft-navy);
    color: var(--halo-ink-brand);
}

/* ── Active call cards (re-architected from the table) ── */
.acp-calls {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
    gap: 8px;
    align-content: start;
    padding: 1px 4px 1px 1px;
}

.acp-call {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--halo-surface);
    border: 1px solid var(--halo-hairline);
    box-shadow: none;
    border-radius: var(--halo-radius-md);
    padding: 9px 11px;
    animation: acp-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: box-shadow 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s;
}

.acp-call__top { display: flex; align-items: center; gap: 9px; min-width: 0; }
.acp-call__bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }

.acp-call:hover {
    transform: translateY(-1px);
    box-shadow: var(--halo-shadow-lift);
    border-color: var(--halo-hairline);
}

.acp-call--live {
    background: var(--halo-surface);
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--halo-fill-navy);
}

.acp-call:nth-child(1) { animation-delay: 0.03s; }
.acp-call:nth-child(2) { animation-delay: 0.07s; }
.acp-call:nth-child(3) { animation-delay: 0.11s; }
.acp-call:nth-child(4) { animation-delay: 0.15s; }
.acp-call:nth-child(5) { animation-delay: 0.19s; }
.acp-call:nth-child(6) { animation-delay: 0.23s; }

.acp-call__dir {
    position: relative;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: var(--halo-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.acp-call__dir .mud-icon-root { font-size: 1rem; }

.acp-call__dir--inbound { background: var(--halo-surface-sunken); color: var(--halo-ink-success); }
.acp-call__dir--outbound { background: var(--halo-surface-sunken); color: var(--halo-ink-brand); }

.acp-call--live .acp-call__dir::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--halo-radius-md);
    box-shadow: 0 0 0 0 rgb(var(--halo-tone-brand) / 0.4);
    animation: acp-ring 1.8s var(--halo-ease) infinite;
}

.acp-call__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.acp-call__numbers {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    font-weight: 700;
    font-size: 0.84rem;
    color: var(--halo-text);
    font-variant-numeric: tabular-nums;
    min-width: 0;
}

.acp-call__from, .acp-call__to { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acp-call__arrow { color: var(--halo-text-tertiary); flex-shrink: 0; }

.acp-call__people {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    font-size: 0.74rem;
    color: var(--halo-text-tertiary);
    font-weight: 600;
    min-width: 0;
}
.acp-call__people span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acp-call__people .mud-icon-root { font-size: 0.95rem; flex-shrink: 0; }

.acp-call__meta { display: flex; flex-direction: row; align-items: center; gap: 7px; flex-shrink: 0; }

.acp-call__elapsed {
    color: var(--halo-ink-brand);
    font-weight: 700;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.acp-call__elapsed--ringing {
    color: var(--halo-ink-warning);
}

.acp-call__open {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: 1px solid var(--halo-hairline);
    border-radius: var(--halo-radius-sm);
    background: var(--halo-surface);
    color: var(--halo-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.acp-call__open:hover {
    border-color: var(--halo-ink-brand);
    background: var(--halo-soft-navy);
    color: var(--halo-ink-brand);
    transform: translateY(-1px);
}

/* Empty state */
.acp-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    min-height: 200px;
    padding: 24px;
    text-align: center;
}
.acp-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--halo-radius-lg);
    background: var(--halo-soft-navy);
    color: var(--halo-ink-brand);
    flex-shrink: 0;
}
.acp-empty__title { margin: 0; font-weight: 700; font-size: 0.95rem; color: var(--halo-text); }
.acp-empty__sub { margin: 2px 0 0; font-size: 0.82rem; color: var(--halo-text-tertiary); }

@keyframes acp-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes acp-ring {
    to { box-shadow: 0 0 0 10px rgb(var(--halo-tone-brand) / 0); }
}

@media (prefers-reduced-motion: reduce) {
    .acp-call, .acp-call--live .acp-call__dir::after { animation: none !important; }
}

@media (max-width: 767px) {
    .active-calls-shell {
        height: auto;
        max-height: 70vh;
    }

    .active-calls-table {
        min-width: 680px;
    }
}

/* -- AgentStatusPanel -- */
/* ── Header search ── */
.asp-search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 180px;
    padding: 0 10px;
    height: 34px;
    border: 1px solid var(--halo-hairline);
    border-radius: var(--halo-radius-pill);
    background: var(--halo-surface);
    color: var(--halo-text-tertiary);
    transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.asp-search:focus-within {
    border-color: var(--halo-ink-brand);
    box-shadow: none;
}

.asp-search .mud-icon-root { font-size: 1rem; flex-shrink: 0; }

.asp-search input {
    border: 0;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--halo-text);
    font-family: inherit;
}

.asp-search input::placeholder { color: var(--halo-text-tertiary); }

/* ── Team mix strip: donut + filter chips ── */
.asp-mix {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 2px 10px;
}

.asp-donut {
    position: relative;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
}

.asp-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.asp-donut__track {
    fill: none;
    stroke: var(--halo-surface-sunken);
    stroke-width: 6;
}

.asp-donut__seg {
    fill: none;
    stroke-width: 6;
    cursor: pointer;
    animation: asp-donut-in 0.8s var(--halo-ease) both;
    transition: stroke-dasharray 0.5s var(--halo-ease),
                stroke-dashoffset 0.5s var(--halo-ease),
                stroke-width 0.15s ease;
}

.asp-donut__seg:hover { stroke-width: 7.5; }

.asp-donut__seg--online { stroke: var(--halo-ink-success); }
.asp-donut__seg--busy { stroke: var(--halo-ink-warning); }
.asp-donut__seg--away { stroke: var(--halo-ink-brand); }
.asp-donut__seg--offline { stroke: var(--halo-text-tertiary); }

.asp-donut__center {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.asp-donut__center strong {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--halo-text);
    font-variant-numeric: tabular-nums;
}

.asp-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.asp-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 10px;
    border: 1px solid var(--halo-hairline);
    border-radius: var(--halo-radius-pill);
    background: var(--halo-surface);
    color: var(--halo-text-secondary);
    font-size: 0.7rem;
    font-weight: 750;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.asp-chip strong { font-weight: 800; font-variant-numeric: tabular-nums; }

.asp-chip:hover:not(:disabled) { transform: translateY(-1px); border-color: rgb(var(--halo-tone-brand) / 0.35); }

.asp-chip:disabled { opacity: 0.45; cursor: default; }

.asp-chip:focus-visible {
    outline: none;
    box-shadow: none;
}

.asp-chip--active,
.asp-chip--active:hover:not(:disabled) {
    background: var(--halo-ink-brand);
    border-color: var(--halo-ink-brand);
    color: var(--halo-text-inverse);
}

.asp-chip__dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: var(--halo-text-tertiary); }
.asp-chip--online .asp-chip__dot { background: var(--halo-ink-success); }
.asp-chip--busy .asp-chip__dot { background: var(--halo-ink-warning); }
.asp-chip--away .asp-chip__dot { background: var(--halo-ink-brand); }
.asp-chip--offline .asp-chip__dot { background: var(--halo-text-tertiary); }
.asp-chip--oncall .asp-chip__dot { background: var(--halo-ink-brand); }
.asp-chip--active .asp-chip__dot { background: var(--halo-surface); }

/* ── No-match state ── */
.asp-nomatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: calc(var(--supervisor-panel-height, 360px) - 62px);
    color: var(--halo-text-secondary);
    font-size: 0.85rem;
    font-weight: 650;
    text-align: center;
}

.asp-nomatch .mud-icon-root { font-size: 1.6rem; color: var(--halo-text-tertiary); }

.asp-nomatch__clear {
    border: 1px solid rgb(var(--halo-tone-brand) / 0.3);
    border-radius: var(--halo-radius-pill);
    background: var(--halo-soft-navy);
    color: var(--halo-ink-brand);
    padding: 6px 14px;
    font-size: 0.76rem;
    font-weight: 750;
    cursor: pointer;
    transition: background-color 0.14s ease, color 0.14s ease;
}

.asp-nomatch__clear:hover { background: var(--halo-ink-brand); color: var(--halo-text-inverse); }

/* Dense live-monitoring grid: compact agent tiles in an auto-fill grid so a
   wall display / TV shows many agents at once. Status is color-coded (tinted
   tile + avatar + pill) for at-a-glance scanning; scrolls internally. */
.asp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
    gap: 8px;
    align-content: start;
    height: calc(var(--supervisor-panel-height, 360px) - 62px);
    overflow-y: auto;
    padding: 1px 4px 1px 1px;
}

.asp-agent {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 9px 11px;
    border-radius: var(--halo-radius-md);
    background: var(--halo-surface);
    border: 1px solid var(--halo-hairline);
    box-shadow: none;
    animation: asp-in 0.35s var(--halo-ease) both;
    transition: box-shadow 0.18s var(--halo-ease), transform 0.18s var(--halo-ease), border-color 0.18s;
}

.asp-agent:hover {
    transform: translateY(-1px);
    box-shadow: var(--halo-shadow-lift);
}

/* Status tint: subtle bg wash + matching hairline so the grid reads as
   color-coded clusters from across the room. */
.asp-agent--online { background: var(--halo-surface); border-color: rgb(var(--halo-tone-success) / 0.20); }
.asp-agent--busy { background: var(--halo-surface); border-color: rgb(var(--halo-tone-warning) / 0.24); }
.asp-agent--away { background: var(--halo-surface); border-color: rgb(var(--halo-tone-brand) / 0.20); }
.asp-agent--offline { background: var(--halo-surface); border-color: var(--halo-hairline); }

/* On a live call → the priority state: navy ring + soft tint. */
.asp-agent--oncall {
    background: var(--halo-surface);
    border-color: transparent !important;
    box-shadow: 0 0 0 2px var(--halo-fill-navy);
}

.asp-agent:nth-child(1) { animation-delay: 0.02s; }
.asp-agent:nth-child(2) { animation-delay: 0.05s; }
.asp-agent:nth-child(3) { animation-delay: 0.08s; }
.asp-agent:nth-child(4) { animation-delay: 0.11s; }
.asp-agent:nth-child(5) { animation-delay: 0.14s; }
.asp-agent:nth-child(6) { animation-delay: 0.17s; }

.asp-agent__main {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

/* Avatar with presence badge */
.asp-avatar {
    position: relative;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.68rem;
    color: var(--halo-text-inverse);
}

.asp-avatar--online { background: var(--halo-action-success); }
.asp-avatar--busy { background: var(--halo-action-warning); }
.asp-avatar--away { background: var(--halo-action-brand); }
.asp-avatar--offline { background: var(--halo-action-neutral); }

.asp-avatar__presence {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--halo-surface);
}

.asp-avatar--online .asp-avatar__presence { background: var(--halo-ink-success); animation: asp-breathe 2s ease-in-out infinite; }
.asp-avatar--busy .asp-avatar__presence { background: var(--halo-ink-warning); }
.asp-avatar--away .asp-avatar__presence { background: var(--halo-text-tertiary); }
.asp-avatar--offline .asp-avatar__presence { background: var(--halo-text-tertiary); }

.asp-agent__id {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.asp-agent__name {
    font-weight: 700;
    font-size: 0.84rem;
    color: var(--halo-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.asp-agent__meta {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--halo-text-tertiary);
    white-space: nowrap;
    overflow: hidden;
}

.asp-agent__ext { flex-shrink: 0; }
.asp-dotsep { color: var(--halo-hairline-strong); flex-shrink: 0; }
.asp-callstate { color: var(--halo-text-secondary); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.asp-agent__call-dir { color: var(--halo-text-tertiary); font-size: 0.95rem !important; flex-shrink: 0; }

.asp-agent__elapsed {
    color: var(--halo-ink-brand);
    font-size: 0.72rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* Status pill */
.asp-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--halo-radius-pill);
    font-size: 0.69rem;
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
}

.asp-pill__dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.asp-pill--online { background: var(--halo-surface-sunken); color: var(--halo-ink-success); }
.asp-pill--online .asp-pill__dot { background: var(--halo-ink-success); }
.asp-pill--busy { background: var(--halo-text-tertiary); color: var(--halo-ink-warning); }
.asp-pill--busy .asp-pill__dot { background: var(--halo-ink-warning); }
.asp-pill--away { background: var(--halo-surface-sunken); color: var(--halo-ink-brand); }
.asp-pill--away .asp-pill__dot { background: var(--halo-ink-brand); }
.asp-pill--offline { background: var(--halo-surface-sunken); color: var(--halo-text-tertiary); }
.asp-pill--offline .asp-pill__dot { background: var(--halo-text-tertiary); }

/* Assist buttons — compact labeled chips, only while on a call */
.asp-agent__assist { display: flex; gap: 5px; flex-wrap: wrap; }

.asp-assist-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 26px;
    padding: 0 9px 0 7px;
    border: 1px solid rgb(var(--halo-tone-brand) / 0.22);
    border-radius: var(--halo-radius-pill);
    background: var(--halo-surface);
    color: var(--halo-ink-brand);
    font-size: 0.68rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.12s ease;
}

.asp-assist-btn .mud-icon-root { font-size: 0.95rem; }

.asp-assist-btn:hover {
    border-color: var(--halo-ink-brand);
    background: var(--halo-soft-navy);
    color: var(--halo-ink-brand);
    transform: translateY(-1px);
}

.asp-assist-btn--barge {
    border-color: rgb(var(--halo-tone-critical) / 0.32);
    color: var(--halo-ink-critical);
}

.asp-assist-btn--barge:hover {
    border-color: rgb(var(--halo-tone-critical) / 0.5);
    background: var(--halo-soft-red);
    color: var(--halo-ink-critical);
}

/* Routing selects — compact inline controls */
.asp-agent__routes {
    display: flex;
    gap: 6px 8px;
    flex-wrap: wrap;
}

.asp-route {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.asp-route__label {
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--halo-text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

.asp-route__select {
    min-height: 25px;
    padding: 0 22px 0 9px;
    border: 1px solid var(--halo-hairline);
    border-radius: var(--halo-radius-pill);
    background-color: var(--halo-text-inverse);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A89A3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    color: var(--halo-text);
    font-size: 0.71rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.asp-route__select:focus-visible {
    outline: none;
    border-color: var(--halo-ink-brand);
    box-shadow: none;
}

.agent-status-empty {
    min-height: 200px;
    box-shadow: none;
    background: transparent;
}

@keyframes asp-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@keyframes asp-breathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.62); opacity: 0.55; }
}

@keyframes asp-donut-in {
    from { stroke-dasharray: 0 100; }
}

@media (prefers-reduced-motion: reduce) {
    .asp-agent, .asp-avatar__presence, .asp-donut__seg { animation: none !important; }
    .asp-donut__seg { transition: none; }
}

@media (max-width: 640px) {
    .asp-search { min-width: 0; width: 100%; }
    .asp-mix { flex-direction: column; align-items: flex-start; }
}

/* -- CallDetailPanel -- */
.cdp-card {
    background: var(--halo-surface);
    border-radius: var(--halo-radius-lg);
    box-shadow: none;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cdp-skeleton {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cdp-skeleton-row {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.cdp-empty {
    min-height: 200px;
    box-shadow: none;
    background: transparent;
}

.cdp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cdp-direction-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cdp-direction-icon--inbound {
    color: var(--halo-ink-brand);
}

.cdp-direction-icon--outbound {
    color: var(--halo-ink-success);
}

.cdp-direction-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--halo-text);
    line-height: 1.3;
}

.cdp-numbers {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cdp-number-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cdp-number-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--halo-text-tertiary);
    min-width: 36px;
}

.cdp-number-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--halo-text);
    font-variant-numeric: tabular-nums;
}

.cdp-duration-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cdp-elapsed {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--halo-text-tertiary);
    font-variant-numeric: tabular-nums;
}

.cdp-elapsed--active {
    color: var(--halo-ink-success);
}

.cdp-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cdp-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--halo-text-tertiary);
    letter-spacing: 0.04em;
}

.cdp-participants {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cdp-participant {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--halo-surface);
    border-radius: var(--halo-radius-sm);
}

.cdp-participant-icon {
    color: var(--halo-text-tertiary);
    font-size: 1rem !important;
}

.cdp-participant-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cdp-participant-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--halo-text);
    line-height: 1.3;
}

.cdp-participant-type {
    font-size: 0.6875rem;
    font-weight: 400;
    color: var(--halo-text-tertiary);
    line-height: 1.3;
}

.cdp-timestamps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cdp-timestamp-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cdp-timestamp-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--halo-text-tertiary);
    min-width: 72px;
}

.cdp-timestamp-value {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--halo-text);
    cursor: default;
}

/* -- ConnectionStatusIndicator -- */
.conn-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.conn-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color var(--halo-duration-2) var(--halo-ease-out);
}

.conn-status-dot--connected {
    background-color: var(--halo-fill-green);
    box-shadow: none;
}

.conn-status-dot--reconnecting {
    background-color: var(--halo-fill-yellow);
    animation: conn-pulse 1.5s ease-in-out infinite;
}

.conn-status-dot--disconnected {
    background-color: var(--halo-fill-red);
}

.conn-status-label {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.conn-status-label--reconnecting {
    color: var(--halo-ink-warning);
}

.conn-status-label--disconnected {
    color: var(--halo-ink-critical);
}

@keyframes conn-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* -- ConversationThreadPanel -- */
.ctp-card {
    background: var(--halo-surface);
    border-radius: var(--halo-radius-lg);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.ctp-skeleton {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ctp-skeleton-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.ctp-empty {
    min-height: 200px;
    box-shadow: none;
    background: transparent;
}

.ctp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--halo-surface-sunken);
    flex-shrink: 0;
}

.ctp-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ctp-external-number {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--halo-text);
    line-height: 1.3;
}

.ctp-platform-number {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--halo-text-tertiary);
    line-height: 1.3;
}

.ctp-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ctp-message-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--halo-text-tertiary);
}

.ctp-thread {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ctp-load-more {
    display: flex;
    justify-content: center;
    padding-bottom: 12px;
}

.ctp-load-more-btn {
    background: var(--halo-surface);
    border: none;
    border-radius: var(--halo-radius-pill);
    padding: 8px 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--halo-text-tertiary);
    cursor: pointer;
    transition: background 0.15s ease;
}

.ctp-load-more-btn:hover:not(:disabled) {
    background: var(--halo-surface-sunken);
}

.ctp-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ctp-retry-wrap {
    display: flex;
    justify-content: flex-end;
    padding: 0 4px;
}

.ctp-retry-btn {
    background: none;
    border: none;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--halo-ink-critical);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: opacity 0.15s ease;
}

.ctp-retry-btn:hover {
    opacity: 0.7;
}

/* -- CustomerContextCard -- */
.ccc-card {
    background: var(--halo-surface);
    border-radius: var(--halo-radius-lg);
    box-shadow: none;
    padding: 20px 24px;
    transition: box-shadow 0.2s ease;
}

.ccc-card:hover {
    box-shadow: none;
}

.ccc-card--empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
}

.ccc-empty-icon {
    color: var(--halo-text-tertiary);
    font-size: 1rem;
}

.ccc-empty-text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--halo-text-tertiary);
    user-select: none;
}

.ccc-skeleton {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ccc-skeleton-row {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.ccc-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 14px;
}

.ccc-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--halo-text);
    line-height: 1.3;
}

.ccc-phone {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--halo-text-tertiary);
    line-height: 1.3;
}

.ccc-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.ccc-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ccc-meta-icon {
    color: var(--halo-text-tertiary);
    font-size: 0.875rem !important;
}

.ccc-meta-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--halo-text);
    line-height: 1;
}

.ccc-meta-label {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--halo-text-tertiary);
    line-height: 1;
}

.ccc-meta-sep {
    width: 1px;
    height: 14px;
    background: var(--halo-surface-sunken);
    flex-shrink: 0;
}

.ccc-action {
    padding-top: 2px;
}

.ccc-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--halo-text);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s ease;
    user-select: none;
}

.ccc-profile-link:hover {
    opacity: 0.7;
}

.ccc-link-icon {
    font-size: 0.875rem !important;
    color: var(--halo-text);
}

/* -- LiveStatusBar -- */
.live-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--halo-surface);
    border-top: 1px solid var(--halo-hairline);
    padding: 10px 24px;
    min-height: 44px;
    user-select: none;
}

.live-status-bar__metrics {
    display: flex;
    align-items: center;
    gap: 16px;
}

.live-status-bar__metric {
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-status-bar__metric-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--halo-text-tertiary);
    line-height: 1;
    white-space: nowrap;
}

.live-status-bar__metric-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--halo-text);
    line-height: 1;
    white-space: nowrap;
}

.live-status-bar__separator {
    width: 1px;
    height: 14px;
    background: var(--halo-hairline);
    flex-shrink: 0;
}

.live-status-bar__connection {
    flex-shrink: 0;
}

/* -- LiveTrendChart -- */
.ltc-card { display: flex; flex-direction: column; }

.ltc-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ltc-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    font-weight: 650;
    color: var(--halo-text-secondary);
    white-space: nowrap;
}

.ltc-legend__item strong {
    color: var(--halo-text);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.ltc-legend__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ltc-legend__dot--navy { background: var(--halo-fill-navy); }
.ltc-legend__dot--red { background: var(--halo-ink-critical); }
.ltc-legend__dot--blue { background: var(--halo-fill-blue); }

.ltc-plot {
    position: relative;
    height: var(--ltc-height, 168px);
    margin: 6px 4px 2px;
}

.ltc-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.ltc-grid {
    stroke: var(--halo-surface-sunken);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 3 5;
}

.ltc-line {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: ltc-draw 0.9s var(--halo-ease) both;
}

.ltc-line--navy { stroke: var(--halo-fill-navy); }
.ltc-line--red { stroke: var(--halo-ink-critical); stroke-width: 2; }
.ltc-line--blue { stroke: var(--halo-fill-blue); stroke-width: 2; }

.ltc-area {
    fill: url(#ltc-area-fill);
    stroke: none;
    animation: ltc-fade 1.1s ease-out both;
}

.ltc-tip {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid var(--halo-surface);
    box-shadow: 0 1px 4px rgb(var(--halo-tone-brand) / 0.25);
    transition: top 0.5s var(--halo-ease), left 0.5s var(--halo-ease);
}

.ltc-tip--navy { background: var(--halo-fill-navy); }
.ltc-tip--red { background: var(--halo-ink-critical); }
.ltc-tip--blue { background: var(--halo-fill-blue); }

.ltc-tip--lead::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgb(var(--halo-tone-brand) / 0.45);
    animation: ltc-pulse 2s ease-out infinite;
}

.ltc-axis {
    position: absolute;
    font-size: 0.64rem;
    font-weight: 700;
    color: var(--halo-text-tertiary);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.ltc-axis--ymax { top: -4px; left: 0; }
.ltc-axis--ymid { top: calc(50% - 12px); left: 0; }
.ltc-axis--start { bottom: -16px; left: 0; }
.ltc-axis--end { bottom: -16px; right: 0; color: var(--halo-ink-brand); }

.ltc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: var(--ltc-height, 168px);
    margin: 6px 4px 2px;
    border: 1px dashed var(--halo-hairline-strong);
    border-radius: var(--halo-radius-md);
    background: var(--halo-surface-sunken);
    color: var(--halo-text-secondary);
    font-size: 0.85rem;
    font-weight: 650;
    text-align: center;
}

.ltc-empty small {
    color: var(--halo-text-tertiary);
    font-size: 0.74rem;
    font-weight: 600;
}

.ltc-empty__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--halo-ink-brand);
    animation: ltc-breathe 1.8s ease-in-out infinite;
}

@keyframes ltc-draw {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

@keyframes ltc-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ltc-pulse {
    0% { box-shadow: 0 0 0 0 rgb(var(--halo-tone-brand) / 0.45); }
    70% { box-shadow: 0 0 0 9px rgb(var(--halo-tone-brand) / 0); }
    100% { box-shadow: 0 0 0 0 rgb(var(--halo-tone-brand) / 0); }
}

@keyframes ltc-breathe {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.72); }
}

@media (prefers-reduced-motion: reduce) {
    .ltc-line, .ltc-area, .ltc-tip--lead::after, .ltc-empty__dot { animation: none !important; }
    .ltc-tip { transition: none; }
}

/* -- MessageComposeArea -- */
.mca-container {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 16px 24px;
    background: var(--halo-surface);
    border-top: 1px solid var(--halo-hairline);
}

.mca-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mca-input {
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    padding: 12px 16px;
    background: var(--halo-surface-sunken);
    border: 1px solid var(--halo-hairline-strong);
    border-radius: var(--halo-radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--halo-text);
    resize: none;
    outline: none;
    transition: background var(--halo-duration-1) var(--halo-ease), border-color var(--halo-duration-1) var(--halo-ease), box-shadow var(--halo-duration-1) var(--halo-ease);
    box-sizing: border-box;
}

.mca-input:focus {
    background: var(--halo-surface);
    border-color: var(--halo-focus-color);
    box-shadow: var(--halo-focus-ring);
}

.mca-input::placeholder {
    color: var(--halo-text-tertiary);
    font-weight: 400;
}

.mca-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mca-char-count {
    font-size: 0.6875rem;
    font-weight: 400;
    color: var(--halo-text-tertiary);
    text-align: right;
    line-height: 1;
    user-select: none;
    padding-right: 4px;
}

.mca-char-count--warn {
    color: var(--halo-ink-warning);
}

.mca-char-count--limit {
    color: var(--halo-ink-critical);
}

.mca-send-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 18px;
    background: var(--halo-fill-navy);
    color: var(--halo-surface);
    border: none;
    border-radius: var(--halo-radius-pill);
    cursor: pointer;
    transition: opacity var(--halo-duration-1) var(--halo-ease), transform var(--halo-duration-1) var(--halo-ease);
    user-select: none;
}

.mca-send-btn:hover:not(:disabled) {
    opacity: 0.85;
}

.mca-send-btn:active:not(:disabled) {
    transform: scale(0.96);
}

.mca-send-btn:disabled {
    background: var(--halo-surface-sunken);
    color: var(--halo-text-tertiary);
    cursor: not-allowed;
}

.mca-send-icon {
    font-size: 1.125rem !important;
    color: var(--halo-surface);
}

.mca-sending-text {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

/* -- OperationalMetricsRow -- */
.supervisor-daily-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--halo-3); }
@media(max-width:960px) { .supervisor-daily-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:480px) { .supervisor-daily-metrics { grid-template-columns:1fr; } }

/* -- PhoneSelector -- */
.ps-container {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ps-container--single {
    padding: 8px 14px;
    background: var(--halo-surface-sunken);
    border-radius: var(--halo-radius-md);
    gap: 8px;
}

.ps-single__icon {
    color: var(--halo-text-tertiary);
    font-size: 1rem !important;
    flex-shrink: 0;
}

.ps-single__number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--halo-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-select {
    min-width: 220px;
    max-width: 320px;
}

.ps-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-option__label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--halo-text-tertiary);
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.ps-option__number {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--halo-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 480px) {
    .ps-select {
        min-width: 180px;
        max-width: 100%;
    }
}

/* -- RecentCallsList -- */
.recent-calls-list {
    display: flex;
    flex-direction: column;
    gap: var(--halo-1);
}

.recent-calls-list__item {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 13px 14px;
    border: 1px solid var(--halo-hairline);
    border-radius: var(--halo-radius-md);
    background: var(--halo-surface);
    cursor: pointer;
    transition: background-color var(--halo-duration-1) var(--halo-ease-out), border-color var(--halo-duration-1) var(--halo-ease-out);
    user-select: none;
}

.recent-calls-list__item:hover {
    background: var(--halo-surface-hover);
    border-color: var(--halo-hairline-strong);
}

.recent-calls-list__item--selected {
    border-color: rgb(var(--halo-tone-brand) / .3);
    background: var(--halo-tint-brand);
}

.recent-calls-list__item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--halo-1);
}

.recent-calls-list__direction-chip {
    display: flex;
    align-items: center;
    gap: var(--halo-1);
}

.recent-calls-list__direction-icon--inbound {
    color: var(--halo-ink-brand);
}

.recent-calls-list__direction-icon--outbound {
    color: var(--halo-ink-success);
}

.recent-calls-list__timestamp {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--halo-text-tertiary);
    white-space: nowrap;
}

.recent-calls-list__item-primary {
    display: flex;
    align-items: center;
    gap: 6px;
}

.recent-calls-list__numbers {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--halo-text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-calls-list__item-footer {
    display: flex;
    align-items: center;
    gap: var(--halo-1);
}

.recent-calls-list__duration {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--halo-text-tertiary);
    font-variant-numeric: tabular-nums;
}

.recent-calls-empty {
    min-height: 200px;
    box-shadow: none;
    background: transparent;
}

/* -- SmsConversationsList -- */
.sms-conversations-list {
    display: flex;
    flex-direction: column;
    gap: var(--halo-1);
}

.sms-conversations-list__item {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 13px 14px;
    border: 1px solid var(--halo-hairline);
    border-radius: var(--halo-radius-md);
    background: var(--halo-surface);
    cursor: pointer;
    transition: background-color var(--halo-duration-1) var(--halo-ease-out), border-color var(--halo-duration-1) var(--halo-ease-out);
    user-select: none;
}

.sms-conversations-list__item:hover {
    background: var(--halo-surface-hover);
    border-color: var(--halo-hairline-strong);
}

.sms-conversations-list__item--selected {
    border-color: rgb(var(--halo-tone-brand) / .3);
    background: var(--halo-tint-brand);
}

.sms-conversations-list__item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--halo-1);
}

.sms-conversations-list__number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--halo-text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sms-conversations-list__timestamp {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--halo-text-tertiary);
    white-space: nowrap;
    flex-shrink: 0;
}

.sms-conversations-list__item-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--halo-1);
}

.sms-conversations-list__preview {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--halo-text-tertiary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.sms-conversations-list__preview--empty {
    font-style: italic;
    color: var(--halo-text-tertiary);
}

.sms-conversations-list__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: var(--halo-radius-pill);
    background-color: var(--halo-ink-brand);
    color: var(--halo-on-action);
    font-size: 0.6875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.sms-conversations-empty {
    min-height: 200px;
    box-shadow: none;
    background: transparent;
}

/* -- WebchatConversationItem -- */
.wci {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    border: 1px solid var(--halo-hairline);
    background: var(--halo-surface);
    cursor: pointer;
    border-radius: var(--halo-radius-lg);
    transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
    width: 100%;
    text-align: left;
}

.wci:hover {
    transform: translateY(-1px);
    border-color: rgba(216, 213, 236, 0.88);
    box-shadow: 0 10px 24px rgba(61, 45, 105, 0.10);
}

.wci--selected {
    border-color: rgba(124, 58, 237, 0.24);
    background: var(--halo-surface-sunken);
    box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.12);
}

.wci--selected:hover {
    background: var(--halo-surface-sunken);
}

.wci--redflag {
    border-color: rgba(245, 158, 11, 0.32);
    background: var(--halo-tint-warning);
}

.wci--redflag:hover {
    border-color: rgba(217, 119, 6, 0.42);
    box-shadow: 0 12px 26px rgba(146, 64, 14, 0.12);
}

/* ─── Highlight animation for new assignment or new message on non-active conversation ─── */
.wci--highlight {
    animation: wci-highlight 300ms ease-out;
}

@keyframes wci-highlight {
    0% { background-color: rgba(99, 102, 241, 0.10); }
    100% { background-color: transparent; }
}

.wci__left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.wci__header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.wci__name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--halo-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.wci__body-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wci__preview {
    font-size: 0.75rem;
    color: var(--halo-text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    min-width: 0;
}

.wci__preview--typing {
    color: var(--halo-ink-success);
    font-weight: 700;
}

.wci__body-row--typing {
    gap: 6px;
}

.wci__typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.wci__typing-dot {
    width: 5px;
    height: 5px;
    border-radius: var(--halo-radius-pill);
    background: var(--halo-fill-green);
    animation: wci-typing-pulse 900ms ease-in-out infinite;
}

.wci__typing-dot:nth-child(2) {
    animation-delay: 140ms;
}

.wci__typing-dot:nth-child(3) {
    animation-delay: 280ms;
}

@keyframes wci-typing-pulse {
    0%, 80%, 100% {
        opacity: 0.35;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

.wci__contact-row {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    color: var(--halo-text-secondary);
    font-size: 0.6875rem;
    line-height: 1.25;
}

.wci__contact-row .mud-icon-root {
    color: var(--halo-text-tertiary);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.wci__contact-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wci__meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.wci__customer-link {
    display: flex;
    align-items: center;
    color: var(--halo-action-brand);
    opacity: 0.7;
}

.wci__customer-link .mud-icon-root {
    font-size: 1rem;
}

.wci__redflag-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: var(--halo-radius-pill);
    background: var(--halo-soft-yellow);
    color: var(--halo-soft-yellow-ink);
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.wci__redflag-pill .mud-icon-root {
    font-size: 0.82rem;
    color: var(--halo-ink-warning);
}

.wci__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    flex-shrink: 0;
    padding-top: 4px;
}

.wci__unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--halo-action-brand);
    flex-shrink: 0;
}

/* -- WidgetSmsThreadPanel -- */
.wstp-container {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Empty state */
.wstp-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    min-height: 160px;
}

.wstp-empty__icon {
    color: var(--halo-text-tertiary);
    font-size: 2rem !important;
}

.wstp-empty__text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--halo-text-secondary);
    text-align: center;
    line-height: 1.5;
}

/* Thread area */
.wstp-thread {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scroll-behavior: smooth;
}

/* Load more */
.wstp-load-more {
    display: flex;
    justify-content: center;
    padding-bottom: 10px;
}

.wstp-load-more-btn {
    background: var(--halo-surface-sunken);
    border: none;
    border-radius: var(--halo-radius-pill);
    padding: 6px 18px;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--halo-text-secondary);
    cursor: pointer;
    transition: background var(--halo-duration-1) var(--halo-ease-out);
}

.wstp-load-more-btn:hover:not(:disabled) {
    background: var(--halo-surface-hover);
}

.wstp-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wstp-retry-wrap {
    display: flex;
    justify-content: flex-end;
    padding: 0 4px;
}

.wstp-retry-btn {
    background: none;
    border: none;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--halo-ink-critical);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: opacity var(--halo-duration-1) var(--halo-ease-out);
}

.wstp-retry-btn:hover {
    opacity: 0.7;
}

/* Compose area */
.wstp-compose {
    flex-shrink: 0;
}

/* Do Not Call indicator */
.wstp-dnc-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: var(--halo-soft-red);
    border-top: 1px solid rgb(var(--halo-tone-critical) / .22);
}

.wstp-dnc-indicator__icon {
    color: var(--halo-ink-critical);
    font-size: 1rem !important;
}

.wstp-dnc-indicator__text {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--halo-ink-critical);
}

/* Compose disabled placeholder */
.wstp-compose-disabled {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    border-top: 1px solid var(--halo-hairline);
}

.wstp-compose-disabled__text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--halo-text-tertiary);
}

.wstp-thread .halo-chat-bubble--outbound .halo-chat-bubble__content {
    color: var(--halo-on-action);
    background: var(--halo-fill-navy);
    border-radius: var(--halo-radius-md) var(--halo-radius-md) var(--halo-1) var(--halo-radius-md);
}

.wstp-thread .halo-chat-bubble--inbound .halo-chat-bubble__content {
    color: var(--halo-text);
    background: var(--halo-surface-sunken);
    border-radius: var(--halo-radius-md) var(--halo-radius-md) var(--halo-radius-md) var(--halo-1);
}

.wstp-thread .halo-chat-bubble__delivery-icon,
.wstp-thread .halo-chat-bubble__timestamp {
    color: var(--halo-text-secondary);
}

@media (max-width: 480px) {
    .wstp-thread {
        max-height: 300px;
        padding: 12px 14px;
    }

    .wstp-bubble-wrap {
        max-width: 88%;
    }
}

/* -- ManualQaSettingsPage -- */
.mqa-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.35fr) minmax(0, 1fr);
    gap: 18px;
}

.mqa-list,
.mqa-editor {
    background: var(--halo-surface);
    border: 1px solid var(--halo-hairline);
    border-radius: var(--halo-radius-sm);
    padding: 16px;
}

.mqa-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mqa-template {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px;
    border: 1px solid var(--halo-hairline);
    border-radius: var(--halo-radius-sm);
    background: var(--halo-surface);
    text-align: left;
    cursor: pointer;
    transition: border-color var(--halo-duration-1) var(--halo-ease-out), background var(--halo-duration-1) var(--halo-ease-out), box-shadow var(--halo-duration-1) var(--halo-ease-out), transform var(--halo-duration-2) var(--halo-ease-spring);
}

.mqa-template:hover {
    border-color: var(--halo-hairline-strong);
    box-shadow: var(--halo-shadow-2);
    transform: translateY(-1px);
}

.mqa-template:active {
    transform: scale(.97);
}

.mqa-template--selected {
    border-color: var(--halo-focus-color);
    background: var(--halo-soft-navy);
}

.mqa-template span {
    color: var(--halo-text);
    font-weight: 700;
}

.mqa-template small {
    color: var(--halo-text-secondary);
}

.mqa-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mqa-editor-row,
.mqa-criterion {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(5, minmax(110px, auto));
    gap: 10px;
    align-items: center;
}

.mqa-criteria-head,
.mqa-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

@media (prefers-reduced-motion: reduce) {
    .mqa-template {
        transition: none;
    }

    .mqa-template:hover,
    .mqa-template:active {
        transform: none;
    }
}

@media (max-width: 1100px) {
    .mqa-layout,
    .mqa-editor-row,
    .mqa-criterion {
        grid-template-columns: 1fr;
    }
}

/* -- TelephonyAnalytics -- */
.telephony-analytics__date-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    max-width: 480px;
}

.telephony-analytics__kpi-row {
    margin-bottom: 24px;
}

.telephony-analytics__limit-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--halo-surface);
    border-radius: var(--halo-radius-lg);
    box-shadow: var(--halo-shadow-1);
}

.telephony-analytics__limit-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--halo-text);
    margin-right: 8px;
}

.telephony-analytics__section {
    margin-bottom: 24px;
}

.telephony-analytics__table {
    width: 100%;
}

.telephony-analytics__table th {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--halo-text-tertiary);
    padding: 14px 20px;
    border-bottom: 1px solid var(--halo-hairline);
    background: transparent;
}

.telephony-analytics__table td {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--halo-text);
    padding: 14px 20px;
    border-bottom: 1px solid var(--halo-hairline);
    transition: background var(--halo-duration-1) var(--halo-ease-out);
}

.telephony-analytics__table tr:last-child td {
    border-bottom: none;
}

.telephony-analytics__table tr:hover td {
    background: var(--halo-surface-hover);
}

.telephony-analytics__table-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.telephony-analytics__agent-name {
    font-weight: 600;
    color: var(--halo-text);
}

.telephony-analytics__inline-empty {
    display: flex;
    justify-content: center;
    padding: 32px 0;
}

/* Skeleton loading */
.telephony-analytics__skeleton {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.telephony-analytics__skeleton-filter {
    display: flex;
    gap: 16px;
}

.telephony-analytics__skeleton-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.telephony-analytics__skeleton-kpi {
    padding: 28px;
    background: var(--halo-surface);
    border-radius: var(--halo-radius-lg);
    box-shadow: var(--halo-shadow-1);
}

.telephony-analytics__skeleton-chart {
    padding: 24px;
    background: var(--halo-surface);
    border-radius: var(--halo-radius-lg);
    box-shadow: var(--halo-shadow-1);
}

@media (prefers-reduced-motion: reduce) {
    .telephony-analytics__table td {
        transition: none;
    }
}

@media (max-width: 600px) {
    .telephony-analytics__date-row {
        flex-direction: column;
        max-width: 100%;
    }

    .telephony-analytics__table th,
    .telephony-analytics__table td {
        padding: 10px 12px;
        font-size: 0.8125rem;
    }
}

/* -- TelephonyReports -- */
.telephony-reports__flow-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 16px 18px;
    color: var(--halo-ink-brand);
    background: var(--halo-surface-sunken);
    border: 1px solid var(--halo-hairline-strong);
    border-radius: var(--halo-radius-lg);
}

.telephony-reports__flow-entry > div,
.telephony-reports__flow-entry span {
    display: flex;
}

.telephony-reports__flow-entry > div {
    align-items: center;
    gap: 13px;
}

.telephony-reports__flow-entry span {
    flex-direction: column;
    gap: 2px;
}

.telephony-reports__flow-entry small {
    color: var(--halo-text-secondary);
}

.telephony-reports__flow-entry strong {
    font-family: var(--halo-font-display);
    font-weight: 700;
}

.telephony-reports__date-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    max-width: 920px;
    align-items: center;
}

.telephony-reports__kpi-row {
    margin-bottom: 24px;
}

.telephony-reports__section {
    margin-bottom: 24px;
}

/* Skeleton loading */
.telephony-reports__skeleton {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.telephony-reports__skeleton-filter {
    display: flex;
    gap: 16px;
}

.telephony-reports__skeleton-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.telephony-reports__skeleton-card {
    padding: 28px;
    background: var(--halo-surface);
    border-radius: var(--halo-radius-lg);
    box-shadow: var(--halo-shadow-1);
}

.telephony-reports__skeleton-table {
    padding: 24px;
    background: var(--halo-surface);
    border-radius: var(--halo-radius-lg);
    box-shadow: var(--halo-shadow-1);
}

.telephony-reports__table {
    width: 100%;
}

.telephony-reports__table th {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--halo-text-tertiary);
    padding: 14px 20px;
    border-bottom: 1px solid var(--halo-hairline);
    background: transparent;
}

.telephony-reports__table td {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--halo-text);
    padding: 14px 20px;
    border-bottom: 1px solid var(--halo-hairline);
    transition: background var(--halo-duration-1) var(--halo-ease-out);
}

.telephony-reports__table tr:last-child td {
    border-bottom: none;
}

.telephony-reports__table tr:hover td {
    background: var(--halo-surface-hover);
}

.telephony-reports__table-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
    .telephony-reports__table td {
        transition: none;
    }
}

@media (max-width: 600px) {
    .telephony-reports__date-row {
        flex-direction: column;
        max-width: 100%;
    }

    .telephony-reports__table th,
    .telephony-reports__table td {
        padding: 10px 12px;
        font-size: 0.8125rem;
    }
}
/* -- WebchatInboxList -- */
.wil {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.wil__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 0;
}

/* ─── Staggered fade-in on first load ─── */
.wil__item--stagger {
    opacity: 0;
    animation: wil-item-fade-in var(--halo-duration-2) ease forwards;
}

@keyframes wil-item-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Slide-in animation for newly assigned conversations ─── */
.wil__item--slide-in {
    animation: wil-item-slide-in var(--halo-duration-2) var(--halo-ease-spring) forwards;
}

@keyframes wil-item-slide-in {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ─── Highlight animation for new assignment or new message on non-active conversation ─── */
.wil__item--highlight {
    animation: wil-item-highlight 300ms ease-out;
}

@keyframes wil-item-highlight {
    0% { background-color: var(--halo-tint-brand); }
    100% { background-color: transparent; }
}

.wil__empty {
    min-height: unset;
    padding: 48px 24px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}
/* -- WebchatThreadPanel -- */
.wtp {
    background: var(--halo-surface);
    border-radius: var(--halo-radius-lg);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.wtp__skeleton {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wtp__skeleton-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.wtp__empty {
    min-height: 200px;
    box-shadow: none;
    background: transparent;
}

/* ─── Header ─── */
.wtp__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--halo-surface-sunken);
    flex-shrink: 0;
}

.wtp__header-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wtp__visitor-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--halo-text);
    line-height: 1.3;
}

.wtp__header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wtp__message-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--halo-text-tertiary);
}

/* ─── Customer Context Card ─── */
.wtp__customer-card {
    padding: 16px 24px;
    border-bottom: 1px solid var(--halo-surface-sunken);
    flex-shrink: 0;
}

.wtp__customer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.wtp__customer-icon {
    color: var(--halo-ink-info);
    font-size: 1.125rem !important;
}

.wtp__customer-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--halo-text);
    line-height: 1.3;
}

.wtp__customer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.wtp__customer-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wtp__customer-meta-icon {
    color: var(--halo-text-tertiary);
    font-size: 0.875rem !important;
}

.wtp__customer-meta-value {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--halo-text-tertiary);
    line-height: 1.3;
}

.wtp__customer-action {
    padding-top: 2px;
}

.wtp__profile-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--halo-text);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 150ms ease;
    user-select: none;
}

.wtp__profile-link:hover {
    opacity: 0.7;
}

.wtp__profile-link-icon {
    font-size: 0.875rem !important;
    color: var(--halo-text);
}
/* ─── Message Thread ─── */
.wtp__thread {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

.wtp__msg-fade-in {
    display: flex;
    flex-direction: column;
    width: 100%;
    animation: wtp-msg-fade-in var(--halo-duration-2) ease forwards;
}

.wtp__thread--anchor-bottom .wtp__msg-fade-in:first-child {
    margin-top: auto;
}

.wtp__msg--same-sender {
    margin-top: 8px;
}

.wtp__msg--diff-sender {
    margin-top: 16px;
}

.wtp__msg--diff-sender:first-child,
.wtp__msg--same-sender:first-child {
    margin-top: 0;
}

@keyframes wtp-msg-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Compose Area ─── */
.wtp__typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    border-top: 1px solid var(--halo-surface-sunken);
    color: var(--halo-ink-success);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.wtp__typing-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--halo-radius-pill);
    background: var(--halo-ink-success);
    box-shadow: none;
    flex-shrink: 0;
}

.wtp__inspection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
    padding: 14px 20px;
    border-top: 1px solid var(--halo-hairline);
    background: var(--halo-surface-sunken);
}
.wtp__inspection strong, .wtp__inspection span { display: block; }
.wtp__inspection strong { font-size: .8125rem; color: var(--halo-text); }
.wtp__inspection span { margin-top: 3px; font-size: .75rem; color: var(--halo-text-secondary); }

.wtp__compose {
    flex-shrink: 0;
    border-top: 1px solid var(--halo-surface-sunken);
    padding: 10px 24px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.wtp__suggestions {
    display: grid;
    gap: 10px;
    padding: 12px 24px;
    border-top: 1px solid var(--halo-surface-sunken);
    background: var(--halo-surface);
    flex-shrink: 0;
}

.wtp__suggestions-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--halo-ink-info);
    font-size: 0.78rem;
    font-weight: 900;
}

.wtp__suggestions-head small,
.wtp__suggestions-loading,
.wtp__suggestions-error {
    color: var(--halo-text-tertiary);
    font-size: 0.75rem;
    font-weight: 700;
}

.wtp__suggestions-error {
    color: var(--halo-ink-critical);
}

.wtp__suggestion-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.wtp__suggestion {
    display: grid;
    gap: 5px;
    padding: 10px 12px;
    border: 1px solid var(--halo-surface-sunken);
    border-radius: var(--halo-radius-md);
    background: var(--halo-surface);
    color: var(--halo-ink-info);
    cursor: pointer;
    text-align: left;
    transition: border-color 150ms ease, background 150ms ease;
}

.wtp__suggestion:hover {
    border-color: var(--halo-text-tertiary);
    background: var(--halo-surface);
}

.wtp__suggestion span {
    color: var(--halo-ink-info);
    font-size: 0.7rem;
    font-weight: 900;
}

.wtp__suggestion strong {
    color: var(--halo-ink-info);
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.4;
}

.wtp__suggestion small {
    color: var(--halo-text-tertiary);
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.35;
}

.wtp__compose-input {
    display: flex;
    flex: 1;
}

.wtp__textarea {
    width: 100%;
    min-height: 36px;
    max-height: 96px;
    padding: 8px 12px;
    border: none;
    border-radius: var(--halo-radius-md);
    background: var(--halo-surface);
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--halo-text);
    resize: none;
    outline: none;
    line-height: 1.45;
    transition: background 150ms ease, box-shadow 150ms ease;
}

.wtp__textarea:focus {
    background: var(--halo-surface);
    box-shadow: 0 0 0 1.5px var(--halo-text);
}

.wtp__textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wtp__textarea::placeholder {
    color: var(--halo-text-tertiary);
}

.wtp__compose-footer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wtp__send-btn,
.wtp__ai-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--halo-text);
    color: var(--halo-surface);
    cursor: pointer;
    transition: background 150ms ease, transform 120ms ease;
    flex-shrink: 0;
}

.wtp__ai-btn {
    width: auto;
    min-width: 92px;
    padding: 0 12px;
    border-radius: var(--halo-radius-pill);
    background: var(--halo-surface);
    color: var(--halo-text);
    border: 1px solid var(--halo-text-tertiary);
    font-size: 0.76rem;
    font-weight: 850;
}

.wtp__ai-btn:hover:not(:disabled) {
    background: var(--halo-surface);
}

.wtp__send-btn:hover:not(:disabled) {
    background: var(--halo-text);
}

.wtp__send-btn:active:not(:disabled) {
    transform: scale(.94);
}

.wtp__send-btn:disabled,
.wtp__ai-btn:disabled {
    background: var(--halo-surface-sunken);
    color: var(--halo-text-tertiary);
    cursor: not-allowed;
}

.wtp__compose--disabled {
    opacity: 0.6;
    pointer-events: none;
}
