@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ======================================================================
   RAG AI Chatbot Extremely Isolated CSS
   All selectors prefixed with #mps-chatbot-widget to strictly override host
   ====================================================================== */

#mps-chatbot-widget {
    --mps-blue: #00aeef;
    --mps-blue-dark: #0088cc;
    --mps-blue-light: #00aeef22;
    --mps-blue-border: #00aeef44;
    --mps-blue-85: rgba(0, 174, 239, 0.85);
    --mps-blue-90: rgba(0, 174, 239, 0.9);
    --mps-blue-65: rgba(0, 174, 239, 0.65);
    --mps-blue-35: rgba(0, 174, 239, 0.35);
    --mps-blue-30: rgba(0, 174, 239, 0.3);
    --mps-blue-25: rgba(0, 174, 239, 0.25);
    --mps-blue-20: rgba(0, 174, 239, 0.2);
    --mps-blue-12: rgba(0, 174, 239, 0.12);
    --mps-blue-08: rgba(0, 174, 239, 0.08);
    --mps-navy: #0f1928;
    --mps-green: #64d84b;
    --mps-red: #ef4444;
    --mps-white: #ffffff;
    --mps-text: #000000;
    --mps-text-light: #444444;
    --mps-radius: 12px;
    --mps-border: #e6e9ee;

    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    text-align: left !important;
    box-sizing: border-box !important;
}

#mps-chatbot-widget *,
#mps-chatbot-widget *::before,
#mps-chatbot-widget *::after {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
    max-width: none;
    max-height: none;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

/* Strong Reset for inherited host site typography */
#mps-chatbot-widget h1,
#mps-chatbot-widget h2,
#mps-chatbot-widget h3,
#mps-chatbot-widget h4,
#mps-chatbot-widget h5,
#mps-chatbot-widget h6,
#mps-chatbot-widget p,
#mps-chatbot-widget span,
#mps-chatbot-widget div,
#mps-chatbot-widget a,
#mps-chatbot-widget button,
#mps-chatbot-widget input,
#mps-chatbot-widget textarea {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-transform: none !important;
    line-height: normal !important;
    text-decoration: none !important;
    text-shadow: none !important;
}

#mps-chatbot-widget .mps-hidden {
    display: none !important;
}

/* ─── Position Variants ─── */
#mps-chatbot-widget.mps-pos-left .mps-chat-launcher {
    left: 24px !important;
    right: auto !important;
}

#mps-chatbot-widget.mps-pos-left .mps-chat-greeting {
    left: 95px !important;
    right: auto !important;
}

#mps-chatbot-widget.mps-pos-left #mps-chat-overlay.mps-right-aligned #mps-chat-panel {
    left: 24px !important;
    transform: translate(0, -100%) !important;
}

/* ─── Launcher ─── */
#mps-chatbot-widget .mps-chat-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--mps-blue), var(--mps-blue-dark)) !important;
    color: var(--mps-white) !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px var(--mps-blue-35), 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2147483647;
}

#mps-chatbot-widget .mps-chat-launcher:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px var(--mps-blue-35), 0 2px 8px rgba(0, 0, 0, 0.2);
}

#mps-chatbot-widget .mps-launcher-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--mps-green);
    border: 2px solid var(--mps-white);
    box-shadow: 0 0 6px rgba(100, 216, 75, 0.5);
    animation: mps-badge-pulse 2.5s infinite;
}

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

/* ─── Greeting Bubble ─── */
#mps-chatbot-widget .mps-chat-greeting {
    position: fixed;
    bottom: 28px;
    right: 95px;
    background: #ffffff !important;
    padding: 10px 38px 10px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    z-index: 2147483647;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: mps-greeting-slide-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    white-space: nowrap;
}

#mps-chatbot-widget .mps-chat-greeting:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

#mps-chatbot-widget .mps-greeting-content {
    display: flex;
    flex-direction: column;
    line-height: 1.4;
}

#mps-chatbot-widget .mps-greeting-title {
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: #475569 !important;
}

#mps-chatbot-widget .mps-greeting-sub {
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: var(--mps-blue) !important;
}

#mps-chatbot-widget .mps-greeting-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

#mps-chatbot-widget .mps-greeting-close:hover {
    color: #475569;
}

@keyframes mps-greeting-slide-in {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ─── Custom Launcher Icon (AI) ─── */
#mps-chatbot-widget .mps-launcher-icon-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-family: 'Inter', sans-serif;
}

#mps-chatbot-widget .mps-ai-text {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

#mps-chatbot-widget .mps-star-symbol {
    font-size: 16px;
    font-weight: 700;
    color: var(--mps-blue);
    position: absolute;
    top: -6px;
    right: -10px;
    text-shadow: 0 0 10px var(--mps-blue-35);
}

/* ─── Overlay and Panel ─── */
#mps-chatbot-widget #mps-chat-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned {
    background: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
}

#mps-chatbot-widget.mps-right-aligned #mps-chat-overlay #mps-chat-panel {
    pointer-events: auto;
    width: min(400px, 92vw);
    height: calc(100vh - 140px);
    max-height: 850px;
    left: calc(100% - 24px);
    top: calc(100% - 95px);
    transform: translate(-100%, -100%);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

#mps-chatbot-widget #mps-chat-panel {
    position: absolute;
    width: min(700px, 92vw);
    height: min(85vh, 720px);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid rgba(200, 200, 200, 0.3);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    overflow: hidden;
    transition:
        width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        left 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        top 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        border-radius 0.4s ease,
        box-shadow 0.4s ease;
}

/* ─── Header ─── */
#mps-chatbot-widget .mps-panel-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--mps-blue-85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff !important;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: padding 0.3s ease;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-panel-header {
    padding: 8px 14px;
}

#mps-chatbot-widget .mps-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2;
}

#mps-chatbot-widget .mps-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

#mps-chatbot-widget .mps-panel-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-panel-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-panel-avatar svg {
    width: 16px;
    height: 16px;
}

#mps-chatbot-widget .mps-panel-title-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: all 0.3s ease;
}

#mps-chatbot-widget .mps-panel-title-container br,
#mps-chatbot-widget .mps-panel-title-container p {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-panel-title-container {
    position: static;
    transform: none;
    align-items: flex-start;
    text-align: left;
    flex: 1;
    padding-left: 14px !important;
    padding-right: 14px !important;
}

#mps-chatbot-widget .mps-panel-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    text-align: center !important;
    color: #ffffff !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    white-space: nowrap !important;
    transition: font-size 0.3s ease, text-align 0.3s ease;
}

#mps-chatbot-widget .mps-panel-version {
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.8) !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    font-weight: 600 !important;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-panel-title {
    font-size: 16px !important;
    text-align: left !important;
}

#mps-chatbot-widget .mps-panel-status {
    font-size: 11px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    transition: all 0.3s ease;
}

#mps-chatbot-widget .mps-panel-status span {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-panel-status {
    display: none !important;
}

#mps-chatbot-widget .mps-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mps-green);
    box-shadow: 0 0 6px rgba(100, 216, 75, 0.6);
    transition: all 0.3s ease;
}

#mps-chatbot-widget #mps-avatar-status-dot {
    display: none;
    position: absolute;
    bottom: -2px;
    right: -2px;
    border: 2px solid var(--mps-blue);
    z-index: 10;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned #mps-avatar-status-dot {
    display: block;
}

#mps-chatbot-widget .mps-status-dot.mps-typing {
    background: #ff9800;
    box-shadow: 0 0 6px rgba(255, 152, 0, 0.6);
    animation: mps-badge-pulse 1.5s infinite;
}

#mps-chatbot-widget .mps-panel-btn {
    width: 34px;
    height: 34px;
    border: none !important;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-panel-btn {
    width: 30px;
    height: 30px;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-panel-btn svg {
    width: 18px;
    height: 18px;
}

#mps-chatbot-widget .mps-panel-btn:hover {
    background: rgba(255, 255, 255, 0.35) !important;
}

/* ─── Messages Area ─── */
#mps-chatbot-widget #mps-panel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    margin: 0 !important;
    transition: padding 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

#mps-chatbot-widget #mps-panel-messages::-webkit-scrollbar {
    width: 5px;
}

#mps-chatbot-widget #mps-panel-messages::-webkit-scrollbar-track {
    background: transparent;
}

#mps-chatbot-widget #mps-panel-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    transition: background 0.3s;
}

#mps-chatbot-widget #mps-panel-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned #mps-panel-messages {
    padding: 16px 18px;
}

/* Welcome State */
#mps-chatbot-widget .mps-welcome-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 10px;
}

#mps-chatbot-widget .mps-welcome-content {
    text-align: center;
    max-width: 440px;
    transition: max-width 0.3s ease;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-welcome-content {
    max-width: 100%;
}

#mps-chatbot-widget .mps-welcome-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--mps-blue), var(--mps-blue-dark));
    color: var(--mps-white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 6px 20px var(--mps-blue-30);
    transition: all 0.3s ease;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-welcome-icon {
    width: 50px;
    height: 50px;
}

#mps-chatbot-widget .mps-welcome-heading {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    transition: font-size 0.3s ease;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-welcome-heading {
    font-size: 18px;
}

#mps-chatbot-widget .mps-welcome-sub {
    font-size: 14px;
    color: #475569;
    margin-bottom: 24px;
    line-height: 1.5;
    transition: font-size 0.3s ease;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-welcome-sub {
    font-size: 13px;
}

#mps-chatbot-widget .mps-welcome-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

#mps-chatbot-widget .mps-welcome-chip {
    padding: 10px 18px;
    border-radius: 20px;
    border: 1.5px solid var(--mps-blue-30);
    background: #ffffff !important;
    color: var(--mps-blue) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

#mps-chatbot-widget .mps-welcome-chip:hover {
    background: var(--mps-blue) !important;
    color: #ffffff !important;
    border-color: var(--mps-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px var(--mps-blue-25);
}

#mps-chatbot-widget .mps-suggestion-carousel {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 24px 12px 24px;
    width: 100%;
    margin-top: 8px;
}

#mps-chatbot-widget button.mps-suggestion-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 20px !important;
    min-height: 32px !important;
    border-radius: 20px !important;
    border: 1.5px solid var(--mps-blue) !important;
    background: #ffffff !important;
    color: var(--mps-blue) !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    margin: 4px 2px !important;
    white-space: nowrap !important;
    text-align: center !important;
    text-transform: none !important;
    letter-spacing: 0.3px !important;
    box-sizing: border-box !important;
    width: auto !important;
    max-width: 100% !important;
}

#mps-chatbot-widget button.mps-suggestion-pill:hover {
    background: var(--mps-blue) !important;
    transform: translateY(-1.5px) !important;
    box-shadow: 0 4px 10px var(--mps-blue-25) !important;
    color: #ffffff !important;
}

/* --- Highlighted PDF Pill --- */
#mps-chatbot-widget button.mps-pdf-pill {
    background: var(--mps-blue) !important;
    border-color: var(--mps-blue-dark) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px var(--mps-blue-35) !important;
}

#mps-chatbot-widget button.mps-pdf-pill:hover {
    background: var(--mps-blue-dark) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px var(--mps-blue-35) !important;
}

#mps-chatbot-widget a.mps-category-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 14px !important;
    border-radius: 20px !important;
    background: var(--mps-blue-light) !important;
    color: var(--mps-blue) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border: 1.5px solid var(--mps-blue) !important;
    transition: all 0.2s ease !important;
    margin: 4px 2px !important;
    white-space: nowrap !important;
}

#mps-chatbot-widget a.mps-category-pill:hover {
    background: var(--mps-blue) !important;
    color: #ffffff !important;
    border-color: var(--mps-blue) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px var(--mps-blue-25) !important;
}

/* Message Bubbles */
#mps-chatbot-widget .mps-msg {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

#mps-chatbot-widget .mps-msg.mps-user {
    justify-content: flex-end;
}

#mps-chatbot-widget .mps-msg.mps-assistant {
    justify-content: flex-start;
    flex-wrap: wrap;
}

#mps-chatbot-widget .mps-suggestion-section {
    width: calc(100% + 48px);
    margin-left: -24px;
    margin-right: -24px;
    margin-top: 4px;
}

#mps-chatbot-widget .mps-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#mps-chatbot-widget .mps-bot-av {
    background: #ffffff;
    color: var(--mps-blue);
    border: 1px solid var(--mps-blue);
}

#mps-chatbot-widget .mps-user-av {
    background: var(--mps-blue);
    color: var(--mps-white);
}

#mps-chatbot-widget .mps-msg-body {
    max-width: 75% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: auto !important;
}

#mps-chatbot-widget .mps-bubble {
    padding: 13px 16px;
    border-radius: 16px;
    line-height: 1.65;
    font-size: 13.5px !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

#mps-chatbot-widget .mps-assistant .mps-bubble {
    background: rgba(255, 255, 255, 0.85) !important;
    color: #374151 !important;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

#mps-chatbot-widget .mps-user .mps-bubble {
    background: var(--mps-blue-90) !important;
    color: #ffffff !important;
    border: 1px solid var(--mps-blue-30);
    border-bottom-right-radius: 4px;
}

#mps-chatbot-widget .mps-assistant .mps-bubble p,
#mps-chatbot-widget .mps-assistant .mps-bubble li,
#mps-chatbot-widget .mps-assistant .mps-bubble span,
#mps-chatbot-widget .mps-assistant .mps-bubble strong {
    color: #374151 !important;
    margin: 6px 0 !important;
    font-size: 13.5px !important;
    line-height: 1.6 !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

#mps-chatbot-widget .mps-bubble ul,
#mps-chatbot-widget .mps-bubble ol {
    margin: 8px 0 !important;
    padding-left: 20px !important;
}

#mps-chatbot-widget .mps-bubble li {
    margin-bottom: 6px !important;
}

#mps-chatbot-widget .mps-bubble strong {
    font-weight: 700 !important;
    color: #111827 !important;
}

#mps-chatbot-widget .mps-assistant .mps-bubble h1,
#mps-chatbot-widget .mps-assistant .mps-bubble h2,
#mps-chatbot-widget .mps-assistant .mps-bubble h3 {
    color: #1e293b !important;
    font-weight: 700 !important;
    margin: 6px 0 4px !important;
}

#mps-chatbot-widget .mps-user .mps-bubble p,
#mps-chatbot-widget .mps-user .mps-bubble li,
#mps-chatbot-widget .mps-user .mps-bubble span,
#mps-chatbot-widget .mps-user .mps-bubble strong,
#mps-chatbot-widget .mps-user .mps-bubble h1,
#mps-chatbot-widget .mps-user .mps-bubble h2,
#mps-chatbot-widget .mps-user .mps-bubble h3 {
    color: #ffffff !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    font-size: 13.5px !important;
    margin: 6px 0 !important;
}

/* Markdown Element Styles */
#mps-chatbot-widget .mps-bubble table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    overflow: hidden;
}

#mps-chatbot-widget .mps-bubble th,
#mps-chatbot-widget .mps-bubble td {
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    text-align: left;
}

#mps-chatbot-widget .mps-bubble th {
    background: rgba(0, 0, 0, 0.03);
    font-weight: 700;
    color: #1e293b;
}

#mps-chatbot-widget .mps-bubble tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.01);
}

#mps-chatbot-widget .mps-bubble blockquote {
    margin: 12px 0;
    padding: 8px 16px;
    border-left: 4px solid var(--mps-blue-30);
    background: rgba(0, 174, 239, 0.05);
    font-style: italic;
    color: #475569;
}

#mps-chatbot-widget .mps-bubble code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.9em;
}

#mps-chatbot-widget .mps-bubble pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

#mps-chatbot-widget .mps-bubble pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Citations / Sources */
#mps-chatbot-widget .mps-citation {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--mps-blue-light);
    color: var(--mps-blue);
    border: 1px solid var(--mps-blue-border);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    margin: 2px 4px 2px 0;
    text-decoration: none;
    transition: all 0.2s ease;
}

#mps-chatbot-widget .mps-citation:hover {
    background: var(--mps-blue);
    color: #ffffff;
    transform: translateY(-1px);
}

#mps-chatbot-widget .mps-source-footer {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 11px;
    color: #64748b;
}

/* Typing */
#mps-chatbot-widget .mps-typing-bubble {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 14px 18px;
}

#mps-chatbot-widget .mps-tdot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mps-blue);
    animation: mps-dotBounce 1.4s infinite ease-in-out;
}

#mps-chatbot-widget .mps-tdot:nth-child(2) {
    animation-delay: 0.16s;
}

#mps-chatbot-widget .mps-tdot:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes mps-dotBounce {
    0%, 80%, 100% {
        transform: scale(0.5);
        opacity: 0.35;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ─── Input Area ─── */
#mps-chatbot-widget .mps-panel-input-area {
    padding: 14px 20px 12px;
    background: rgba(120, 120, 120, 0.15);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

#mps-chatbot-widget .mps-pdf-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    padding-bottom: 2px;
}

#mps-chatbot-widget .mps-pdf-download-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    background: rgba(120, 120, 120, 0.1) !important;
    border: 1.5px solid var(--mps-blue-20) !important;
    color: var(--mps-blue) !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    padding: 0 20px !important;
    min-height: 34px !important;
    min-width: 180px !important;
    border-radius: 20px !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-transform: none !important;
    letter-spacing: 0.3px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    flex-shrink: 0 !important;
}

#mps-chatbot-widget .mps-pdf-download-btn:hover {
    background: var(--mps-blue) !important;
    color: #ffffff !important;
    border-color: var(--mps-blue);
    box-shadow: 0 5px 15px var(--mps-blue-25);
    transform: translateY(-1.5px);
}

#mps-chatbot-widget .mps-pdf-download-btn:active {
    transform: translateY(0);
}

#mps-chatbot-widget .mps-pdf-download-btn svg {
    stroke: currentColor;
}

#mps-chatbot-widget .mps-panel-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.7);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--mps-radius);
    padding: 3px 3px 3px 16px;
}

#mps-chatbot-widget .mps-panel-input {
    flex: 1;
    padding: 11px 0;
    border: none;
    background: transparent;
    color: #1e293b !important;
    font-size: 14px !important;
    outline: none;
}

#mps-chatbot-widget .mps-panel-send {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: var(--mps-border);
    color: var(--mps-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

#mps-chatbot-widget .mps-panel-send.mps-active {
    background: var(--mps-blue);
    color: var(--mps-white);
    cursor: pointer;
}

/* ─── Category Carousel ─── */
#mps-chatbot-widget .mps-category-section-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--mps-blue);
    margin: 16px 0 8px 28px;
    display: flex;
    align-items: center;
    gap: 6px;
}

#mps-chatbot-widget .mps-category-carousel {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

#mps-chatbot-widget .mps-category-section {
    width: 100%;
    margin-top: 12px;
}

#mps-chatbot-widget .mps-category-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #64748b !important;
    margin-bottom: 10px;
    padding-left: 0;
}

#mps-chatbot-widget .mps-category-carousel::-webkit-scrollbar {
    display: none;
}

#mps-chatbot-widget .mps-category-card {
    width: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-category-card {
    width: 100%;
}

#mps-chatbot-widget .mps-category-card:hover {
    transform: translateY(-4px);
    border-color: var(--mps-blue);
    box-shadow: 0 6px 16px var(--mps-blue-12);
}

#mps-chatbot-widget .mps-category-image-wrapper {
    width: 100%;
    height: 110px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f1f5f9;
    padding: 5px;
}

#mps-chatbot-widget .mps-category-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#mps-chatbot-widget .mps-category-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #94a3b8;
}

#mps-chatbot-widget .mps-category-info {
    padding: 10px 8px;
    background: #fff;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mps-chatbot-widget .mps-category-name {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--mps-blue);
    text-align: center;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Carousel & Products ─── */
#mps-chatbot-widget .mps-carousel-wrapper {
    margin-top: 12px;
    width: 100%;
    position: relative;
}

#mps-chatbot-widget .mps-carousel-container {
    position: relative;
    display: flex;
    align-items: center;
}

#mps-chatbot-widget .mps-product-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

#mps-chatbot-widget .mps-product-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#mps-chatbot-widget .mps-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

#mps-chatbot-widget .mps-card-image-area {
    position: relative;
    width: 100%;
    padding-top: 75%;
    background: #f5f7fa;
    overflow: hidden;
}

#mps-chatbot-widget .mps-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#mps-chatbot-widget .mps-card-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

#mps-chatbot-widget .mps-card-category {
    display: inline-block;
    align-self: flex-start;
    padding: 3px 8px;
    border-radius: 12px;
    background: var(--mps-blue-light);
    color: var(--mps-blue) !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    border: 1px solid var(--mps-blue-border);
}

#mps-chatbot-widget .mps-card-name {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 0 4px !important;
    line-height: 1.3 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

#mps-chatbot-widget .mps-card-price {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--mps-blue) !important;
    margin-bottom: 8px !important;
}

#mps-chatbot-widget .mps-card-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
}

#mps-chatbot-widget .mps-action-btn {
    flex: 1;
    text-align: center;
    padding: 6px 4px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

#mps-chatbot-widget .mps-view-btn {
    background: var(--mps-blue) !important;
    color: #ffffff !important;
    border: 1px solid var(--mps-blue) !important;
}

#mps-chatbot-widget .mps-view-btn:hover {
    background: var(--mps-blue-dark) !important;
    border-color: var(--mps-blue-dark) !important;
}

#mps-chatbot-widget .mps-enquire-btn {
    background: transparent !important;
    color: var(--mps-blue) !important;
    border: 1px solid var(--mps-blue) !important;
}

#mps-chatbot-widget .mps-enquire-btn:hover {
    background: var(--mps-blue-08) !important;
}

#mps-chatbot-widget .mps-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(4px);
    color: #334155 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    z-index: 10;
    padding: 0;
}

#mps-chatbot-widget .mps-nav-arrow:hover {
    background: #ffffff !important;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

#mps-chatbot-widget .mps-nav-prev {
    left: -16px;
}

#mps-chatbot-widget .mps-nav-next {
    right: -16px;
}

#mps-chatbot-widget .mps-pagination-dots {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 12px 0 0;
}

#mps-chatbot-widget .mps-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: none;
    background: rgba(29, 60, 108, 0.2) !important;
    cursor: pointer;
    padding: 0;
    transition: all 0.25s ease;
}

#mps-chatbot-widget .mps-dot.mps-active {
    background: var(--mps-blue) !important;
    width: 16px;
    border-radius: 4px;
}

/* ─── Right-Aligned Carousel Overrides (Single Card View) ─── */
#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-product-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    padding: 0 20px !important;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-nav-prev {
    left: -4px !important;
    width: 32px !important;
    height: 32px !important;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-nav-next {
    right: -4px !important;
    width: 32px !important;
    height: 32px !important;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-nav-arrow svg {
    width: 16px !important;
    height: 16px !important;
}

#mps-chatbot-widget #mps-chat-overlay.mps-right-aligned .mps-category-carousel {
    grid-template-columns: repeat(2, 1fr) !important;
    padding: 0 20px !important;
}

/* ─── Responsive Carousel ─── */
@media (max-width: 640px) {
    #mps-chatbot-widget .mps-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #mps-chatbot-widget .mps-panel-title {
        font-size: 15px !important;
    }

    #mps-chatbot-widget .mps-category-carousel {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    #mps-chatbot-widget .mps-nav-prev {
        left: -8px;
    }

    #mps-chatbot-widget .mps-nav-next {
        right: -8px;
    }
}

/* ─── Modal ─── */
#mps-chatbot-widget #mps-enquiry-modal,
#mps-chatbot-widget #mps-contact-modal,
#mps-chatbot-widget #mps-download-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mps-chatbot-widget .mps-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#mps-chatbot-widget .mps-modal-content {
    position: relative;
    width: min(90%, 400px);
    background: #ffffff !important;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    z-index: 1;
}

#mps-chatbot-widget .mps-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0;
}

#mps-chatbot-widget .mps-modal-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#mps-chatbot-widget .mps-modal-close-btn {
    background: none;
    border: none;
    font-size: 24px !important;
    color: #64748b !important;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

#mps-chatbot-widget .mps-modal-body {
    padding: 20px;
}

#mps-chatbot-widget .mps-form-group {
    margin-bottom: 14px;
}

#mps-chatbot-widget .mps-form-group label {
    display: block;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    margin-bottom: 6px !important;
}

#mps-chatbot-widget .mps-form-group input,
#mps-chatbot-widget .mps-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px !important;
    color: #1e293b !important;
    background: #ffffff !important;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

#mps-chatbot-widget .mps-form-group input:focus,
#mps-chatbot-widget .mps-form-group textarea:focus {
    border-color: var(--mps-blue);
}

#mps-chatbot-widget .mps-enq-submit {
    width: 100%;
    padding: 12px;
    background: var(--mps-blue) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}

#mps-chatbot-widget .mps-enq-submit:hover {
    background: var(--mps-blue-dark) !important;
}

#mps-chatbot-widget .mps-enq-submit:disabled {
    background: #94a3b8 !important;
    cursor: not-allowed;
}

#mps-chatbot-widget .mps-form-feedback {
    margin-top: 12px;
    font-size: 13px !important;
    text-align: center;
    font-weight: 600 !important;
}

#mps-chatbot-widget .mps-form-feedback.mps-success {
    color: #16a34a !important;
}

#mps-chatbot-widget .mps-form-feedback.mps-error {
    color: #dc2626 !important;
}
