/* ===================================================
   NMD INFOTECH - PREMIUM AI CHATBOT WIDGET STYLES
   Scoped strictly to #nmdChatbotRoot
   Enterprise-Grade UI Inspired by Intercom & ChatGPT
   =================================================== */

#nmdChatbotRoot,
#nmdChatbotRoot * {
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================================
   1. FLOATING LAUNCHER BUTTON (Bottom-Right)
   Signature NMD Gradient: #f4c02f to #007ea7
   =================================================== */
.nmd-chatbot-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999999;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 22px 0 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: linear-gradient(90deg, #f4c02f 0%, #007ea7 100%) !important;
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 126, 167, 0.38), 0 4px 10px rgba(0, 0, 0, 0.12);
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    outline: none;
}

.nmd-chatbot-launcher::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f4c02f, #007ea7);
    z-index: -1;
    opacity: 0.4;
    animation: nmdLauncherPulse 2.4s infinite ease-out;
}

@keyframes nmdLauncherPulse {
    0% {
        transform: scale(0.96);
        opacity: 0.55;
    }
    70% {
        transform: scale(1.12);
        opacity: 0;
    }
    100% {
        transform: scale(1.12);
        opacity: 0;
    }
}

.nmd-chatbot-launcher:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 14px 34px rgba(0, 126, 167, 0.48), 0 6px 14px rgba(0, 0, 0, 0.15);
    background: linear-gradient(90deg, #e5a00d 0%, #006d91 100%) !important;
}

.nmd-chatbot-launcher:active {
    transform: translateY(0) scale(0.97);
}

.nmd-launcher-icon-wrap {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nmd-launcher-status-dot {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #007ea7;
}

.nmd-launcher-label {
    white-space: nowrap;
    line-height: 1;
}

.nmd-chatbot-launcher.is-open {
    width: 54px;
    height: 54px;
    padding: 0;
    justify-content: center;
    background: #002c46 !important;
    box-shadow: 0 8px 24px rgba(0, 44, 70, 0.38);
}

.nmd-chatbot-launcher.is-open::before {
    display: none;
}

.nmd-chatbot-launcher.is-open .nmd-launcher-label,
.nmd-chatbot-launcher.is-open .nmd-launcher-icon-chat {
    display: none;
}

.nmd-launcher-icon-close {
    display: none;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.nmd-chatbot-launcher.is-open .nmd-launcher-icon-close {
    display: inline-flex;
}

.nmd-chatbot-launcher.is-open .nmd-launcher-icon-wrap {
    background: transparent;
    width: auto;
    height: auto;
}

.nmd-chatbot-launcher.is-open .nmd-launcher-status-dot {
    display: none;
}

/* ===================================================
   2. POPUP CHAT WINDOW CONTAINER
   =================================================== */
.nmd-chatbot-popup {
    position: fixed;
    right: 24px;
    bottom: 96px;
    width: 380px;
    height: 590px;
    max-height: calc(100vh - 116px);
    z-index: 999998;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(18px) scale(0.96);
    transform-origin: bottom right;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.nmd-chatbot-popup.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

#nmdChatbotRoot .chat-container {
    width: 100%;
    height: 100%;
    margin: 0;
    background: #ffffff;
    border: 1px solid rgba(0, 44, 70, 0.1);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 44, 70, 0.2), 0 4px 16px rgba(15, 23, 42, 0.08);
}

/* ===================================================
   3. SLEEK ENTERPRISE HEADER
   Corporate Deep Navy Gradient: #002c46 to #004b70
   =================================================== */
#nmdChatbotRoot .chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #002c46 0%, #004b70 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    color: #ffffff;
    gap: 12px;
}

#nmdChatbotRoot .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

#nmdChatbotRoot .header-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 10px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
    padding: 3px;
}

#nmdChatbotRoot .header-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#nmdChatbotRoot .header-text-icon {
    color: #002c46;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.5px;
}

#nmdChatbotRoot .header-left h1 {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: 0.1px;
}

#nmdChatbotRoot .header-left p {
    margin: 2px 0 0;
    padding: 0;
    font-size: 11px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
}

#nmdChatbotRoot .online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
    animation: nmdPulseDot 2s infinite;
}

@keyframes nmdPulseDot {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
    }
}

#nmdChatbotRoot .header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

#nmdChatbotRoot .header-action-btn,
#nmdChatbotRoot .clear-chat-btn {
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1;
    text-decoration: none;
    height: 26px;
}

#nmdChatbotRoot .header-action-btn:hover,
#nmdChatbotRoot .clear-chat-btn:hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

#nmdChatbotRoot .whatsapp-btn {
    background: rgba(37, 211, 102, 0.2) !important;
    border-color: rgba(37, 211, 102, 0.45) !important;
    color: #25d366 !important;
}

#nmdChatbotRoot .whatsapp-btn:hover {
    background: #25d366 !important;
    color: #ffffff !important;
    border-color: #25d366 !important;
}

#nmdChatbotRoot .close-chat-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

#nmdChatbotRoot .close-chat-btn:hover {
    background: rgba(255, 255, 255, 0.24);
    transform: rotate(90deg);
}

/* ===================================================
   4. MESSAGES STREAM
   =================================================== */
#nmdChatbotRoot .chat-messages {
    flex: 1;
    padding: 16px 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #f8fafc;
    scroll-behavior: smooth;
}

/* Welcome Card */
#nmdChatbotRoot .welcome-message {
    text-align: center;
    padding: 8px 8px 4px;
    margin: 0;
    width: 100%;
}

#nmdChatbotRoot .welcome-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 8px;
    border-radius: 14px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 44, 70, 0.08);
    padding: 4px;
}

#nmdChatbotRoot .welcome-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#nmdChatbotRoot .welcome-message h2 {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.2px;
}

#nmdChatbotRoot .welcome-message p {
    margin: 0 0 10px;
    color: #64748b;
    font-size: 12.5px;
    line-height: 1.45;
}

/* Quick Action Chips (Modern 2x2 Grid) */
#nmdChatbotRoot .suggestion-buttons {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-top: 14px !important;
}

#nmdChatbotRoot .suggestion-buttons button,
#nmdChatbotRoot .suggestion-chip {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    color: #1e293b !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
    text-align: left !important;
}

#nmdChatbotRoot .suggestion-buttons button:hover,
#nmdChatbotRoot .suggestion-chip:hover {
    background: #f0f9ff !important;
    border-color: #007ea7 !important;
    color: #007ea7 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 126, 167, 0.12) !important;
}

#nmdChatbotRoot .chip-arrow {
    font-size: 13px;
    color: #94a3b8;
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    margin-left: 4px;
}

#nmdChatbotRoot .suggestion-buttons button:hover .chip-arrow,
#nmdChatbotRoot .suggestion-chip:hover .chip-arrow {
    color: #007ea7;
    transform: translateX(3px);
}

/* Message Rows */
#nmdChatbotRoot .message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
    animation: nmdMessageAppear 0.22s ease-out;
}

#nmdChatbotRoot .user-message {
    justify-content: flex-end;
}

#nmdChatbotRoot .ai-message {
    justify-content: flex-start;
    align-items: flex-start;
}

#nmdChatbotRoot .ai-bubble-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 82%;
}

/* Message Bubbles */
#nmdChatbotRoot .message-bubble {
    padding: 11px 14px;
    line-height: 1.58;
    font-size: 13.5px;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    text-align: left;
}

#nmdChatbotRoot .user-message .message-bubble {
    background: #003b5c !important;
    color: #ffffff !important;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 3px 10px rgba(0, 59, 92, 0.16);
    max-width: 82%;
}

#nmdChatbotRoot .ai-message .message-bubble {
    background: #ffffff;
    color: #0f172a;
    border-radius: 16px 16px 16px 4px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

#nmdChatbotRoot .ai-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 44, 70, 0.12);
    border: 1px solid #e2e8f0;
    padding: 3px;
    flex-shrink: 0;
    margin-top: 2px;
}

#nmdChatbotRoot .ai-icon .ai-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#nmdChatbotRoot .ai-icon.is-fallback {
    background: linear-gradient(135deg, #002c46, #004b70);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 0;
}

#nmdChatbotRoot .ai-icon.is-fallback .ai-icon-fallback {
    display: block !important;
}

#nmdChatbotRoot .message-meta {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 3px;
    padding: 0 4px;
}

#nmdChatbotRoot .user-meta {
    text-align: right;
}

/* Typing animation */
#nmdChatbotRoot .typing {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 50px;
    height: 30px;
}

#nmdChatbotRoot .typing span {
    width: 6px;
    height: 6px;
    background: #007ea7;
    border-radius: 50%;
    animation: nmdTyping 1.4s infinite ease-in-out;
}

#nmdChatbotRoot .typing span:nth-child(2) {
    animation-delay: 0.2s;
}

#nmdChatbotRoot .typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes nmdTyping {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.35;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

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

/* ===================================================
   5. AI ACTION BUTTONS (TTS Listen + Copy)
   =================================================== */
#nmdChatbotRoot .ai-bubble-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    margin-left: 2px;
}

#nmdChatbotRoot .tts-speak-btn,
#nmdChatbotRoot .msg-copy-btn,
#nmdChatbotRoot .msg-feedback-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

#nmdChatbotRoot .tts-speak-btn:hover,
#nmdChatbotRoot .msg-copy-btn:hover {
    background: #f0f9ff;
    color: #007ea7;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

#nmdChatbotRoot .msg-feedback-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
}

#nmdChatbotRoot .msg-feedback-btn.is-active-like {
    background: #dcfce7 !important;
    color: #15803d !important;
    border-color: #86efac !important;
}

#nmdChatbotRoot .msg-feedback-btn.is-active-dislike {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
}

#nmdChatbotRoot .ai-action-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 16px;
    background: linear-gradient(135deg, #007ea7, #004b70);
    color: #ffffff !important;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 126, 167, 0.25);
    transition: all 0.2s ease;
}

#nmdChatbotRoot .ai-action-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 126, 167, 0.35);
    background: linear-gradient(135deg, #006b8f, #003652);
}

#nmdChatbotRoot .tts-speak-btn.is-speaking {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
    animation: nmdPulseSpeaker 1.4s infinite;
}

@keyframes nmdPulseSpeaker {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.35);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
    }
}

/* ===================================================
   6. MODERN CAPSULE INPUT AREA (ChatGPT / Claude Style)
   =================================================== */
#nmdChatbotRoot .chat-input-wrap {
    background: #ffffff;
    border-top: 1px solid #edf2f7;
    padding: 10px 14px 8px;
    flex-shrink: 0;
}

#nmdChatbotRoot .chat-input-capsule {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 24px;
    padding: 3px 5px 3px 14px;
    transition: all 0.2s ease;
}

#nmdChatbotRoot .chat-input-capsule:focus-within {
    border-color: #007ea7;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 126, 167, 0.12);
}

#nmdChatbotRoot .chat-input-capsule input {
    flex: 1;
    min-width: 0;
    height: 38px;
    border: none;
    background: transparent;
    font-size: 13.5px;
    color: #0f172a;
    outline: none;
    padding: 0;
}

#nmdChatbotRoot .chat-input-capsule input::placeholder {
    color: #94a3b8;
}

#nmdChatbotRoot .capsule-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Language Switcher Pill */
#nmdChatbotRoot .mic-lang-pill {
    height: 28px;
    padding: 0 9px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    color: #007ea7;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

#nmdChatbotRoot .mic-lang-pill:hover {
    background: #f0f9ff;
    border-color: #007ea7;
}

/* Microphone Button (Clean Minimal SVG) */
#nmdChatbotRoot .mic-icon-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

#nmdChatbotRoot .mic-icon-btn:hover {
    color: #007ea7;
    background: #f0f9ff;
}

#nmdChatbotRoot .mic-icon-btn.listening {
    color: #ffffff !important;
    background: #ef4444 !important;
    animation: nmdPulseMic 1.2s infinite;
}

@keyframes nmdPulseMic {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.1);
    }
}

/* Send Circle Button (Arrow Up) */
#nmdChatbotRoot .send-circle-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    border: none;
    background: #007ea7;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0, 126, 167, 0.28);
}

#nmdChatbotRoot .send-circle-btn:hover {
    background: #006080;
    transform: scale(1.05);
}

#nmdChatbotRoot .send-circle-btn:active {
    transform: scale(0.95);
}

#nmdChatbotRoot .send-circle-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

#nmdChatbotRoot .send-circle-btn.is-sending {
    animation: nmdSpinSend 1s linear infinite;
}

@keyframes nmdSpinSend {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Brand Watermark Footer */
#nmdChatbotRoot .chat-footer-brand {
    text-align: center;
    padding-top: 6px;
    font-size: 10.5px;
    color: #94a3b8;
    letter-spacing: 0.2px;
    user-select: none;
}

#nmdChatbotRoot .chat-footer-brand span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ===================================================
   7. SCROLLBAR & RESPONSIVENESS
   =================================================== */
#nmdChatbotRoot .chat-messages::-webkit-scrollbar {
    width: 5px;
}

#nmdChatbotRoot .chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

#nmdChatbotRoot .chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

@media (max-width: 768px) {
    .nmd-chatbot-popup {
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        width: 100dvw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        z-index: 9999999 !important;
    }

    #nmdChatbotRoot .chat-container {
        border-radius: 0 !important;
        border: none !important;
        height: 100% !important;
    }

    /* CRITICAL FIX: Hide the floating launcher X cross button completely when chat is open on mobile */
    .nmd-chatbot-launcher.is-open {
        display: none !important;
        opacity: 0 !important;
        pointer-events: none !important;
        visibility: hidden !important;
        z-index: -1 !important;
    }

    .nmd-chatbot-launcher {
        right: 16px;
        bottom: 16px;
    }

    .nmd-proactive-bubble {
        right: 16px;
        bottom: 84px;
        max-width: calc(100vw - 32px);
    }

    /* Provide comfortable bottom spacing for safe areas on mobile devices */
    #nmdChatbotRoot .chat-input-wrap {
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Ensure send button and capsule actions are fully visible and comfortable to tap */
    #nmdChatbotRoot .capsule-actions {
        gap: 6px !important;
    }

    #nmdChatbotRoot .send-circle-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        z-index: 10 !important;
        position: relative !important;
    }

    #nmdChatbotRoot .mic-icon-btn {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
    }

    /* Prominent close X button in the header for mobile */
    #nmdChatbotRoot .close-chat-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        font-size: 16px !important;
        background: rgba(255, 255, 255, 0.22) !important;
        border-radius: 8px !important;
    }
}

/* ===================================================
   8. PROACTIVE FLOATING WELCOME BUBBLE
   =================================================== */
.nmd-proactive-bubble {
    position: fixed;
    right: 24px;
    bottom: 92px;
    max-width: 300px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: 0 12px 32px rgba(0, 44, 70, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 999997;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: nmdProactiveSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

.nmd-proactive-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(0, 44, 70, 0.24);
}

.nmd-proactive-bubble::after {
    content: "";
    position: absolute;
    bottom: -7px;
    right: 32px;
    width: 13px;
    height: 13px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    transform: rotate(45deg);
}

.nmd-proactive-bubble .proactive-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #002c46, #004b70);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.nmd-proactive-bubble .proactive-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nmd-proactive-bubble .proactive-text strong {
    font-size: 13px;
    color: #0f172a;
    font-weight: 600;
    line-height: 1.2;
}

.nmd-proactive-bubble .proactive-text span {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.4;
}

.nmd-proactive-bubble .proactive-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.nmd-proactive-bubble .proactive-close:hover {
    color: #0f172a;
}

@keyframes nmdProactiveSlide {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===================================================
   9. FEATURE 8: VOICE WAVEFORM BAR
   =================================================== */
#nmdChatbotRoot .nmd-voice-wave-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #002c46, #004b70);
    color: #ffffff;
    padding: 7px 12px;
    border-radius: 12px;
    margin-bottom: 7px;
    font-size: 11.5px;
    box-shadow: 0 4px 12px rgba(0, 44, 70, 0.22);
    animation: nmdWaveSlideIn 0.22s ease-out;
}

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

#nmdChatbotRoot .wave-bars {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 16px;
}

#nmdChatbotRoot .wave-bar {
    width: 3px;
    height: 14px;
    background: #f4c02f;
    border-radius: 3px;
    animation: nmdWavePulse 0.9s ease-in-out infinite alternate;
}

#nmdChatbotRoot .wave-bar:nth-child(1) { animation-delay: 0.1s; height: 6px; }
#nmdChatbotRoot .wave-bar:nth-child(2) { animation-delay: 0.3s; height: 14px; }
#nmdChatbotRoot .wave-bar:nth-child(3) { animation-delay: 0.2s; height: 16px; }
#nmdChatbotRoot .wave-bar:nth-child(4) { animation-delay: 0.4s; height: 10px; }
#nmdChatbotRoot .wave-bar:nth-child(5) { animation-delay: 0.15s; height: 8px; }

@keyframes nmdWavePulse {
    0% { transform: scaleY(0.3); opacity: 0.6; }
    50% { transform: scaleY(1); opacity: 1; }
    100% { transform: scaleY(0.4); opacity: 0.7; }
}

#nmdChatbotRoot .wave-status-text {
    flex: 1;
    margin: 0 10px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #f1f5f9;
}

#nmdChatbotRoot .wave-stop-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

#nmdChatbotRoot .wave-stop-btn:hover {
    background: #ef4444;
    color: #ffffff;
}

/* ===================================================
   10. FEATURE 2: WHATSAPP & CALL ACTION HUB
   =================================================== */
#nmdChatbotRoot .nmd-quick-connect-hub {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #cbd5e1;
}

#nmdChatbotRoot .connect-hub-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 9px;
}

#nmdChatbotRoot .hub-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

#nmdChatbotRoot .connect-hub-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}

#nmdChatbotRoot .hub-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

#nmdChatbotRoot .hub-icon-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    transition: transform 0.2s ease;
}

#nmdChatbotRoot .hub-label-wrap strong {
    display: block;
    font-size: 11.5px;
    line-height: 1.2;
    color: #0f172a;
    font-weight: 700;
}

#nmdChatbotRoot .hub-label-wrap small {
    display: block;
    font-size: 9.5px;
    line-height: 1.2;
    color: #64748b;
    margin-top: 1px;
}

#nmdChatbotRoot .hub-card-wa .hub-icon-circle {
    background: #e8f9ef;
    color: #128c7e;
}
#nmdChatbotRoot .hub-card-wa:hover {
    background: #ffffff;
    border-color: #25d366;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.18);
    transform: translateY(-2px);
}
#nmdChatbotRoot .hub-card-wa:hover .hub-icon-circle {
    background: #25d366;
    color: #ffffff;
    transform: scale(1.08);
}

#nmdChatbotRoot .hub-card-call .hub-icon-circle {
    background: #f0f9ff;
    color: #0284c7;
}
#nmdChatbotRoot .hub-card-call:hover {
    background: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.18);
    transform: translateY(-2px);
}
#nmdChatbotRoot .hub-card-call:hover .hub-icon-circle {
    background: #0284c7;
    color: #ffffff;
    transform: scale(1.08);
}

#nmdChatbotRoot .hub-card-form .hub-icon-circle {
    background: #fefce8;
    color: #ca8a04;
}
#nmdChatbotRoot .hub-card-form:hover {
    background: #ffffff;
    border-color: #eab308;
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.2);
    transform: translateY(-2px);
}
#nmdChatbotRoot .hub-card-form:hover .hub-icon-circle {
    background: #eab308;
    color: #ffffff;
    transform: scale(1.08);
}

/* Response Message CTA Pills */
#nmdChatbotRoot .nmd-msg-cta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
    animation: nmdMessageAppear 0.22s ease-out;
}

#nmdChatbotRoot .nmd-cta-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.18s ease;
    border: 1px solid transparent;
    line-height: 1.2;
}

#nmdChatbotRoot .nmd-pill-wa {
    background: #e8f9ef;
    color: #128c7e;
    border-color: #a7f3d0;
}

#nmdChatbotRoot .nmd-pill-wa:hover {
    background: #25d366;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(37, 211, 102, 0.28);
}

#nmdChatbotRoot .nmd-pill-call {
    background: #f0f9ff;
    color: #0369a1;
    border-color: #bae6fd;
}

#nmdChatbotRoot .nmd-pill-call:hover {
    background: #0284c7;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.28);
}

#nmdChatbotRoot .nmd-pill-inquiry {
    background: #fefce8;
    color: #a16207;
    border-color: #fde047;
}

#nmdChatbotRoot .nmd-pill-inquiry:hover {
    background: #eab308;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(234, 179, 8, 0.28);
}

/* ===================================================
   11. FEATURE 1: DEDICATED INQUIRY & COUNSELING VIEW
   =================================================== */
#nmdChatbotRoot .nmd-inquiry-view {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 14px 14px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
    animation: nmdInquiryFade 0.2s ease-out;
}

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

#nmdChatbotRoot .inquiry-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}

#nmdChatbotRoot .inquiry-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 18px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #002c46;
    cursor: pointer;
    transition: all 0.18s ease;
}

#nmdChatbotRoot .inquiry-back-btn:hover {
    background: #002c46;
    color: #ffffff;
    border-color: #002c46;
}

#nmdChatbotRoot .inquiry-close-x {
    background: #f1f5f9;
    border: none;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

#nmdChatbotRoot .inquiry-close-x:hover {
    background: #fee2e2;
    color: #ef4444;
}

#nmdChatbotRoot .inquiry-company-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

#nmdChatbotRoot .inquiry-co-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

#nmdChatbotRoot .inquiry-co-logo {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 2px;
}

#nmdChatbotRoot .inquiry-co-info h4 {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: #002c46;
    line-height: 1.2;
}

#nmdChatbotRoot .inquiry-co-info p {
    margin: 1px 0 0;
    font-size: 9.5px;
    color: #64748b;
    line-height: 1.2;
}

#nmdChatbotRoot .inquiry-contact-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    padding: 3px 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 9px;
    color: #475569;
}

#nmdChatbotRoot .inquiry-main-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

#nmdChatbotRoot .inquiry-field {
    text-align: left;
}

#nmdChatbotRoot .inquiry-field label {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
}

#nmdChatbotRoot .inquiry-field .req {
    color: #ef4444;
    font-weight: 700;
}

#nmdChatbotRoot .inquiry-field input,
#nmdChatbotRoot .inquiry-field select {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-size: 11.5px;
    background: #f8fafc;
    color: #0f172a;
    outline: none;
    height: 31px;
    transition: all 0.18s ease;
    font-family: inherit;
}

#nmdChatbotRoot .inquiry-field input:focus,
#nmdChatbotRoot .inquiry-field select:focus {
    border-color: #007ea7;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(0, 126, 167, 0.12);
}

#nmdChatbotRoot .inquiry-actions {
    margin-top: 4px;
}

#nmdChatbotRoot .inquiry-submit-btn {
    width: 100%;
    padding: 8px 12px;
    background: linear-gradient(135deg, #002c46, #007ea7);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 44, 70, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#nmdChatbotRoot .inquiry-submit-btn:hover {
    background: linear-gradient(135deg, #003a5c, #0096c7);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 44, 70, 0.24);
}

#nmdChatbotRoot .inquiry-alt-connect {
    text-align: center;
    margin-top: 2px;
    padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
}

#nmdChatbotRoot .inquiry-alt-connect span {
    display: block;
    font-size: 9.5px;
    color: #64748b;
    margin-bottom: 3px;
}

#nmdChatbotRoot .inquiry-wa-direct {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 10px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

#nmdChatbotRoot .inquiry-wa-direct:hover {
    background: #25d366;
    color: #ffffff;
    border-color: #25d366;
}

#nmdChatbotRoot .inquiry-trust-strip {
    margin-top: 3px;
    text-align: center;
    font-size: 9px;
    color: #64748b;
}

#nmdChatbotRoot .inquiry-success-view {
    text-align: center;
    padding: 24px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin: auto 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#nmdChatbotRoot .inquiry-success-view .inquiry-success-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #22c55e;
    color: #ffffff;
    font-size: 22px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

#nmdChatbotRoot .inquiry-success-view h3 {
    margin: 0 0 6px;
    font-size: 15px;
    color: #002c46;
    font-weight: 700;
}

#nmdChatbotRoot .inquiry-success-view p {
    font-size: 12px;
    color: #475569;
    line-height: 1.45;
    margin: 0 0 10px;
}

#nmdChatbotRoot .inquiry-success-sub {
    font-size: 11px;
    color: #007ea7;
    font-weight: 600;
}
