/* abcdeal AI chat widget v0.1 */
#abcdeal-chat * { box-sizing: border-box; }

#abcdeal-chat .ac-bubble {
  position: fixed; right: 20px; bottom: 20px;
  width: 56px; height: 56px; border-radius: 50%;
  background: #d62828; color: #fff; border: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  cursor: pointer; z-index: 999998;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
#abcdeal-chat .ac-bubble:hover { transform: scale(1.06); }

#abcdeal-chat .ac-panel {
  position: fixed; right: 20px; bottom: 20px;
  width: 360px; height: 540px; max-height: calc(100vh - 40px);
  background: #fff; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  display: flex; flex-direction: column; overflow: hidden;
  z-index: 999999; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px; color: #222;
}

#abcdeal-chat .ac-head {
  padding: 12px 14px; background: #d62828; color: #fff;
  display: flex; align-items: center; gap: 8px;
}
#abcdeal-chat .ac-title { flex: 1; font-weight: 600; }
#abcdeal-chat .ac-close, #abcdeal-chat .ac-clear {
  background: transparent; border: none; color: #fff; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 4px 8px; border-radius: 4px;
}
#abcdeal-chat .ac-close:hover, #abcdeal-chat .ac-clear:hover {
  background: rgba(255,255,255,0.15);
}
#abcdeal-chat .ac-clear { font-size: 16px; }

#abcdeal-chat .ac-msgs {
  flex: 1; overflow-y: auto; padding: 12px;
  background: #f7f7f8;
  display: flex; flex-direction: column; gap: 8px;
}
#abcdeal-chat .ac-msg {
  max-width: 85%; padding: 8px 12px; border-radius: 12px;
  line-height: 1.4; word-wrap: break-word;
}
#abcdeal-chat .ac-msg.ac-user {
  align-self: flex-end; background: #d62828; color: #fff;
  border-bottom-right-radius: 4px;
}
#abcdeal-chat .ac-msg.ac-assistant {
  align-self: flex-start; background: #fff; color: #222;
  border: 1px solid #e3e3e6; border-bottom-left-radius: 4px;
}
#abcdeal-chat .ac-msg a {
  color: #d62828; text-decoration: underline; word-break: break-word;
}
#abcdeal-chat .ac-msg.ac-user a { color: #fff; }
#abcdeal-chat .ac-msg del { opacity: 0.6; }

#abcdeal-chat .ac-typing { display: inline-flex; gap: 4px; padding: 12px; }
#abcdeal-chat .ac-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #bbb;
  animation: ac-bounce 1.2s infinite ease-in-out;
}
#abcdeal-chat .ac-typing span:nth-child(2) { animation-delay: 0.2s; }
#abcdeal-chat .ac-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ac-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1; }
}

#abcdeal-chat .ac-form {
  display: flex; gap: 6px; padding: 10px; border-top: 1px solid #e3e3e6; background: #fff;
}
#abcdeal-chat .ac-input {
  flex: 1; resize: none; border: 1px solid #d0d0d3; border-radius: 8px;
  padding: 8px 10px; font: inherit; outline: none; max-height: 120px;
}
#abcdeal-chat .ac-input:focus { border-color: #d62828; }
#abcdeal-chat .ac-send {
  width: 38px; height: 38px; border-radius: 8px; background: #d62828;
  color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  align-self: flex-end;
}
#abcdeal-chat .ac-send:disabled { background: #b0b0b3; cursor: wait; }

#abcdeal-chat .ac-foot {
  padding: 6px 12px 10px; font-size: 11px; color: #888; background: #fff;
  text-align: center; border-top: 1px solid #f0f0f2;
}
#abcdeal-chat .ac-foot a { color: #d62828; text-decoration: none; }

/* Mobile */
@media (max-width: 480px) {
  #abcdeal-chat .ac-panel {
    right: 0; bottom: 0; width: 100%; height: 100%;
    max-height: 100vh; border-radius: 0;
  }
}
