:root {
  --aureabot-primary: #0B7A45;
  --aureabot-primary-dark: #075c34;
  --aureabot-bg: #f3f7f5;
  --aureabot-text: #18342a;
  --aureabot-muted: #64756e;
  --aureabot-border: #dce7e1;
  --aureabot-shadow: 0 18px 60px rgba(10, 48, 34, .20);
}

.aureabot-root,
.aureabot-root * { box-sizing: border-box; }
.aureabot-root { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: var(--aureabot-text); line-height: 1.4; }
.aureabot-root button,
.aureabot-root input,
.aureabot-root textarea,
.aureabot-root select { font: inherit; }

/* Posicionado para NO tapar el botón flotante de WhatsApp */
.aureabot-floating { position: fixed; z-index: 999999; right: 18px; bottom: 98px; }
.aureabot-floating.aureabot-position-left { right: auto; left: 18px; bottom: 98px; }

.aureabot-launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px 6px 8px;
  background: linear-gradient(135deg, var(--aureabot-primary-dark), var(--aureabot-primary));
  color: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,.20);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.aureabot-launcher:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(0,0,0,.24); }
.aureabot-launcher-label { font-weight: 700; font-size: 14px; white-space: nowrap; }
.aureabot-launcher-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(11,122,69,.08);
}
.aureabot-launcher-icon img { width: 28px; height: 28px; object-fit: contain; display: block; }
.aureabot-notification {
  position: absolute;
  right: -2px;
  top: -5px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border: 2px solid #fff;
}

.aureabot-panel {
  width: min(340px, calc(100vw - 28px));
  height: min(530px, calc(100vh - 190px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(214, 231, 223, .92);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--aureabot-shadow);
}
.aureabot-floating .aureabot-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  transform-origin: bottom right;
  animation: aureabot-in .18s ease-out;
}
.aureabot-position-left .aureabot-panel { right: auto; left: 0; transform-origin: bottom left; }
.aureabot-inline { width: 100%; max-width: 390px; margin: 0 auto; }
.aureabot-inline .aureabot-panel { width: 100%; height: 560px; max-height: 80vh; }

@keyframes aureabot-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.aureabot-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--aureabot-primary-dark), var(--aureabot-primary));
}
.aureabot-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.14);
}
.aureabot-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aureabot-header-copy { display: flex; min-width: 0; flex-direction: column; }
.aureabot-bot-name { font-size: 15px; line-height: 1.2; }
.aureabot-status { display: flex; align-items: center; gap: 6px; font-size: 11px; opacity: .94; }
.aureabot-status i { width: 8px; height: 8px; border-radius: 50%; background: #8effb7; box-shadow: 0 0 0 3px rgba(142,255,183,.18); }
.aureabot-status.is-offline i { background: #ffd57a; box-shadow: 0 0 0 3px rgba(255,213,122,.18); }
.aureabot-close {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.aureabot-close:hover { background: rgba(255,255,255,.24); }

.aureabot-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: radial-gradient(circle at top right, rgba(11,122,69,.08), transparent 36%), var(--aureabot-bg);
  scrollbar-width: thin;
}
.aureabot-messages { display: flex; flex-direction: column; gap: 10px; }
.aureabot-message { max-width: 90%; padding: 11px 12px; border-radius: 15px; font-size: 13px; white-space: pre-line; box-shadow: 0 2px 7px rgba(18, 63, 46, .08); }
.aureabot-message.bot { align-self: flex-start; border-bottom-left-radius: 5px; background: #fff; }
.aureabot-message.user { align-self: flex-end; border-bottom-right-radius: 5px; background: #daf5e5; }
.aureabot-message strong { color: var(--aureabot-primary-dark); }
.aureabot-typing { display: inline-flex; gap: 4px; align-items: center; }
.aureabot-typing span { width: 6px; height: 6px; border-radius: 50%; background: #8aa097; animation: aureabot-dot 1s infinite ease-in-out; }
.aureabot-typing span:nth-child(2) { animation-delay: .15s; }
.aureabot-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes aureabot-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-4px); opacity: 1; } }

.aureabot-actions { display: grid; gap: 7px; margin-top: 12px; }
.aureabot-option { width: 100%; border: 1px solid var(--aureabot-border); border-radius: 13px; padding: 10px 11px; background: #fff; color: var(--aureabot-text); text-align: left; cursor: pointer; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.aureabot-option:hover { border-color: var(--aureabot-primary); transform: translateY(-1px); box-shadow: 0 4px 13px rgba(11,122,69,.11); }
.aureabot-option strong { display: block; font-size: 13px; }
.aureabot-option small { display: block; margin-top: 2px; color: var(--aureabot-muted); font-size: 11px; }
.aureabot-subtitle { margin: 8px 0 2px; font-size: 12px; color: var(--aureabot-muted); font-weight: 700; }
.aureabot-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.aureabot-chip { border: 1px solid var(--aureabot-border); border-radius: 999px; padding: 7px 10px; background: #fff; color: var(--aureabot-primary-dark); font-size: 12px; cursor: pointer; }
.aureabot-chip:hover, .aureabot-chip.is-selected { color: #fff; background: var(--aureabot-primary); border-color: var(--aureabot-primary); }

.aureabot-form { margin-top: 14px; }
.aureabot-form-fields { display: grid; gap: 10px; }
.aureabot-field label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 700; color: var(--aureabot-text); }
.aureabot-field label span { color: #b42318; }
.aureabot-field input,
.aureabot-field textarea,
.aureabot-field select { width: 100%; border: 1px solid var(--aureabot-border); border-radius: 11px; padding: 10px 11px; background: #fff; color: var(--aureabot-text); outline: none; }
.aureabot-field textarea { min-height: 84px; resize: vertical; }
.aureabot-field input:focus,
.aureabot-field textarea:focus,
.aureabot-field select:focus { border-color: var(--aureabot-primary); box-shadow: 0 0 0 3px rgba(11,122,69,.1); }
.aureabot-form-error { min-height: 18px; margin: 7px 0; color: #b42318; font-size: 12px; }
.aureabot-whatsapp-button { width: 100%; display: flex; justify-content: center; align-items: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 14px; background: #25D366; color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 6px 18px rgba(37,211,102,.25); }
.aureabot-whatsapp-button:hover { filter: brightness(.96); }
.aureabot-whatsapp-button svg { width: 22px; fill: currentColor; }
.aureabot-back { width: 100%; margin-top: 8px; border: 0; background: transparent; color: var(--aureabot-primary); font-size: 12px; font-weight: 700; cursor: pointer; }
.aureabot-privacy { margin: 8px 0 0; color: var(--aureabot-muted); text-align: center; font-size: 10px; }

.aureabot-footer {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid var(--aureabot-border);
}
.aureabot-free-text { flex: 1; min-width: 0; border: 1px solid var(--aureabot-border); border-radius: 999px; padding: 10px 14px; background: #f7faf8; outline: none; font-size: 13px; }
.aureabot-free-text:focus { border-color: var(--aureabot-primary); }
.aureabot-send { width: 38px; height: 38px; flex: 0 0 auto; border: 0; border-radius: 50%; background: var(--aureabot-primary); color: #fff; cursor: pointer; }

@media (max-width: 600px) {
  .aureabot-floating { right: 12px; bottom: 84px; }
  .aureabot-floating.aureabot-position-left { left: 12px; bottom: 84px; }
  .aureabot-launcher { min-height: 50px; padding: 6px 10px 6px 8px; }
  .aureabot-launcher-label { font-size: 13px; }
  .aureabot-floating .aureabot-panel {
    position: fixed;
    right: 12px;
    left: auto;
    bottom: 146px;
    width: min(340px, calc(100vw - 24px));
    height: min(72vh, 500px);
    inset: auto 12px 146px auto;
    border-radius: 18px;
  }
}

.aureabot-hide-desktop { display: none !important; }
@media (max-width: 767px) { .aureabot-hide-desktop { display: block !important; } .aureabot-hide-mobile { display: none !important; } }
@media (min-width: 768px) { .aureabot-hide-mobile { display: block !important; } }

/* El atributo hidden debe prevalecer sobre display:flex del panel. */
.aureabot-panel[hidden] { display: none !important; }

.aureabot-window-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 5;
}
.aureabot-minimize,
.aureabot-close {
  margin: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
}
.aureabot-minimize:hover,
.aureabot-close:hover,
.aureabot-minimize:focus-visible,
.aureabot-close:focus-visible {
  background: rgba(255,255,255,.30);
  outline: 2px solid rgba(255,255,255,.75);
  outline-offset: 1px;
}
.aureabot-close { font-size: 24px; }

/* Al abrir, el lanzador sigue disponible en la estructura, pero queda detrás del panel. */
.aureabot-is-open .aureabot-launcher { visibility: hidden; pointer-events: none; }

@media (max-width: 600px) {
  .aureabot-window-controls { gap: 4px; }
  .aureabot-minimize,
  .aureabot-close { width: 34px; height: 34px; }
}

/* v1.3: dos accesos separados — AureaBot y ¿Necesitas ayuda? */
.aureabot-launchers {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.aureabot-launcher-bot,
.aureabot-launcher-help {
  min-height: 50px;
}
.aureabot-launcher-bot {
  padding: 5px 10px 5px 5px;
  background: #fff;
  color: var(--aureabot-primary-dark);
  border: 1px solid rgba(11,122,69,.18);
}
.aureabot-launcher-bot .aureabot-launcher-icon {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(11,122,69,.16);
}
.aureabot-launcher-bot .aureabot-launcher-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.aureabot-launcher-bot-text {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.aureabot-launcher-help {
  padding: 7px 15px;
}
.aureabot-launcher-help .aureabot-launcher-label {
  display: inline;
}
.aureabot-is-open .aureabot-launchers {
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 600px) {
  .aureabot-launchers { gap: 6px; }
  .aureabot-launcher-bot,
  .aureabot-launcher-help { min-height: 46px; }
  .aureabot-launcher-bot { padding: 4px 8px 4px 4px; }
  .aureabot-launcher-bot .aureabot-launcher-icon { width: 36px; height: 36px; }
  .aureabot-launcher-bot-text { font-size: 12px; }
  .aureabot-launcher-help { padding: 6px 11px; }
  .aureabot-launcher-help .aureabot-launcher-label { display: inline; font-size: 12px; }
}
