#mps-chat-launcher,
#mps-chat-widget,
#mps-chat-widget * {
    box-sizing: border-box;
}

#mps-chat-launcher {
    position: fixed;
    right: 24px;
    bottom: 120px;
    border: 0;
    background: #0f3d68;
    color: #ffffff;
    border-radius: 999px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(0,0,0,.20);
    z-index: 99998;
}

#mps-chat-widget {
    position: fixed;
    right: 24px;
    bottom: 185px;
    width: 390px;
    height: 610px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 18px 60px rgba(0,0,0,.24);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: #1f2937;
}

#mps-chat-widget.mps-hidden,
#mps-chat-launcher.mps-hidden {
    display: none !important;
}

.mps-chat-header {
    background: #0f3d68;
    color: white;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mps-chat-title {
    font-size: 16px;
    font-weight: 800;
}

.mps-chat-subtitle {
    font-size: 12px;
    margin-top: 3px;
    opacity: .85;
}

.mps-chat-header-actions {
    display: flex;
    gap: 8px;
}

.mps-chat-header-actions button {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: rgba(255,255,255,.14);
    color: white;
    font-size: 20px;
    cursor: pointer;
}

#mps-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background: #f8fafc;
}

.mps-message {
    display: flex;
    margin-bottom: 12px;
}

.mps-message.bot {
    justify-content: flex-start;
}

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

.mps-bubble {
    max-width: 82%;
    padding: 11px 14px;
    border-radius: 16px;
    line-height: 1.45;
    font-size: 14px;
    white-space: pre-wrap;
}

.mps-message.bot .mps-bubble {
    background: white;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 5px;
}

.mps-message.user .mps-bubble {
    background: #0f3d68;
    color: white;
    border-bottom-right-radius: 5px;
}

.mps-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 14px;
}

.mps-quick-actions button {
    border: 1px solid #cbd5e1;
    background: white;
    padding: 8px 11px;
    border-radius: 999px;
    cursor: pointer;
    color: #0f3d68;
    font-weight: 700;
    font-size: 12px;
}

.mps-quick-actions button:hover {
    background: #eef5fb;
}

#mps-chat-typing {
    padding: 8px 18px;
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
}

.mps-chat-input-area {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

#mps-chat-input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    outline: none;
    font: inherit;
}

#mps-chat-input:focus {
    border-color: #0f3d68;
}

.mps-chat-send {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #0f3d68;
    color: white;
    cursor: pointer;
    font-size: 18px;
}

@media (max-width: 600px) {
    #mps-chat-widget {
        right: 10px;
        left: 10px;
        bottom: 80px;
        width: auto;
        height: 72vh;
    }

    #mps-chat-launcher {
        right: 14px;
        bottom: 14px;
    }

    #mps-chat-launcher .mps-launcher-text {
        display: none;
    }
}

/* ====================================================
   MPS AI - SAFE MARKDOWN DISPLAY
   ==================================================== */

.mps-message.bot .mps-md-heading {
    font-weight: 700;
    font-size: 1.02em;
    margin: 2px 0 10px;
    line-height: 1.35;
}

.mps-message.bot .mps-md-paragraph {
    margin: 0 0 8px;
    line-height: 1.5;
}

.mps-message.bot .mps-md-paragraph:last-child {
    margin-bottom: 0;
}

.mps-message.bot .mps-md-list {
    margin: 4px 0 10px 18px;
    padding: 0;
}

.mps-message.bot .mps-md-list li {
    margin: 4px 0;
    line-height: 1.45;
}

.mps-message.bot .mps-bubble strong {
    font-weight: 700;
}
