/* Floating live chat dock — Autonix dashboard tokens (Messenger-style, our theme) */
.lcd-skip { display: none !important; }

/* row + flex-end keeps FAB/rail on the viewport right; windows grow leftward */
.lcd-layer {
    position: fixed;
    right: 0;
    bottom: 0;
    z-index: 9998;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: flex-end;
    gap: 0;
    pointer-events: none;
    font-family: inherit;
    height: auto;
    max-height: none;
}

.lcd-layer * {
    pointer-events: auto;
}

/* Chat windows stack to the left of the side panel + rail */
.lcd-windows {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 8px 12px 0;
    max-width: calc(100vw - 72px);
    overflow-x: auto;
    overflow-y: visible;
    flex: 0 1 auto;
}

.lcd-windows::-webkit-scrollbar {
    height: 4px;
}

.lcd-windows::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.lcd-win {
    position: relative;
    width: min(clamp(26rem, 42vw, 36rem), calc(100vw - 72px));
    height: clamp(30rem, 65vh, 50rem);
    max-height: min(50rem, calc(100vh - 3rem));
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -4px 28px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.lcd-win-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 30;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
}

.lcd-win-ctrl {
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow:
        0 4px 16px rgba(15, 23, 42, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.85);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.lcd-win-ctrl:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.28);
    background: var(--hover-bg);
    color: var(--primary, #0069ff);
}

.lcd-win-ctrl:focus-visible {
    outline: 2px solid var(--primary, #0069ff);
    outline-offset: 2px;
}

.lcd-win-ctrl--close {
    background: #ef4444;
    border-color: #dc2626;
    color: #fff;
}

.lcd-win-ctrl--close:hover {
    background: #dc2626;
    border-color: #b91c1c;
    color: #fff;
}

[data-theme="dark"] .lcd-win {
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.45);
}

.lcd-win-hd {
    position: relative;
    z-index: 1;
    border-radius: 14px 14px 0 0;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 10px 88px 10px 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--hover-bg);
    cursor: grab;
}

.lcd-win-hd:active {
    cursor: grabbing;
}

.lcd-win-title {
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--text-main);
    line-height: 1.25;
    min-width: 0;
}

.lcd-win-title-btn {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    line-height: 1.25;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lcd-win-title-btn:hover {
    color: var(--primary, #0069ff);
    text-decoration: underline;
}

.lcd-win-title-btn:focus-visible {
    outline: 2px solid var(--primary, #0069ff);
    outline-offset: 2px;
    border-radius: 4px;
}

.lcd-win-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lcd-win-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.lcd-dm-hd-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px 8px;
    flex: 1 1 12rem;
    min-width: 0;
}

.lcd-dm-action-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.lcd-dm-action-group--rtc {
    padding-left: 8px;
    margin-left: 2px;
    border-left: 1px solid var(--border-color);
}

.lcd-dm-action-group--win {
    margin-left: auto;
}

.lcd-icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.lcd-icon-btn:hover {
    background: var(--bg-card);
    color: var(--primary);
}

.lcd-icon-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    pointer-events: none;
}

.lcd-win-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.lcd-msgs {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-anchor: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lcd-msgs-bottom-anchor {
    overflow-anchor: auto;
    height: 1px;
    flex-shrink: 0;
    pointer-events: none;
}

.lcd-msgs::-webkit-scrollbar {
    width: 4px;
}

.lcd-msgs::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.lcd-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 92%;
}

.lcd-row.me {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.lcd-row.them {
    align-self: flex-start;
}

.lcd-row.sys {
    align-self: center;
    max-width: 100%;
}

.lcd-av {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    flex-shrink: 0;
}

.lcd-av.has-photo {
    background: var(--hover-bg);
    padding: 0;
    overflow: hidden;
}

.lcd-av.has-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lcd-av.me.has-photo {
    background: transparent;
}

.lcd-av.me {
    background: var(--primary);
    color: #fff;
}

.lcd-av.them {
    background: #10b981;
    color: #fff;
}

.lcd-av.them.has-photo {
    background: var(--hover-bg);
}

/* Status rings — keep circular: row aligns flex-start; outer is shrink-wrapped to avatar only */
.lcd-av-outer {
    flex-shrink: 0;
    align-self: flex-start;
    border-radius: 50%;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    height: fit-content;
}

.lcd-av-outer.lcd-av-ring-online {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.35),
        0 0 0 3px rgba(34, 197, 94, 0.98),
        0 2px 10px rgba(34, 197, 94, 0.2);
}

.lcd-av-outer.lcd-av-ring-busy {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.35),
        0 0 0 3px rgba(245, 158, 11, 0.98),
        0 2px 10px rgba(245, 158, 11, 0.22);
}

.lcd-av-outer.lcd-av-ring-dnd {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.35),
        0 0 0 3px rgba(239, 68, 68, 0.98),
        0 2px 10px rgba(239, 68, 68, 0.2);
}

.lcd-av-outer.lcd-av-ring-invisible {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.3),
        0 0 0 3px rgba(148, 163, 184, 0.95),
        0 2px 8px rgba(148, 163, 184, 0.18);
}

.lcd-av-outer.lcd-av-ring-away {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.35),
        0 0 0 3px rgba(245, 158, 11, 0.98),
        0 2px 10px rgba(245, 158, 11, 0.2);
}

/* Customer offline — red ring on live support minimized chip */
.lcd-av-outer.lcd-av-ring-offline {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.35),
        0 0 0 3px rgba(239, 68, 68, 0.95),
        0 2px 10px rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .lcd-av-outer.lcd-av-ring-offline {
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.8),
        0 0 0 3px rgba(239, 68, 68, 0.9),
        0 2px 14px rgba(239, 68, 68, 0.26);
}

[data-theme="dark"] .lcd-av-outer.lcd-av-ring-online {
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.8),
        0 0 0 3px rgba(34, 197, 94, 0.92),
        0 2px 14px rgba(34, 197, 94, 0.28);
}

[data-theme="dark"] .lcd-av-outer.lcd-av-ring-busy {
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.8),
        0 0 0 3px rgba(245, 158, 11, 0.92),
        0 2px 14px rgba(245, 158, 11, 0.28);
}

[data-theme="dark"] .lcd-av-outer.lcd-av-ring-dnd {
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.8),
        0 0 0 3px rgba(239, 68, 68, 0.92),
        0 2px 14px rgba(239, 68, 68, 0.26);
}

[data-theme="dark"] .lcd-av-outer.lcd-av-ring-invisible {
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.8),
        0 0 0 3px rgba(148, 163, 184, 0.88),
        0 2px 12px rgba(148, 163, 184, 0.22);
}

[data-theme="dark"] .lcd-av-outer.lcd-av-ring-away {
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.8),
        0 0 0 3px rgba(245, 158, 11, 0.92),
        0 2px 14px rgba(245, 158, 11, 0.26);
}

.lcd-team-av {
    width: 34px;
    height: 34px;
    font-size: 0.72rem;
}

.lcd-dm-hd-av {
    width: 36px;
    height: 36px;
    font-size: 0.75rem;
}

.lcd-dm-hd-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 10rem;
    min-width: 0;
}

.lcd-bub {
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 0.84rem;
    line-height: 1.45;
    word-break: break-word;
}

.lcd-bub.me {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.lcd-bub.them {
    background: var(--hover-bg);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
}

.lcd-bub.sys {
    background: transparent;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-style: italic;
    text-align: center;
}

.lcd-dm-sys-bub {
    max-width: 100%;
}

.lcd-dm-sys-audio {
    margin-top: 8px;
}

.lcd-dm-sys-audio-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.lcd-dm-sys-audio audio {
    width: 100%;
    max-width: 280px;
    height: 32px;
    vertical-align: middle;
}

.lcd-dm-sys-audio-dl {
    font-size: 0.72rem;
    font-style: normal;
    color: var(--accent, #3b82f6);
    text-decoration: none;
    white-space: nowrap;
}

.lcd-dm-sys-audio-dl:hover {
    text-decoration: underline;
}

.lcd-win-body > .lcd-dm-pstn-pop,
.lcd-win-body > .lcd-dm-sms-pop,
.lcd-win-body > .lcd-dm-wa-pop,
.lcd-win-body > .lcd-dm-email-pop {
    flex-shrink: 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 0;
    padding: 10px 12px 12px;
    background: var(--bg-card);
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    box-shadow: none;
}

[data-theme="dark"] .lcd-win-body > .lcd-dm-pstn-pop,
[data-theme="dark"] .lcd-win-body > .lcd-dm-sms-pop,
[data-theme="dark"] .lcd-win-body > .lcd-dm-wa-pop,
[data-theme="dark"] .lcd-win-body > .lcd-dm-email-pop {
    box-shadow: none;
}

.lcd-dm-pstn-pop-in {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: none;
}

.lcd-dm-pstn-pop-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.lcd-dm-pstn-pop-head .lcd-dm-pstn-detail {
    flex: 1;
    min-width: 0;
}

.lcd-dm-pstn-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lcd-dm-pstn-close:hover {
    background: var(--hover-bg, rgba(15, 23, 42, 0.06));
    color: var(--text-main);
}

.lcd-dm-pstn-close:focus-visible {
    outline: 2px solid var(--primary, #0069ff);
    outline-offset: 2px;
}

.lcd-dm-pstn-detail {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
    word-break: break-all;
}

.lcd-dm-pstn-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.lcd-dm-pstn-from,
.lcd-dm-sms-from,
.lcd-dm-wa-from {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--input-bg, var(--bg-card));
    color: var(--text-main);
    font-size: 0.84rem;
    box-sizing: border-box;
}

.lcd-dm-sms-ta,
.lcd-dm-wa-ta {
    width: 100%;
    min-height: 4.25rem;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--input-bg, var(--bg-card));
    color: var(--text-main);
    font-size: 0.84rem;
    font-family: inherit;
    line-height: 1.4;
    resize: vertical;
    box-sizing: border-box;
}

.lcd-dm-pstn-status {
    font-size: 0.78rem;
    color: var(--text-muted);
    min-height: 1em;
}

/* Live PSTN call UI lives in the message thread, not the dialer popover */
.lcd-dm-pstn-pop .lcd-dm-pstn-status,
.lcd-dm-pstn-pop .lcd-dm-pstn-hangup,
.lcd-dm-sms-pop .lcd-dm-sms-status,
.lcd-dm-email-pop .lcd-dm-email-status {
    display: none !important;
}

.lcd-row.lcd-dm-live-pstn-row .lcd-dm-live-call-bub {
    min-width: 200px;
    max-width: 280px;
    padding: 12px 14px;
    border-radius: 14px 14px 4px 14px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.25);
}

.lcd-dm-live-call-phase {
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.3;
}

.lcd-dm-live-call-meta {
    font-size: 0.78rem;
    opacity: 0.92;
    margin-top: 4px;
}

.lcd-dm-live-channel-body {
    font-size: 0.9rem;
    line-height: 1.45;
    margin-top: 8px;
    white-space: pre-wrap;
    word-break: break-word;
}

.lcd-dm-live-pstn-row.lcd-dm-live-pstn-row--ended .lcd-dm-live-channel-body {
    color: var(--text-main);
}

.lcd-dm-live-call-timer {
    font-size: 1.05rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-top: 8px;
}

.lcd-dm-live-call-timer[hidden] {
    display: none !important;
}

.lcd-dm-live-call-end {
    margin-top: 10px;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-weight: 600;
    font-size: 0.84rem;
    cursor: pointer;
}

.lcd-dm-live-call-end:hover {
    background: rgba(255, 255, 255, 0.28);
}

.lcd-dm-live-call-end[hidden] {
    display: none !important;
}

.lcd-dm-live-pstn-row.lcd-dm-live-pstn-row--ended .lcd-dm-live-call-bub {
    background: var(--hover-bg);
    color: var(--text-main);
    box-shadow: none;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .lcd-row.lcd-dm-live-pstn-row .lcd-dm-live-call-bub {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.lcd-dm-pstn-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.lcd-dm-pstn-call {
    flex: 1;
    min-width: 6rem;
    padding: 9px 12px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
}

.lcd-dm-pstn-hangup {
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--hover-bg);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
}

.lcd-meta {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.lcd-row.me .lcd-meta {
    text-align: right;
}

.lcd-typing {
    display: none;
    padding: 4px 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.lcd-typing.on {
    display: block;
}

.lcd-input-bar {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

.lcd-input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.88rem;
    background: var(--input-bg, var(--bg-card));
    color: var(--text-main);
    outline: none;
    resize: none;
    min-height: 40px;
    max-height: 100px;
    font-family: inherit;
}

.lcd-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 105, 255, 0.12);
}

.lcd-send {
    padding: 9px 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    flex-shrink: 0;
}

.lcd-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.lcd-start {
    padding: 16px;
    text-align: center;
}

.lcd-start p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0 0 12px;
    line-height: 1.45;
}

.lcd-start input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
    background: var(--input-bg, var(--bg-card));
    color: var(--text-main);
    font-size: 0.88rem;
}

.lcd-start-btn {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
}

.lcd-closed {
    padding: 12px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

/* Side panel: team directory + queues (fixed to viewport, not full-height strip) */
.lcd-side-panel {
    display: none;
    width: min(300px, calc(100vw - 72px));
    max-height: min(420px, calc(100vh - 24px));
    overflow: hidden;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px 14px 0 0;
    margin: 0 6px 12px 0;
    box-shadow: 0 -4px 28px rgba(0, 0, 0, 0.12);
    flex: 0 0 auto;
}

[data-theme="dark"] .lcd-side-panel {
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.45);
}

.lcd-side-panel.open {
    display: flex;
    flex-direction: column;
}

.lcd-side-hd-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 10px 10px 14px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.lcd-side-hd {
    padding: 0;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-main);
    flex: 1;
    min-width: 0;
}

.lcd-side-min-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--hover-bg);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.lcd-side-min-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--bg-card);
}

.lcd-side-search-wrap {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.lcd-side-search {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    font-size: 0.84rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--input-bg, var(--hover-bg));
    color: var(--text-main);
    outline: none;
}

.lcd-side-search::placeholder {
    color: var(--text-muted);
}

.lcd-side-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.lcd-side-no-matches {
    margin: 4px 0 0;
    padding: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
}

.lcd-side-scroll {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 8px 10px 12px;
}

.lcd-side-scroll::-webkit-scrollbar {
    width: 4px;
}

.lcd-staff-row {
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--hover-bg);
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.84rem;
    color: var(--text-main);
}

.lcd-staff-row:hover {
    border-color: var(--primary);
}

.lcd-staff-row.is-self {
    opacity: 0.65;
    cursor: default;
}

.lcd-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lcd-dot.online {
    background: #22c55e;
}

.lcd-dot.busy {
    background: #eab308;
}

.lcd-dot.away {
    background: #94a3b8;
}

.lcd-dot.dnd {
    background: #ef4444;
}

.lcd-dot.offline {
    background: #cbd5e1;
}

[data-theme="dark"] .lcd-dot.offline {
    background: #475569;
}

.lcd-peer {
    min-width: 0;
    flex: 1;
}

.lcd-peer strong {
    display: block;
    font-size: 0.86rem;
}

.lcd-peer small {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.lcd-section-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 12px 0 8px;
}

/* Customer directory: Support Team always open; CRM / team lists in <details> (closed by default) */
.lcd-side-section-support .lcd-section-label {
    margin-top: 0;
}

.lcd-side-collapsible {
    margin: 4px 0 0;
    border: 0;
}

.lcd-side-collapsible-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    list-style: none;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 10px 0 0;
    padding: 6px 0 8px;
    user-select: none;
    border-radius: 6px;
}

.lcd-side-collapsible-summary:hover {
    color: var(--text-main);
}

.lcd-side-collapsible-summary::-webkit-details-marker {
    display: none;
}

.lcd-side-collapsible-summary::after {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 4px 0 4px 6px;
    border-color: transparent transparent transparent currentColor;
    opacity: 0.55;
    flex-shrink: 0;
    transition: border-width 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.lcd-side-collapsible[open] .lcd-side-collapsible-summary::after {
    border-width: 6px 4px 0 4px;
    border-color: currentColor transparent transparent transparent;
}

.lcd-side-collapsible-inner {
    padding-bottom: 4px;
}

.lcd-team-user-group {
    margin-top: 10px;
}

.lcd-team-user-group:first-child {
    margin-top: 0;
}

.lcd-team-user-group-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-main);
    padding: 0 4px 6px 2px;
    letter-spacing: 0.01em;
}

.lcd-link-support {
    display: block;
    text-align: center;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.82rem;
    text-decoration: none;
}

.lcd-link-support:hover {
    border-color: var(--primary);
}

/* Right rail — transparent so no white strip over dashboard (--bg-body)
   column-reverse: FAB stays bottom-right; minimized chips stack upward above it */
.lcd-rail {
    width: 56px;
    height: auto;
    align-self: flex-end;
    padding: 12px 8px 20px;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
}

.lcd-rail-main {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 105, 255, 0.35);
    position: relative;
    transition: transform 0.15s;
}

.lcd-rail-main:hover {
    transform: scale(1.05);
}

.lcd-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lcd-rail-chips {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    width: 100%;
    flex: none;
    overflow-x: visible;
    overflow-y: auto;
    max-height: min(220px, 38vh);
    padding: 12px 4px 16px;
    box-sizing: border-box;
    /* Padding gives status rings / shadows room inside the scroll box */
}

.lcd-chip {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--hover-bg);
    color: var(--text-main);
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.lcd-chip:hover {
    border-color: var(--primary);
}

.lcd-chip .lcd-badge {
    top: -4px;
    right: -4px;
}

/* Live support minimized chip: initial letter + unread counter */
.lcd-chip-letter {
    user-select: none;
    pointer-events: none;
}

/* DM minimized bubble — peer photo + status ring, stacked on rail */
.lcd-chip.lcd-dm-chip {
    width: 44px;
    height: 44px;
    padding: 0;
    overflow: visible;
    border: none;
    background: transparent;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .lcd-chip.lcd-dm-chip {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.lcd-chip.lcd-dm-chip:hover {
    border-color: transparent;
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(0, 105, 255, 0.25);
}

.lcd-dm-chip-av {
    width: 36px;
    height: 36px;
    font-size: 0.75rem;
}

.lcd-dm-chip .lcd-av-outer {
    flex-shrink: 0;
}

/* Queue block inside side panel (reuse item styles) */
.lcd-side-scroll h4 {
    margin: 0 0 8px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.lcd-q-item {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--hover-bg);
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-main);
}

.lcd-q-item:hover {
    border-color: var(--primary);
}

.lcd-q-item small {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.lcd-dock-wrap {
    position: relative;
    flex: 0 0 auto;
    background: transparent;
    pointer-events: none;
    overflow: visible;
}

.lcd-dock-wrap > * {
    pointer-events: auto;
}

/* In-chat incoming call strip + system line */
.lcd-dm-call-strip {
    flex-shrink: 0;
    position: relative;
    z-index: 5;
    border-bottom: 2px solid var(--primary, #3b82f6);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(34, 197, 94, 0.12));
    padding: 12px 12px;
    min-height: 52px;
    box-sizing: border-box;
}

[data-theme='dark'] .lcd-dm-call-strip {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(34, 197, 94, 0.12));
}

.lcd-dm-call-strip-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.lcd-dm-call-strip-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.lcd-dm-call-strip-text {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lcd-dm-call-strip-text strong {
    font-size: 0.82rem;
    color: var(--text-main);
}

.lcd-dm-call-strip-text span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.lcd-dm-call-strip-actions {
    display: flex;
    gap: 8px;
}

.lcd-dm-call-answer {
    padding: 6px 14px;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    background: #22c55e;
    color: #fff;
}

.lcd-dm-call-answer:hover {
    filter: brightness(1.06);
}

.lcd-dm-call-decline {
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    background: var(--hover-bg);
    color: var(--text-main);
}

.lcd-dm-call-decline:hover {
    border-color: #ef4444;
    color: #b91c1c;
}

.lcd-row.lcd-dm-call-msg {
    justify-content: center;
    margin: 8px 0;
}

.lcd-dm-call-msg-inner {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--hover-bg);
    border: 1px dashed var(--border-color);
    max-width: 92%;
}

.lcd-dm-call-msg-icon {
    margin-right: 4px;
}

.lcd-dm-call-msg-inner--ended {
    line-height: 1.35;
}

.lcd-dm-call-ended-sub {
    margin-top: 4px;
    font-size: 0.78rem;
    opacity: 0.92;
}

/* —— CRM timeline rows in external-contact chat (system-style + avatar) —— */
.lcd-dm-timeline-row {
    align-self: flex-start;
    max-width: 92%;
}

.lcd-event-av {
    width: 30px;
    height: 30px;
    font-size: 0.78rem;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

[data-theme='dark'] .lcd-event-av {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.35);
}

.lcd-dm-event-bub {
    font-style: normal;
    text-align: left;
}

.lcd-dm-event-title {
    display: block;
    font-weight: 700;
    font-size: 0.86rem;
    margin: 0 0 4px;
}

.lcd-dm-event-desc {
    margin: 0 0 8px;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-muted);
    font-style: normal;
}

.lcd-dm-event-tag {
    display: inline-flex;
    align-items: center;
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.22);
    font-style: normal;
}

.lcd-dm-event-bub .lcd-dm-sys-audio {
    margin-top: 8px;
    text-align: left;
}

.lcd-dm-event-bub .lcd-dm-sys-audio-row {
    justify-content: flex-start;
}

/* —— DM composer (toolbar, emoji, GIF, attachments) —— */
.lcd-win-dm .lcd-win-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Drag-and-drop files onto DM window (same upload as paperclip) */
.lcd-win-dm.lcd-win-dm--file-drag {
    box-shadow: 0 -4px 28px rgba(0, 0, 0, 0.12), inset 0 0 0 2px var(--primary);
    background: linear-gradient(rgba(59, 130, 246, 0.09), rgba(59, 130, 246, 0.09)), var(--bg-card);
}

[data-theme="dark"] .lcd-win-dm.lcd-win-dm--file-drag {
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.45), inset 0 0 0 2px var(--primary);
    background: linear-gradient(rgba(59, 130, 246, 0.14), rgba(59, 130, 246, 0.14)), var(--bg-card);
}

.lcd-dm-msg-col {
    flex: 1;
    min-width: 0;
}

.lcd-dm-composer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 8px 8px 10px;
    position: relative;
    flex-shrink: 0;
}

.lcd-tb {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--hover-bg);
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.lcd-tb:hover {
    border-color: var(--primary);
    background: var(--bg-card);
}

.lcd-tb-gif {
    font-size: 0.62rem;
    letter-spacing: 0.02em;
}

.lcd-tb-thumb {
    font-size: 1.1rem;
    line-height: 1;
}

/* Single row: attach · GIF · emoji · textarea · thumb · Send */
.lcd-dm-composer .lcd-input-bar {
    border-top: none;
    margin: 0;
    padding: 0;
    background: transparent;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
}

.lcd-dm-input-row {
    align-items: flex-end;
}

.lcd-dm-input-row .lcd-input {
    flex: 1;
    min-width: 0;
    min-height: 40px;
}

.lcd-dm-file {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

/* `hidden` must win over component display:flex (e.g. GIF panel) */
.lcd-dm-pop[hidden] {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}

.lcd-dm-pop {
    position: absolute;
    bottom: 100%;
    left: 8px;
    right: 8px;
    margin-bottom: 4px;
    max-height: 220px;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.12);
    z-index: 3;
}

[data-theme="dark"] .lcd-dm-pop {
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
}

.lcd-emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.lcd-emoji-cell {
    border: none;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1.4;
    cursor: pointer;
    border-radius: 8px;
    padding: 4px;
}

.lcd-emoji-cell:hover {
    background: var(--hover-bg);
}

.lcd-dm-gif-pop:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    max-height: min(240px, 40vh);
    overflow: hidden;
}

.lcd-dm-gif-mount {
    flex: 1;
    min-height: 120px;
    max-height: 180px;
    overflow: auto;
    border-radius: 8px;
    background: var(--hover-bg);
}

.lcd-dm-gif-search {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--input-bg, var(--bg-card));
    color: var(--text-main);
    font-size: 0.82rem;
}

/* REST fallback grid (no client SDK key) */
.lcd-dm-gif-mount.lcd-dm-gif-rest {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.lcd-gif-tile {
    border: none;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: var(--hover-bg);
    aspect-ratio: 1;
}

.lcd-gif-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lcd-dm-gif-hint {
    margin: 0;
    font-size: 0.72rem;
    color: var(--text-muted);
    display: none;
}

.lcd-bub-reaction {
    font-size: 2.25rem;
    line-height: 1.1;
    padding: 6px 10px !important;
    background: transparent !important;
    border: 1px solid var(--border-color);
}

.lcd-row.me .lcd-bub-reaction {
    border-color: rgba(255, 255, 255, 0.35);
}

.lcd-bub-media {
    padding: 4px !important;
    overflow: hidden;
}

.lcd-dm-media-open {
    display: block;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    max-width: min(260px, 72vw);
    line-height: 0;
}

.lcd-dm-media-open:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.lcd-dm-gif-img,
.lcd-dm-file-img {
    max-width: min(260px, 72vw);
    max-height: 200px;
    border-radius: 10px;
    display: block;
    vertical-align: middle;
    pointer-events: none;
}

.lcd-bub-file {
    padding: 10px 12px !important;
}

.lcd-dm-file-link {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
    word-break: break-all;
}

.lcd-dm-file-link:hover {
    text-decoration: underline;
    color: var(--primary);
}

.lcd-bub-audio {
    padding: 10px 12px !important;
    max-width: 100%;
}

.lcd-dm-audio-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.lcd-dm-audio-el {
    width: 100%;
    min-width: 200px;
    max-width: min(280px, 100%);
    height: 36px;
    vertical-align: middle;
}

.lcd-dm-audio-dl {
    align-self: flex-start;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.lcd-dm-audio-dl:hover {
    text-decoration: underline;
}

.lcd-dm-caption {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* PDF attachment thumbnail + full preview */
.lcd-bub-pdf-wrap {
    padding: 4px !important;
}

.lcd-dm-pdf-thumb {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 0;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--hover-bg);
    cursor: pointer;
    max-width: min(220px, 78vw);
    text-align: left;
    overflow: hidden;
}

.lcd-dm-pdf-thumb:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.lcd-dm-pdf-canvas {
    display: block;
    width: 100%;
    height: auto;
    min-height: 80px;
    background: var(--bg-card);
    border-radius: 8px 8px 0 0;
}

.lcd-dm-pdf-canvas-fail {
    min-height: 100px;
    background: linear-gradient(135deg, var(--hover-bg), var(--bg-card));
    position: relative;
}

.lcd-dm-pdf-canvas-fail::after {
    content: 'PDF';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
}

.lcd-dm-pdf-filename {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-main);
    padding: 0 8px 8px;
    word-break: break-all;
    line-height: 1.25;
}

/* Fullscreen-style lightbox (images + PDF iframe) */
.lcd-dm-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.lcd-dm-lightbox[hidden] {
    display: none !important;
}

.lcd-dm-lightbox-scrim {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: rgba(15, 18, 28, 0.82);
    cursor: pointer;
}

.lcd-dm-lightbox-panel {
    position: relative;
    z-index: 1;
    max-width: min(960px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lcd-dm-lightbox-x {
    position: absolute;
    top: -4px;
    right: -4px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lcd-dm-lightbox-x:hover {
    background: var(--hover-bg);
}

.lcd-dm-lightbox-img {
    max-width: min(920px, 92vw);
    max-height: min(88vh, 900px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
}

.lcd-dm-lightbox-img[hidden] {
    display: none !important;
}

.lcd-dm-lightbox-pdf {
    width: min(920px, 94vw);
    height: min(85vh, 820px);
    background: #525659;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
}

.lcd-dm-lightbox-pdf[hidden] {
    display: none !important;
}

.lcd-dm-lightbox-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #fff;
}

.lcd-dm-lightbox-video {
    width: min(920px, 94vw);
    max-height: min(88vh, 900px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
    background: #000;
}

.lcd-dm-lightbox-video[hidden] {
    display: none !important;
}

.lcd-dm-lightbox-video-el {
    display: block;
    width: 100%;
    max-height: min(88vh, 900px);
    vertical-align: middle;
}

.lcd-dm-video-open {
    display: block;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    max-width: min(260px, 72vw);
    text-align: left;
    line-height: 1.2;
}

.lcd-dm-video-open:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.lcd-dm-video-thumb-wrap {
    position: relative;
    display: block;
    border-radius: 10px;
    overflow: hidden;
    background: #111;
}

.lcd-dm-video-thumb {
    display: block;
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    pointer-events: none;
    vertical-align: middle;
}

.lcd-dm-video-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.38);
    font-size: 2.25rem;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.lcd-dm-video-filename {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 6px 2px 0;
    word-break: break-all;
}

/* —— Voice calls (WebRTC) —— */
.lcd-voice-root {
    position: fixed;
    inset: 0;
    z-index: 10002;
    pointer-events: none;
}

.lcd-voice-root * {
    pointer-events: auto;
}

.lcd-voice-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 18, 28, 0.55);
    backdrop-filter: blur(4px);
}

.lcd-voice-modal[hidden] {
    display: none !important;
}

.lcd-voice-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px 28px;
    min-width: 280px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.lcd-voice-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: var(--hover-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    overflow: hidden;
}

.lcd-voice-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lcd-voice-name {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-main);
}

.lcd-voice-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.lcd-voice-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 20px;
}

.lcd-voice-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
}

.lcd-voice-decline {
    background: #fecaca;
    color: #991b1b;
}

.lcd-voice-decline:hover {
    transform: scale(1.05);
}

.lcd-voice-accept {
    background: #22c55e;
    color: #fff;
}

.lcd-voice-accept:hover {
    transform: scale(1.05);
}

.lcd-voice-banner {
    position: fixed;
    bottom: 96px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0,  0, 0.15);
    z-index: 10003;
    max-width: 96vw;
}

.lcd-voice-banner[hidden] {
    display: none !important;
}

.lcd-voice-banner--active {
    border-color: var(--primary);
}

.lcd-voice-banner-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.lcd-voice-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: lcd-voice-pulse 1.2s ease-in-out infinite;
}

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

.lcd-voice-timer {
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 2.5rem;
}

.lcd-voice-btn-sm {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--hover-bg);
    color: var(--text-main);
    font-size: 0.82rem;
    cursor: pointer;
}

.lcd-voice-btn-sm:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.lcd-voice-end {
    background: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
}

.lcd-voice-btn-sm.is-muted {
    opacity: 0.5;
}

/* DM video calls — glass overlay + PiP local (same signaling as voice) */
.lcd-video-call-overlay {
    position: fixed;
    inset: 0;
    z-index: 10003;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.lcd-video-call-overlay[hidden] {
    display: none !important;
}

.lcd-video-call-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 14, 22, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.lcd-video-call-card {
    position: relative;
    z-index: 1;
    width: min(440px, 96vw);
    max-height: min(90vh, 680px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 28px 90px rgba(0, 0, 0, 0.38),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    display: flex;
    flex-direction: column;
}

.lcd-video-call-card-hd {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.06) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-color);
}

.lcd-video-call-title {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-main);
}

.lcd-video-call-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.lcd-video-call-x {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--hover-bg);
    color: var(--text-main);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}

.lcd-video-call-x:hover {
    background: var(--border-color);
}

.lcd-video-call-stage {
    position: relative;
    flex: 1;
    min-height: 240px;
    background: #07080d;
}

.lcd-vc-remote {
    position: relative;
    z-index: 0;
    width: 100%;
    height: 100%;
    min-height: 240px;
    max-height: 52vh;
    object-fit: cover;
    display: block;
    background: #000;
}

.lcd-vc-local {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 118px;
    height: 88px;
    border-radius: 14px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
    z-index: 3;
    background: #111;
}

.lcd-vc-wait {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2;
}

.lcd-vc-wait-inner {
    text-align: center;
    color: #fff;
}

.lcd-vc-wait-pulse {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    margin-right: 8px;
    vertical-align: middle;
    animation: lcd-vc-pulse 1.2s ease-in-out infinite;
}

@keyframes lcd-vc-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.55;
        transform: scale(0.88);
    }
}

#lcd-vc-wait-text {
    font-size: 0.92rem;
    font-weight: 600;
}

.lcd-video-call-ft {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--hover-bg);
    border-top: 1px solid var(--border-color);
}

.lcd-vc-timer {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
}

.lcd-video-call-ft-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lcd-vc-ft-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 0.15s,
        border-color 0.15s;
}

.lcd-vc-ft-btn:hover {
    transform: scale(1.06);
    border-color: var(--primary);
}

.lcd-vc-ft-btn.is-muted,
.lcd-vc-ft-btn.is-off {
    opacity: 0.45;
}

.lcd-vc-ft-end {
    width: auto;
    min-width: 72px;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
    background: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
}

.lcd-dm-call-strip--video {
    border-color: rgba(59, 130, 246, 0.4);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), transparent);
}

/* Clickable DM avatars → profile / user management */
.lcd-av-btn {
    display: inline-block;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    line-height: 0;
    vertical-align: middle;
    font: inherit;
    color: inherit;
}

.lcd-av-btn:focus-visible {
    outline: 2px solid var(--primary, #0069ff);
    outline-offset: 2px;
}

.lcd-av-btn .lcd-av-outer,
.lcd-av-btn .lcd-av {
    pointer-events: none;
}

/* Simple peer profile (customer view of staff, or non-admin staff) */
.lcd-profile-pop {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.lcd-profile-pop[hidden] {
    display: none !important;
}

.lcd-profile-pop-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}

.lcd-profile-pop-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 320px;
    padding: 28px 24px 24px;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
    text-align: center;
}

.lcd-profile-pop-x {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: var(--hover-bg);
    color: var(--text-main);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.lcd-profile-pop-x:hover {
    background: var(--border-color);
}

.lcd-profile-pop-av {
    width: 96px;
    height: 96px;
    margin: 0 auto 14px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--hover-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-muted);
}

.lcd-profile-pop-av img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lcd-profile-pop-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    word-break: break-word;
}

@media (max-width: 520px) {
    .lcd-win {
        width: calc(100vw - 58px);
    }
}
