#stm-ai-chatbot,
#stm-ai-chatbot * {
    box-sizing: border-box;
}

#stm-ai-chatbot {
    --stm-orange: #f48402;
    --stm-dark: #151a2b;
    --stm-soft: #f7f8fb;
    --stm-border: #e6e8ee;
    font-family: Poppins, Arial, sans-serif;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
}

.stm-chat-launcher {
    border: 0;
    background: var(--stm-orange);
    color: #fff;
    min-height: 58px;
    padding: 8px 18px 8px 10px;
    border-radius: 32px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.22);
    cursor: pointer;
    font-weight: 600;
    transition: transform .2s ease, box-shadow .2s ease;
}

.stm-chat-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(0,0,0,.26);
}

.stm-chat-launcher-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.stm-chat-launcher-label {
    white-space: nowrap;
}

.stm-chat-panel {
    position: absolute;
    right: 0;
    bottom: 70px;
    width: min(390px, calc(100vw - 28px));
    height: min(650px, calc(100vh - 110px));
    min-height: 500px;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.28);
    border: 1px solid rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
}

.stm-chat-header {
    background: linear-gradient(135deg, #151a2b 0%, #262e49 100%);
    color: #fff;
    padding: 13px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stm-chat-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stm-chat-brand strong {
    display: block;
    font-size: 14px;
    line-height: 1.2;
}

.stm-chat-brand small {
    display: block;
    opacity: .75;
    font-size: 10px;
    margin-top: 3px;
}

.stm-chat-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    padding: 3px;
}

.stm-chat-close {
    border: 0;
    background: rgba(255,255,255,.1);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
}

.stm-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px 13px;
    background:
        radial-gradient(circle at 10% 0%, rgba(244,132,2,.08), transparent 28%),
        var(--stm-soft);
}

.stm-msg-row {
    display: flex;
    margin: 0 0 10px;
}

.stm-msg-user {
    justify-content: flex-end;
}

.stm-msg-bubble {
    max-width: 86%;
    padding: 10px 12px;
    border-radius: 15px;
    font-size: 12.5px;
    line-height: 1.55;
    color: #263043;
    background: #fff;
    border: 1px solid var(--stm-border);
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.stm-msg-user .stm-msg-bubble {
    color: #fff;
    background: var(--stm-orange);
    border-color: var(--stm-orange);
    border-bottom-right-radius: 5px;
}

.stm-msg-assistant .stm-msg-bubble {
    border-bottom-left-radius: 5px;
}

.stm-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 54px;
}

.stm-typing span {
    width: 5px;
    height: 5px;
    background: #8b91a0;
    border-radius: 50%;
    animation: stmTyping 1.1s infinite ease-in-out;
}

.stm-typing span:nth-child(2) { animation-delay: .15s; }
.stm-typing span:nth-child(3) { animation-delay: .3s; }

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

.stm-chat-suggestions {
    padding: 8px 10px 4px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    background: #fff;
    border-top: 1px solid var(--stm-border);
}

.stm-chat-suggestions button {
    border: 1px solid #f0c99e;
    background: #fff8ef;
    color: #9a5200;
    border-radius: 20px;
    padding: 6px 9px;
    font-size: 10px;
    white-space: nowrap;
    cursor: pointer;
}

.stm-chat-input {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    padding: 8px 10px;
    background: #fff;
    border-top: 1px solid var(--stm-border);
}

.stm-chat-input textarea {
    flex: 1;
    resize: none;
    border: 1px solid #dfe2e9;
    border-radius: 12px;
    padding: 9px 10px;
    min-height: 40px;
    max-height: 120px;
    outline: none;
    font-size: 12px;
    line-height: 1.4;
}

.stm-chat-input textarea:focus {
    border-color: var(--stm-orange);
}

.stm-chat-input > button {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 0;
    border-radius: 12px;
    background: var(--stm-orange);
    color: #fff;
    cursor: pointer;
}

.stm-chat-input > button:disabled {
    opacity: .6;
    cursor: wait;
}

.stm-chat-disclaimer {
    padding: 5px 10px 9px;
    text-align: center;
    color: #9096a3;
    background: #fff;
    font-size: 8.5px;
    line-height: 1.35;
}

.stm-quote-card {
    padding: 10px 11px;
    background: #fffaf3;
    border-top: 1px solid #f4d8b6;
}

.stm-quote-title {
    color: #8c4b00;
    font-size: 12px;
    font-weight: 700;
}

.stm-quote-card p {
    margin: 4px 0 8px;
    color: #6e7077;
    font-size: 10px;
}

.stm-quote-card input {
    display: block;
    width: 100%;
    height: 36px;
    margin-bottom: 6px;
    padding: 7px 9px;
    border: 1px solid #dedfe4;
    border-radius: 9px;
    outline: none;
    font-size: 11px;
}

.stm-quote-card input:focus {
    border-color: var(--stm-orange);
}

.stm-quote-submit {
    width: 100%;
    border: 0;
    border-radius: 9px;
    padding: 9px;
    color: #fff;
    background: var(--stm-orange);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.stm-form-message {
    margin-top: 5px;
    font-size: 9.5px;
    line-height: 1.35;
}

.stm-form-message.is-error {
    color: #b42318;
}

.stm-form-message.is-success {
    color: #16794c;
}

.stm-whatsapp-followup {
    display: block;
    text-align: center;
    margin-top: 7px;
    color: #16794c;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 575px) {
    #stm-ai-chatbot {
        right: 12px;
        bottom: 12px;
    }

    .stm-chat-launcher {
        min-height: 52px;
        padding-right: 12px;
    }

    .stm-chat-launcher-icon {
        width: 38px;
        height: 38px;
    }

    .stm-chat-panel {
        bottom: 62px;
        width: calc(100vw - 24px);
        height: calc(100vh - 90px);
        min-height: 420px;
        border-radius: 16px;
    }
}
