/* Extracted from the inline <style id="chatbot-css"> block that was repeated
   byte-identically on 6 pages. Cached once instead of re-downloaded
   with every page. Do not reorder: it is linked at the exact position the
   inline block occupied, because these skins depend on source order. */
.ai-chat-widget {
            position: fixed;
            bottom: 24px;
            right: 24px;
            z-index: 9999;
            font-family: 'Inter', sans-serif;
        }

        .ai-chat-toggle {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--accent) 0%, #ff6b6b 100%);
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 20px rgba(255, 77, 77, 0.4), 0 0 40px rgba(255, 77, 77, 0.2);
            transition: all 0.3s ease;
            position: relative;
        }

        .ai-chat-toggle:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 30px rgba(255, 77, 77, 0.5), 0 0 60px rgba(255, 77, 77, 0.3);
        }

        .ai-chat-toggle svg {
            width: 28px;
            height: 28px;
            color: white;
            transition: all 0.3s ease;
        }

        .ai-chat-toggle .close-icon {
            position: absolute;
            opacity: 0;
            transform: rotate(-90deg);
        }

        .ai-chat-widget.open .ai-chat-toggle .chat-icon {
            opacity: 0;
            transform: rotate(90deg);
        }

        .ai-chat-widget.open .ai-chat-toggle .close-icon {
            opacity: 1;
            transform: rotate(0deg);
        }

        .chat-badge {
            position: absolute;
            top: -4px;
            right: -4px;
            width: 20px;
            height: 20px;
            background: #00d4aa;
            border-radius: 50%;
            font-size: 11px;
            font-weight: 600;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 1;
            transition: opacity 0.3s ease;
        }

        .ai-chat-widget.open .chat-badge,
        .chat-badge.hidden {
            opacity: 0;
        }

        .ai-chat-window {
            position: absolute;
            bottom: 80px;
            right: 0;
            width: 380px;
            max-width: calc(100vw - 48px);
            height: 550px;
            max-height: calc(100vh - 150px);
            background: rgba(20, 20, 25, 0.95);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-radius: 20px;
            border: 1px solid rgba(255,255,255,0.1);
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 77, 77, 0.1);
            display: flex;
            flex-direction: column;
            opacity: 0;
            visibility: hidden;
            transform: translateY(20px) scale(0.95);
            transition: all 0.3s ease;
            overflow: hidden;
        }

        .ai-chat-widget.open .ai-chat-window {
            opacity: 1;
            visibility: visible;
            transform: translateY(0) scale(1);
        }

        .ai-chat-header {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 16px 20px;
            background: linear-gradient(135deg, rgba(255, 77, 77, 0.15) 0%, rgba(255, 107, 107, 0.1) 100%);
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }

        .ai-avatar {
            width: 40px;
            height: 40px;
            border-radius: 12px;
            background: linear-gradient(135deg, var(--accent) 0%, #ff6b6b 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .ai-avatar svg {
            width: 24px;
            height: 24px;
            color: white;
        }

        .ai-header-info {
            flex: 1;
        }

        .ai-header-info h4 {
            margin: 0;
            font-size: 15px;
            font-weight: 600;
            color: white;
        }

        .ai-status {
            font-size: 12px;
            color: #00d4aa;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .ai-status::before {
            content: '';
            width: 6px;
            height: 6px;
            background: #00d4aa;
            border-radius: 50%;
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        .ai-chat-minimize {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            background: rgba(255,255,255,0.1);
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }

        .ai-chat-minimize:hover {
            background: rgba(255,255,255,0.05);
        }

        .ai-chat-minimize svg {
            width: 18px;
            height: 18px;
            color: rgba(255,255,255,0.9);
        }

        .ai-chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .ai-chat-messages::-webkit-scrollbar {
            width: 4px;
        }

        .ai-chat-messages::-webkit-scrollbar-track {
            background: transparent;
        }

        .ai-chat-messages::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,0.05);
            border-radius: 2px;
        }

        .ai-message {
            display: flex;
            gap: 10px;
            max-width: 95%;
            animation: messageIn 0.3s ease;
        }

        @keyframes messageIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .ai-message.user {
            flex-direction: row-reverse;
            align-self: flex-end;
        }

        .message-avatar {
            width: 32px;
            height: 32px;
            border-radius: 10px;
            background: linear-gradient(135deg, var(--accent) 0%, #ff6b6b 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .message-avatar svg {
            width: 18px;
            height: 18px;
            color: white;
        }

        .ai-message.user .message-avatar {
            background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
        }

        .message-content {
            background: rgba(255,255,255,0.08);
            border-radius: 16px;
            border-top-left-radius: 4px;
            padding: 12px 16px;
            color: rgba(255,255,255,0.9);
            font-size: 14px;
            line-height: 1.5;
        }

        .ai-message.user .message-content {
            background: linear-gradient(135deg, var(--accent) 0%, #ff6b6b 100%);
            border-radius: 16px;
            border-top-right-radius: 4px;
            color: white;
        }

        .message-content p {
            margin: 0 0 8px 0;
        }

        .message-content p:last-child {
            margin-bottom: 0;
        }

        .message-content ul {
            margin: 8px 0 0 0;
            padding-left: 20px;
        }

        .message-content li {
            margin: 4px 0;
            color: rgba(255,255,255,0.9);
        }

        .message-content code {
            background: rgba(0, 0, 0, 0.3);
            padding: 2px 6px;
            border-radius: 4px;
            font-family: 'Fira Code', monospace;
            font-size: 13px;
        }

        .message-content pre {
            background: rgba(0, 0, 0, 0.4);
            padding: 12px;
            border-radius: 8px;
            overflow-x: auto;
            margin: 8px 0;
        }

        .message-content pre code {
            background: none;
            padding: 0;
        }

        .ai-quick-questions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            padding: 0 20px 12px 20px;
        }

        .quick-btn {
            padding: 8px 14px;
            background: rgba(255, 77, 77, 0.15);
            border: 1px solid rgba(255, 77, 77, 0.3);
            border-radius: 20px;
            color: rgba(255,255,255,0.9);
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            white-space: nowrap;
        }

        .quick-btn:hover {
            background: rgba(255, 77, 77, 0.25);
            border-color: rgba(255, 77, 77, 0.5);
            color: white;
        }

        .ai-chat-input-container {
            padding: 16px 20px;
            border-top: 1px solid rgba(255,255,255,0.1);
            background: rgba(0, 0, 0, 0.2);
        }

        .ai-chat-input-wrapper {
            display: flex;
            align-items: flex-end;
            gap: 10px;
            background: rgba(255,255,255,0.08);
            border-radius: 16px;
            padding: 10px 14px;
            border: 1px solid rgba(255,255,255,0.1);
            transition: all 0.2s ease;
        }

        .ai-chat-input-wrapper:focus-within {
            border-color: rgba(255, 77, 77, 0.5);
            box-shadow: 0 0 20px rgba(255, 77, 77, 0.1);
        }

        #aiChatInput {
            flex: 1;
            background: none;
            border: none;
            outline: none;
            color: white;
            font-size: 14px;
            font-family: 'Inter', sans-serif;
            resize: none;
            max-height: 100px;
            line-height: 1.5;
        }

        #aiChatInput::placeholder {
            color: rgba(255,255,255,0.9);
        }

        .ai-send-btn {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            background: linear-gradient(135deg, var(--accent) 0%, #ff6b6b 100%);
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            flex-shrink: 0;
        }

        .ai-send-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 4px 15px rgba(255, 77, 77, 0.4);
        }

        .ai-send-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }

        .ai-send-btn svg {
            width: 18px;
            height: 18px;
            color: white;
        }

        .ai-disclaimer {
            margin: 10px 0 0 0;
            font-size: 11px;
            color: rgba(255,255,255,0.9);
            text-align: center;
        }

        /* Typing Indicator */
        .typing-indicator {
            display: flex;
            gap: 4px;
            padding: 8px 0;
        }

        .typing-indicator span {
            width: 8px;
            height: 8px;
            background: rgba(255,255,255,0.05);
            border-radius: 50%;
            animation: typing 1.4s infinite ease-in-out;
        }

        .typing-indicator span:nth-child(1) { animation-delay: 0s; }
        .typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
        .typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

        @keyframes typing {
            0%, 60%, 100% { transform: translateY(0); }
            30% { transform: translateY(-8px); }
        }

        /* RTL Support */
        [dir="rtl"] .ai-chat-widget {
            right: auto;
            left: 24px;
        }

        [dir="rtl"] .ai-chat-window {
            right: auto;
            left: 0;
        }

        [dir="rtl"] .ai-message.user {
            flex-direction: row;
        }

        [dir="rtl"] .message-content {
            border-top-left-radius: 16px;
            border-top-right-radius: 4px;
        }

        [dir="rtl"] .ai-message.user .message-content {
            border-top-right-radius: 16px;
            border-top-left-radius: 4px;
        }
