.eco-viatibot-fab {
  position: fixed;
  bottom: 88px;
  right: 22px;
  z-index: 1045;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 55%, #40916c 100%);
  color: #fff;
  box-shadow: 0 6px 24px rgba(27, 67, 50, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.eco-viatibot-fab:hover {
  transform: scale(1.07);
  color: #fff;
  box-shadow: 0 8px 28px rgba(27, 67, 50, 0.6);
}

.eco-viatibot-panel {
  position: fixed;
  bottom: 152px;
  right: 16px;
  z-index: 1046;
  width: min(400px, calc(100vw - 24px));
  max-height: min(580px, calc(100vh - 160px));
  display: none;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  background: #fff;
  border: 1px solid rgba(27, 67, 50, 0.15);
}

.eco-viatibot-panel.is-open {
  display: flex;
}

.eco-viatibot-header {
  background: linear-gradient(135deg, #1b4332, #40916c);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.eco-viatibot-header strong {
  display: block;
  font-size: 1rem;
}

.eco-viatibot-gemini-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  vertical-align: middle;
}

.eco-viatibot-header small {
  opacity: 0.9;
  display: block;
  font-size: 0.68rem;
  margin-top: 4px;
  line-height: 1.3;
}

.eco-viatibot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #f8fafb;
  min-height: 240px;
}

.eco-viatibot-msg {
  margin-bottom: 10px;
  max-width: 94%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
}

.eco-viatibot-msg.user {
  margin-left: auto;
  background: #d8f3dc;
  color: #1b4332;
  border-bottom-right-radius: 4px;
}

.eco-viatibot-msg.bot {
  background: #fff;
  border: 1px solid #e9ecef;
  border-bottom-left-radius: 4px;
}

.eco-viatibot-msg.bot strong {
  color: #1b4332;
}

.eco-viatibot-msg-files {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.eco-viatibot-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(27, 67, 50, 0.12);
}

.eco-viatibot-actions {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.eco-viatibot-action {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.eco-viatibot-action--error {
  background: #fef2f2;
  border-color: #fecaca;
}

.eco-viatibot-action--pending {
  background: #fffbeb;
  border-color: #fde68a;
}

.eco-viatibot-action-icon {
  font-size: 1rem;
  line-height: 1;
  margin-top: 1px;
}

.eco-viatibot-action--done .eco-viatibot-action-icon {
  color: #16a34a;
}

.eco-viatibot-action--error .eco-viatibot-action-icon {
  color: #dc2626;
}

.eco-viatibot-action--pending .eco-viatibot-action-icon {
  color: #d97706;
}

.eco-viatibot-action-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.eco-viatibot-action-body strong {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.eco-viatibot-quick-replies {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.eco-viatibot-quick-reply {
  border: 1px solid #40916c;
  background: #fff;
  color: #1b4332;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}

.eco-viatibot-quick-reply:hover {
  background: #d8f3dc;
}

.eco-viatibot-typing {
  font-size: 0.8rem;
  color: #6c757d;
  padding: 4px 12px 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.eco-viatibot-typing-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #40916c;
  animation: eco-viatibot-bounce 1.2s infinite ease-in-out;
}

.eco-viatibot-typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.eco-viatibot-typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes eco-viatibot-bounce {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.eco-viatibot-attach-preview {
  padding: 6px 10px;
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.eco-viatibot-pending-file {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: #e9ecef;
}

.eco-viatibot-pending-file button {
  border: none;
  background: none;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: #6c757d;
  padding: 0 2px;
}

.eco-viatibot-clear-files {
  border: none;
  background: none;
  font-size: 0.72rem;
  color: #dc3545;
  text-decoration: underline;
  cursor: pointer;
}

.eco-viatibot-input-row {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid #eee;
  background: #fff;
  align-items: center;
}

.eco-viatibot-attach-btn {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  border: 1px solid #ced4da;
  background: #fff;
  color: #1b4332;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eco-viatibot-attach-btn:hover {
  background: #f0fdf4;
}

.eco-viatibot-input-row input[type="text"] {
  flex: 1;
  border-radius: 20px;
  border: 1px solid #ced4da;
  padding: 8px 14px;
  font-size: 0.88rem;
  min-width: 0;
}

.eco-viatibot-input-row button#ecoViatiBotSend {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  border: none;
  background: #d4af37;
  color: #1b4332;
  font-weight: bold;
  flex-shrink: 0;
}

.eco-viatibot-input-row button#ecoViatiBotSend:disabled {
  opacity: 0.5;
}

@media (max-width: 576px) {
  .eco-viatibot-fab {
    bottom: 76px;
    right: 14px;
  }
  .eco-viatibot-panel {
    right: 8px;
    bottom: 140px;
    width: calc(100vw - 16px);
  }
}
