/* Asistente ADN. Estilos propios (no dependen de styles.css) para poder
   incluirlo en cualquier pagina del sitio. */
.innova-bot {
  --bot-purple: #302A50;
  --bot-purple-light: #483f73;
  --bot-accent: #6b52d1;
  --bot-soft: #f4f0ff;
  --bot-text: #0f172a;
  --bot-muted: #64748b;
  --bot-border: #e2e8f0;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 300;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--bot-text);
}
.innova-bot * { box-sizing: border-box; }

.innova-bot-toggle {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: var(--bot-purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(48, 42, 80, 0.35);
  transition: transform 0.2s, background 0.2s;
  margin-left: auto;
}
.innova-bot-toggle:hover { background: var(--bot-purple-light); transform: translateY(-2px); }
.innova-bot.is-open .innova-bot-toggle { display: none; }

.innova-bot-panel {
  width: 370px;
  height: min(560px, calc(100vh - 48px));
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(48, 42, 80, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--bot-border);
}
.innova-bot-panel[hidden] { display: none; }

.innova-bot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--bot-purple), var(--bot-accent));
  color: #fff;
}
.innova-bot-header strong { display: block; font-size: 16px; }
.innova-bot-header span { display: block; font-size: 12px; opacity: 0.85; margin-top: 2px; }
.innova-bot-icon,
.innova-bot-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.innova-bot-close:hover { background: rgba(255, 255, 255, 0.3); }
.innova-bot-actions { display: flex; gap: 6px; }
.innova-bot-icon { display: flex; align-items: center; justify-content: center; padding: 0; }
.innova-bot-icon:hover { background: rgba(255, 255, 255, 0.3); }
.innova-bot-gear[aria-expanded="true"] { background: #fff; color: var(--bot-purple); }
.innova-bot-voice[aria-pressed="true"] { background: #fff; color: var(--bot-purple); }
.innova-bot-voice[aria-pressed="true"] .innova-bot-mute,
.innova-bot-voice[aria-pressed="false"] .innova-bot-wave { display: none; }
.innova-bot [hidden] { display: none !important; }

/* Ajustes de voz */
.innova-bot-settings {
  display: grid;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bot-soft);
  border-bottom: 1px solid var(--bot-border);
  font-size: 13px;
  color: var(--bot-purple);
}
.innova-bot-settings label { display: grid; gap: 4px; margin: 0; font-weight: 600; font-size: 13px; }
.innova-bot-settings select { width: 100%; padding: 7px 8px; border: 1px solid #c5bddf; border-radius: 9px; background: #fff; font: inherit; font-weight: 400; color: var(--bot-text); }
.innova-bot-settings input[type="range"] { width: 100%; accent-color: var(--bot-accent); padding: 0; border: 0; }
.innova-bot-settings output { font-weight: 400; color: var(--bot-muted); }
.innova-bot-settings .innova-bot-check { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; }
.innova-bot-settings .innova-bot-check input { margin-top: 2px; accent-color: var(--bot-accent); width: 16px; height: 16px; }
.innova-bot-test { justify-self: start; border: 1px solid #c5bddf; background: #fff; color: var(--bot-purple); border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.innova-bot-test:hover { border-color: var(--bot-accent); }

.innova-bot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}
.innova-bot-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.innova-bot-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--bot-border); border-bottom-left-radius: 4px; }
.innova-bot-msg.user { align-self: flex-end; background: var(--bot-purple); color: #fff; border-bottom-right-radius: 4px; }
.innova-bot-msg a { color: var(--bot-accent); font-weight: 600; }
.innova-bot-msg ul, .innova-bot-msg ol { margin: 6px 0 0; padding-left: 20px; }
.innova-bot-msg li { margin: 3px 0; }
.innova-bot-msg code { background: var(--bot-soft); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.innova-bot-msg em { color: var(--bot-muted); }
.innova-bot-msg p { margin: 0 0 6px; color: inherit; line-height: 1.5; }
.innova-bot-msg p:last-of-type { margin-bottom: 0; }
.innova-bot-ai-note { display: block; margin-top: 8px; font-size: 11px; color: var(--bot-muted); }
.innova-bot-msg.is-ai { border-color: #d9cffa; }
/* Manos libres activo: el microfono se marca para que se note. */
.innova-bot.is-handsfree .innova-bot-mic { box-shadow: inset 0 0 0 2px var(--bot-accent); }

.innova-bot-msg.typing { display: flex; gap: 4px; padding: 14px; }
.innova-bot-msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: #b4a6d1; animation: innova-bot-dot 1s infinite ease-in-out; }
.innova-bot-msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.innova-bot-msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes innova-bot-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.innova-bot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
  background: #f8fafc;
}
.innova-bot-chips:empty { display: none; }
.innova-bot-chips button {
  border: 1px solid #c5bddf;
  background: #fff;
  color: var(--bot-purple);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
}
.innova-bot-chips button:hover { background: var(--bot-soft); border-color: var(--bot-accent); }

.innova-bot-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--bot-border);
  background: #fff;
}
.innova-bot-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
.innova-bot-form input:focus { outline: 2px solid var(--bot-accent); outline-offset: 1px; border-color: transparent; }
.innova-bot-form button {
  width: 42px;
  border: none;
  border-radius: 12px;
  background: var(--bot-purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.innova-bot-form button:hover { background: var(--bot-purple-light); }
.innova-bot-form .innova-bot-mic { background: var(--bot-soft); color: var(--bot-purple); }
.innova-bot-form .innova-bot-mic:hover { background: #e9e2ff; }
.innova-bot-form .innova-bot-mic.is-listening { background: #e11d48; color: #fff; animation: innova-bot-pulse 1.2s infinite; }
@keyframes innova-bot-pulse { 0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.45); } 70% { box-shadow: 0 0 0 10px rgba(225, 29, 72, 0); } 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); } }
.innova-bot button:focus-visible { outline: 3px solid var(--bot-accent); outline-offset: 2px; }

@media (max-width: 480px) {
  .innova-bot { right: 12px; bottom: 12px; left: 12px; }
  .innova-bot-panel { width: 100%; height: calc(100vh - 24px); }
}
@media (prefers-reduced-motion: reduce) {
  .innova-bot-msg.typing span { animation: none; }
  .innova-bot-toggle { transition: none; }
  .innova-bot-form .innova-bot-mic.is-listening { animation: none; }
}
