:root{--aca-primary:#dc1414;--aca-primary-d:#b01010;--aca-bg:#ffffff;--aca-border:#e4e4f0;--aca-text:#1a1a2e;--aca-muted:#7b7b9d;--aca-bot-bg:#fdeaea;--aca-radius:18px;--aca-shadow:0 8px 40px rgba(220,20,20,.20);--aca-z:99999}
#aca-wrapper{position:fixed;bottom:24px;z-index:var(--aca-z);font-family:'Segoe UI',system-ui,sans-serif;line-height:1.5}
#aca-wrapper.aca-right{right:24px}
#aca-wrapper.aca-left{left:24px}

#aca-bubble{
  width:64px;height:64px;border-radius:50%;border:none;
  background:#dc1414;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 4px 24px rgba(220,20,20,.45);
  transition:transform .2s cubic-bezier(.34,1.56,.64,1);
  position:relative;overflow:visible;padding:0;
}
#aca-bubble:hover{transform:scale(1.08)}
#aca-bubble:active{transform:scale(.95)}

#aca-bubble::before{
  content:'';
  position:absolute;
  top:50%;left:50%;
  transform:translate(-50%,-50%);
  width:38px;height:38px;
  background:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCI+PHBhdGggZD0iTTggOCBDOCA0IDExIDIgMTQgMiBMNTAgMiBDNTMgMiA1NiA0IDU2IDggTDU2IDQwIEM1NiA0NCA1MyA0NiA1MCA0NiBMMjAgNDYgTDggNTggWiIgZmlsbD0id2hpdGUiLz48Y2lyY2xlIGN4PSIyNCIgY3k9IjI0IiByPSI0IiBmaWxsPSIjZGMxNDE0Ii8+PGNpcmNsZSBjeD0iMzIiIGN5PSIyNCIgcj0iNCIgZmlsbD0iI2RjMTQxNCIvPjxjaXJjbGUgY3g9IjQwIiBjeT0iMjQiIHI9IjQiIGZpbGw9IiNkYzE0MTQiLz48L3N2Zz4=') center/38px 38px no-repeat;
  pointer-events:none;
  transition:none;
}
#aca-bubble:hover::before,
#aca-bubble:focus::before,
#aca-bubble:active::before{
  background:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCI+PHBhdGggZD0iTTggOCBDOCA0IDExIDIgMTQgMiBMNTAgMiBDNTMgMiA1NiA0IDU2IDggTDU2IDQwIEM1NiA0NCA1MyA0NiA1MCA0NiBMMjAgNDYgTDggNTggWiIgZmlsbD0id2hpdGUiLz48Y2lyY2xlIGN4PSIyNCIgY3k9IjI0IiByPSI0IiBmaWxsPSIjZGMxNDE0Ii8+PGNpcmNsZSBjeD0iMzIiIGN5PSIyNCIgcj0iNCIgZmlsbD0iI2RjMTQxNCIvPjxjaXJjbGUgY3g9IjQwIiBjeT0iMjQiIHI9IjQiIGZpbGw9IiNkYzE0MTQiLz48L3N2Zz4=') center/38px 38px no-repeat !important;
  transform:translate(-50%,-50%) !important;
}
#aca-bubble[aria-expanded="true"]::before,
#aca-bubble[aria-expanded="true"]:hover::before{
  background:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCI+PGxpbmUgeDE9IjE0IiB5MT0iMTQiIHgyPSI1MCIgeTI9IjUwIiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjciIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPjxsaW5lIHgxPSI1MCIgeTE9IjE0IiB4Mj0iMTQiIHkyPSI1MCIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSI3IiBzdHJva2UtbGluZWNhcD0icm91bmQiLz48L3N2Zz4=') center/30px 30px no-repeat !important;
  transform:translate(-50%,-50%) !important;
}

#aca-unread{position:absolute;top:-4px;right:-4px;min-width:20px;height:20px;border-radius:10px;background:#dc1414;border:2px solid white;color:#fff;font-size:11px;font-weight:700;display:none;align-items:center;justify-content:center;padding:0 4px}
#aca-unread.visible{display:flex}

#aca-window{position:absolute;bottom:74px;width:360px;max-height:520px;background:var(--aca-bg);border-radius:var(--aca-radius);box-shadow:var(--aca-shadow);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom center;transform:scale(.9);opacity:0;pointer-events:none;transition:transform .25s cubic-bezier(.34,1.56,.64,1),opacity .2s}
.aca-right #aca-window{right:0}
.aca-left #aca-window{left:0}
#aca-window:not([hidden]){transform:scale(1);opacity:1;pointer-events:auto}
#aca-window[hidden]{display:flex!important}

#aca-header{background:#dc1414;color:#fff;padding:14px 16px;display:flex;align-items:center;gap:10px}
#aca-avatar{width:42px;height:42px;border-radius:50%;background:rgba(255,255,255,.15);display:flex;align-items:center;justify-content:center;flex-shrink:0;overflow:hidden;border:2px solid rgba(255,255,255,.4)}
#aca-avatar svg{width:42px;height:42px}
#aca-avatar img{width:42px;height:42px;object-fit:cover;border-radius:50%}
#aca-header-info{flex:1;min-width:0}
#aca-header-info strong{display:block;font-size:15px}
#aca-status{font-size:12px;opacity:.85}
#aca-status::before{content:'\25CF';margin-right:4px;font-size:9px;color:#55efc4}
#aca-close-btn{background:none;border:none;color:#fff;cursor:pointer;padding:4px;border-radius:6px;transition:background .15s;display:flex;align-items:center}
#aca-close-btn:hover{background:rgba(255,255,255,.2)}
#aca-close-btn svg{width:20px;height:20px}

#aca-messages{flex:1;overflow-y:auto;padding:16px 14px;display:flex;flex-direction:column;gap:10px;scroll-behavior:smooth}
#aca-messages::-webkit-scrollbar{width:4px}
#aca-messages::-webkit-scrollbar-thumb{background:var(--aca-border);border-radius:4px}
.aca-msg{max-width:82%;padding:10px 14px;border-radius:14px;font-size:14px;animation:acaPop .2s ease;word-break:break-word;line-height:1.55}
@keyframes acaPop{from{opacity:0;transform:translateY(6px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
.aca-msg-bot{background:#fdeaea;color:#1a1a2e;border-bottom-left-radius:4px;align-self:flex-start}
.aca-msg-user{background:#dc1414;color:#fff;border-bottom-right-radius:4px;align-self:flex-end}
.aca-typing{display:flex;gap:4px;padding:12px 14px;background:#fdeaea;border-radius:14px;border-bottom-left-radius:4px;align-self:flex-start}
.aca-typing span{width:7px;height:7px;border-radius:50%;background:#dc1414;animation:acaDot 1.2s infinite}
.aca-typing span:nth-child(2){animation-delay:.2s}
.aca-typing span:nth-child(3){animation-delay:.4s}
@keyframes acaDot{0%,80%,100%{opacity:.25;transform:scale(.8)}40%{opacity:1;transform:scale(1)}}

#aca-input-area{display:flex;align-items:flex-end;gap:8px;padding:10px 12px;border-top:1px solid var(--aca-border);background:var(--aca-bg)}
#aca-input{flex:1;resize:none;border:1px solid var(--aca-border);border-radius:12px;padding:9px 12px;font-size:14px;font-family:inherit;outline:none;max-height:120px;overflow-y:auto;transition:border-color .15s;line-height:1.5}
#aca-input:focus{border-color:#dc1414}

#aca-send{
  width:40px;height:40px;flex-shrink:0;border:none;border-radius:50%;
  background:#dc1414;cursor:pointer;
  position:relative;overflow:visible;padding:0;
  transition:background .15s,transform .1s;
}
#aca-send::after{
  content:'';
  position:absolute;
  top:50%;left:50%;
  transform:translate(-50%,-50%);
  width:20px;height:20px;
  background:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTIgMjFMMjMgMTIgMiAzdjdsMTUgMi0xNSAyeiIgZmlsbD0id2hpdGUiLz48L3N2Zz4=') center/20px no-repeat;
  pointer-events:none;
}
#aca-send svg{display:none!important}
#aca-send:hover{background:#b01010}
#aca-send:active{transform:scale(.9)}
#aca-send:disabled{background:#ccc;cursor:not-allowed}

#aca-footer-note{text-align:center;font-size:11px;color:var(--aca-muted);margin:0;padding:6px 0 8px;background:var(--aca-bg)}
@media(max-width:400px){#aca-window{width:calc(100vw - 32px)}#aca-wrapper.aca-right{right:16px}#aca-wrapper.aca-left{left:16px}}