/* ── PieroSupport.UI — Shared Theme ("Calm Command") ──────────────────── */

/* ── CSS Custom Properties ────────────────────────────────────────────── */
:root {
    --ps-primary: #0D9488;
    --ps-surface: #ffffff;
    --ps-bg: #F8FAFB;
    --ps-text: #0F172A;
    --ps-text-primary: var(--ps-text);
    --ps-text-secondary: #64748B;
    --ps-divider: rgba(0,0,0,0.06);
    /* Outgoing bubble — subtle teal glass */
    --ps-bubble-out: rgba(13, 148, 136, 0.08);
    --ps-bubble-out-text: #0F172A;
    --ps-bubble-out-border: rgba(13, 148, 136, 0.16);
    /* Incoming bubble */
    --ps-bubble-in: #F1F5F9;
    --ps-bubble-in-text: #0F172A;
    --ps-bubble-in-border: rgba(0,0,0,0.04);
    /* Sender identity */
    --ps-sender-agent: #0D9488;
    --ps-sender-customer: #6366F1;
    --ps-sender-system: #94A3B8;
    /* Translation badge */
    --ps-translate-bg: rgba(13, 148, 136, 0.08);
    --ps-translate-text: #0D9488;
    /* Date separator glass */
    --ps-date-bg: rgba(255,255,255,0.78);
    --ps-date-border: rgba(0,0,0,0.05);
    --ps-date-shadow: 0 1px 4px rgba(0,0,0,0.05);
    /* Skeletons */
    --ps-skeleton-bg: #E2E8F0;
    --ps-skeleton-pulse: #CBD5E1;
    /* Notes */
    --ps-note-bg: #FFFBEB;
    --ps-note-border: #FBBF24;
    --ps-note-text: #92400E;
    /* Status chips */
    --ps-status-open-bg: rgba(2, 119, 189, 0.10);
    --ps-status-open-text: #0277BD;
    --ps-status-progress-bg: rgba(217, 119, 6, 0.10);
    --ps-status-progress-text: #D97706;
    --ps-status-resolved-bg: rgba(13, 148, 136, 0.10);
    --ps-status-resolved-text: #0D9488;
    --ps-status-escalated-bg: rgba(220, 38, 38, 0.10);
    --ps-status-escalated-text: #DC2626;
    --ps-status-closed-bg: rgba(100, 116, 139, 0.10);
    --ps-status-closed-text: #64748B;
    --ps-status-awaiting-bg: rgba(217, 119, 6, 0.10);
    --ps-status-awaiting-text: #D97706;
    --ps-status-reopened-bg: rgba(99, 102, 241, 0.10);
    --ps-status-reopened-text: #6366F1;
    --ps-status-onhold-bg: rgba(147, 51, 234, 0.10);
    --ps-status-onhold-text: #9333EA;
    /* Priority */
    --ps-priority-critical: #EF4444;
    --ps-priority-high: #F97316;
    --ps-priority-medium: #EAB308;
    --ps-priority-low: #6B7280;
    /* Star rating */
    --ps-star-active: #F59E0B;
    --ps-star-inactive: #CBD5E1;
    /* Reaction chip — "mine" state + link colour that contrasts against both
       incoming and outgoing bubble backgrounds. WCAG AA verified at 4.5:1. */
    --ps-chip-bg: #0D9488;
    --ps-chip-fg: #FFFFFF;
    --ps-link: #0E7490;
    --ps-link-on-out: #134E4A;
    --ps-focus-ring: #0D9488;
}

.mud-theme-dark {
    --ps-primary: #14B8A6;
    --ps-surface: #151D2E;
    --ps-bg: #0C1222;
    --ps-text: #E2E8F0;
    --ps-text-primary: var(--ps-text);
    --ps-text-secondary: #94A3B8;
    --ps-divider: rgba(255,255,255,0.06);
    --ps-bubble-out: rgba(20, 184, 166, 0.14);
    --ps-bubble-out-text: #E2E8F0;
    --ps-bubble-out-border: rgba(20, 184, 166, 0.22);
    --ps-bubble-in: rgba(255,255,255,0.04);
    --ps-bubble-in-text: #E0E0E0;
    --ps-bubble-in-border: rgba(255,255,255,0.06);
    --ps-sender-agent: #14B8A6;
    --ps-sender-customer: #818CF8;
    --ps-sender-system: #64748B;
    --ps-translate-bg: rgba(20, 184, 166, 0.10);
    --ps-translate-text: #14B8A6;
    --ps-date-bg: rgba(21,29,46,0.85);
    --ps-date-border: rgba(255,255,255,0.06);
    --ps-date-shadow: 0 1px 4px rgba(0,0,0,0.3);
    --ps-skeleton-bg: #1E293B;
    --ps-skeleton-pulse: #334155;
    /* Notes (dark) */
    --ps-note-bg: #422006;
    --ps-note-border: #92400E;
    --ps-note-text: #FDE68A;
    /* Status chips (dark) */
    --ps-status-open-bg: rgba(56, 189, 248, 0.12);
    --ps-status-open-text: #38BDF8;
    --ps-status-progress-bg: rgba(251, 191, 36, 0.12);
    --ps-status-progress-text: #FBBF24;
    --ps-status-resolved-bg: rgba(45, 212, 191, 0.12);
    --ps-status-resolved-text: #2DD4BF;
    --ps-status-escalated-bg: rgba(248, 113, 113, 0.12);
    --ps-status-escalated-text: #F87171;
    --ps-status-closed-bg: rgba(148, 163, 184, 0.10);
    --ps-status-closed-text: #94A3B8;
    --ps-status-awaiting-bg: rgba(251, 191, 36, 0.12);
    --ps-status-awaiting-text: #FBBF24;
    --ps-status-reopened-bg: rgba(129, 140, 248, 0.12);
    --ps-status-reopened-text: #818CF8;
    --ps-status-onhold-bg: rgba(192, 132, 252, 0.12);
    --ps-status-onhold-text: #C084FC;
    /* Star (dark) */
    --ps-star-active: #FBBF24;
    --ps-star-inactive: #334155;
    /* Chip + link (dark) — contrast-tuned for dark surfaces. */
    --ps-chip-bg: #14B8A6;
    --ps-chip-fg: #0B1220;
    --ps-link: #5EEAD4;
    --ps-link-on-out: #CCFBF1;
    --ps-focus-ring: #2DD4BF;
}

/* ── Chat Layout ──────────────────────────────────────────────────────── */
.ps-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ps-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* ── Message Row Layout ───────────────────────────────────────────────── */
.ps-msg-row {
    display: flex;
    gap: 8px;
    margin-bottom: 2px;
    animation: ps-msg-enter 250ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ps-msg-row--out { align-self: flex-end; flex-direction: row-reverse; max-width: 82%; }
.ps-msg-row--in  { align-self: flex-start; max-width: 82%; }
.ps-msg-content  { display: flex; flex-direction: column; min-width: 0; }

@keyframes ps-msg-enter {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Sender Avatar ───────────────────────────────────────────────────── */
.ps-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff;
    flex-shrink: 0; align-self: flex-end;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.ps-avatar--agent    { background: var(--ps-sender-agent); }
.ps-avatar--customer { background: var(--ps-sender-customer); }
.ps-avatar--system   { background: var(--ps-sender-system); }
.ps-avatar-spacer    { width: 28px; flex-shrink: 0; }

/* ── Sender Name ─────────────────────────────────────────────────────── */
.ps-sender-name {
    font-size: 11px; font-weight: 600;
    margin-top: 8px; margin-bottom: 2px; margin-left: 2px;
    letter-spacing: 0.01em;
}
.ps-sender-name--agent    { color: var(--ps-sender-agent); }
.ps-sender-name--customer { color: var(--ps-sender-customer); }

/* ── Chat Bubbles — Frosted Glass ────────────────────────────────────── */
.ps-bubble {
    padding: 10px 14px;
    word-break: break-word;
    margin-bottom: 0;
    max-width: none;
    position: relative;
}

.ps-bubble--out {
    background: var(--ps-bubble-out);
    color: var(--ps-bubble-out-text);
    border: 1px solid var(--ps-bubble-out-border);
}
.ps-bubble--out.ps-bubble--tail { border-radius: 16px 16px 4px 16px; }
.ps-bubble--out:not(.ps-bubble--tail) { border-radius: 16px 4px 4px 16px; }

.ps-bubble--in {
    background: var(--ps-bubble-in);
    color: var(--ps-bubble-in-text);
    border: 1px solid var(--ps-bubble-in-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.ps-bubble--in.ps-bubble--tail { border-radius: 16px 16px 16px 4px; }
.ps-bubble--in:not(.ps-bubble--tail) { border-radius: 4px 16px 16px 4px; }

.ps-bubble--note {
    background: var(--ps-note-bg);
    border: none;
    border-left: 3px solid var(--ps-note-border);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.ps-bubble__note-badge {
    display: flex; align-items: center; gap: 4px;
    font-size: 10px; font-weight: 700; color: var(--ps-note-text);
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.ps-bubble__image { max-width: 100%; border-radius: 8px; display: block; }
.ps-bubble__content { font-size: 14px; line-height: 1.5; word-break: break-word; overflow-wrap: anywhere; }
.ps-bubble__content p { margin: 0 0 8px 0; }
.ps-bubble__content p:last-child { margin-bottom: 0; }
.ps-bubble__content strong { font-weight: 700; }
.ps-bubble__content em { font-style: italic; }
.ps-bubble__content code {
    background: rgba(0,0,0,0.08); padding: 1px 5px; border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', ui-monospace, monospace; font-size: 13px;
}
.ps-bubble--out .ps-bubble__content code { background: rgba(255,255,255,0.22); }
.mud-theme-dark .ps-bubble__content code { background: rgba(255,255,255,0.08); }
.ps-bubble__content pre {
    background: rgba(0,0,0,0.08); padding: 8px 10px; border-radius: 6px;
    overflow-x: auto; margin: 6px 0; font-size: 13px; line-height: 1.45;
}
.ps-bubble--out .ps-bubble__content pre { background: rgba(255,255,255,0.22); }
.mud-theme-dark .ps-bubble__content pre { background: rgba(255,255,255,0.06); }
.ps-bubble__content pre code { background: transparent; padding: 0; border-radius: 0; }
.ps-bubble__content ul, .ps-bubble__content ol { margin: 8px 0; padding-left: 1.5em; }
.ps-bubble__content li { margin: 2px 0; }
/* Links — distinguishable from body text by colour AND underline (WCAG 1.4.1).
   Use `--ps-link-on-out` on outgoing bubbles so the link stays legible on the
   primary-tinted background. */
.ps-bubble__content a { color: var(--ps-link); text-decoration: underline; }
.ps-bubble--out .ps-bubble__content a { color: var(--ps-link-on-out); }
.ps-bubble__content a:hover { text-decoration-thickness: 2px; }
.ps-bubble__content a:focus-visible {
    outline: 2px solid var(--ps-focus-ring); outline-offset: 2px; border-radius: 2px;
}
.ps-bubble__content blockquote {
    border-left: 3px solid var(--ps-primary);
    margin: 8px 0; padding: 4px 12px;
    color: var(--ps-text-secondary);
}

.ps-bubble__footer {
    display: flex; gap: 6px; align-items: center;
    font-size: 11px; opacity: 0.65; margin-top: 4px;
}
.ps-bubble__reactions {
    display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}
.ps-reaction-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 14px;
    background: rgba(0,0,0,0.06); border: 1px solid transparent;
    font-size: 12px; cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.ps-bubble--out .ps-reaction-chip { background: rgba(255,255,255,0.18); }
.mud-theme-dark .ps-reaction-chip { background: rgba(255,255,255,0.08); }
.ps-reaction-chip:hover { background: rgba(0,0,0,0.12); }
.ps-bubble--out .ps-reaction-chip:hover { background: rgba(255,255,255,0.30); }
.mud-theme-dark .ps-reaction-chip:hover { background: rgba(255,255,255,0.14); }
.ps-reaction-chip:focus-visible {
    outline: 2px solid var(--ps-focus-ring); outline-offset: 2px;
}
.ps-reaction-chip--mine {
    background: var(--ps-chip-bg);
    color: var(--ps-chip-fg);
    border-color: var(--ps-chip-bg);
}
.ps-bubble--out .ps-reaction-chip--mine,
.mud-theme-dark .ps-reaction-chip--mine {
    background: var(--ps-chip-bg);
    color: var(--ps-chip-fg);
}
.ps-reaction-emoji { font-size: 14px; line-height: 1; }
.ps-reaction-count { font-weight: 500; font-size: 11px; opacity: 0.8; }
.ps-reaction-chip--mine .ps-reaction-count { opacity: 1; }
.ps-bubble__react-add {
    position: absolute; top: -10px; right: 8px;
    opacity: 0; transition: opacity 120ms ease;
    background: var(--ps-surface);
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.ps-bubble:hover .ps-bubble__react-add,
.ps-bubble:focus-within .ps-bubble__react-add,
.ps-bubble__react-add:focus-visible,
.ps-bubble__react-add:focus-within { opacity: 1; }
/* Touch devices have no hover — show the picker unconditionally so reactions
   are reachable on mobile. */
@media (hover: none) {
    .ps-bubble__react-add { opacity: 1; }
}
.ps-bubble__react-add:focus-visible {
    outline: 2px solid var(--ps-focus-ring); outline-offset: 2px;
}
.ps-bubble { position: relative; }
.ps-bubble__time { margin-left: auto; white-space: nowrap; }

/* Respect OS-level motion preference. All bubble / reaction / date-pill
   animations collapse to an instant change so vestibular-sensitive users
   are not made nauseous by the chat UI. */
@media (prefers-reduced-motion: reduce) {
    .ps-msg-row,
    .ps-bubble,
    .ps-bubble__react-add,
    .ps-reaction-chip,
    .ps-date-pill,
    .ps-system-msg,
    .ps-chat-input__textarea {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Translation Badge ───────────────────────────────────────────────── */
.ps-translate-badge {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 1px 6px; border-radius: 8px;
    background: var(--ps-translate-bg);
    color: var(--ps-translate-text);
    font-size: 10px; font-weight: 600;
    cursor: help; transition: background 0.15s;
}
.ps-translate-badge .mud-icon-root { font-size: 12px !important; }
.ps-translate-badge:hover { background: var(--ps-sender-agent); color: #fff; }
.ps-bubble__translate-icon { display: none; }

/* ── Read Receipts ───────────────────────────────────────────────────── */
.ps-status-icon { font-size: 16px; }
.ps-status-icon--pending { color: #D4820A; }
.ps-status-icon--sent    { color: #9CA3AF; }
.ps-status-icon--read    { color: var(--ps-sender-agent); }
.mud-theme-dark .ps-status-icon--pending { color: #FFB300; }
.mud-theme-dark .ps-status-icon--sent    { color: #6B7280; }

/* ── System Messages ─────────────────────────────────────────────────── */
.ps-system-msg {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; padding: 8px 16px; margin: 12px auto;
    align-self: center; max-width: 85%;
    animation: ps-msg-enter 250ms ease-out both;
}
.ps-system-msg__icon { color: var(--ps-sender-system); font-size: 16px !important; opacity: 0.6; }
.ps-system-msg__text {
    font-size: 13px; font-style: italic;
    color: var(--ps-text-secondary);
    text-align: center; line-height: 1.4;
}
.ps-system-msg__time { font-size: 11px; color: var(--ps-text-secondary); opacity: 0.5; }

/* ── Load More ────────────────────────────────────────────────────────── */
.ps-load-more {
    display: flex;
    justify-content: center;
    padding: 8px;
}

/* ── Chat Input ───────────────────────────────────────────────────────── */
.ps-chat-input {
    display: flex;
    align-items: center;
    padding: 8px;
    background: var(--ps-surface);
    border-top: 1px solid var(--ps-divider);
    gap: 4px;
    flex-shrink: 0;
}

.ps-chat-input--note {
    background: var(--ps-note-bg);
    border-top-color: var(--ps-note-border);
}

.ps-chat-input__textarea {
    flex: 1;
    border: none;
    resize: none;
    font-size: 15px;
    background: transparent;
    padding: 8px 12px;
    outline: none;
    max-height: 150px;
    overflow-y: auto;
    font-family: inherit;
    color: inherit;
    line-height: 1.4;
}

.ps-chat-input__textarea::placeholder {
    color: var(--ps-text-secondary);
}

/* Keyboard hint under the composer. Muted, single line, desktop only —
   on touch devices hardware keyboards aren't universal so we hide it. */
.ps-chat-input__hint {
    font-size: 11px; color: var(--ps-text-secondary); opacity: 0.7;
    padding: 2px 12px 6px 12px; line-height: 1.3; user-select: none;
}
@media (hover: none) {
    .ps-chat-input__hint { display: none; }
}

/* ── Controller Health Strip ───────────────────────────────────────────
   Dense one-liner above the chat. Each pill is an independent signal so
   it's scannable in a glance: dot + title | firmware | CPU | disk | errors.
   Small typography — this is metadata, not content. */
.ps-health-strip {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--ps-divider);
    background: var(--ps-bg);
    font-size: 12px; line-height: 1.4;
}
.ps-health-dot {
    width: 8px; height: 8px; border-radius: 50%;
    flex: 0 0 auto;
}
.ps-health-dot--ok      { background: #10B981; box-shadow: 0 0 0 3px rgba(16,185,129,0.15); }
.ps-health-dot--stale   { background: #F59E0B; box-shadow: 0 0 0 3px rgba(245,158,11,0.15); }
.ps-health-dot--offline { background: #9CA3AF; box-shadow: 0 0 0 3px rgba(156,163,175,0.15); }
.mud-theme-dark .ps-health-dot--offline { background: #6B7280; }
.ps-health-title {
    font-weight: 600; color: var(--ps-text);
    max-width: 40ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ps-health-pill {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 1px 7px; border-radius: 10px;
    background: rgba(0,0,0,0.06); color: var(--ps-text-secondary);
    font-size: 11px; font-weight: 500; white-space: nowrap;
}
.mud-theme-dark .ps-health-pill { background: rgba(255,255,255,0.06); }
.ps-health-pill--fw    { font-family: 'Fira Code', 'Consolas', ui-monospace, monospace; }
.ps-health-pill--info  { background: rgba(13,148,136,0.12); color: var(--ps-primary); }
.ps-health-pill--warn  { background: rgba(245,158,11,0.15); color: #B45309; }
.mud-theme-dark .ps-health-pill--warn { color: #FBBF24; }
.ps-health-pill--error { background: rgba(220,38,38,0.15); color: #B91C1C; font-weight: 600; }
.mud-theme-dark .ps-health-pill--error { color: #F87171; }
.ps-health-seen {
    margin-left: auto;
    font-size: 11px; color: var(--ps-text-secondary);
    white-space: nowrap;
}

/* ── Device Tree ──────────────────────────────────────────────────────── */
.ps-device-tree {
    display: flex; flex-direction: column; gap: 4px;
    padding: 8px 12px;
    background: var(--ps-surface-raised, #fafafa);
    border-bottom: 1px solid var(--ps-border, rgba(0,0,0,0.08));
    max-height: 280px; overflow-y: auto;
}
.mud-theme-dark .ps-device-tree { background: rgba(255,255,255,0.02); border-bottom-color: rgba(255,255,255,0.08); }
.ps-device-tree--empty {
    padding: 10px 14px;
    font-size: 12px; color: var(--ps-text-secondary);
    font-style: italic;
}
/* Pills — compact status badges reused across the Intel panel.
   Hoisted ABOVE the scrollable device tree so they never scroll out
   of view (T1 plan §13.G J-5). Info/warn/error severities mapped to
   semantic colors; AA contrast in both themes. */
.ps-intel-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; margin: 4px 12px 2px;
    font-size: 11px; border-radius: 999px; line-height: 1.4;
    border: 1px solid transparent;
}
.ps-intel-pill--info {
    background: rgba(33, 150, 243, 0.10);
    color: #0d47a1; border-color: rgba(33, 150, 243, 0.30);
}
.mud-theme-dark .ps-intel-pill--info {
    background: rgba(100, 181, 246, 0.10);
    color: #90caf9; border-color: rgba(100, 181, 246, 0.30);
}
.ps-intel-pill--warn {
    background: rgba(255, 167, 38, 0.12);
    color: #8a4b00; border-color: rgba(255, 167, 38, 0.40);
}
.mud-theme-dark .ps-intel-pill--warn {
    background: rgba(255, 167, 38, 0.10);
    color: #ffcc80; border-color: rgba(255, 167, 38, 0.35);
}
.ps-intel-pill--error {
    background: rgba(244, 67, 54, 0.10);
    color: #b71c1c; border-color: rgba(244, 67, 54, 0.35);
}
.mud-theme-dark .ps-intel-pill--error {
    background: rgba(244, 67, 54, 0.12);
    color: #ef9a9a; border-color: rgba(244, 67, 54, 0.35);
}

/* ── Controller Intel summary bar ── (T1 Intel plan §12.4) */
.ps-intel-summary-bar {
    display: flex; flex-direction: column; gap: 8px;
    padding: 8px 12px;
    background: var(--ps-surface-raised, #fafafa);
    border-bottom: 1px solid var(--ps-border, rgba(0,0,0,0.08));
}
.mud-theme-dark .ps-intel-summary-bar {
    background: rgba(255,255,255,0.02);
    border-bottom-color: rgba(255,255,255,0.08);
}
.ps-intel-summary-chips {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.ps-intel-chip {
    display: inline-flex; align-items: baseline; gap: 4px;
    padding: 3px 8px; border-radius: 12px;
    background: rgba(0,0,0,0.04); font-size: 12px;
}
.mud-theme-dark .ps-intel-chip { background: rgba(255,255,255,0.06); }
.ps-intel-chip-value { font-weight: 600; color: var(--ps-text-primary); }
.ps-intel-chip-label { color: var(--ps-text-secondary); font-size: 11px; }
.ps-intel-chip--muted { background: transparent; }
.ps-intel-chip--muted .ps-intel-chip-value { font-weight: 500; font-size: 11px; }
/* Primary chip — the most important headline number (device count).
   Slightly bigger and bolder so scanning starts there (T1 plan §13.G J-6). */
.ps-intel-chip--primary { padding: 4px 10px; }
.ps-intel-chip--primary .ps-intel-chip-value { font-size: 14px; font-weight: 700; }

.ps-intel-health { display: flex; flex-direction: column; gap: 4px; }
.ps-intel-health-allok {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: #2e7d32;
}
.mud-theme-dark .ps-intel-health-allok { color: #81c784; }
.ps-intel-health-allok-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px; border-radius: 50%;
    background: #43a047; color: white; font-size: 10px; font-weight: 700;
}
.ps-intel-health-bar {
    display: flex; width: 100%; height: 6px; border-radius: 3px;
    overflow: hidden; background: rgba(0,0,0,0.05);
}
.mud-theme-dark .ps-intel-health-bar { background: rgba(255,255,255,0.08); }
.ps-intel-health-seg { height: 100%; }
.ps-intel-health-seg--online  { background: #43a047; }
.ps-intel-health-seg--offline { background: #e53935; }
.ps-intel-health-seg--faulted { background: #fb8c00; }
.ps-intel-health-seg--unknown { background: #9e9e9e; }
/* Dark-mode overrides — sibling .ps-intel-health-allok has one on line
   545; the four segments didn't (§17.D D-6). Lighter-saturation
   variants tuned for dark-mode card backgrounds. §19 S6.4. */
.mud-theme-dark .ps-intel-health-seg--online  { background: #66bb6a; }
.mud-theme-dark .ps-intel-health-seg--offline { background: #ef5350; }
.mud-theme-dark .ps-intel-health-seg--faulted { background: #ffa726; }
.mud-theme-dark .ps-intel-health-seg--unknown { background: #bdbdbd; }

.ps-intel-health-legend {
    display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px;
}
.ps-intel-health-label {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--ps-text-secondary);
}
.ps-intel-health-label--online::before,
.ps-intel-health-label--offline::before,
.ps-intel-health-label--faulted::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%;
    display: inline-block;
}
.ps-intel-health-label--online::before  { background: #43a047; }
.ps-intel-health-label--offline::before { background: #e53935; }
.ps-intel-health-label--faulted::before { background: #fb8c00; }
.ps-intel-offline-status { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.ps-intel-offline-status--offline { color: #e53935; }
.ps-intel-offline-status--faulted { color: #fb8c00; }
.ps-intel-offline-status--unknown { color: #9e9e9e; }

/* Device row status badges — MudIcon overlay when a device is not
   Online. Color matches the health-bar segment palette. */
.ps-device-status-icon { margin-left: auto; }
.ps-device-status-icon--offline  { color: #e53935; }
.ps-device-status-icon--faulted  { color: #fb8c00; }
.ps-device-status-icon--unknown  { color: #9e9e9e; }
.ps-intel-health-label--interactive {
    background: transparent; border: 0; cursor: pointer;
    padding: 0; font: inherit; color: inherit;
}
.ps-intel-health-label--interactive:hover { color: var(--ps-text-primary); }
.ps-intel-health-chevron { font-size: 10px; }

.ps-intel-offline-list {
    list-style: none; margin: 4px 0 0; padding: 6px 0 0;
    border-top: 1px dashed var(--ps-border, rgba(0,0,0,0.08));
    display: flex; flex-direction: column; gap: 2px;
    max-height: 160px; overflow-y: auto;
}
.mud-theme-dark .ps-intel-offline-list { border-top-color: rgba(255,255,255,0.08); }
.ps-intel-offline-item {
    display: flex; justify-content: space-between; gap: 8px;
    font-size: 12px; padding: 2px 0;
}
.ps-intel-offline-name { color: var(--ps-text-primary); }
.ps-intel-offline-kind { color: var(--ps-text-secondary); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.ps-device-room-header {
    display: flex; align-items: center; gap: 6px;
    width: 100%; padding: 4px 6px;
    background: transparent; border: 0;
    font-size: 13px; font-weight: 600; color: var(--ps-text-primary);
    cursor: pointer; border-radius: 4px;
    text-align: left;
}
.ps-device-room-header:hover,
.ps-device-room-header:focus-visible {
    background: rgba(0,0,0,0.04);
    outline: none;
}
.mud-theme-dark .ps-device-room-header:hover,
.mud-theme-dark .ps-device-room-header:focus-visible { background: rgba(255,255,255,0.06); }
.ps-device-room-chevron { font-size: 10px; width: 12px; color: var(--ps-text-secondary); }
.ps-device-room-name { flex: 1; }
.ps-device-room-count {
    font-size: 11px; font-weight: 500;
    color: var(--ps-text-secondary);
    background: rgba(0,0,0,0.06);
    padding: 1px 6px; border-radius: 10px;
}
.mud-theme-dark .ps-device-room-count { background: rgba(255,255,255,0.08); }
.ps-device-list {
    list-style: none; margin: 2px 0 4px 16px; padding: 0;
    display: flex; flex-direction: column; gap: 2px;
}
.ps-device-item {
    display: flex; align-items: center; gap: 8px;
    padding: 3px 6px; border-radius: 4px;
    font-size: 12.5px; color: var(--ps-text-primary);
}
.ps-device-icon { width: 16px; text-align: center; font-size: 13px; }

/* Controller Situation Brief */
.ps-brief-panel {
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px 12px;
    background: rgba(13,148,136,0.055);
    border-bottom: 1px solid var(--ps-border, rgba(0,0,0,0.08));
}
.mud-theme-dark .ps-brief-panel { background: rgba(45,212,191,0.07); border-bottom-color: rgba(255,255,255,0.08); }
.ps-brief-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; flex-wrap: wrap;
}
.ps-brief-title-row {
    display: inline-flex; align-items: center; gap: 6px;
    min-width: 0;
}
.ps-brief-title { font-size: 13px; font-weight: 700; color: var(--ps-text-primary); }
.ps-brief-actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ps-brief-window {
    height: 28px; padding: 3px 7px; border-radius: 6px;
    border: 1px solid rgba(13,148,136,0.24);
    background: var(--ps-surface, #fff); color: var(--ps-text-primary);
    font-size: 12px;
}
.mud-theme-dark .ps-brief-window { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.16); }
.ps-brief-live {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--ps-text-secondary); font-size: 12px; user-select: none;
}
.ps-brief-btn {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 28px; padding: 4px 9px; border-radius: 6px;
    background: rgba(13,148,136,0.10); color: var(--ps-primary, #0D9488);
    border: 1px solid rgba(13,148,136,0.24);
    font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.ps-brief-btn:hover:not(:disabled) { background: rgba(13,148,136,0.16); }
.ps-brief-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.ps-brief-window:focus-visible,
.ps-brief-live input:focus-visible,
.ps-brief-btn:focus-visible {
    outline: 2px solid var(--ps-focus-ring, #0D9488);
    outline-offset: 2px;
}
.mud-theme-dark .ps-brief-btn { color: #5EEAD4; border-color: rgba(94,234,212,0.26); }
.ps-brief-severity {
    display: inline-flex; align-items: center;
    min-height: 20px; padding: 2px 7px; border-radius: 10px;
    font-size: 10px; font-weight: 800; text-transform: uppercase;
}
.ps-brief-severity--info { color: #0369A1; background: rgba(14,165,233,0.12); }
.ps-brief-severity--warning { color: #92400E; background: rgba(245,158,11,0.16); }
.ps-brief-severity--critical { color: #991B1B; background: rgba(220,38,38,0.14); }
.mud-theme-dark .ps-brief-severity--info { color: #7DD3FC; }
.mud-theme-dark .ps-brief-severity--warning { color: #FBBF24; }
.mud-theme-dark .ps-brief-severity--critical { color: #FCA5A5; }
.ps-brief-stale {
    display: inline-flex; align-items: center;
    min-height: 20px; padding: 2px 7px; border-radius: 6px;
    font-size: 10px; font-weight: 800; text-transform: uppercase;
    color: #92400E; background: rgba(245,158,11,0.14);
}
.ps-brief-meta {
    display: flex; flex-wrap: wrap; gap: 6px 10px;
    color: var(--ps-text-secondary);
    font-size: 11px;
}
.ps-brief-meta span:not(:last-child)::after {
    content: "";
    display: inline-block;
    width: 3px; height: 3px; margin-left: 10px;
    border-radius: 999px;
    background: currentColor;
    vertical-align: middle;
    opacity: 0.45;
}
.ps-brief-summary {
    color: var(--ps-text-primary); font-size: 12.5px; line-height: 1.45;
}
.ps-brief-error { color: #B91C1C; font-size: 12px; font-weight: 600; }
.mud-theme-dark .ps-brief-error { color: #FCA5A5; }
.ps-brief-sources {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.ps-brief-source {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 7px; border-radius: 6px;
    font-size: 10.5px; color: var(--ps-text-secondary);
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(0,0,0,0.03);
}
.ps-brief-source em { font-style: normal; text-transform: uppercase; font-size: 9px; opacity: 0.72; }
.mud-theme-dark .ps-brief-source { border-color: rgba(255,255,255,0.10); background: rgba(255,255,255,0.04); }
.ps-brief-source--ok b { color: #059669; }
.ps-brief-source--empty b { color: var(--ps-text-secondary); }
.ps-brief-source--warn b,
.ps-brief-source--warn em { color: #B45309; }
.ps-brief-source--err b,
.ps-brief-source--err em { color: #B91C1C; }
.ps-brief-source--miss { opacity: 0.68; }
.ps-brief-log {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 5px;
}
.ps-brief-log-item {
    display: flex; flex-direction: column; gap: 2px;
    padding: 6px 8px; border-radius: 6px;
    background: rgba(0,0,0,0.035);
}
.mud-theme-dark .ps-brief-log-item { background: rgba(255,255,255,0.045); }
.ps-brief-log-meta {
    color: var(--ps-text-secondary); font-size: 10.5px; text-transform: uppercase;
}
.ps-brief-log-msg {
    color: var(--ps-text-primary); font-size: 11.5px; line-height: 1.35;
    overflow-wrap: anywhere;
}
.ps-brief-paths { display: flex; flex-direction: column; gap: 6px; }
.ps-brief-path {
    padding: 7px 8px; border-radius: 6px;
    border-left: 3px solid rgba(13,148,136,0.50);
    background: rgba(255,255,255,0.58);
}
.mud-theme-dark .ps-brief-path { background: rgba(255,255,255,0.04); }
.ps-brief-path-head {
    display: flex; justify-content: space-between; gap: 8px;
    color: var(--ps-text-primary); font-size: 12.5px; font-weight: 700;
}
.ps-brief-path-risk {
    color: var(--ps-text-secondary); font-size: 10px; text-transform: uppercase;
}
.ps-brief-path p {
    margin: 4px 0 0; color: var(--ps-text-secondary);
    font-size: 11.5px; line-height: 1.35;
}
.ps-brief-path ol {
    margin: 5px 0 0 18px; padding: 0;
    color: var(--ps-text-primary); font-size: 11.5px; line-height: 1.35;
}
.ps-brief-evidence-refs {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-top: 6px;
}
.ps-brief-evidence-refs span {
    display: inline-flex;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', ui-monospace, monospace;
    font-size: 10px;
    color: var(--ps-text-secondary);
    background: rgba(0,0,0,0.05);
}
.mud-theme-dark .ps-brief-evidence-refs span { background: rgba(255,255,255,0.06); }

/* ── Diagnostic Drawer ────────────────────────────────────────────────── */
.ps-diag-drawer {
    display: flex; flex-direction: column; gap: 6px;
    padding: 10px 12px;
    background: var(--ps-surface-raised, #fafafa);
    border-bottom: 1px solid var(--ps-border, rgba(0,0,0,0.08));
}
.mud-theme-dark .ps-diag-drawer { background: rgba(255,255,255,0.02); border-bottom-color: rgba(255,255,255,0.08); }
.ps-diag-toolbar {
    display: flex; gap: 6px; flex-wrap: wrap;
}
.ps-diag-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 8px;
    background: rgba(13,148,136,0.08); color: var(--ps-primary, #0D9488);
    border: 1px solid rgba(13,148,136,0.24);
    font-size: 12.5px; font-weight: 600;
    cursor: pointer;
    transition: background-color 120ms;
}
.ps-diag-btn:hover:not(:disabled) { background: rgba(13,148,136,0.14); }
.ps-diag-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ps-diag-btn:focus-visible { outline: 2px solid var(--ps-primary, #0D9488); outline-offset: 2px; }
.ps-diag-btn-icon { font-size: 14px; }
.ps-diag-btn--primary {
    background: rgba(37,99,235,0.10);
    border-color: rgba(37,99,235,0.28);
    color: #2563EB;
}
.ps-diag-complaint-picker {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ps-text-secondary);
}
.ps-diag-complaint-select {
    min-width: 0;
    height: 28px;
    border: 1px solid var(--ps-border, rgba(0,0,0,0.12));
    border-radius: 6px;
    background: var(--ps-surface, #fff);
    color: var(--ps-text-primary);
    padding: 0 8px;
    font-size: 12px;
}
.mud-theme-dark .ps-diag-complaint-select {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.12);
}
.ps-diag-complaint-stale {
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(245,158,11,0.12);
    color: #B45309;
    font-size: 11px;
    font-weight: 700;
}
.ps-diag-empty {
    padding: 8px 4px; font-size: 12px; color: var(--ps-text-secondary);
    font-style: italic;
}
.ps-diag-log {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 6px;
    max-height: min(58vh, 620px); overflow-y: auto;
}
.ps-diag-entry {
    padding: 6px 8px; border-radius: 6px;
    background: rgba(0,0,0,0.03);
    border-left: 3px solid transparent;
}
.mud-theme-dark .ps-diag-entry { background: rgba(255,255,255,0.04); }
.ps-diag-entry--ok   { border-left-color: #10B981; }
.ps-diag-entry--fail { border-left-color: #DC2626; }
.ps-diag-entry--running { border-left-color: #2563EB; }
.ps-diag-entry-head {
    display: flex; justify-content: space-between;
    font-size: 11.5px; color: var(--ps-text-secondary);
    margin-bottom: 4px;
}
.ps-diag-entry-tool { font-weight: 600; color: var(--ps-text-primary); }
.ps-diag-entry-output {
    margin: 0; padding: 6px 8px;
    background: rgba(0,0,0,0.06); border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', ui-monospace, monospace;
    font-size: 11.5px; line-height: 1.4;
    white-space: pre-wrap; word-break: break-word;
    max-height: 160px; overflow-y: auto;
}
.mud-theme-dark .ps-diag-entry-output { background: rgba(255,255,255,0.06); }
.ps-diag-entry-error {
    color: #B91C1C; font-size: 12px; font-weight: 500;
}
.mud-theme-dark .ps-diag-entry-error { color: #F87171; }

.ps-dossier {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
}
.ps-dossier-verdict {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(37,99,235,0.20);
    background: rgba(37,99,235,0.08);
}
.ps-dossier-verdict--warning {
    border-color: rgba(245,158,11,0.32);
    background: rgba(245,158,11,0.10);
}
.ps-dossier-verdict--muted {
    border-color: rgba(100,116,139,0.24);
    background: rgba(100,116,139,0.10);
}
.ps-dossier-eyebrow {
    color: var(--ps-text-secondary);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
}
.ps-dossier-title {
    color: var(--ps-text-primary);
    font-size: 14px;
    font-weight: 800;
    overflow-wrap: anywhere;
}
.ps-dossier-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid rgba(37,99,235,0.24);
    background: rgba(37,99,235,0.10);
    color: #2563EB;
    cursor: pointer;
}
.ps-dossier-note:hover:not(:disabled) {
    background: rgba(37,99,235,0.16);
    border-color: rgba(37,99,235,0.38);
}
.ps-dossier-note:focus-visible {
    outline: 2px solid #2563EB;
    outline-offset: 2px;
}
.ps-dossier-note:disabled { opacity: 0.5; cursor: not-allowed; }
.ps-dossier-summary {
    margin: 0;
    color: var(--ps-text-primary);
    line-height: 1.45;
}
.ps-dossier-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}
.ps-dossier-metrics span {
    min-width: 0;
    padding: 5px 6px;
    border-radius: 6px;
    background: rgba(15,23,42,0.05);
    color: var(--ps-text-secondary);
    text-align: center;
}
.mud-theme-dark .ps-dossier-metrics span { background: rgba(255,255,255,0.06); }
.ps-dossier-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ps-dossier-section h4 {
    margin: 0;
    color: var(--ps-text-primary);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}
.ps-dossier-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.ps-dossier-targets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 6px;
}
.ps-dossier-target,
.ps-dossier-fact,
.ps-dossier-action,
.ps-dossier-gap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 5px 0 5px 8px;
    border-left: 3px solid rgba(100,116,139,0.26);
    background: transparent;
}
.mud-theme-dark .ps-dossier-target,
.mud-theme-dark .ps-dossier-fact,
.mud-theme-dark .ps-dossier-action,
.mud-theme-dark .ps-dossier-gap {
    border-left-color: rgba(255,255,255,0.18);
}
.ps-dossier-target span,
.ps-dossier-fact strong,
.ps-dossier-action strong {
    color: var(--ps-text-primary);
    font-weight: 750;
}
.ps-dossier-target small,
.ps-dossier-fact span,
.ps-dossier-fact small,
.ps-dossier-action span,
.ps-dossier-gap {
    color: var(--ps-text-secondary);
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.ps-dossier-evidence {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex-wrap: wrap;
}
.ps-dossier-evidence-badge {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 1px 6px;
    border-radius: 999px;
    border: 1px solid rgba(100,116,139,0.22);
    background: rgba(100,116,139,0.10);
    color: var(--ps-text-secondary);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0;
}
.ps-dossier-evidence-badge--causal {
    border-color: rgba(22,163,74,0.34);
    background: rgba(22,163,74,0.12);
    color: #15803D;
}
.ps-dossier-evidence-badge--fresh {
    border-color: rgba(37,99,235,0.32);
    background: rgba(37,99,235,0.12);
    color: #1D4ED8;
}
.ps-dossier-evidence-badge--temporal {
    border-color: rgba(245,158,11,0.34);
    background: rgba(245,158,11,0.12);
    color: #B45309;
}
.ps-dossier-evidence-badge--stale,
.ps-dossier-evidence-badge--missing {
    border-color: rgba(220,38,38,0.30);
    background: rgba(220,38,38,0.09);
    color: #B91C1C;
}
.mud-theme-dark .ps-dossier-evidence-badge--causal { color: #86EFAC; }
.mud-theme-dark .ps-dossier-evidence-badge--fresh { color: #93C5FD; }
.mud-theme-dark .ps-dossier-evidence-badge--temporal { color: #FCD34D; }
.mud-theme-dark .ps-dossier-evidence-badge--stale,
.mud-theme-dark .ps-dossier-evidence-badge--missing { color: #FCA5A5; }
.ps-dossier-fact--warning,
.ps-dossier-action--warning {
    border-left-color: #F59E0B;
}
.ps-dossier-timeline {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 240px;
    overflow: auto;
}
.ps-dossier-timeline-row {
    display: grid;
    grid-template-columns: 52px 92px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 5px 6px;
    border-left: 3px solid rgba(37,99,235,0.45);
    background: rgba(15,23,42,0.04);
    border-radius: 4px;
}
.mud-theme-dark .ps-dossier-timeline-row { background: rgba(255,255,255,0.04); }
.ps-dossier-timeline-row--warning { border-left-color: #F59E0B; }
.ps-dossier-timeline-row time,
.ps-dossier-lane {
    color: var(--ps-text-secondary);
    font-size: 10.5px;
    font-weight: 700;
}
.ps-dossier-timeline-row strong {
    display: block;
    color: var(--ps-text-primary);
    font-weight: 750;
}
.ps-dossier-timeline-row span {
    color: var(--ps-text-secondary);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .ps-diag-complaint-picker { grid-template-columns: auto minmax(0, 1fr); }
    .ps-diag-complaint-picker label { display: none; }
    .ps-diag-complaint-stale { justify-self: start; }
    .ps-dossier-grid { grid-template-columns: 1fr; }
    .ps-dossier-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ps-dossier-timeline-row { grid-template-columns: 48px 72px minmax(0, 1fr); }
}

/* ── Control Drawer ──────────────────────────────────────────────────── */
.ps-ctrl-drawer {
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px 12px;
    background: rgba(245,158,11,0.06);
    border-left: 3px solid #F59E0B;
    border-bottom: 1px solid var(--ps-border, rgba(0,0,0,0.08));
}
.mud-theme-dark .ps-ctrl-drawer { background: rgba(245,158,11,0.08); }
.ps-ctrl-header { display: flex; justify-content: space-between; align-items: baseline; }
.ps-ctrl-title { font-size: 13px; font-weight: 700; }
.ps-ctrl-warning {
    font-size: 11px; color: #B45309;
    font-style: italic;
}
.mud-theme-dark .ps-ctrl-warning { color: #FBBF24; }
.ps-ctrl-toolbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ps-ctrl-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 14px;
    background: rgba(0,0,0,0.04); color: var(--ps-text-primary);
    border: 1px solid rgba(0,0,0,0.1);
    font-size: 12.5px; font-weight: 600;
    cursor: pointer;
}
.ps-ctrl-btn:hover:not(:disabled) { background: rgba(0,0,0,0.08); }
.ps-ctrl-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ps-ctrl-btn--warn {
    background: rgba(245,158,11,0.14); color: #B45309;
    border-color: rgba(245,158,11,0.32);
}
.mud-theme-dark .ps-ctrl-btn--warn { color: #FBBF24; }
.ps-ctrl-btn--danger {
    background: #DC2626; color: #fff; border-color: #DC2626;
}
.ps-ctrl-btn--danger:hover:not(:disabled) { background: #B91C1C; }
.ps-ctrl-btn:focus-visible { outline: 2px solid #F59E0B; outline-offset: 2px; }
.ps-ctrl-confirm {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 8px; border-radius: 8px;
    background: rgba(220,38,38,0.08);
    font-size: 12px;
}
.ps-ctrl-empty { font-size: 12px; color: var(--ps-text-secondary); font-style: italic; }
.ps-ctrl-log {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 6px;
    max-height: 220px; overflow-y: auto;
}
.ps-ctrl-entry {
    padding: 6px 8px; border-radius: 6px;
    background: rgba(0,0,0,0.04);
    border-left: 3px solid transparent;
}
.mud-theme-dark .ps-ctrl-entry { background: rgba(255,255,255,0.04); }
.ps-ctrl-entry--ok   { border-left-color: #10B981; }
.ps-ctrl-entry--fail { border-left-color: #DC2626; }
.ps-ctrl-entry-head {
    display: flex; gap: 8px; align-items: baseline;
    font-size: 11.5px; color: var(--ps-text-secondary);
    margin-bottom: 4px;
}
.ps-ctrl-entry-tool { font-weight: 600; color: var(--ps-text-primary); }
.ps-ctrl-entry-duration { font-family: 'Fira Code', ui-monospace, monospace; }
.ps-ctrl-entry-time { margin-left: auto; }
.ps-ctrl-entry-ok { color: #047857; font-size: 12px; font-weight: 600; }
.mud-theme-dark .ps-ctrl-entry-ok { color: #34D399; }
.ps-ctrl-entry-err { color: #B91C1C; font-size: 12px; }
.mud-theme-dark .ps-ctrl-entry-err { color: #F87171; }

/* ── Controller Intel Panel ──────────────────────────────────────────── */
.ps-intel-panel {
    display: flex; flex-direction: column;
    border-bottom: 1px solid var(--ps-border, rgba(0,0,0,0.08));
}
/* Cap the panel's total vertical footprint so it can't push chat
   below the fold. Children (summary bar, tree, drawers) bring their
   own scroll regions — this cap is the outer safety net. T1 plan MED-4/J-9. */
.ps-intel-panel > .ps-intel-body {
    max-height: 40vh;
    overflow-y: auto;
}
/* Mobile: panel defaults to collapsed (markup sets --mobile on the
   outer section when the viewport was ≤768px at first render).
   Collapsed state hides the body entirely via the existing @if in
   the component. Media-query override catches viewports that
   resize down AFTER first render — not exact, but better than
   nothing. */
@media (max-width: 768px) {
    .ps-intel-panel > .ps-intel-body {
        max-height: 30vh;  /* tighter on small screens */
    }
}
.ps-intel-header {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 8px 12px;
    background: var(--ps-surface-raised, #fafafa);
    border: 0; border-bottom: 1px solid transparent;
    font-size: 13px; font-weight: 700; color: var(--ps-text-primary);
    cursor: pointer; text-align: left;
}
.mud-theme-dark .ps-intel-header { background: rgba(255,255,255,0.02); }
.ps-intel-header:hover,
.ps-intel-header:focus-visible {
    background: rgba(0,0,0,0.04); outline: none;
}
.mud-theme-dark .ps-intel-header:hover,
.mud-theme-dark .ps-intel-header:focus-visible { background: rgba(255,255,255,0.06); }
.ps-intel-chevron { font-size: 11px; width: 14px; color: var(--ps-text-secondary); }
.ps-intel-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-intel-subtitle {
    margin-left: auto;
    color: var(--ps-text-secondary);
    font-family: 'Fira Code', 'Consolas', ui-monospace, monospace;
    font-size: 11px;
    font-weight: 600;
}
.ps-intel-body {
    display: flex; flex-direction: column;
    /* Children already bring their own borders/padding. */
}
.ps-intel-unavailable {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    color: var(--ps-text-secondary);
    font-size: 12.5px;
    background: rgba(100,116,139,0.06);
    border-bottom: 1px solid var(--ps-border, rgba(0,0,0,0.08));
}
.mud-theme-dark .ps-intel-unavailable {
    background: rgba(148,163,184,0.08);
    border-bottom-color: rgba(255,255,255,0.08);
}

/* ── Session List ─────────────────────────────────────────────────────── */
.ps-session-list {
    display: flex;
    flex-direction: column;
}

.ps-session-list__items {
    display: flex;
    flex-direction: column;
}

/* ── Session Card ─────────────────────────────────────────────────────── */
.ps-session-card {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--ps-divider);
    transition: background 0.1s;
}

.ps-session-card:hover {
    background: rgba(0,0,0,0.04);
}

.ps-session-card__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ps-primary);
    color: #fff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.ps-session-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ps-session-card__header {
    display: flex;
    justify-content: space-between;
}

.ps-session-card__name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-session-card__time {
    font-size: 12px;
    color: var(--ps-text-secondary);
    white-space: nowrap;
}

.ps-session-card__preview {
    font-size: 13px;
    color: var(--ps-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-session-card__footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.ps-session-card__badge {
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: var(--ps-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    margin-left: auto;
}

.ps-session-card__assign--none {
    font-size: 11px;
    color: #d97706;
}

.ps-session-card__assign--mine {
    font-size: 11px;
    color: #16a34a;
}

/* ── Status Chips ─────────────────────────────────────────────────────── */
.ps-status-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 500;
}

.ps-status--open { background: var(--ps-status-open-bg); color: var(--ps-status-open-text); }
.ps-status--inprogress { background: var(--ps-status-progress-bg); color: var(--ps-status-progress-text); }
.ps-status--resolved, .ps-status--closed { background: var(--ps-status-closed-bg); color: var(--ps-status-closed-text); }
.ps-status--escalated { background: var(--ps-status-escalated-bg); color: var(--ps-status-escalated-text); }
.ps-status--awaitingcustomer { background: var(--ps-status-awaiting-bg); color: var(--ps-status-awaiting-text); }
.ps-status--reopened { background: var(--ps-status-reopened-bg); color: var(--ps-status-reopened-text); }
.ps-status--onhold { background: var(--ps-status-onhold-bg); color: var(--ps-status-onhold-text); }

/* ── Priority Dots ────────────────────────────────────────────────────── */
.ps-priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.ps-priority--critical { background: var(--ps-priority-critical); }
.ps-priority--high { background: var(--ps-priority-high); }
.ps-priority--medium { background: var(--ps-priority-medium); }
.ps-priority--low { background: var(--ps-priority-low); }

/* ── Dark Mode Status Overrides ───────────────────────────────────────── */
/* Dark mode status chips — handled via CSS variables in .mud-theme-dark block */
/* Dark mode note styling — handled via CSS variables */

/* ── Filter Chips ─────────────────────────────────────────────────────── */
.ps-filter-chips {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 16px;
}

.ps-filter-chips__row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
}

.ps-chip {
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid var(--ps-divider);
    background: transparent;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    color: var(--ps-text);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ps-chip.active {
    background: var(--ps-primary);
    color: #fff;
    border-color: var(--ps-primary);
}

/* ── Agent Status Picker ──────────────────────────────────────────────── */
.ps-agent-status-picker {
    position: relative;
}

.ps-agent-status-picker__trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    color: inherit;
}

.ps-agent-status-picker__menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--ps-surface);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.16);
    padding: 4px;
    z-index: 100;
    min-width: 160px;
}

.ps-agent-status-picker__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    color: inherit;
    font-size: 14px;
}

.ps-agent-status-picker__option:hover {
    background: rgba(0,0,0,0.04);
}

.ps-agent-status-picker__option.active {
    background: rgba(0,0,0,0.08);
}

.ps-agent-status-picker__backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
}

/* ── Status Dots ──────────────────────────────────────────────────────── */
.ps-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.ps-status-dot--online { background: #22c55e; }
.ps-status-dot--away { background: #eab308; }
.ps-status-dot--busy { background: #ef4444; }
.ps-status-dot--offline { background: #6b7280; }

/* ── Copilot Card ─────────────────────────────────────────────────────── */
.ps-copilot-card {
    background: linear-gradient(135deg, #eff6ff, #e0e7ff);
    padding: 12px;
    border-radius: 8px;
    margin: 8px;
}

.ps-copilot-card__header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 13px;
}

.ps-copilot-card__text {
    font-size: 14px;
    margin: 8px 0;
    line-height: 1.4;
}

.ps-copilot-card__actions {
    display: flex;
    gap: 8px;
}

.ps-copilot-card__btn {
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s;
}

.ps-copilot-card__btn--use {
    background: var(--ps-primary);
    color: #fff;
}

.ps-copilot-card__btn--dismiss {
    background: transparent;
    color: var(--ps-text-secondary);
}

/* ── Canned Response Picker ───────────────────────────────────────────── */
.ps-canned-picker {
    background: var(--ps-surface);
    border-radius: 8px;
    border: 1px solid var(--ps-divider);
    max-height: 300px;
    display: flex;
    flex-direction: column;
}

.ps-canned-picker__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--ps-divider);
}

.ps-canned-picker__input {
    border: none;
    outline: none;
    font-size: 14px;
    padding: 8px 12px;
    width: 100%;
    background: transparent;
    color: inherit;
    font-family: inherit;
}

.ps-canned-picker__list {
    flex: 1;
    overflow-y: auto;
}

.ps-canned-picker__item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--ps-divider);
    text-align: left;
    width: 100%;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    display: block;
    color: inherit;
    font-size: 14px;
    font-family: inherit;
}

.ps-canned-picker__item:hover {
    background: rgba(0,0,0,0.04);
}

.ps-canned-picker__item:last-child {
    border-bottom: none;
}

/* ── Common: Banners ──────────────────────────────────────────────────── */
.ps-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
}

.ps-banner--offline {
    background: #fef2f2;
    color: #991b1b;
}

.ps-banner--reconnecting {
    background: #eff6ff;
    color: #1d4ed8;
}

/* ── Common: Empty State ──────────────────────────────────────────────── */
.ps-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.ps-empty-state__icon {
    opacity: 0.4;
    margin-bottom: 8px;
}

/* Inline variant: tighter padding + smaller font, for empty states
   INSIDE drawers where 40px top+bottom padding would be overkill. */
.ps-empty-state--inline { padding: 12px 14px; }
.ps-empty-state--inline .ps-empty-state__message { font-size: 12px; font-style: italic; }

.ps-empty-state__message {
    color: var(--ps-text-secondary);
    font-size: 15px;
    margin: 0;
}

/* ── Common: Error Banner ─────────────────────────────────────────────── */
.ps-error-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fef2f2;
    border-top: 1px solid #fca5a5;
}

.ps-error-banner__text {
    flex: 1;
    font-size: 13px;
    color: #991b1b;
}

.ps-error-banner__actions {
    display: flex;
    gap: 4px;
}

/* ── Rating ────────────────────────────────────────────────────────────── */
.ps-star-rating {
    text-align: center;
}

.ps-star-rating__stars {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.ps-star-rating__star {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--ps-star-inactive);
    transition: color 0.15s;
}

.ps-star-rating__star--filled {
    color: var(--ps-star-active);
}

.ps-star-rating__star:disabled {
    cursor: default;
}

.ps-star-rating__label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ps-primary);
    margin-top: 4px;
}

/* ── FAB ──────────────────────────────────────────────────────────────── */
.ps-fab-container {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 100;
}

.ps-fab-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 99;
}

.ps-fab {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--ps-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.24);
    transition: transform 0.15s;
}

.ps-fab:hover {
    transform: scale(1.05);
}

.ps-fab-menu {
    position: absolute;
    bottom: 56px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ── Scroll-to-bottom FAB ─────────────────────────────────────────────── */
.ps-scroll-fab {
    position: absolute;
    bottom: 72px;
    right: 16px;
    z-index: 10;
    cursor: pointer;
}

/* ── Date Separator — Frosted Glass Pill ─────────────────────────────── */
.ps-date-pill {
    display: flex;
    justify-content: center;
    margin: 16px 0;
    user-select: none;
}
.ps-date-pill__label {
    font-size: 12px;
    font-weight: 500;
    color: var(--ps-text-secondary);
    padding: 4px 14px;
    border-radius: 12px;
    background: var(--ps-date-bg);
    border: 1px solid var(--ps-date-border);
    box-shadow: var(--ps-date-shadow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
/* Keep old class as alias for backward compat */
.ps-date-sep { display: flex; justify-content: center; margin: 16px 0; user-select: none; }
.ps-date-sep::before, .ps-date-sep::after { display: none; }
.ps-date-sep__label {
    font-size: 12px; font-weight: 500; color: var(--ps-text-secondary);
    padding: 4px 14px; border-radius: 12px;
    background: var(--ps-date-bg); border: 1px solid var(--ps-date-border);
    box-shadow: var(--ps-date-shadow);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

/* ── Typing Indicator ─────────────────────────────────────────────────── */
.ps-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 16px;
    font-size: 0.8rem;
    color: var(--ps-text-secondary, rgba(0,0,0,0.54));
}

.ps-typing__dots {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}

.ps-typing__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ps-text-secondary, rgba(0,0,0,0.38));
    animation: ps-typing-bounce 1.4s ease-in-out infinite;
}

.ps-typing__dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ps-typing__dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ps-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* ── Skeleton Chat ────────────────────────────────────────────────────── */
.ps-skeleton-chat {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.ps-skeleton-bubble {
    display: flex;
}

.ps-skeleton-bubble--right {
    justify-content: flex-end;
}

.ps-skeleton-bubble--left {
    justify-content: flex-start;
}

.ps-skeleton-bubble__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--ps-skeleton-bg, #e5e7eb);
    max-width: 65%;
    animation: ps-skeleton-pulse 1.5s ease-in-out infinite;
}

.ps-skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: var(--ps-skeleton-pulse, #d1d5db);
}

.ps-skeleton-line--long {
    width: 180px;
}

.ps-skeleton-line--short {
    width: 100px;
}

@keyframes ps-skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Skeleton Session List ────────────────────────────────────────────── */
.ps-skeleton-sessions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 16px;
}

.ps-skeleton-session {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: var(--ps-skeleton-bg, #f3f4f6);
    animation: ps-skeleton-session-pulse 1.5s ease-in-out infinite;
}

.ps-skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ps-skeleton-pulse, #d1d5db);
    flex-shrink: 0;
}

.ps-skeleton-session__text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.ps-skeleton-session .ps-skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: var(--ps-skeleton-pulse, #d1d5db);
}

.ps-skeleton-session .ps-skeleton-line--title {
    width: 60%;
}

.ps-skeleton-session .ps-skeleton-line--subtitle {
    width: 80%;
}

@keyframes ps-skeleton-session-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Dark Mode Banner Overrides ───────────────────────────────────────── */
.mud-theme-dark .ps-banner--offline { background: #7f1d1d; color: #fca5a5; }
.mud-theme-dark .ps-banner--reconnecting { background: #1e3a5f; color: #93c5fd; }
.mud-theme-dark .ps-error-banner { background: #450a0a; border-top-color: #991b1b; }
.mud-theme-dark .ps-error-banner__text { color: #fca5a5; }
.mud-theme-dark .ps-session-card:hover { background: rgba(255,255,255,0.05); }
.mud-theme-dark .ps-canned-picker__item:hover { background: rgba(255,255,255,0.05); }
.mud-theme-dark .ps-agent-status-picker__option:hover { background: rgba(255,255,255,0.05); }
.mud-theme-dark .ps-agent-status-picker__option.active { background: rgba(255,255,255,0.08); }
.mud-theme-dark .ps-chat-input--note .ps-chat-input__textarea::placeholder { color: var(--ps-note-text); }
.mud-theme-dark .ps-copilot-card { background: #1e293b; }

/* ── Attachment Renderer ────────────────────────────────────────────── */
.ps-attachments { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.ps-attachment { border-radius: 8px; overflow: hidden; }
.ps-attachment--image { cursor: pointer; }
.ps-attachment__image { max-width: 100%; border-radius: 8px; display: block; }
.ps-attachment--audio { background: var(--ps-surface); border-radius: 8px; padding: 8px; }
.ps-attachment__audio { width: 100%; height: 36px; }
.ps-attachment__transcription {
    display: flex; align-items: flex-start; gap: 4px; margin-top: 6px;
    font-size: 12px; opacity: 0.8; font-style: italic;
}
.ps-attachment--file {
    display: flex; align-items: center; gap: 6px; padding: 8px 12px;
    background: var(--ps-surface); border-radius: 8px; text-decoration: none;
    color: var(--ps-primary); font-size: 13px;
}
.ps-attachment--file:hover { opacity: 0.8; }
.ps-attachment__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-attachment__size { font-size: 11px; opacity: 0.6; white-space: nowrap; }

/* ── CSAT Prompt ────────────────────────────────────────────────────── */
.ps-csat-prompt { display: flex; justify-content: center; padding: 16px; }
.ps-csat-prompt__card {
    background: var(--ps-surface); border-radius: 12px; padding: 20px 24px;
    text-align: center; max-width: 320px; width: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.ps-csat-prompt__thanks {
    display: flex; align-items: center; gap: 8px; justify-content: center;
    padding: 16px; font-size: 15px; color: var(--ps-primary);
}

/* ── Translation Overlay ────────────────────────────────────────────── */
.ps-translation { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--ps-divider); }
.ps-translation__header {
    display: flex; align-items: center; gap: 4px; font-size: 11px;
    opacity: 0.6; margin-bottom: 2px;
}
.ps-translation__lang { text-transform: uppercase; font-weight: 600; }
.ps-translation__text { font-size: 13px; opacity: 0.7; font-style: italic; }

/* ── Session List Refresh ────────────────────────────────────────────── */
.ps-session-list__refresh {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 10px; border: none; background: transparent;
    color: var(--ps-primary); font-size: 13px; cursor: pointer;
    opacity: 0.7; transition: opacity 0.2s;
}
.ps-session-list__refresh:hover { opacity: 1; }
.ps-session-list__refresh:disabled { opacity: 0.4; cursor: default; }

/* ── Dark Mode — New Components ─────────────────────────────────────── */
.mud-theme-dark .ps-attachment--audio { background: rgba(255,255,255,0.05); }
.mud-theme-dark .ps-attachment--file { background: rgba(255,255,255,0.05); color: var(--ps-primary); }
.mud-theme-dark .ps-csat-prompt__card { background: #1e293b; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.mud-theme-dark .ps-attachment__transcription { opacity: 0.9; }
.mud-theme-dark .ps-translation__text { opacity: 0.8; }

/* ── Translate Icon ──────────────────────────────────────────────── */
.ps-bubble__translate-icon { font-size: 14px !important; opacity: 0.5; cursor: help; }
.ps-bubble__translate-icon:hover { opacity: 1; }
