/* ── ABP Chatbot Widget ── */
#abp-chat-root *{box-sizing:border-box;margin:0;padding:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif}

/* Launcher button */
#abp-launcher{
  position:fixed;bottom:24px;width:56px;height:56px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;border:none;box-shadow:0 4px 16px rgba(0,0,0,.18);
  transition:transform .2s,box-shadow .2s;z-index:99998
}
#abp-launcher:hover{transform:scale(1.08);box-shadow:0 6px 20px rgba(0,0,0,.22)}
#abp-launcher svg{width:26px;height:26px;fill:#fff;transition:opacity .2s}
#abp-launcher.open .abp-icon-chat{opacity:0;position:absolute}
#abp-launcher.open .abp-icon-close{opacity:1}
#abp-launcher .abp-icon-close{opacity:0}

/* Position variants */
.abp-pos-right #abp-launcher,.abp-pos-right #abp-window{right:24px}
.abp-pos-left  #abp-launcher,.abp-pos-left  #abp-window{left:24px}

/* Chat window */
#abp-window{
  position:fixed;bottom:92px;width:360px;height:520px;
  background:#fff;border-radius:16px;
  box-shadow:0 8px 40px rgba(0,0,0,.16);
  display:flex;flex-direction:column;overflow:hidden;
  z-index:99997;
  transform:scale(.92) translateY(16px);opacity:0;pointer-events:none;
  transition:transform .22s cubic-bezier(.34,1.56,.64,1),opacity .18s
}
#abp-window.open{transform:scale(1) translateY(0);opacity:1;pointer-events:all}

/* Header */
#abp-header{
  padding:14px 16px;display:flex;align-items:center;gap:10px;
  color:#fff;flex-shrink:0
}
#abp-avatar{
  width:36px;height:36px;border-radius:50%;background:rgba(255,255,255,.22);
  display:flex;align-items:center;justify-content:center;flex-shrink:0
}
#abp-avatar svg{width:20px;height:20px;fill:#fff}
#abp-bot-name{font-size:15px;font-weight:600;flex:1}
#abp-status{font-size:11px;opacity:.8}
#abp-close-btn{
  background:none;border:none;cursor:pointer;padding:4px;
  color:#fff;opacity:.8;border-radius:6px;display:flex
}
#abp-close-btn:hover{opacity:1;background:rgba(255,255,255,.15)}
#abp-close-btn svg{width:18px;height:18px;stroke:#fff;fill:none}

/* Messages area */
#abp-messages{
  flex:1;overflow-y:auto;padding:16px;
  display:flex;flex-direction:column;gap:10px;
  background:#f8f9fb;scrollbar-width:thin
}

/* Message bubbles */
.abp-msg{display:flex;flex-direction:column;max-width:82%}
.abp-msg.user{align-self:flex-end;align-items:flex-end}
.abp-msg.bot {align-self:flex-start;align-items:flex-start}
.abp-bubble{
  padding:10px 14px;border-radius:16px;font-size:14px;line-height:1.55;
  word-break:break-word;white-space:pre-wrap
}
.abp-msg.user .abp-bubble{color:#fff;border-bottom-right-radius:4px}
.abp-msg.bot  .abp-bubble{background:#fff;color:#1a1a2e;border:1px solid #e8eaf0;border-bottom-left-radius:4px}
.abp-msg-time{font-size:10px;color:#9ca3af;margin-top:3px;padding:0 4px}

/* Typing indicator */
.abp-typing{display:flex;align-items:center;gap:4px;padding:10px 14px;background:#fff;border:1px solid #e8eaf0;border-radius:16px;border-bottom-left-radius:4px;width:fit-content}
.abp-dot{width:7px;height:7px;border-radius:50%;background:#9ca3af;animation:abpDot 1.2s infinite}
.abp-dot:nth-child(2){animation-delay:.2s}
.abp-dot:nth-child(3){animation-delay:.4s}
@keyframes abpDot{0%,60%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(-5px);opacity:1}}

/* Input area */
#abp-input-area{
  padding:12px 14px;border-top:1px solid #eef0f4;
  display:flex;gap:8px;align-items:flex-end;background:#fff;flex-shrink:0
}
#abp-input{
  flex:1;border:1px solid #e2e8f0;border-radius:12px;
  padding:9px 14px;font-size:14px;resize:none;outline:none;
  max-height:100px;line-height:1.5;color:#1a1a2e;background:#f8f9fb;
  transition:border-color .15s
}
#abp-input:focus{border-color:var(--abp-color);background:#fff}
#abp-send{
  width:38px;height:38px;border-radius:10px;border:none;cursor:pointer;
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
  transition:opacity .15s,transform .1s
}
#abp-send:hover{opacity:.88}
#abp-send:active{transform:scale(.95)}
#abp-send svg{width:18px;height:18px;fill:#fff}
#abp-send:disabled{opacity:.45;cursor:not-allowed}

/* Powered by */
#abp-powered{text-align:center;padding:6px;font-size:10px;color:#c0c0cc;background:#fff;flex-shrink:0}

/* Notification badge */
#abp-badge{
  position:absolute;top:-4px;right:-4px;width:18px;height:18px;
  background:#ef4444;color:#fff;font-size:10px;font-weight:700;
  border-radius:50%;display:none;align-items:center;justify-content:center;
  border:2px solid #fff
}
#abp-badge.show{display:flex}

/* Unread hint bubble */
#abp-hint{
  position:fixed;bottom:92px;background:#1a1a2e;color:#fff;
  padding:8px 14px;border-radius:10px;font-size:13px;
  box-shadow:0 4px 12px rgba(0,0,0,.18);white-space:nowrap;
  opacity:0;pointer-events:none;transition:opacity .3s;z-index:99996
}
#abp-hint.show{opacity:1}
.abp-pos-right #abp-hint{right:88px}
.abp-pos-left  #abp-hint{left:88px}

/* Mobile */
@media(max-width:420px){
  #abp-window{width:calc(100vw - 24px);bottom:84px}
  .abp-pos-right #abp-window{right:12px}
  .abp-pos-left  #abp-window{left:12px}
}
