.digileo-chat * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }
.digileo-chat { position: fixed; bottom: 90px; right: 20px; z-index: 99999; }
.digileo-chat-btn {
  width: 60px; height: 60px; border-radius: 50%; background: #25D366; border: none;
  cursor: pointer; box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease; position: relative;
}
.digileo-chat-btn:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(37,211,102,0.5); }
.digileo-chat-btn svg { width: 28px; height: 28px; fill: #fff; }
.digileo-chat-btn .badge {
  position: absolute; top: -4px; right: -4px; background: #D32F2F; color: #fff;
  font-size: 11px; font-weight: 700; min-width: 20px; height: 20px;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  padding: 0 6px; display: none;
}
.digileo-chat-btn .badge.show { display: flex; }
.digileo-chat-panel {
  position: fixed; bottom: 90px; right: 20px; width: 380px; height: 560px;
  background: #fff; border-radius: 16px; box-shadow: 0 8px 48px rgba(0,0,0,0.15);
  display: none; flex-direction: column; overflow: hidden;
  animation: digileoSlideUp 0.35s ease; transform-origin: bottom right;
}
.digileo-chat-panel.open { display: flex; }
@keyframes digileoSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.digileo-chat-header {
  background: linear-gradient(135deg, #075E54, #128C7E); color: #fff;
  padding: 16px 20px; display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.digileo-chat-header .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: 18px;
}
.digileo-chat-header .info { flex: 1; }
.digileo-chat-header .info h4 { font-size: 14px; font-weight: 600; }
.digileo-chat-header .info .status { font-size: 11px; opacity: 0.85; display: flex; align-items: center; gap: 4px; }
.digileo-chat-header .info .status .dot { width: 7px; height: 7px; border-radius: 50%; }
.digileo-chat-header .info .status .dot.online { background: #25D366; }
.digileo-chat-header .info .status .dot.offline { background: #999; }
.digileo-chat-header .info .status .dot.away { background: #FF9800; }
.digileo-chat-header .close-btn {
  background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; opacity: 0.8; padding: 4px;
}
.digileo-chat-header .close-btn:hover { opacity: 1; }
.digileo-chat-lead {
  padding: 16px; background: #f0fdf4; border-bottom: 1px solid #e8f5e9;
  display: flex; flex-direction: column; gap: 8px; flex-shrink: 0;
}
.digileo-chat-lead input, .digileo-chat-lead textarea {
  padding: 8px 12px; border: 1px solid #c8e6c9; border-radius: 8px; font-size: 13px; outline: none;
  font-family: inherit; background: #fff;
}
.digileo-chat-lead input:focus, .digileo-chat-lead textarea:focus { border-color: #25D366; box-shadow: 0 0 0 2px rgba(37,211,102,0.15); }
.digileo-chat-lead textarea { resize: vertical; min-height: 50px; }
.digileo-chat-lead .lead-hint { font-size: 11px; color: #666; }
.digileo-chat-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px;
  background: #e5ddd5;
}
.digileo-chat-messages .msg {
  max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.5;
  position: relative; word-wrap: break-word;
}
.digileo-chat-messages .msg.visitor { align-self: flex-end; background: #dcf8c6; border-bottom-right-radius: 4px; }
.digileo-chat-messages .msg.ai, .digileo-chat-messages .msg.agent { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; }
.digileo-chat-messages .msg.system { align-self: center; background: rgba(0,0,0,0.05); font-size: 11px; color: #666; border-radius: 8px; padding: 6px 14px; }
.digileo-chat-messages .msg .time { font-size: 10px; color: #999; text-align: right; margin-top: 4px; }
.digileo-chat-messages .msg img { max-width: 100%; border-radius: 8px; margin-top: 6px; }
.digileo-chat-messages .msg .typing-dots { display: flex; gap: 4px; padding: 4px 0; }
.digileo-chat-messages .msg .typing-dots span {
  width: 8px; height: 8px; background: #999; border-radius: 50%; animation: digileoBounce 1.2s infinite;
}
.digileo-chat-messages .msg .typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.digileo-chat-messages .msg .typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes digileoBounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }
.digileo-chat-input {
  display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px;
  background: #fff; border-top: 1px solid #e0e0e0; flex-shrink: 0;
}
.digileo-chat-input textarea {
  flex: 1; border: none; outline: none; padding: 8px 0; font-size: 13.5px;
  resize: none; max-height: 100px; font-family: inherit; line-height: 1.4;
}
.digileo-chat-input .send-btn {
  width: 40px; height: 40px; border-radius: 50%; background: #25D366; border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background 0.3s;
}
.digileo-chat-input .send-btn:hover { background: #128C7E; }
.digileo-chat-input .send-btn svg { width: 18px; height: 18px; fill: #fff; }
.digileo-chat-input .attach-btn {
  background: none; border: none; color: #999; cursor: pointer; padding: 4px; font-size: 20px;
}
.digileo-chat-input .attach-btn:hover { color: #666; }

.digileo-chat-suggestions {
  padding: 8px 16px 4px; background: #fff; border-top: 1px solid #f0f0f0;
  display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0;
}
.digileo-chat-suggestions .chip {
  padding: 6px 14px; background: #f0fdf4; border: 1px solid #c8e6c9; border-radius: 16px;
  font-size: 12px; cursor: pointer; color: #075E54; transition: all 0.2s; white-space: nowrap;
}
.digileo-chat-suggestions .chip:hover { background: #25D366; color: #fff; border-color: #25D366; }

.digileo-chat-powered {
  text-align: center; padding: 4px; font-size: 10px; color: #999; background: #fafafa; flex-shrink: 0;
}

@media (max-width: 480px) {
  .digileo-chat-panel { width: 100vw; height: 100vh; bottom: 0; right: 0; border-radius: 0; }
  .digileo-chat { bottom: 20px; right: 16px; }
}
