.cs{
  display:flex;
  flex-direction:column;
  height:min(560px,78vh);
  max-height:min(78vh,680px);
  overflow:hidden;
  visibility:hidden;
  opacity:0;
  pointer-events:none;
  transform:translateY(12px);
  transition:opacity .18s,transform .18s,visibility .18s;
}
.cs.open{
  display:flex!important;
  visibility:visible;
  opacity:1;
  pointer-events:auto;
  transform:none;
}
.cs a[href*="t.me"]{display:none!important}
.chat-privacy-note{
  flex:0 0 auto;
  margin:8px 14px;
  padding:8px 10px;
  border-radius:10px;
  background:#e0f2fe;
  color:#0b4a6f;
  font-size:12px;
  line-height:1.7;
}
.chat-history{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:9px;
  padding:12px;
  overscroll-behavior:contain;
}
.chat-empty{margin:auto;text-align:center;color:#5b7a91;line-height:1.8}
.chat-bubble{display:grid;gap:5px;max-width:88%;padding:10px 12px;border-radius:14px;overflow-wrap:anywhere}
.chat-bubble.from-store{align-self:flex-start;background:#e0f2fe;border:1px solid #bae6fd}
.chat-bubble.from-customer{align-self:flex-end;background:#f7fcff;border:1px solid #cceeff}
.chat-bubble small{font-weight:700;color:#0369a1}
.chat-bubble p{white-space:pre-wrap;margin:0;line-height:1.7}
.chat-bubble time{font-size:10px;color:#698699}
.chat-bubble img{max-width:100%;max-height:250px;border-radius:9px}
.chat-bubble audio{width:min(100%,280px)}
.cs #cm{flex:0 0 auto;min-height:56px;max-height:100px;resize:vertical}
.cs #att{flex:0 0 auto;max-height:72px;overflow:auto}
.cs .cr{flex:0 0 auto;display:flex;align-items:center;gap:6px}
.cs .cr .send{flex:0 0 auto;min-width:72px}
.chat-push-button{flex:0 0 auto;margin:5px 12px 10px;padding:9px;border:1px solid #bae6fd;border-radius:12px;background:#fff;color:#075985;cursor:pointer;font:inherit;font-size:13px}
.cs[role=dialog]{z-index:90}
#bell.is-on{color:#167b45;border-color:#167b45;background:#e8f6ed}
#bell.is-off{color:#bd3434;border-color:#bd3434;background:#fff0ef}
#bell.bell-wiggle{animation:bell-wiggle .52s ease-in-out}
@keyframes bell-wiggle{0%,100%{transform:rotate(0)}20%{transform:rotate(16deg)}40%{transform:rotate(-14deg)}60%{transform:rotate(10deg)}80%{transform:rotate(-6deg)}}
@media(max-width:600px){
  .cs{
    inset-inline:10px!important;
    bottom:8px!important;
    width:auto!important;
    max-width:none!important;
    height:min(65dvh,520px);
    max-height:calc(100dvh - 20px - env(safe-area-inset-bottom,0px));
    padding:11px;
  }
  .chat-history{min-height:0;padding:8px}
  .chat-bubble{max-width:92%}
  .cs #cm{min-height:52px;max-height:88px;resize:none}
  .cs .cr .ib{width:36px;height:36px}
}
@media(prefers-reduced-motion:reduce){
  .cs{transition:none}
  #bell.bell-wiggle{animation:none}
}

.chat-audio-download{display:inline-flex;align-self:flex-start;min-height:34px;align-items:center;margin-top:3px;padding:5px 10px;border:1px solid var(--ln);border-radius:9px;color:var(--pr);background:var(--sf);font-size:12px;font-weight:700;text-decoration:underline;text-underline-offset:2px}
.chat-bubble audio{display:block;min-width:min(100%,220px);min-height:42px}
