/* Floating chat widget */
.mpchat{position:fixed;right:20px;bottom:74px;z-index:9998;font-family:inherit;}
.mpchat-fab{width:58px;height:58px;border-radius:50%;border:none;background:#0d6efd;color:#fff;font-size:24px;cursor:pointer;box-shadow:0 6px 20px rgba(0,0,0,.25);display:flex;align-items:center;justify-content:center;transition:transform .15s, background .15s;position:relative;z-index:2;}
.mpchat-fab:hover{transform:scale(1.06);}
.mpchat-fab .mpchat-fab-close{display:none;}
.mpchat.open .mpchat-fab .mpchat-fab-open{display:none;}
.mpchat.open .mpchat-fab .mpchat-fab-close{display:inline;}
.mpchat.open .mpchat-fab{background:#444;}

/* Manual mode buttons */
.mpchat-manual{position:absolute;right:0;bottom:72px;display:flex;flex-direction:column;gap:10px;align-items:flex-end;opacity:0;visibility:hidden;transform:translateY(10px);transition:.2s;}
.mpchat.open .mpchat-manual{opacity:1;visibility:visible;transform:translateY(0);}
.mpchat-mbtn{display:inline-flex;align-items:center;gap:8px;padding:10px 16px;border-radius:30px;color:#fff;text-decoration:none;font-size:14px;font-weight:600;box-shadow:0 4px 14px rgba(0,0,0,.2);white-space:nowrap;}
.mpchat-msgr{background:#0084ff;}.mpchat-wa{background:#25d366;}.mpchat-tel{background:#202020;}

/* AI panel */
.mpchat-panel{position:absolute;right:0;bottom:72px;width:360px;max-width:calc(100vw - 32px);height:520px;max-height:calc(100vh - 110px);background:#fff;border-radius:16px;box-shadow:0 12px 40px rgba(0,0,0,.28);display:flex;flex-direction:column;overflow:hidden;opacity:0;visibility:hidden;transform:translateY(12px) scale(.98);transform-origin:bottom right;transition:.18s;}
.mpchat.open .mpchat-panel{opacity:1;visibility:visible;transform:translateY(0) scale(1);}
.mpchat-head{background:#0d6efd;color:#fff;padding:14px 16px;display:flex;justify-content:space-between;align-items:center;}
.mpchat-sub{font-size:12px;opacity:.85;}
.mpchat-head-x{background:none;border:none;color:#fff;font-size:18px;cursor:pointer;}
.mpchat-body{flex:1;overflow-y:auto;padding:16px;background:#f5f6f8;display:flex;flex-direction:column;gap:8px;}
.mpchat-msg{max-width:82%;padding:9px 13px;border-radius:14px;font-size:14px;line-height:1.5;word-break:break-word;}
.mpchat-bot{background:#fff;border:1px solid #e7e7e7;align-self:flex-start;border-bottom-left-radius:4px;}
.mpchat-user{background:#0d6efd;color:#fff;align-self:flex-end;border-bottom-right-radius:4px;}
.mpchat-agent{background:#198754;color:#fff;}
.mpchat-bot strong{font-weight:700;}
.mpchat-bot .mpchat-h{font-weight:700;margin:6px 0 2px;}
.mpchat-bot .mpchat-hr{border:0;border-top:1px solid #ececec;margin:8px 0;}
.mpchat-bot .mpchat-ul{margin:4px 0 4px 2px;padding-left:18px;}
.mpchat-bot .mpchat-ul li{margin:2px 0;}
.mpchat-bot code{background:#f1f1f1;border-radius:4px;padding:1px 5px;font-size:13px;font-family:ui-monospace,Menlo,Consolas,monospace;}
.mpchat-bot a{color:#0d6efd;text-decoration:underline;}
.mpchat-bot .mpchat-tw{overflow-x:auto;margin:6px 0;-webkit-overflow-scrolling:touch;}
.mpchat-bot .mpchat-tbl{border-collapse:collapse;width:100%;font-size:12.5px;background:#fff;}
.mpchat-bot .mpchat-tbl th,.mpchat-bot .mpchat-tbl td{border:1px solid #e2e2e2;padding:5px 8px;text-align:left;white-space:nowrap;}
.mpchat-bot .mpchat-tbl th{background:#f5f5f5;font-weight:700;}
.mpchat-bot .mpchat-tbl tr:nth-child(even) td,.mpchat-bot .mpchat-tbl tbody tr:nth-child(even){background:#fafafa;}
.mpchat-foot{display:flex;gap:8px;padding:10px;border-top:1px solid #eee;background:#fff;}
.mpchat-foot input{flex:1;border:1px solid #ddd;border-radius:20px;padding:9px 14px;font-size:14px;outline:none;}
.mpchat-foot input:focus{border-color:#0d6efd;}
.mpchat-foot button{width:40px;height:40px;border-radius:50%;border:none;background:#0d6efd;color:#fff;cursor:pointer;flex:none;display:flex;align-items:center;justify-content:center;}
.mpchat-foot button:disabled{opacity:.7;cursor:not-allowed;}
.mpchat-foot input:disabled{background:#f1f1f1;cursor:not-allowed;}
.mpchat-spin{width:16px;height:16px;border:2px solid rgba(255,255,255,.45);border-top-color:#fff;border-radius:50%;display:inline-block;animation:mpchatspin .7s linear infinite;}
@keyframes mpchatspin{to{transform:rotate(360deg);}}
.mpchat-login{text-align:center;margin:auto;color:#666;}
.mpchat-login p{margin:12px 0;}
.mpchat-loginbtn{display:inline-block;background:#0d6efd;color:#fff;text-decoration:none;padding:9px 22px;border-radius:24px;font-weight:600;}
.mpchat-typing{display:flex;gap:4px;align-items:center;}
.mpchat-typing span{width:7px;height:7px;border-radius:50%;background:#bbb;animation:mpchatblink 1.2s infinite both;}
.mpchat-typing span:nth-child(2){animation-delay:.2s;}
.mpchat-typing span:nth-child(3){animation-delay:.4s;}
@keyframes mpchatblink{0%,80%,100%{opacity:.3;}40%{opacity:1;}}
@media (max-width:480px){.mpchat-panel{width:calc(100vw - 24px);height:70vh;}}
