#mh-chat-widget{--mh-blue:#2563eb;--mh-blue-dark:#1d4ed8;--mh-gray:#f3f4f6;--mh-radius:16px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;font-size:14px;line-height:1.5;z-index:99999}
#mh-chat-btn{position:fixed;bottom:24px;right:24px;width:60px;height:60px;border-radius:50%;background:var(--mh-blue);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 16px rgba(37,99,235,.4);transition:transform .2s,box-shadow .2s;z-index:99999}
#mh-chat-btn:hover{transform:scale(1.08);box-shadow:0 6px 24px rgba(37,99,235,.5)}
#mh-chat-btn svg{width:28px;height:28px;fill:#fff;display:block}
#mh-chat-btn .mh-close-icon{display:none}
#mh-chat-btn.mh-open .mh-chat-icon{display:none}
#mh-chat-btn.mh-open .mh-close-icon{display:block}

#mh-chat-window{position:fixed;bottom:100px;right:24px;width:380px;max-width:calc(100vw - 32px);height:520px;max-height:calc(100vh - 140px);background:#fff;border-radius:var(--mh-radius);box-shadow:0 8px 40px rgba(0,0,0,.15);display:none;flex-direction:column;overflow:hidden;z-index:99998}
#mh-chat-window.mh-visible{display:flex}

#mh-chat-header{background:var(--mh-blue);color:#fff;padding:16px 20px;display:flex;align-items:center;gap:12px;flex-shrink:0}
#mh-chat-header-avatar{width:36px;height:36px;border-radius:50%;background:rgba(255,255,255,.2);display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0}
#mh-chat-header-info h3{margin:0;font-size:15px;font-weight:600}
#mh-chat-header-info p{margin:0;font-size:12px;opacity:.85}

#mh-chat-messages{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px}
#mh-chat-messages::-webkit-scrollbar{width:4px}
#mh-chat-messages::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:2px}

.mh-msg{max-width:82%;padding:10px 14px;border-radius:12px;word-wrap:break-word;white-space:pre-wrap;font-size:14px;line-height:1.45}
.mh-msg-assistant{background:var(--mh-gray);color:#1f2937;align-self:flex-start;border-bottom-left-radius:4px}
.mh-msg-user{background:var(--mh-blue);color:#fff;align-self:flex-end;border-bottom-right-radius:4px}

.mh-typing{align-self:flex-start;background:var(--mh-gray);padding:10px 18px;border-radius:12px;border-bottom-left-radius:4px;display:flex;gap:4px;align-items:center}
.mh-typing span{width:7px;height:7px;border-radius:50%;background:#9ca3af;animation:mh-bounce .6s infinite alternate}
.mh-typing span:nth-child(2){animation-delay:.2s}
.mh-typing span:nth-child(3){animation-delay:.4s}
@keyframes mh-bounce{to{opacity:.3;transform:translateY(-4px)}}

#mh-chat-input-bar{display:flex;align-items:center;padding:12px 16px;border-top:1px solid #e5e7eb;gap:8px;flex-shrink:0;background:#fff}
#mh-chat-input{flex:1;border:1px solid #d1d5db;border-radius:24px;padding:10px 16px;font-size:14px;outline:none;resize:none;max-height:80px;font-family:inherit;line-height:1.4}
#mh-chat-input:focus{border-color:var(--mh-blue);box-shadow:0 0 0 2px rgba(37,99,235,.15)}
#mh-chat-input::placeholder{color:#9ca3af}
#mh-chat-send{width:38px;height:38px;border-radius:50%;background:var(--mh-blue);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background .15s}
#mh-chat-send:hover{background:var(--mh-blue-dark)}
#mh-chat-send:disabled{background:#d1d5db;cursor:not-allowed}
#mh-chat-send svg{width:18px;height:18px;fill:#fff}

#mh-chat-welcome{position:fixed;bottom:96px;right:24px;width:300px;background:#fff;border-radius:12px;box-shadow:0 4px 24px rgba(0,0,0,.15);padding:16px;display:none;z-index:99997;animation:mh-fade-in .3s ease}
#mh-chat-welcome.mh-visible{display:block}
#mh-chat-welcome-close{position:absolute;top:8px;right:10px;background:none;border:none;cursor:pointer;color:#9ca3af;font-size:18px;line-height:1;padding:2px 6px}
#mh-chat-welcome-close:hover{color:#6b7280}
#mh-chat-welcome-header{display:flex;align-items:center;gap:10px;margin-bottom:10px}
#mh-chat-welcome-avatar{width:36px;height:36px;border-radius:50%;background:var(--mh-blue);display:flex;align-items:center;justify-content:center;color:#fff;font-size:16px;flex-shrink:0}
#mh-chat-welcome-name{font-weight:600;font-size:14px;color:#1f2937}
#mh-chat-welcome-text{font-size:14px;color:#374151;line-height:1.5;margin-bottom:12px}
#mh-chat-welcome-cta{display:inline-flex;align-items:center;gap:8px;background:var(--mh-blue);color:#fff;border:none;border-radius:24px;padding:10px 20px;font-size:14px;font-weight:500;cursor:pointer;transition:background .15s;font-family:inherit}
#mh-chat-welcome-cta:hover{background:var(--mh-blue-dark)}
#mh-chat-welcome-cta svg{width:16px;height:16px;fill:#fff}
@keyframes mh-fade-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}

#mh-chat-badge{position:absolute;top:-4px;right:-4px;width:20px;height:20px;background:#ef4444;border-radius:50%;color:#fff;font-size:11px;font-weight:700;display:none;align-items:center;justify-content:center;border:2px solid #fff}
#mh-chat-badge.mh-visible{display:flex}

.mh-contact-form{align-self:flex-start;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:14px;max-width:88%;animation:mh-fade-in .3s ease}
.mh-contact-form-title{font-size:13px;font-weight:600;color:#374151;margin-bottom:10px}
.mh-contact-form input{display:block;width:100%;border:1px solid #d1d5db;border-radius:8px;padding:9px 12px;font-size:14px;font-family:inherit;margin-bottom:8px;outline:none;box-sizing:border-box}
.mh-contact-form input:focus{border-color:var(--mh-blue);box-shadow:0 0 0 2px rgba(37,99,235,.15)}
.mh-contact-form button{width:100%;background:var(--mh-blue);color:#fff;border:none;border-radius:8px;padding:10px;font-size:14px;font-weight:500;cursor:pointer;font-family:inherit;transition:background .15s}
.mh-contact-form button:hover{background:var(--mh-blue-dark)}
.mh-contact-form button:disabled{background:#d1d5db;cursor:not-allowed}
.mh-contact-form-sent{text-align:center;padding:8px 0;color:#059669;font-weight:500;font-size:14px}

@media(max-width:480px){
    #mh-chat-window{bottom:0;right:0;width:100vw;max-width:100vw;height:100vh;max-height:100vh;border-radius:0}
    #mh-chat-btn{bottom:16px;right:16px;width:54px;height:54px}
    #mh-chat-welcome{bottom:82px;right:16px;width:calc(100vw - 32px);max-width:300px}
}
