:root {
    --cx-primary: #d4763c;
    --cx-primary-dark: #b85e28;
    --cx-primary-light: #e8a46d;
    --cx-accent: #2ea87e;
    --cx-accent-dark: #1f8a64;
    --cx-danger: #c44;
    --cx-warn: #c8a020;
    --cx-bg: #1a1a1f;
    --cx-bg2: #222228;
    --cx-bg3: #2a2a32;
    --cx-bg4: #32323c;
    --cx-surface: #28282f;
    --cx-text: #e0ddd8;
    --cx-text2: #a09a90;
    --cx-text3: #706a60;
    --cx-border: #3a3a42;
    --cx-border2: #484850;
    --cx-online: #3cc43c;
    --cx-offline: #555;
    --cx-typing: #c8a020;
    --cx-msg-me: #2a3528;
    --cx-msg-them: #2a2a32;
    --cx-msg-ai: #302820;
    --cx-msg-system: #28282f;
    --cx-fab-size: 56px;
    --cx-panel-w: 420px;
    --cx-panel-h: 620px;
    --cx-radius: 12px;
    --cx-radius-sm: 8px;
    --cx-radius-xs: 4px;
    --cx-shadow: 0 8px 32px rgba(0,0,0,0.5);
    --cx-font: 'Segoe UI', Tahoma, Geneva, sans-serif;
    --cx-font-mono: 'Consolas', 'Courier New', monospace;
    --cx-transition: 0.2s ease;
    --cx-z-fab: 9990;
    --cx-z-panel: 9991;
    --cx-z-modal: 9995;
    --cx-z-lightbox: 9999;
    --cx-z-toast: 9997;
}

.cx-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: var(--cx-fab-size);
    height: var(--cx-fab-size);
    border-radius: 50%;
    background: var(--cx-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 22px;
    z-index: var(--cx-z-fab);
    box-shadow: 0 4px 16px rgba(212,118,60,0.4);
    transition: transform var(--cx-transition), box-shadow var(--cx-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--cx-font);
}
.cx-fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(212,118,60,0.6); }
.cx-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: var(--cx-danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.cx-panel {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: var(--cx-panel-w);
    height: var(--cx-panel-h);
    background: var(--cx-bg);
    border-radius: var(--cx-radius);
    box-shadow: var(--cx-shadow);
    z-index: var(--cx-z-panel);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--cx-border);
    font-family: var(--cx-font);
    color: var(--cx-text);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.cx-panel.cx-hiding { opacity: 0; transform: translateY(12px) scale(0.96); pointer-events: none; }
.cx-hdr {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--cx-bg2);
    border-bottom: 1px solid var(--cx-border);
    gap: 8px;
    min-height: 48px;
    flex-shrink: 0;
}
.cx-hdr-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cx-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}
.cx-hdr-info { flex: 1; min-width: 0; }
.cx-hdr-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--cx-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cx-hdr-sub {
    font-size: 11px;
    color: var(--cx-text2);
}
.cx-hdr-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--cx-text3);
    font-size: 16px;
    transition: background var(--cx-transition), color var(--cx-transition);
    flex-shrink: 0;
}
.cx-hdr-close:hover { background: var(--cx-bg4); color: var(--cx-text); }

.cx-modebar {
    display: flex;
    padding: 0;
    background: var(--cx-bg2);
    border-bottom: 1px solid var(--cx-border);
    flex-shrink: 0;
}
.cx-mode-btn {
    flex: 1;
    padding: 8px 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--cx-text3);
    font-size: 12px;
    font-family: var(--cx-font);
    cursor: pointer;
    transition: color var(--cx-transition), border-color var(--cx-transition);
    position: relative;
}
.cx-mode-btn:hover { color: var(--cx-text2); }
.cx-mode-btn.cx-on {
    color: var(--cx-primary);
    border-bottom-color: var(--cx-primary);
    font-weight: 600;
}
.cx-mode-badge {
    position: absolute;
    top: 4px;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cx-danger);
}

.cx-users-sidebar {
    flex-shrink: 0;
    max-height: 180px;
    overflow-y: auto;
    border-bottom: 1px solid var(--cx-border);
    background: var(--cx-bg2);
    display: none;
}
.cx-users-sidebar.cx-show { display: block; }
.cx-user-row {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    gap: 8px;
    cursor: pointer;
    transition: background var(--cx-transition);
    font-size: 13px;
}
.cx-user-row:hover { background: var(--cx-bg3); }
.cx-user-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cx-user-dot.cx-online { background: var(--cx-online); box-shadow: 0 0 6px rgba(60,196,60,0.5); }
.cx-user-dot.cx-offline { background: var(--cx-offline); }
.cx-user-name { flex: 1; color: var(--cx-text); }
.cx-user-name.cx-offline-name { color: var(--cx-text3); }
.cx-user-role { font-size: 10px; color: var(--cx-text3); text-transform: uppercase; }
.cx-user-buzz {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--cx-text3);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--cx-transition);
}
.cx-user-buzz:hover { color: var(--cx-warn); }

.cx-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scroll-behavior: smooth;
}
.cx-messages::-webkit-scrollbar { width: 5px; }
.cx-messages::-webkit-scrollbar-track { background: transparent; }
.cx-messages::-webkit-scrollbar-thumb { background: var(--cx-border); border-radius: 3px; }

.cx-msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: var(--cx-radius-sm);
    font-size: 13px;
    line-height: 1.45;
    word-wrap: break-word;
    position: relative;
    animation: cx-msg-in 0.2s ease;
}
@keyframes cx-msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cx-msg-user { align-self: flex-end; background: var(--cx-msg-me); border-bottom-right-radius: 2px; }
.cx-msg-ai { align-self: flex-start; background: var(--cx-msg-ai); border-bottom-left-radius: 2px; }
.cx-msg-system { align-self: center; background: var(--cx-msg-system); color: var(--cx-text2); font-size: 11px; text-align: center; max-width: 90%; border-radius: var(--cx-radius-xs); padding: 4px 10px; }
.cx-msg-pm-in { align-self: flex-start; background: var(--cx-msg-them); border-bottom-left-radius: 2px; }
.cx-msg-pm-out { align-self: flex-end; background: var(--cx-msg-me); border-bottom-right-radius: 2px; }
.cx-msg-sender {
    font-size: 10px;
    font-weight: 600;
    color: var(--cx-primary-light);
    margin-bottom: 2px;
}
.cx-msg-time {
    font-size: 9px;
    color: var(--cx-text3);
    text-align: right;
    margin-top: 3px;
}
.cx-msg-media { margin-top: 6px; }
.cx-msg-media img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--cx-radius-xs);
    cursor: pointer;
}
.cx-msg-link-preview {
    background: var(--cx-bg3);
    border-radius: var(--cx-radius-xs);
    border-left: 3px solid var(--cx-primary);
    padding: 8px;
    margin-top: 6px;
    font-size: 12px;
    cursor: pointer;
}
.cx-msg-link-title { font-weight: 600; color: var(--cx-text); margin-bottom: 2px; }
.cx-msg-link-desc { color: var(--cx-text2); font-size: 11px; }
.cx-msg-link-thumb { width: 60px; height: 60px; border-radius: var(--cx-radius-xs); object-fit: cover; float: right; margin-left: 8px; }
.cx-msg-file {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--cx-bg3);
    border-radius: var(--cx-radius-xs);
    padding: 8px;
    margin-top: 6px;
    cursor: pointer;
    text-decoration: none;
    color: var(--cx-text);
}
.cx-msg-file-icon { font-size: 20px; flex-shrink: 0; }
.cx-msg-file-name { font-size: 12px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-msg-file-size { font-size: 10px; color: var(--cx-text3); }
.cx-typing-indicator {
    align-self: flex-start;
    padding: 8px 12px;
    background: var(--cx-msg-ai);
    border-radius: var(--cx-radius-sm);
    display: none;
    gap: 4px;
    align-items: center;
}
.cx-typing-indicator.cx-show { display: flex; }
.cx-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cx-primary-light);
    animation: cx-typing-bounce 1.2s infinite;
}
.cx-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.cx-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes cx-typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-6px); opacity: 1; } }

.cx-input-area {
    padding: 8px 10px;
    border-top: 1px solid var(--cx-border);
    background: var(--cx-bg2);
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}
.cx-input-row {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}
.cx-input-field {
    flex: 1;
    min-height: 34px;
    max-height: 100px;
    padding: 7px 10px;
    background: var(--cx-bg3);
    border: 1px solid var(--cx-border);
    border-radius: var(--cx-radius-sm);
    color: var(--cx-text);
    font-family: var(--cx-font);
    font-size: 13px;
    resize: none;
    outline: none;
    transition: border-color var(--cx-transition);
    overflow-y: auto;
}
.cx-input-field:focus { border-color: var(--cx-primary); }
.cx-input-field::placeholder { color: var(--cx-text3); }
.cx-input-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--cx-radius-sm);
    background: none;
    border: 1px solid var(--cx-border);
    color: var(--cx-text2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background var(--cx-transition), color var(--cx-transition), border-color var(--cx-transition);
    flex-shrink: 0;
    font-family: var(--cx-font);
}
.cx-input-btn:hover { background: var(--cx-bg4); color: var(--cx-text); border-color: var(--cx-border2); }
.cx-input-btn.cx-active { background: var(--cx-primary); color: #fff; border-color: var(--cx-primary); }
.cx-input-btn.cx-send { background: var(--cx-primary); color: #fff; border-color: var(--cx-primary); }
.cx-input-btn.cx-send:hover { background: var(--cx-primary-dark); }
.cx-input-btn.cx-recording { background: var(--cx-danger); color: #fff; border-color: var(--cx-danger); animation: cx-pulse 1.5s infinite; }
@keyframes cx-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.cx-input-attachments {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.cx-input-attach-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--cx-bg3);
    border-radius: var(--cx-radius-xs);
    padding: 3px 8px;
    font-size: 11px;
    color: var(--cx-text2);
}
.cx-input-attach-remove {
    cursor: pointer;
    color: var(--cx-danger);
    font-size: 12px;
}
.cx-input-mention-popup {
    position: absolute;
    bottom: 100%;
    left: 10px;
    right: 10px;
    background: var(--cx-bg3);
    border: 1px solid var(--cx-border);
    border-radius: var(--cx-radius-sm);
    max-height: 140px;
    overflow-y: auto;
    display: none;
    z-index: var(--cx-z-modal);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.3);
}
.cx-input-mention-popup.cx-show { display: block; }
.cx-mention-item {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cx-mention-item:hover, .cx-mention-item.cx-active { background: var(--cx-bg4); }

.cx-tts-player {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

@keyframes cx-buzz-shake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-8px, -3px); }
    20% { transform: translate(6px, 4px); }
    30% { transform: translate(-5px, -6px); }
    40% { transform: translate(7px, 2px); }
    50% { transform: translate(-4px, 5px); }
    60% { transform: translate(6px, -4px); }
    70% { transform: translate(-7px, 3px); }
    80% { transform: translate(5px, -5px); }
    90% { transform: translate(-3px, 4px); }
}
.cx-buzzing { animation: cx-buzz-shake 0.7s ease-in-out; }

.cx-notification-sound { display: none; }

.cx-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: var(--cx-z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cx-modal {
    background: var(--cx-bg2);
    border-radius: var(--cx-radius);
    border: 1px solid var(--cx-border);
    padding: 20px;
    min-width: 280px;
    max-width: 360px;
    box-shadow: var(--cx-shadow);
}
.cx-modal-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }

@media (max-width: 480px) {
    .cx-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    .cx-fab { bottom: 16px; right: 16px; }
}

/* ================================================================
   MULTIMEDIA SYSTEM v2.0 — Images, Video, Audio, Files, Gallery
   ================================================================ */

/* ---- Lightbox ---- */
.cx-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: var(--cx-z-lightbox);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cx-fade-in 0.2s ease;
    cursor: zoom-out;
}
.cx-lightbox-img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: var(--cx-radius-sm);
    object-fit: contain;
    animation: cx-zoom-in 0.25s ease;
    cursor: default;
}
.cx-lightbox-video {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: var(--cx-radius-sm);
    outline: none;
}
.cx-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.cx-lightbox-close:hover { opacity: 1; }
@keyframes cx-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cx-zoom-in { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---- Media Grid in Message ---- */
.cx-msg-media-grid {
    display: grid;
    gap: 4px;
    margin-top: 6px;
    border-radius: var(--cx-radius-xs);
    overflow: hidden;
}
.cx-msg-media-grid.cx-count-1 { grid-template-columns: 1fr; }
.cx-msg-media-grid.cx-count-2 { grid-template-columns: 1fr 1fr; }
.cx-msg-media-grid.cx-count-3 { grid-template-columns: 1fr 1fr 1fr; }
.cx-msg-media-grid.cx-count-4 { grid-template-columns: 1fr 1fr; }
.cx-msg-media-grid.cx-count-5 { grid-template-columns: 1fr 1fr 1fr; }
.cx-msg-media-grid.cx-count-5 .cx-media-cell:first-child { grid-column: 1 / 3; }
.cx-msg-media-grid.cx-count-6 { grid-template-columns: 1fr 1fr 1fr; }

.cx-media-cell {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--cx-bg3);
    cursor: pointer;
}
.cx-media-cell img, .cx-media-cell video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.cx-media-cell:hover img, .cx-media-cell:hover video { transform: scale(1.05); }

.cx-media-cell .cx-media-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

/* ---- Video Thumbnail with Play Button ---- */
.cx-video-thumb {
    position: relative;
    cursor: pointer;
    border-radius: var(--cx-radius-xs);
    overflow: hidden;
    background: #000;
    display: inline-block;
    max-width: 100%;
}
.cx-video-thumb img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
}
.cx-video-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cx-video-play svg {
    width: 48px;
    height: 48px;
    fill: rgba(255,255,255,0.9);
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
    transition: transform 0.2s, fill 0.2s;
}
.cx-video-thumb:hover .cx-video-play svg {
    transform: scale(1.12);
    fill: #fff;
}

/* ---- Inline Video Player ---- */
.cx-video-player {
    max-width: 100%;
    max-height: 320px;
    border-radius: var(--cx-radius-xs);
    background: #000;
    display: block;
}

/* ---- Audio Player ---- */
.cx-audio-player {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--cx-bg3);
    border-radius: var(--cx-radius-sm);
    padding: 8px 10px;
    margin-top: 6px;
    min-width: 220px;
}
.cx-audio-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cx-primary);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.2s;
}
.cx-audio-play-btn:hover { background: var(--cx-primary-dark); }
.cx-audio-wave {
    flex: 1;
    height: 24px;
    display: flex;
    align-items: center;
    gap: 2px;
}
.cx-audio-bar {
    width: 3px;
    background: var(--cx-primary);
    border-radius: 2px;
    animation: cx-audio-wave 1.2s ease-in-out infinite;
    opacity: 0.4;
}
.cx-audio-bar:nth-child(2) { animation-delay: 0.1s; height: 60%; }
.cx-audio-bar:nth-child(3) { animation-delay: 0.2s; height: 85%; }
.cx-audio-bar:nth-child(4) { animation-delay: 0.3s; height: 50%; }
.cx-audio-bar:nth-child(5) { animation-delay: 0.15s; height: 70%; }
.cx-audio-bar:nth-child(6) { animation-delay: 0.25s; height: 40%; }
.cx-audio-bar:nth-child(7) { animation-delay: 0.05s; height: 90%; }
.cx-audio-bar:nth-child(8) { animation-delay: 0.35s; height: 55%; }
.cx-audio-time {
    font-size: 11px;
    color: var(--cx-text3);
    flex-shrink: 0;
    min-width: 36px;
    text-align: right;
}
@keyframes cx-audio-wave {
    0%, 100% { transform: scaleY(0.4); opacity: 0.3; }
    50% { transform: scaleY(1); opacity: 0.8; }
}

/* ---- File Attachment Card ---- */
.cx-msg-file-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--cx-bg3);
    border-radius: var(--cx-radius-sm);
    padding: 10px 12px;
    margin-top: 6px;
    text-decoration: none;
    color: var(--cx-text);
    transition: background 0.2s;
    cursor: pointer;
    max-width: 280px;
}
.cx-msg-file-card:hover { background: var(--cx-bg4); }
.cx-msg-file-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: var(--cx-radius-xs);
    background: var(--cx-bg4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.cx-msg-file-info { flex: 1; min-width: 0; }
.cx-msg-file-name {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cx-msg-file-meta {
    font-size: 11px;
    color: var(--cx-text3);
    margin-top: 2px;
}
.cx-msg-file-download {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--cx-bg4);
    border: none;
    color: var(--cx-text2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.cx-msg-file-download:hover { background: var(--cx-primary); color: #fff; }

/* ---- Input: Attachment Preview Strip ---- */
.cx-input-attach-strip {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px 0;
}
.cx-input-attach-preview {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: var(--cx-radius-xs);
    overflow: hidden;
    background: var(--cx-bg3);
    border: 1px solid var(--cx-border);
    flex-shrink: 0;
}
.cx-input-attach-preview img, .cx-input-attach-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cx-input-attach-preview .cx-file-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.cx-input-attach-preview .cx-attach-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 9px;
    padding: 2px 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cx-input-attach-preview .cx-attach-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--cx-danger);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}
.cx-input-attach-preview .cx-upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--cx-primary);
    transition: width 0.2s;
}

/* ---- Drag & Drop Zone ---- */
.cx-drag-overlay {
    position: absolute;
    inset: 0;
    background: rgba(212,118,60,0.12);
    border: 2px dashed var(--cx-primary);
    border-radius: var(--cx-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
    pointer-events: none;
    animation: cx-fade-in 0.15s ease;
}
.cx-drag-overlay .cx-drag-icon { font-size: 36px; opacity: 0.7; }
.cx-drag-overlay .cx-drag-text { color: var(--cx-primary); font-size: 14px; font-weight: 500; }

/* ---- Toast Notifications ---- */
.cx-toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: var(--cx-z-toast);
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}
.cx-toast {
    background: var(--cx-bg2);
    border: 1px solid var(--cx-border);
    border-radius: var(--cx-radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--cx-text);
    box-shadow: var(--cx-shadow);
    animation: cx-toast-in 0.3s ease, cx-toast-out 0.3s ease 3.7s forwards;
    pointer-events: auto;
    max-width: 300px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cx-toast.cx-toast-err { border-left: 3px solid var(--cx-danger); }
.cx-toast.cx-toast-ok { border-left: 3px solid var(--cx-accent); }
.cx-toast.cx-toast-warn { border-left: 3px solid var(--cx-warn); }
@keyframes cx-toast-in { from { transform: translateX(120%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cx-toast-out { to { transform: translateX(120%); opacity: 0; } }

/* ---- Scrollbar Messages ---- */
.cx-messages::-webkit-scrollbar { width: 4px; }
.cx-messages::-webkit-scrollbar-track { background: transparent; }
.cx-messages::-webkit-scrollbar-thumb { background: var(--cx-border2); border-radius: 2px; }
