.ael-chatbot {
  --ael-primary: #006633;
  --ael-secondary: #ff9900;
  --ael-bg: #ffffff;
  --ael-text: #222;
  --ael-muted: #666;
  --ael-border: #e5e5e5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ael-chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ael-primary), #008844);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 102, 51, 0.35);
  font-size: 26px;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ael-chatbot-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 30px rgba(0, 102, 51, 0.45);
}

.ael-chatbot-toggle .ael-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--ael-secondary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ael-chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 140px);
  background: var(--ael-bg);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  animation: aelFadeInUp 0.25s ease;
}

.ael-chatbot-window.ael-open {
  display: flex;
}

@keyframes aelFadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.ael-chat-header {
  background: linear-gradient(135deg, var(--ael-primary), #008844);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ael-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ael-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.ael-chat-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.ael-chat-header p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ael-chat-header p::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
}

.ael-chat-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.85;
  padding: 4px 8px;
  border-radius: 4px;
}

.ael-chat-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.ael-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background: #f7f8fa;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ael-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: aelMsgIn 0.2s ease;
}

@keyframes aelMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ael-msg-bot {
  background: #fff;
  color: var(--ael-text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  white-space: pre-wrap;
}

.ael-msg-user {
  background: var(--ael-primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.ael-msg-error {
  background: #fee2e2;
  color: #991b1b;
  align-self: flex-start;
  font-size: 13px;
}

.ael-typing {
  align-self: flex-start;
  background: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ael-typing span {
  width: 7px;
  height: 7px;
  background: #bbb;
  border-radius: 50%;
  animation: aelBounce 1.2s infinite ease-in-out;
}

.ael-typing span:nth-child(2) { animation-delay: 0.15s; }
.ael-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes aelBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.ael-suggestions {
  padding: 0 18px 12px;
  background: #f7f8fa;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ael-suggestion {
  background: #fff;
  border: 1px solid var(--ael-border);
  color: var(--ael-primary);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.ael-suggestion:hover {
  background: var(--ael-primary);
  color: #fff;
  border-color: var(--ael-primary);
}

.ael-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-top: 1px solid var(--ael-border);
}

.ael-chat-input input {
  flex: 1;
  border: 1px solid var(--ael-border);
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.ael-chat-input input:focus {
  border-color: var(--ael-primary);
}

.ael-chat-input button {
  background: var(--ael-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.ael-chat-input button:hover:not(:disabled) {
  background: #008844;
}

.ael-chat-input button:disabled {
  background: #bbb;
  cursor: not-allowed;
}

.ael-chat-footer {
  text-align: center;
  font-size: 11px;
  color: var(--ael-muted);
  padding: 6px;
  background: #fff;
  border-top: 1px solid var(--ael-border);
}

@media (max-width: 480px) {
  .ael-chatbot-window {
    bottom: 90px;
    right: 8px;
    left: 8px;
    width: auto;
    height: calc(100vh - 110px);
  }
  .ael-chatbot-toggle {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
    font-size: 22px;
  }
}
