html, body {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }

    /* Chatbot Global Styling Variables */
    :root {
        --cb-primary: #4f46e5;
        --cb-primary-dark: #312e81;
        --cb-bg-bubble-user: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
        --cb-bg-bubble-ai: #ffffff;
        --cb-bg-chat: #f8fafc;
        --cb-text-main: #0f172a;
        --cb-text-muted: #64748b;
        --cb-border-color: rgba(226, 232, 240, 0.8);
    }

    /* Floating Trigger Button */
    .chatbot-trigger-wrapper {
        position: fixed;
        bottom: 24px;
        left: 24px;
        z-index: 99999;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    .chatbot-trigger-label {
        background: #ffffff;
        color: var(--cb-text-main);
        padding: 8px 14px;
        border-radius: 20px;
        font-size: 0.85rem;
        font-weight: 600;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        position: relative;
        animation: cbFloat 3s ease-in-out infinite;
        cursor: pointer;
        border: 1px solid var(--cb-border-color);
        white-space: nowrap;
        transition: opacity 0.3s ease;
    }
    /* Little triangle pointer */
    .chatbot-trigger-label::after {
        content: '';
        position: absolute;
        right: -6px;
        top: 50%;
        transform: translateY(-50%);
        border-width: 6px 0 6px 6px;
        border-style: solid;
        border-color: transparent transparent transparent #ffffff;
    }
    .chatbot-trigger-label::before {
        content: '';
        position: absolute;
        right: -7px;
        top: 50%;
        transform: translateY(-50%);
        border-width: 7px 0 7px 7px;
        border-style: solid;
        border-color: transparent transparent transparent var(--cb-border-color);
        z-index: -1;
    }
    @keyframes cbFloat {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-5px); }
    }
    .chatbot-trigger-btn {
        position: relative;
        width: 60px;
        height: 60px;
        background: linear-gradient(135deg, var(--cb-primary) 0%, var(--cb-primary-dark) 100%);
        color: #ffffff;
        border: none;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 99999;
        box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        outline: none;
    }
    .chatbot-trigger-btn:hover {
        transform: scale(1.08) rotate(4deg);
        box-shadow: 0 12px 30px rgba(79, 70, 229, 0.55);
    }
    .chatbot-trigger-btn:active {
        transform: scale(0.95);
    }
    .chatbot-trigger-btn i {
        stroke-width: 2.25;
        transition: transform 0.2s ease;
    }
    .chatbot-trigger-btn .trigger-pulse {
        position: absolute;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        background: transparent;
        animation: chatbotPulse 2.2s infinite;
        pointer-events: none;
        z-index: -1;
    }

    @keyframes chatbotPulse {
        0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.6); }
        70% { box-shadow: 0 0 0 14px rgba(79, 70, 229, 0); }
        100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
    }

    /* Chat Window Container */
    .chatbot-window-container {
        position: fixed;
        bottom: 100px;
        left: 24px;
        width: 380px;
        height: 570px;
        background: #ffffff;
        border: 1px solid var(--cb-border-color);
        border-radius: 1.5rem;
        box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.12), 0 0 1px 1px rgba(0, 0, 0, 0.02);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        z-index: 99998;
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        pointer-events: none;
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    .chatbot-window-container.active {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

    /* Chat Window Header */
    .chatbot-window-header {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        padding: 1rem 1.25rem;
        border-bottom: 1px solid rgba(226, 232, 240, 0.7);
        display: flex;
        align-items: center;
        justify-content: space-between;
        z-index: 10;
    }
    .chatbot-agent-info {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    .chatbot-avatar {
        width: 42px;
        height: 42px;
        background: linear-gradient(135deg, var(--cb-primary) 0%, var(--cb-primary-dark) 100%);
        color: #ffffff;
        border-radius: 0.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 1.1rem;
        box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
        position: relative;
    }
    .chatbot-status-pulse {
        width: 9px;
        height: 9px;
        background-color: #10b981;
        border: 2px solid #ffffff;
        border-radius: 50%;
        position: absolute;
        bottom: -2px;
        right: -2px;
        animation: cbPulse 2s infinite;
    }
    @keyframes cbPulse {
        0% { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
        70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
        100% { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
    }
    .chatbot-agent-name {
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--cb-text-main);
    }
    .chatbot-btn-action {
        background: transparent;
        border: none;
        color: var(--cb-text-muted);
        cursor: pointer;
        padding: 4px;
        border-radius: 0.35rem;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }
    .chatbot-btn-action:hover {
        background: #f1f5f9;
        color: var(--cb-text-main);
    }
    .chatbot-btn-action:hover i {
        transform: rotate(-15deg);
    }

    /* Message window */
    .chatbot-messages {
        flex: 1;
        overflow-y: auto;
        padding: 1.25rem;
        background-color: var(--cb-bg-chat);
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    .chatbot-messages::-webkit-scrollbar {
        width: 4px;
    }
    .chatbot-messages::-webkit-scrollbar-thumb {
        background-color: rgba(203, 213, 225, 0.5);
        border-radius: 10px;
    }
    .chatbot-bubble {
        max-width: 85%;
        padding: 0.85rem 1.15rem;
        border-radius: 1.15rem;
        font-size: 0.9rem;
        line-height: 1.5;
        white-space: pre-line;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.01);
        animation: cbSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }
    @keyframes cbSlideIn {
        from { opacity: 0; transform: translateY(12px) scale(0.97); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }
    .chatbot-bubble.incoming {
        background-color: var(--cb-bg-bubble-ai);
        color: var(--cb-text-main);
        border: 1px solid rgba(226, 232, 240, 0.5);
        align-self: flex-start;
        border-top-left-radius: 0.25rem;
    }
    .chatbot-bubble.outgoing {
        background: var(--cb-bg-bubble-user);
        color: #ffffff;
        align-self: flex-end;
        border-top-right-radius: 0.25rem;
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    }
    .chatbot-bubble p {
        margin-bottom: 0;
    }

    /* Suggestion Chips Container */
    .chatbot-chip-container {
        padding: 0.6rem 1rem;
        background-color: var(--cb-bg-chat);
        border-top: 1px solid rgba(226, 232, 240, 0.4);
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .chatbot-suggestion-chip {
        background: #ffffff;
        color: var(--cb-primary);
        border: 1px solid rgba(226, 232, 240, 0.8);
        border-radius: 100px;
        padding: 0.4rem 0.9rem;
        font-size: 0.8rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        outline: none;
    }
    .chatbot-suggestion-chip:hover {
        background: var(--cb-primary);
        color: #ffffff;
        border-color: var(--cb-primary);
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15);
    }
    .chatbot-suggestion-chip:active {
        transform: scale(0.96);
    }

    /* Input Footer Area */
    .chatbot-footer {
        padding: 0.85rem 1rem;
        background: #ffffff;
        border-top: 1px solid rgba(226, 232, 240, 0.6);
    }
    .chatbot-input-wrapper {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 1rem;
        padding: 0.35rem 0.5rem 0.35rem 1rem;
        transition: all 0.2s ease;
    }
    .chatbot-input-wrapper:focus-within {
        border-color: var(--cb-primary);
        background: #ffffff;
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
    }
    .chatbot-input-wrapper input {
        flex: 1;
        border: none;
        outline: none;
        background: transparent;
        font-size: 0.9rem;
        color: var(--cb-text-main);
        padding: 0.4rem 0;
    }
    .chatbot-send-btn {
        width: 34px;
        height: 34px;
        background: var(--cb-primary);
        color: #ffffff;
        border: none;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    .chatbot-send-btn:hover {
        background: var(--cb-primary-dark);
        transform: scale(1.05);
    }
    .chatbot-send-btn:disabled {
        background: #cbd5e1;
        cursor: not-allowed;
        transform: none;
    }

    /* Typing Bouncing indicator */
    .chatbot-typing-indicator {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        padding: 0.4rem 0.6rem;
    }
    .chatbot-typing-dot {
        width: 5px;
        height: 5px;
        background-color: var(--cb-text-muted);
        border-radius: 50%;
        animation: cbBounce 1.4s infinite ease-in-out both;
    }
    .chatbot-typing-dot:nth-child(1) { animation-delay: -0.32s; }
    .chatbot-typing-dot:nth-child(2) { animation-delay: -0.16s; }
    @keyframes cbBounce {
        0%, 80%, 100% { transform: scale(0); }
        40% { transform: scale(1); }
    }

    /* Responsive Design drawer for Mobile & Tablet */
    @media (max-width: 991.98px) {
        .chatbot-trigger-wrapper {
            bottom: 5.5rem;
        }
        .chatbot-window-container {
            bottom: 100px;
        }
    }

    @media (max-width: 575.98px) {
        /* Hide trigger when chat is open via CSS sibling selector */
        .chatbot-window-container.active + .chatbot-trigger-wrapper {
            display: none !important;
        }

        /* Prevent iOS keyboard from causing horizontal overflow */
        .chatbot-input-wrapper input,
        .chatbot-input-wrapper textarea {
            font-size: 16px !important; /* Prevents iOS auto-zoom */
            -webkit-text-size-adjust: 100%;
        }

        .chatbot-window-container {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            top: 0;
            width: 100vw !important;
            max-width: 100vw !important;
            /* Use dvh so it shrinks correctly when iOS keyboard appears */
            height: 100dvh;
            height: calc(var(--vh, 1vh) * 100); /* fallback for Android using CSS variable */
            border-radius: 0;
            border: none;
            overflow: hidden;
            transform: translateY(100%);
            transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .chatbot-window-container.active {
            transform: translateY(0);
        }
        .chatbot-window-header {
            padding: 1.1rem 1rem 0.9rem;
            border-bottom: 1px solid rgba(226, 232, 240, 0.8);
            flex-shrink: 0;
        }
        .chatbot-messages {
            padding: 1rem;
            flex: 1;
            min-height: 0; /* Critical: allows flex child to shrink */
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }
        .chatbot-chip-container {
            flex-wrap: nowrap;
            overflow-x: auto;
            white-space: nowrap;
            gap: 0.4rem;
            padding: 0.5rem 0.85rem;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
            flex-shrink: 0;
        }
        .chatbot-chip-container::-webkit-scrollbar {
            display: none;
        }
        .chatbot-bubble {
            max-width: 90%;
            padding: 0.75rem 1rem;
            font-size: 0.875rem;
            border-radius: 1rem;
        }
        .chatbot-suggestion-chip {
            padding: 0.35rem 0.85rem;
            font-size: 0.775rem;
        }
        .chatbot-footer {
            padding: 0.75rem 0.85rem;
            flex-shrink: 0;
            /* Push above safe area on notched phones */
            padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
        }
        .chatbot-trigger-wrapper {
            bottom: 9.5rem;
            left: auto;
            right: 16px;
        }
        .chatbot-trigger-btn {
            width: 52px;
            height: 52px;
        }
        .chatbot-trigger-label {
            font-size: 0.75rem;
            padding: 6px 12px;
        }
    }
