#mxchat-btn{
  position:fixed; left:1rem; bottom:1rem; z-index:10050;
  width:56px; height:56px; border-radius:50%; border:1px solid rgba(255,255,255,.18);
  background:rgba(79,79,77,.94); color:#fff; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 8px 28px rgba(0,0,0,.32); backdrop-filter:blur(10px);
  transition:transform .15s ease, background .15s ease;
}
#mxchat-btn:hover{ transform:translateY(-2px); background:rgba(63,63,61,.98) }
#mxchat-btn svg{ width:30px; height:30px }
#mxchat-btn[aria-expanded="true"]{ background:#3f3f3d }

#mxchat-panel{
  position:fixed; left:1rem; bottom:4.8rem; z-index:10050;
  width:min(390px, calc(100vw - 2rem)); max-height:min(640px, 72vh);
  display:none; flex-direction:column; overflow:hidden;
  background:rgba(79,79,77,.94); color:#fff;
  border:1px solid rgba(255,255,255,.16); border-radius:16px;
  box-shadow:0 16px 48px rgba(0,0,0,.38);
  backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px);
  font-size:.9rem;
}
#mxchat-panel.open{ display:flex }
#mxchat-head{
  display:flex; align-items:center; gap:.55rem; padding:.7rem .8rem;
  border-bottom:1px solid rgba(255,255,255,.12); flex:0 0 auto;
}
#mxchat-head svg{ width:22px; height:22px; opacity:.95 }
#mxchat-title{ font-weight:700; font-size:.92rem; flex:1 }
#mxchat-close{
  background:transparent; border:none; color:#e5e5e5; font-size:1.35rem;
  line-height:1; cursor:pointer; padding:0 .25rem; margin:0;
}
#mxchat-body{
  flex:1 1 auto; min-height:120px; overflow:auto; padding:.7rem .8rem;
  display:flex; flex-direction:column; gap:.55rem;
}
.mxchat-msg{
  max-width:92%; padding:.5rem .65rem; border-radius:12px;
  white-space:pre-wrap; word-break:break-word; line-height:1.35;
}
.mxchat-msg.user{ align-self:flex-end; background:rgba(255,255,255,.14) }
.mxchat-msg.bot{ align-self:flex-start; background:rgba(0,0,0,.22) }
.mxchat-msg, .mxchat-msg p, .mxchat-msg ul, .mxchat-msg ol,
.mxchat-msg li, .mxchat-msg strong, .mxchat-msg em, .mxchat-msg code,
.mxchat-msg .mxchat-h{ color:#fff }
.mxchat-msg p{ margin:.2rem 0 }
.mxchat-msg p:first-child{ margin-top:0 }
.mxchat-msg p:last-child{ margin-bottom:0 }
.mxchat-msg ul, .mxchat-msg ol{ margin:.25rem 0 .3rem 1.1rem; padding:0 }
.mxchat-msg li{ margin:.12rem 0 }
.mxchat-msg strong{ font-weight:700 }
.mxchat-msg em{ font-style:italic }
.mxchat-msg code{
  background:rgba(0,0,0,.28); padding:.08rem .25rem; border-radius:4px;
  font-size:.86em; font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
}
.mxchat-msg .mxchat-h{ font-weight:700; margin:.35rem 0 .15rem }
#mxchat-foot{
  flex:0 0 auto; padding:.55rem .65rem; border-top:1px solid rgba(255,255,255,.12);
  display:flex; gap:.4rem; align-items:flex-end;
}
#mxchat-input{
  flex:1; min-height:2.3rem; max-height:6rem; resize:none; margin:0;
  background:rgba(30,30,29,.6) !important; color:#fff !important;
  border:1px solid rgba(255,255,255,.2) !important; border-radius:10px;
  padding:.4rem .55rem; font:inherit;
}
#mxchat-input::placeholder{ color:rgba(255,255,255,.45) }
#mxchat-send{
  width:auto; margin:0; padding:.45rem .7rem; border-radius:10px;
  background:#4F4F4D; color:#fff; border:1px solid rgba(255,255,255,.2);
  cursor:pointer; height:2.3rem;
}
#mxchat-send:disabled{ opacity:.45; cursor:default }
.mxchat-hint{ opacity:.72; font-size:.8rem; padding:.2rem 0 }
@media (max-width:640px){
  #mxchat-btn{ width:50px; height:50px; left:.75rem; bottom:.75rem }
  #mxchat-btn svg{ width:26px; height:26px }
  #mxchat-panel{ left:.75rem; bottom:4.2rem; width:calc(100vw - 1.5rem); max-height:75vh }
}
