    /* 1. Theme Variables */
    :root {
        --msger-bg: #ffffff;
        --msger-sidebar-bg: #f8f9fa;
        --msger-text-main: #1c1e21;
        --msger-text-sub: #65676b;
        --msger-border: #dee2e6;
        --msger-input-bg: #f0f2f5;
        --msger-bubble-received: #e4e6eb;
        --msger-bubble-received-text: #050505;
        --msger-bubble-sent: #6f42c1;
        --msger-hover: #f2f2f2;
        --msger-active: #e7f3ff;
        --msger-shadow: rgba(0, 0, 0, 0.15);
    }

    [data-bs-theme="dark"] {
        --msger-bg: #242526;
        --msger-sidebar-bg: #18191a;
        --msger-text-main: #e4e6eb;
        --msger-text-sub: #b0b3b8;
        --msger-border: #3e4042;
        --msger-input-bg: #3a3b3c;
        --msger-bubble-received: #3e4042;
        --msger-bubble-received-text: #e4e6eb;
        --msger-bubble-sent: #8250df;
        --msger-hover: #3a3b3c;
        --msger-active: #263951;
        --msger-shadow: rgba(0, 0, 0, 0.4);
    }

    /* 2. Layout */
    #smart-chat-wrapper { position: fixed; bottom: 20px; right: 20px; z-index: 10000; }
    #smart-chat-container {
        width: 850px; height: 600px; max-height: 80vh;
        background: var(--msger-bg); border-radius: 12px;
        box-shadow: 0 12px 28px 0 rgba(0,0,0,0.2);
        display: none; position: absolute; bottom: 0; right: 70px;
        border: 1px solid var(--msger-border); overflow: hidden; z-index: 10001;
    }
    #smart-chat-container.active { display: flex !important; flex-direction: row !important; }

    /* Buttons Deck & Toggles Style */
    .chat-toggle-buttons-deck {
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: center;
        z-index: 10002;
        position: relative;
    }

    .ai-chat-toggle-btn, .admin-support-toggle-btn {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        border: none;
        color: white !important;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.35rem;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        outline: none;
    }

    .ai-chat-toggle-btn {
        background: linear-gradient(135deg, #a855f7, #6366f1);
        box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
        animation: premium-pulse 3s infinite;
    }
    .ai-chat-toggle-btn:hover {
        transform: translateY(-3px) scale(1.08);
        box-shadow: 0 10px 25px rgba(99, 102, 241, 0.5);
        background: linear-gradient(135deg, #b55fe6, #4f46e5);
    }

    .admin-support-toggle-btn {
        background: linear-gradient(135deg, #10b981, #06b6d4);
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
        animation: support-pulse 3.5s infinite;
    }
    .admin-support-toggle-btn:hover {
        transform: translateY(-3px) scale(1.08);
        box-shadow: 0 10px 25px rgba(16, 185, 129, 0.5);
        background: linear-gradient(135deg, #059669, #0891b2);
    }

    .ai-chat-toggle-btn:active, .admin-support-toggle-btn:active {
        transform: translateY(1px) scale(0.95);
    }

    /* Premium Custom Tooltips for All Toggles */
    .ai-chat-toggle-btn::before, .admin-support-toggle-btn::before, #chat-toggle-btn::before {
        content: attr(data-tooltip);
        position: absolute;
        right: 65px;
        top: 50%;
        transform: translateY(-50%) translateX(10px);
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(8px);
        color: white;
        padding: 8px 14px;
        border-radius: 8px;
        font-size: 0.75rem;
        font-weight: 600;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
        pointer-events: none;
        border: 1px solid rgba(255, 255, 255, 0.1);
        font-family: inherit;
        letter-spacing: 0.3px;
    }
    #chat-toggle-btn::before {
        right: 70px;
    }

    .ai-chat-toggle-btn:hover::before, .admin-support-toggle-btn:hover::before, #chat-toggle-btn:hover::before {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) translateX(0);
    }

    /* Tooltip Arrow */
    .ai-chat-toggle-btn::after, .admin-support-toggle-btn::after, #chat-toggle-btn::after {
        content: '';
        position: absolute;
        right: 57px;
        top: 50%;
        transform: translateY(-50%) translateX(10px);
        border-width: 5px;
        border-style: solid;
        border-color: transparent transparent transparent rgba(15, 23, 42, 0.95);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
    }
    #chat-toggle-btn {
        right: 62px;
    }

    .ai-chat-toggle-btn:hover::after, .admin-support-toggle-btn:hover::after, #chat-toggle-btn:hover::after {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) translateX(0);
    }

    /* Glow/Pulse Animations */
    @keyframes premium-pulse {
        0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.45), 0 6px 20px rgba(99, 102, 241, 0.3); }
        70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0), 0 6px 20px rgba(99, 102, 241, 0.3); }
        100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0), 0 6px 20px rgba(99, 102, 241, 0.3); }
    }

    @keyframes support-pulse {
        0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45), 0 6px 20px rgba(16, 185, 129, 0.3); }
        70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0), 0 6px 20px rgba(16, 185, 129, 0.3); }
        100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0), 0 6px 20px rgba(16, 185, 129, 0.3); }
    }

    /* Mobile Responsive Adjustments */
    @media (max-width: 991px) {
        #smart-chat-container {
            width: calc(100vw - 40px);
            height: calc(85vh - 70px);
            right: 0;
            bottom: 70px;
        }
        .chat-toggle-buttons-deck {
            flex-direction: row;
            gap: 12px;
        }
        /* Adjust tooltips for mobile layout to open upwards */
        .ai-chat-toggle-btn::before, .admin-support-toggle-btn::before, #chat-toggle-btn::before {
            right: 50%;
            top: -55px;
            transform: translateX(50%) translateY(10px);
        }
        .ai-chat-toggle-btn:hover::before, .admin-support-toggle-btn:hover::before, #chat-toggle-btn:hover::before {
            transform: translateX(50%) translateY(0);
        }
        .ai-chat-toggle-btn::after, .admin-support-toggle-btn::after, #chat-toggle-btn::after {
            right: 50%;
            top: -15px;
            transform: translateX(50%) translateY(10px);
            border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
        }
        .ai-chat-toggle-btn:hover::after, .admin-support-toggle-btn:hover::after, #chat-toggle-btn:hover::after {
            transform: translateX(50%) translateY(0);
        }

        .messenger-sidebar {
            position: absolute;
            left: -100%;
            top: 0;
            bottom: 0;
            z-index: 10005;
            transition: left 0.3s ease;
            box-shadow: 5px 0 15px rgba(0,0,0,0.1);
        }
        .messenger-sidebar.show {
            left: 0;
        }
        #sidebar-toggle-mobile {
            display: block !important;
        }
    }

    #sidebar-toggle-mobile {
        display: none;
    }

    .messenger-sidebar {
        width: 300px; min-width: 300px; border-right: 1px solid var(--msger-border);
        display: flex; flex-direction: column; background: var(--msger-sidebar-bg); flex-shrink: 0;
    }
    .sidebar-top { padding: 15px; border-bottom: 1px solid var(--msger-border); background: var(--msger-bg); display: flex; justify-content: space-between; align-items: center;}
    .sidebar-top h4 { font-size: 1.2rem; font-weight: 700; margin: 0; color: var(--msger-text-main); }
    
    .messenger-list { flex: 1; overflow-y: auto; padding: 8px; }
    .m-item { padding: 10px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 12px; margin-bottom: 2px; position: relative;}
    .m-item:hover { background: var(--msger-hover); }
    .m-item.active { background: var(--msger-active); }
    
    .m-avatar {
        width: 44px; height: 44px; border-radius: 50%; background: #6f42c1;
        display: flex; align-items: center; justify-content: center;
        color: white; font-weight: 600; position: relative; flex-shrink: 0;
    }
    .m-online-dot { position: absolute; bottom: 2px; right: 2px; width: 11px; height: 12px; background: #31a24c; border-radius: 50%; border: 2px solid var(--msger-bg); }

    .m-info { flex: 1; overflow: hidden; }
    .m-name { font-weight: 600; font-size: 0.9rem; color: var(--msger-text-main); }
    .m-comp { font-size: 0.75rem; color: var(--msger-text-sub); }
    .m-unread-dot { background: #0084ff; min-width: 10px; height: 10px; border-radius: 50%; margin-left: auto; }

    .messenger-chat { flex: 1; display: flex; flex-direction: column; background: var(--msger-bg); min-width: 0; position: relative; }
    .chat-top { padding: 12px 15px; border-bottom: 1px solid var(--msger-border); display: flex; justify-content: space-between; align-items: center; }
    .chat-top-name { font-weight: 700; font-size: 1rem; color: var(--msger-text-main); }

    .chat-content { flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; position: relative; }
    .msg-row { display: flex; width: 100%; }
    .msg-row.sent { justify-content: flex-end; }
    .msg-bubble { max-width: 80%; padding: 8px 12px; font-size: 0.9rem; border-radius: 15px; }
    .sent .msg-bubble { background: var(--msger-bubble-sent); color: white; border-bottom-right-radius: 4px; border-bottom-left-radius: 15px; }
    .received .msg-bubble { background: var(--msger-bubble-received); color: var(--msger-bubble-received-text); border-bottom-left-radius: 4px; border-bottom-right-radius: 15px; }
    .msg-bubble img { max-width: 100%; border-radius: 8px; cursor: zoom-in; }

    .chat-bottom {
        padding: 14px 16px;
        border-top: 1px solid var(--msger-border);
        display: flex;
        align-items: center;
        gap: 10px;
        background: var(--msger-bg);
    }
    .chat-input-wrap {
        flex: 1;
        background: var(--msger-input-bg);
        border-radius: 24px;
        padding: 4px 14px;
        display: flex;
        align-items: center;
        gap: 12px;
        border: 1px solid var(--msger-border);
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
    }
    .chat-input-wrap:focus-within {
        border-color: rgba(124, 58, 237, 0.45);
        box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15), inset 0 1px 3px rgba(0, 0, 0, 0.03);
        background: var(--msger-bg);
    }
    .chat-input-wrap input {
        flex: 1;
        border: none !important;
        background: transparent !important;
        outline: none !important;
        color: var(--msger-text-main) !important;
        font-size: 0.92rem;
        padding: 6px 0;
    }
    
    .m-attach-btn {
        background: transparent;
        border: none;
        color: var(--msger-text-sub);
        font-size: 1.2rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.25s ease;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        padding: 0;
        outline: none;
        flex-shrink: 0;
    }
    .m-attach-btn:hover:not(:disabled) {
        background: rgba(124, 58, 237, 0.08);
        color: #7c3aed;
        transform: scale(1.05);
    }
    .m-attach-btn:disabled {
        opacity: 0.35;
        cursor: not-allowed;
    }

    .chat-send-btn {
        background: linear-gradient(135deg, #7c3aed, #4f46e5);
        color: white !important;
        border: none;
        border-radius: 50%;
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 0;
        outline: none;
        flex-shrink: 0;
    }
    .chat-send-btn i {
        font-size: 0.95rem;
        transform: translateX(-1px) translateY(0px);
        transition: transform 0.25s ease;
    }
    .chat-send-btn:hover:not(:disabled) {
        transform: scale(1.06) rotate(-5deg);
        box-shadow: 0 6px 15px rgba(124, 58, 237, 0.4);
        background: linear-gradient(135deg, #8b5cf6, #6366f1);
    }
    .chat-send-btn:hover:not(:disabled) i {
        transform: translateX(1px) translateY(-1px) scale(1.05);
    }
    .chat-send-btn:active:not(:disabled) {
        transform: scale(0.95);
    }
    .chat-send-btn:disabled {
        background: var(--msger-input-bg) !important;
        color: var(--msger-text-sub) !important;
        opacity: 0.5;
        box-shadow: none;
        cursor: not-allowed;
    }

    #chat-toggle-btn {
        display: none !important;
    }
    #chat-notification-badge { position: absolute; top: -2px; right: -2px; background: #fa3e3e; color: white; border-radius: 50%; width: 20px; height: 20px; font-size: 11px; display: none; align-items: center; justify-content: center; font-weight: 700; border: 2px solid white; }

    #m-drag-overlay {
        position: absolute; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(124, 58, 237, 0.93); backdrop-filter: blur(8px);
        color: white; display: none; flex-direction: column; align-items: center; justify-content: center;
        z-index: 1000; border: 3px dashed rgba(255, 255, 255, 0.6); border-radius: 12px;
        margin: 5px; width: calc(100% - 10px); height: calc(100% - 10px);
        transition: all 0.3s ease;
    }
    .scroll_m::-webkit-scrollbar { width: 5px; }
    .scroll_m::-webkit-scrollbar-thumb { background: #bcc0c4; border-radius: 10px; }

    #m-ticket-prompt {
        position: absolute; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px);
        display: none; flex-direction: column; align-items: center; justify-content: center;
        z-index: 50; text-align: center; padding: 30px;
        transition: all 0.3s ease;
    }
    [data-bs-theme="dark"] #m-ticket-prompt {
        background: rgba(36, 37, 38, 0.94);
    }
    #m-ticket-prompt i {
        animation: pulseTicket 2s infinite ease-in-out;
    }
    @keyframes pulseTicket {
        0% { transform: scale(1); }
        50% { transform: scale(1.08); text-shadow: 0 0 15px rgba(124, 58, 237, 0.4); }
        100% { transform: scale(1); }
    }

    #m-btn-share-screen {
        background: rgba(16, 185, 129, 0.12) !important; color: #10b981 !important;
        border: 1px solid rgba(16, 185, 129, 0.25) !important;
        transition: all 0.25s ease;
        font-weight: 600;
    }
    #m-btn-share-screen:hover {
        background: #10b981 !important; color: white !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
    }
    
    #m-btn-close-ticket {
        background: rgba(239, 68, 68, 0.12) !important; color: #ef4444 !important;
        border: 1px solid rgba(239, 68, 68, 0.25) !important;
        transition: all 0.25s ease;
        font-weight: 600;
    }
    #m-btn-close-ticket:hover {
        background: #ef4444 !important; color: white !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
    }

    #m-btn-open-ticket-header {
        background: rgba(16, 185, 129, 0.12) !important; color: #10b981 !important;
        border: 1px solid rgba(16, 185, 129, 0.25) !important;
        transition: all 0.25s ease;
        font-weight: 600;
    }
    #m-btn-open-ticket-header:hover {
        background: #10b981 !important; color: white !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
    }

    /* Rating UI */
    .m-star-rating { display: flex; flex-direction: row-reverse; gap: 5px; }
    .m-star-rating input { display: none; }
    .m-star-rating label { font-size: 1.5rem; color: #ddd; cursor: pointer; }
    .m-star-rating input:checked ~ label, .m-star-rating label:hover, .m-star-rating label:hover ~ label { color: #ffc107; }

    /* Premium Glassmorphism & UI Customizations */
    .m-item {
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 3px solid transparent;
    }
    .m-item:hover {
        background: rgba(111, 66, 193, 0.05) !important;
        transform: translateX(4px);
    }
    .m-item.active {
        background: rgba(111, 66, 193, 0.1) !important;
        border-left: 3px solid #7c3aed !important;
    }
    
    /* Dynamic active user online light */
    .m-online-dot {
        box-shadow: 0 0 8px rgba(49, 162, 76, 0.6);
        animation: pulseOnline 2s infinite;
    }
    @keyframes pulseOnline {
        0% { box-shadow: 0 0 0 0 rgba(49, 162, 76, 0.7); }
        70% { box-shadow: 0 0 0 6px rgba(49, 162, 76, 0); }
        100% { box-shadow: 0 0 0 0 rgba(49, 162, 76, 0); }
    }

    .admin-online-indicator {
        box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    }

    /* AI and Support bubbles */
    .msg-row.received-ai .msg-bubble {
        background: rgba(99, 102, 241, 0.08) !important;
        color: var(--msger-text-main) !important;
        border: 1px solid rgba(99, 102, 241, 0.25) !important;
        border-left: 4px solid #6366f1 !important;
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 15px;
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.05);
    }

    .msg-row.received-admin .msg-bubble {
        background: rgba(16, 185, 129, 0.08) !important;
        color: var(--msger-text-main) !important;
        border: 1px solid rgba(16, 185, 129, 0.25) !important;
        border-left: 4px solid #10b981 !important;
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 15px;
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.05);
    }
    
    /* Bouncing dots for typing indicator */
    .premium-typing-indicator {
        display: flex;
        gap: 4px;
        padding: 4px 8px;
        align-items: center;
    }
    .premium-typing-indicator span {
        width: 6px;
        height: 6px;
        background-color: #6f42c1;
        border-radius: 50%;
        display: inline-block;
        animation: premiumBounce 1.4s infinite ease-in-out both;
    }
    .premium-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
    .premium-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
    
    @keyframes premiumBounce {
        0%, 80%, 100% { transform: scale(0); }
        40% { transform: scale(1.0); }
    }

    /* Languages toggle bar style */
    .m-lang-btn {
        transition: all 0.2s ease;
        user-select: none;
    }
    .m-lang-btn.active {
        background: #6f42c1 !important;
        color: white !important;
        border-color: #6f42c1 !important;
        box-shadow: 0 2px 5px rgba(111, 66, 193, 0.3);
    }

    /* Suggestions Tab button style */
    .m-tab-btn {
        font-weight: 600;
        transition: all 0.25s;
        border-bottom: 2px solid transparent !important;
        border-radius: 0 !important;
    }
    .m-tab-btn.active {
        color: #6f42c1 !important;
        border-bottom: 2px solid #6f42c1 !important;
    }

    /* Query Tag Plate Style */
    .suggestion-tag-plate {
        background: var(--msger-input-bg);
        border: 1px solid var(--msger-border);
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .suggestion-tag-plate:hover {
        background: rgba(111, 66, 193, 0.05);
        border-color: rgba(111, 66, 193, 0.3);
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    }
    
    /* Custom scrollbar for suggestions */
    .scroll_m::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }

    /* Screen recording pulsing overlay keyframe */
    @keyframes m-pulse-red {
        0% { transform: translate(-50%, 0) scale(1); }
        50% { transform: translate(-50%, 0) scale(1.05); }
        100% { transform: translate(-50%, 0) scale(1); }
    }
