        /* Scope the reset to the chat widget only so it doesn't affect the rest of the site */
        .ai-chat-widget,
        .ai-chat-widget * {
            box-sizing: border-box;
        }

        .ai-chat-widget {
            font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
        }

        /* ----- Floating button ----- */
        .ai-chat-button {
            position: fixed;
            bottom: 210px;
            right: 30px;
            width: 70px;
            height: 70px;
            background-color: #036830;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 32px;
            cursor: pointer;
            box-shadow: 0 8px 20px rgba(0,0,0,0.2);
            z-index: 1000;
            transition: transform 0.2s;
            border: none;
            outline: none;
        }
        .ai-chat-button:hover {
            transform: scale(1.05);
            background-color: #048f78;
        }
        /* Wave animation – stops when popup is open */
        .ai-chat-button::before,
        .ai-chat-button::after {
            content: "";
            position: absolute;
            width: 100%;
            height: 100%;
            background-color: #4ef097;
            border-radius: 50%;
            opacity: 0.4;
            animation: wave 2s infinite;
            z-index: -1;
        }
        .ai-chat-button.active::before,
        .ai-chat-button.active::after {
            animation: none;
            opacity: 0;
        }
        .ai-chat-button::before { animation-delay: 0.5s; }
        .ai-chat-button::after { animation-delay: 1s; }
        @keyframes wave {
            0% { transform: scale(1); opacity: 0.4; }
            100% { transform: scale(2); opacity: 0; }
        }
        .ai-chat-button:hover::after {
            content: "Chat with Agent";
            position: absolute;
            top: -40px;
            right: 0;
            background: #333;
            color: white;
            font-size: 14px;
            padding: 6px 12px;
            border-radius: 20px;
            white-space: nowrap;
            box-shadow: 0 4px 10px rgba(0,0,0,0.2);
            opacity: 1;
            animation: none;
            width: auto;
            height: auto;
            background-color: #333;
            z-index: 1001;
        }

        /* ----- Chat popup ----- */
        .chat-popup {
            position: fixed;
            bottom: 40px;
            right: 110px;
            width: 360px;
            max-width: 90vw;
            background: white;
            border-radius: 24px;
            box-shadow: 0 25px 50px -12px rgba(0,0,0,0.3);
            z-index: 1000;
            display: none;
            flex-direction: column;
            overflow: hidden;
            border: 1px solid rgba(0,0,0,0.1);
        }
        .chat-popup.active { display: flex; }

        /* ----- Header with logo ----- */
        .chat-header {
            background: #036830;
            color: white;
            padding: 12px 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-weight: 600;
        }
        .header-left {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .header-left img {
            height: 32px;
            width: auto;
            border-radius: 6px;
            background: #036830;
            padding: 2px;
        }
        .header-left span {
            font-size: 18px;
            font-weight: 600;
        }
        .close-btn {
            background: rgba(255,255,255,0.2);
            border: none;
            color: white;
            font-size: 18px;
            cursor: pointer;
            width: 34px;
            height: 34px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s;
        }
        .close-btn:hover {
            background: rgba(255,255,255,0.35);
        }

        /* ----- WhatsApp section----- */
        .whatsapp-section {
            padding: 20px;
            border-bottom: 1px solid #eee;
            text-align: center;
        }
        .whatsapp-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            background: #25D366;
            color: white;
            padding: 14px 24px;
            border-radius: 40px;
            text-decoration: none;
            font-weight: 600;
            font-size: 16px;
            transition: background 0.2s;
            width: 80%;
            border: none;
            cursor: pointer;
        }
        .whatsapp-btn i { font-size: 22px; }
        .whatsapp-btn:hover { background: #128C7E; }

        /* ----- Chat section ----- */
        .chat-section {
            padding: 20px;
            background: #f9fafc;
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        .chat-messages {
            background: white;
            border-radius: 18px;
            padding: 15px;
            height: 260px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 12px;
            box-shadow: inset 0 2px 5px rgba(0,0,0,0.02);
        }
        .message {
            display: flex;
            flex-direction: column;
            max-width: 85%;
        }
        .bot-message { align-self: flex-start; }
        .user-message { align-self: flex-end; }
        .message-bubble {
            padding: 10px 14px;
            border-radius: 18px;
            font-size: 14px;
            line-height: 1.4;
            word-wrap: break-word;
        }
        .bot-message .message-bubble {
            background: #eef2f6;
            color: #1e2a3a;
            border-bottom-left-radius: 4px;
        }
        .user-message .message-bubble {
            background: #036830;
            color: white;
            border-bottom-right-radius: 4px;
        }
        .message-time {
            font-size: 10px;
            color: #999;
            margin-top: 4px;
            margin-left: 8px;
        }
        .chat-input-area {
            display: flex;
            gap: 10px;
            align-items: center;
            background: white;
            border-radius: 30px;
            padding: 5px 5px 5px 18px;
            border: 1px solid #ddd;
        }
        .chat-input-area input {
            flex: 1;
            border: none;
            outline: none;
            padding: 10px 0;
            font-size: 14px;
            background: transparent;
        }
        .chat-input-area button {
            background: #036830;
            color: white;
            border: none;
            width: 42px;
            height: 42px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 18px;
            transition: background 0.2s;
        }
        .chat-input-area button:hover { background: #088a42; }
        .chat-input-area button i { margin-left: 2px; }
        .footer-note {
            font-size: 11px;
            color: #aaa;
            text-align: center;
            margin-top: 5px;
        }
        .typing-indicator {
            display: flex;
            gap: 4px;
            padding: 8px 12px;
            background: #eef2f6;
            border-radius: 18px;
            width: fit-content;
            margin-bottom: 8px;
        }
        .typing-indicator span {
            width: 8px;
            height: 8px;
            background: #999;
            border-radius: 50%;
            animation: typing 1.4s infinite;
        }
        .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% { opacity: 0.4; transform: translateY(0); }
            30% { opacity: 1; transform: translateY(-4px); }
        }

        /* Responsive tweaks for very small screens */
        @media (max-width: 480px) {
            .chat-popup {
                bottom: 90px;
                right: 15px;
                width: 90vw;
            }
            .ai-chat-button {
                bottom: 90px;
                right: 30px;
                width: 60px;
                height: 60px;
                font-size: 28px;
            }
            .header-left span {
                font-size: 16px;
            }
        }