
.m2ba-root{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:999999;
  font-family:Arial,Helvetica,sans-serif;
  color:#171b22;
}
.m2ba-root.m2ba-pos-left{right:auto;left:18px}

.m2ba-launcher{
  display:flex;
  align-items:center;
  gap:8px;
  height:54px;
  padding:0 17px;
  border:0;
  border-radius:28px;
  background:linear-gradient(#df0d1b,#bd000d);
  color:#fff;
  box-shadow:0 9px 28px rgba(0,0,0,.24);
  cursor:pointer;
  font-weight:900;
  font-size:14px;
}
.m2ba-launcher-icon{font-size:20px;line-height:1}

.m2ba-panel{
  position:absolute;
  right:0;
  bottom:66px;
  width:380px;
  height:min(590px,calc(100vh - 110px));
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid #d8dee5;
  border-radius:12px;
  background:#f5f7f9;
  box-shadow:0 18px 50px rgba(0,0,0,.24);
  opacity:0;
  visibility:hidden;
  transform:translateY(14px) scale(.98);
  transform-origin:bottom right;
  transition:.18s ease;
}
.m2ba-pos-left .m2ba-panel{right:auto;left:0;transform-origin:bottom left}
.m2ba-root.is-open .m2ba-panel{opacity:1;visibility:visible;transform:none}

.m2ba-header{
  min-height:62px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 15px 0 17px;
  background:linear-gradient(135deg,#131a22,#202a35);
  color:#fff;
}
.m2ba-header strong{display:block;font-size:16px}
.m2ba-header small{display:block;margin-top:2px;color:#9ee2aa;font-size:11px}
.m2ba-close{
  width:34px;height:34px;border:0;border-radius:50%;
  background:rgba(255,255,255,.1);color:#fff;font-size:25px;cursor:pointer
}

.m2ba-messages{
  flex:1;
  overflow-y:auto;
  padding:15px 12px;
  scroll-behavior:smooth;
}
.m2ba-msg{display:flex;margin:0 0 11px}
.m2ba-msg-user{justify-content:flex-end}
.m2ba-bubble{
  max-width:86%;
  padding:10px 12px;
  border-radius:12px;
  font-size:14px;
  line-height:1.45;
  box-shadow:0 1px 2px rgba(0,0,0,.05);
}
.m2ba-msg-bot .m2ba-bubble{background:#fff;border:1px solid #e0e5ea;border-bottom-left-radius:4px}
.m2ba-msg-user .m2ba-bubble{background:#cf0614;color:#fff;border-bottom-right-radius:4px}

.m2ba-form{
  display:grid;
  grid-template-columns:1fr 44px;
  gap:7px;
  padding:10px;
  background:#fff;
  border-top:1px solid #e0e5ea;
}
.m2ba-form input{
  min-width:0;
  height:42px;
  padding:0 12px;
  border:1px solid #ccd4dc;
  border-radius:8px;
  outline:none;
  font-size:14px;
  background:#fff;
}
.m2ba-form input:focus{border-color:#cf0614;box-shadow:0 0 0 2px rgba(207,6,20,.08)}
.m2ba-form button{
  border:0;border-radius:8px;background:#cf0614;color:#fff;font-size:18px;cursor:pointer
}

.m2ba-result-bubble{max-width:96%!important;padding:10px!important}
.m2ba-result-intro{margin:0 0 8px;font-weight:700}
.m2ba-result-card{
  display:grid;
  grid-template-columns:72px 1fr;
  gap:10px;
  margin-top:8px;
  padding:8px;
  border:1px solid #e0e5ea;
  border-radius:8px;
  background:#fafbfc;
  color:#171b22!important;
  text-decoration:none!important;
  transition:.15s;
}
.m2ba-result-card:hover{border-color:#cf0614;background:#fff}
.m2ba-result-card img{
  width:72px!important;
  height:72px!important;
  object-fit:cover!important;
  border-radius:6px!important;
}
.m2ba-result-copy{min-width:0}
.m2ba-result-copy strong{display:block;font-size:13px;line-height:1.3;margin-bottom:4px}
.m2ba-result-copy small{display:block;color:#68737e;font-size:11px;line-height:1.35;margin-bottom:5px}
.m2ba-result-copy b{font-size:11px;color:#cf0614}

.m2ba-typing{display:flex;gap:4px;align-items:center;height:18px}
.m2ba-typing i{width:6px;height:6px;border-radius:50%;background:#8a939d;animation:m2ba-dot 1s infinite ease-in-out}
.m2ba-typing i:nth-child(2){animation-delay:.15s}.m2ba-typing i:nth-child(3){animation-delay:.3s}
@keyframes m2ba-dot{0%,100%{opacity:.3;transform:translateY(0)}50%{opacity:1;transform:translateY(-3px)}}

@media(max-width:620px){
  .m2ba-root,.m2ba-root.m2ba-pos-left{right:10px;left:auto;bottom:10px}
  .m2ba-launcher{height:50px;padding:0 14px}
  .m2ba-panel{
    position:fixed;
    left:8px!important;
    right:8px!important;
    bottom:70px;
    width:auto;
    height:min(72vh,620px);
    border-radius:12px;
    transform-origin:bottom center;
  }
  .m2ba-header{min-height:58px}
  .m2ba-bubble{max-width:91%;font-size:14px}
  .m2ba-result-bubble{max-width:98%!important}
  .m2ba-result-card{grid-template-columns:60px 1fr}
  .m2ba-result-card img{width:60px!important;height:60px!important}
}
