
.eko-fab {
  position: fixed;
  bottom: 7rem;
  right: 2.35rem;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  border: 1px solid #2d5a27;
  cursor: pointer;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
}
.eko-fab[data-modo="privado"] {
  bottom: 1.5rem;
  right: 1.5rem;
}
.eko-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(45,90,39,0.25);
  background: #f6fbf5;
}
.eko-fab svg {
  width: 3.25rem;
  height: 3.25rem;
}
.eko-fab--hidden {
  display: none;
}

.eko-panel {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 380px;
  max-width: calc(100vw - 2rem);
  height: 520px;
  max-height: calc(100vh - 6rem);
  border-radius: 1rem;
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-surface-primary, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.eko-panel--open {
  display: flex;
}

.eko-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: #2d5a27;
  color: white;
  flex-shrink: 0;
}
.eko-header-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.eko-header-avatar svg {
  width: 1.25rem;
  height: 1.25rem;
}
.eko-header-info {
  flex: 1;
  min-width: 0;
}
.eko-header-name {
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.2;
}
.eko-header-status {
  font-size: 0.7rem;
  opacity: 0.8;
}
.eko-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.eko-close:hover {
  opacity: 1;
}

.eko-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.eko-msg {
  max-width: 85%;
  padding: 0.625rem 0.875rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  word-wrap: break-word;
}
.eko-msg--user {
  align-self: flex-end;
  background: #2d5a27;
  color: white;
  border-bottom-right-radius: 0.25rem;
}
.eko-msg--assistant {
  align-self: flex-start;
  background: var(--color-surface-secondary, #f3f4f6);
  color: var(--color-text-primary, #111827);
  border-bottom-left-radius: 0.25rem;
}
.eko-msg--assistant .eko-msg-source {
  display: inline-block;
  margin-top: 0.375rem;
  font-size: 0.625rem;
  opacity: 0.6;
  font-style: italic;
}
.eko-msg--assistant strong { font-weight: 700; color: inherit; }
.eko-msg--assistant em { font-style: italic; }
.eko-msg--assistant a {
  color: var(--brand-forest, #2d5a27);
  text-decoration: underline;
  font-weight: 500;
}
.eko-msg--assistant a:hover { opacity: 0.75; }
.eko-msg--assistant code {
  background: rgba(0,0,0,0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
}
.eko-msg--assistant ul,
.eko-msg--assistant ol {
  margin: 0.4rem 0 0.4rem 1.2rem;
  padding: 0;
}
.eko-msg--assistant li {
  margin: 0.15rem 0;
  list-style-position: outside;
}
.eko-msg--assistant ul li { list-style-type: disc; }
.eko-msg--assistant ol li { list-style-type: decimal; }
.eko-typing {
  align-self: flex-start;
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted, #6b7280);
  display: none;
}
.eko-typing--visible {
  display: block;
}
.eko-typing-dots {
  display: inline-flex;
  gap: 0.2rem;
}
.eko-typing-dots span {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--color-text-muted, #9ca3af);
  animation: ekoBounce 1.2s infinite ease-in-out;
}
.eko-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.eko-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ekoBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.eko-welcome {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--color-text-secondary, #6b7280);
  font-size: 0.8125rem;
  line-height: 1.6;
}
.eko-welcome strong {
  color: var(--color-text-primary, #111827);
  display: block;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.eko-input-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
  flex-shrink: 0;
}
.eko-input {
  flex: 1;
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: 1.5rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  outline: none;
  background: var(--color-surface-primary, #fff);
  color: var(--color-text-primary, #111827);
  resize: none;
  max-height: 5rem;
  line-height: 1.4;
}
.eko-input:focus {
  border-color: #2d5a27;
  box-shadow: 0 0 0 2px rgba(45,90,39,0.15);
}
.eko-send {
  background: #2d5a27;
  border: none;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.eko-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.eko-send svg {
  width: 1rem;
  height: 1rem;
  color: white;
}

.eko-header, .eko-tabs, .eko-input-area { flex-shrink: 0; }
.eko-messages, .eko-voz { min-height: 0; }

.eko-onboarding {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, #f3f8f1 0%, #ffffff 60%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1.75rem 1.5rem;
  text-align: center;
  transition: opacity 0.25s ease;
}
.eko-header { position: relative; z-index: 3; }
.eko-onboarding--hidden { opacity: 0; pointer-events: none; visibility: hidden; }
.eko-onb-buho {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  background: #eaf3e7;
  box-shadow: 0 10px 28px rgba(6, 46, 35, 0.16);
}
.eko-onb-title { font-size: 1.4rem; font-weight: 800; color: #1a2e1a; margin: 0.25rem 0 0; }
.eko-onb-sub { font-size: 0.875rem; color: rgba(26, 46, 26, 0.7); margin: 0 0 0.5rem; max-width: 280px; line-height: 1.45; }
.eko-onb-voz {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  max-width: 280px;
  padding: 0.9rem 1.25rem;
  border: none;
  border-radius: 0.9rem;
  background: #2d5a27;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(45, 90, 39, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.eko-onb-voz:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(45, 90, 39, 0.4); }
.eko-onb-chat {
  background: transparent;
  border: none;
  color: #2d5a27;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 1rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.eko-onb-chat:hover { color: #1a8f3c; }
.eko-wave--lg { height: 26px; }
.eko-wave--lg i { width: 3.5px; background: #ecf39e; }

@media (max-width: 640px) {
  .eko-panel {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    border: none;
  }
}
