
        /* Mini Chat Button - Floating at bottom right */
        .mini-chat-button {
            position: fixed;
            bottom: 20px;
            right: 20px;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            z-index: 9998;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .mini-chat-button:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
        }

        .mini-chat-button-icon {
            font-size: 28px;
            line-height: 1;
        }

        /* Mini Chat Container */
        .mini-chat-container {
            position: fixed;
            bottom: 90px;
            right: 20px;
            width: 380px;
            height: 550px;
            background: white;
            border-radius: 16px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
            z-index: 9999;
            display: none;
            flex-direction: column;
            overflow: hidden;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        }

        .mini-chat-container.active {
            display: flex;
            animation: slideUp 0.3s ease;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Chat Header */
        .mini-chat-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 16px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .mini-chat-header h3 {
            margin: 0;
            font-size: 18px;
            font-weight: 600;
        }

        .mini-chat-header-controls {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .mini-chat-control-btn {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 32px;
            height: 32px;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s;
        }

        .mini-chat-control-btn:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .mini-chat-close {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            font-size: 28px;
            width: 32px;
            height: 32px;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            transition: background 0.2s;
        }

        .mini-chat-close:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        /* Messages Area */
        .mini-chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 16px;
            background: #f7f9fc;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .mini-chat-messages::-webkit-scrollbar {
            width: 6px;
        }

        .mini-chat-messages::-webkit-scrollbar-track {
            background: transparent;
        }

        .mini-chat-messages::-webkit-scrollbar-thumb {
            background: #cbd5e0;
            border-radius: 3px;
        }

        /* Message Bubbles */
        .mini-chat-message {
            max-width: 80%;
            padding: 10px 14px;
            border-radius: 12px;
            line-height: 1.5;
            font-size: 14px;
            word-wrap: break-word;
            animation: messageSlide 0.3s ease;
        }

        @keyframes messageSlide {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .mini-chat-message.user {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            align-self: flex-end;
            border-bottom-right-radius: 4px;
        }

        .mini-chat-message.ai {
            background: white;
            color: #2d3748;
            align-self: flex-start;
            border-bottom-left-radius: 4px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        }

        /* Processing Animation */
        .mini-chat-processing {
            align-self: flex-start;
            background: white;
            padding: 12px 16px;
            border-radius: 12px;
            border-bottom-left-radius: 4px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
            display: flex;
            gap: 6px;
        }

        .mini-chat-processing-dot {
            width: 8px;
            height: 8px;
            background: #667eea;
            border-radius: 50%;
            animation: bounce 1.4s infinite ease-in-out both;
        }

        .mini-chat-processing-dot:nth-child(1) {
            animation-delay: -0.32s;
        }

        .mini-chat-processing-dot:nth-child(2) {
            animation-delay: -0.16s;
        }

        @keyframes bounce {
            0%, 80%, 100% {
                transform: scale(0);
                opacity: 0.5;
            }
            40% {
                transform: scale(1);
                opacity: 1;
            }
        }

        /* Input Area */
        .mini-chat-input-area {
            padding: 12px 16px;
            background: white;
            border-top: 1px solid #e2e8f0;
        }

        .mini-chat-input-wrapper {
            display: flex;
            gap: 8px;
            align-items: flex-end;
        }

        .mini-chat-input {
            flex: 1;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            padding: 10px 12px;
            font-size: 14px;
            font-family: inherit;
            resize: none;
            max-height: 100px;
            min-height: 40px;
            transition: border-color 0.2s;
        }

        .mini-chat-input:focus {
            outline: none;
            border-color: #667eea;
        }

        .mini-chat-send {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            width: 40px;
            height: 40px;
            border-radius: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            transition: all 0.2s;
        }

        .mini-chat-send:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .mini-chat-send:not(:disabled):hover {
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
        }

        /* Quick Actions */
        .mini-chat-quick-actions {
            display: flex;
            gap: 8px;
            padding: 0 16px 12px;
            overflow-x: auto;
            background: white;
        }

        .mini-chat-quick-actions::-webkit-scrollbar {
            height: 4px;
        }

        .mini-chat-quick-actions::-webkit-scrollbar-thumb {
            background: #cbd5e0;
            border-radius: 2px;
        }

        .mini-chat-quick-action {
            background: #f7f9fc;
            border: 1px solid #e2e8f0;
            padding: 8px 14px;
            border-radius: 20px;
            font-size: 13px;
            color: #4a5568;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.2s;
            flex-shrink: 0;
        }

        .mini-chat-quick-action:hover {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        /* Responsive Design */
        @media (max-width: 480px) {
            .mini-chat-container {
                width: calc(100vw - 40px);
                height: calc(100vh - 140px);
                bottom: 90px;
                right: 20px;
                left: 20px;
            }
        }

        /* Message Text Container */
        .message-text {
            line-height: 1.6;
        }

        /* Markdown Styling in Messages */
        .message-text h1 {
            font-size: 20px;
            font-weight: 700;
            margin: 0 0 12px 0;
            color: #1a202c;
        }

        .message-text h2 {
            font-size: 18px;
            font-weight: 600;
            margin: 12px 0 10px 0;
            color: #2d3748;
        }

        .message-text h3 {
            font-size: 16px;
            font-weight: 600;
            margin: 10px 0 8px 0;
            color: #2d3748;
        }

        .message-text h4,
        .message-text h5,
        .message-text h6 {
            font-size: 14px;
            font-weight: 600;
            margin: 8px 0 6px 0;
            color: #4a5568;
        }

        .message-text p {
            margin: 0 0 10px 0;
            color: #2d3748;
        }

        .message-text p:last-child {
            margin-bottom: 0;
        }

        .message-text strong {
            font-weight: 600;
            color: #1a202c;
        }

        .message-text em {
            font-style: italic;
        }

        .message-text code {
            background: #f1f5f9;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 13px;
            font-family: 'Courier New', monospace;
            color: #d63384;
        }

        .message-text pre {
            background: #1e293b;
            color: #e2e8f0;
            padding: 12px;
            border-radius: 6px;
            overflow-x: auto;
            margin: 10px 0;
        }

        .message-text pre code {
            background: transparent;
            padding: 0;
            color: inherit;
        }

        .message-text ul,
        .message-text ol {
            margin: 10px 0;
            padding-left: 24px;
        }

        .message-text ul {
            list-style-type: disc;
        }

        .message-text ol {
            list-style-type: decimal;
        }

        .message-text li {
            margin: 6px 0;
            color: #2d3748;
        }

        .message-text li p {
            margin: 4px 0;
        }

        .message-text blockquote {
            border-left: 4px solid #667eea;
            padding-left: 12px;
            margin: 10px 0;
            color: #4a5568;
            font-style: italic;
        }

        .message-text a {
            color: #667eea;
            text-decoration: underline;
            font-weight: 500;
            transition: all 0.2s;
            word-break: break-word;
        }

        .message-text a:hover {
            color: #764ba2;
            text-decoration: underline;
        }

        /* Source links styling */
        .message-text p a {
            display: inline-block;
            margin: 2px 0;
        }

        /* List links styling */
        .message-text li a {
            font-weight: 500;
        }

        .message-text hr {
            border: none;
            border-top: 1px solid #e2e8f0;
            margin: 12px 0;
        }

        .message-text table {
            width: 100%;
            border-collapse: collapse;
            margin: 12px 0;
            font-size: 12px;
            display: block;
            overflow-x: auto;
            background: white;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            border-radius: 6px;
        }

        .message-text table thead {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }

        .message-text table th {
            padding: 10px 12px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            text-align: left;
            font-weight: 600;
            color: white;
            white-space: nowrap;
        }

        .message-text table td {
            padding: 10px 12px;
            border: 1px solid #e2e8f0;
            text-align: left;
            color: #2d3748;
        }

        .message-text table tbody tr:nth-child(even) {
            background: #f7f9fc;
        }

        .message-text table tbody tr:hover {
            background: #edf2f7;
        }

        .message-text img {
            max-width: 100%;
            height: auto;
            border-radius: 6px;
            margin: 10px 0;
        }
    