.ai-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 340px;
  height: 480px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,.1);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
}
.ai-chat.is-open { display: flex; }

.ai-chat-header {
  background: linear-gradient(135deg, #3369E3, #008a64);
  color: #fff;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ai-chat-title { font-weight: bold; }
.ai-chat-tools .ai-chat-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  margin-left: 6px;
  cursor: pointer;
}

.ai-chat-body {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background: #f8fafc;
}
.ai-chat-msg {
  display: flex;
  margin-bottom: 12px;
}
.ai-chat-msg.me { flex-direction: row-reverse; }
.ai-chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #3369E3;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 8px;
}
.ai-chat-msg.me .ai-chat-avatar { background: #008a64; }
.ai-chat-bubble {
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  max-width: 70%;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  word-break: break-word;
}
.ai-chat-msg.me .ai-chat-bubble {
  background: #3369E3;
  color: #fff;
}

.ai-chat-typing {
  display: none;
  font-size: 13px;
  color: #666;
  align-items: center;
  gap: 6px;
}
.ai-chat-typing.is-show { display: flex; }
.ai-chat-dots { display: flex; gap: 4px; }
.ai-chat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999;
  animation: aiChatTyping 1.2s infinite;
}
.ai-chat-dot:nth-child(2){ animation-delay: 0.2s; }
.ai-chat-dot:nth-child(3){ animation-delay: 0.4s; }
@keyframes aiChatTyping {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

.ai-chat-foot {
  border-top: 1px solid #e2e8f0;
  padding: 10px;
  background: #fff;
}
.ai-chat-row { display: flex; gap: 8px; }
.ai-chat-input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px;
  resize: none;
}
.ai-chat-send {
  background: linear-gradient(135deg, #3369E3, #008a64);
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 0 16px;
  cursor: pointer;
}

.ai-chat-mini {
  display: none;
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #3369E3;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  cursor: pointer;
  z-index: 9999;
}
.ai-chat-mini.is-show { display: block; }
