#qaw-echo-root,
#qaw-echo-root * { box-sizing: border-box; }

#qaw-echo-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147483000;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #102a43;
}

/* ---------- Launcher ---------- */
#qaw-echo-root .qaw-launcher {
  appearance: none;
  border: 0;
  min-height: 50px;
  max-width: min(320px, calc(100vw - 32px));
  padding: 0 18px;
  border-radius: 999px;
  background: #0878c9;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 12px 30px rgba(8, 120, 201, .24);
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  transition: transform .15s ease, background .15s ease;
}
#qaw-echo-root .qaw-launcher:hover { transform: translateY(-1px); background: #0563a8; }
#qaw-echo-root.qaw-open .qaw-launcher { display: none !important; }

/* ---------- Panel ---------- */
#qaw-echo-root .qaw-panel {
  width: min(420px, calc(100vw - 40px));
  height: min(640px, calc(100vh - 72px));
  min-height: 440px;
  background: #f7fcff;
  border: 1px solid rgba(8, 120, 201, .16);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(9, 55, 92, .20);
  display: none;
  flex-direction: column;
}
#qaw-echo-root.qaw-open .qaw-panel { display: flex; }

/* ---------- Header ---------- */
#qaw-echo-root .qaw-header {
  flex: 0 0 auto;
  min-height: 72px;
  padding: 14px 14px 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #dcecf6;
  background: #ffffff;
}
#qaw-echo-root .qaw-brand { min-width: 0; }
#qaw-echo-root .qaw-pill {
  display: inline-block;
  margin-bottom: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e8f6fd;
  color: #0878c9;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}
#qaw-echo-root .qaw-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 750;
  color: #12304a;
}
#qaw-echo-root .qaw-subtitle {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.3;
  color: #667f92;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#qaw-echo-root .qaw-close {
  appearance: none;
  width: 36px;
  height: 36px;
  border: 1px solid #cfe3ef;
  border-radius: 12px;
  background: #ffffff;
  color: #24465f;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
  flex: 0 0 auto;
}
#qaw-echo-root .qaw-close:hover { background: #eff8fd; }

/* ---------- Body ---------- */
#qaw-echo-root .qaw-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 18px 10px;
  background: #f7fcff;
  scroll-behavior: smooth;
}

/* ---------- Primera pantalla (intro + menú de opciones) ---------- */
/* El menú usa SIEMPRE azul de Quantum: texto azul, borde azul delgado,
   fondo claro. Nada de verde. Sólo se muestra en home/contacto/esencia. */
#qaw-echo-root .qaw-intro { display: none; }
#qaw-echo-root.qaw-intro-visible .qaw-intro { display: block; }
#qaw-echo-root .qaw-intro-text {
  margin: 6px 2px 18px;
  font-size: 15.5px;
  line-height: 1.55;
  color: #29475d;
  font-weight: 500;
}
#qaw-echo-root .qaw-chips {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 6px;
}
#qaw-echo-root .qaw-chip {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid #9ccbe6;
  background: #ffffff;
  color: #0878c9;
  border-radius: 14px;
  padding: 13px 15px;
  font-size: 13.5px;
  line-height: 1.3;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
#qaw-echo-root .qaw-chip:hover {
  background: #edf8fe;
  border-color: #0878c9;
  transform: translateY(-1px);
}
#qaw-echo-root .qaw-chip:disabled { opacity: .55; cursor: default; transform: none; }
#qaw-echo-root .qaw-intro-note {
  margin: 14px 2px 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: #71899a;
}

/* ---------- Mensajes ---------- */
#qaw-echo-root .qaw-message-row { display: flex; margin: 0 0 10px; }
#qaw-echo-root .qaw-message-row.qaw-user { justify-content: flex-end; }
#qaw-echo-root .qaw-message-row.qaw-assistant,
#qaw-echo-root .qaw-message-row.qaw-system { justify-content: flex-start; }
#qaw-echo-root .qaw-bubble {
  max-width: 84%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#qaw-echo-root .qaw-user .qaw-bubble {
  background: #0878c9;
  color: #ffffff;
  border-bottom-right-radius: 5px;
}
#qaw-echo-root .qaw-assistant .qaw-bubble {
  background: #ffffff;
  color: #213d52;
  border: 1px solid #d9e9f2;
  border-bottom-left-radius: 5px;
}
#qaw-echo-root .qaw-system .qaw-bubble {
  background: #fff7e8;
  color: #6f5118;
  border: 1px solid #f0ddb3;
  font-size: 13px;
}

/* ---------- Acciones sugeridas ---------- */
#qaw-echo-root .qaw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 12px;
}
#qaw-echo-root .qaw-action {
  appearance: none;
  border: 1px solid #9ccbe6;
  background: #ffffff;
  color: #0563a8;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
}
#qaw-echo-root .qaw-action:hover { background: #edf8fe; border-color: #0878c9; }
#qaw-echo-root .qaw-action:disabled { opacity: .55; cursor: default; }

/* ---------- Typing ---------- */
#qaw-echo-root .qaw-typing {
  display: none;
  margin: 2px 0 10px;
  font-size: 12px;
  color: #71899a;
}
#qaw-echo-root.qaw-busy .qaw-typing { display: block; }

/* ---------- Composer ---------- */
#qaw-echo-root .qaw-composer {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 12px 14px 14px;
  border-top: 1px solid #dcecf6;
  background: #ffffff;
}
#qaw-echo-root .qaw-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  max-height: 110px;
  resize: none;
  padding: 11px 13px;
  border: 1px solid #bdd9e8;
  border-radius: 13px;
  outline: none;
  background: #ffffff;
  color: #16364d;
  font: inherit;
  font-size: 14px;
  line-height: 20px;
}
#qaw-echo-root .qaw-input:focus { border-color: #20a4df; box-shadow: 0 0 0 3px rgba(32, 164, 223, .16); }
#qaw-echo-root .qaw-send {
  appearance: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 13px;
  background: #0878c9;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  flex: 0 0 auto;
  transition: background .15s ease;
}
#qaw-echo-root .qaw-send:hover { background: #0563a8; }
#qaw-echo-root .qaw-send:disabled { opacity: .5; cursor: default; }

/* ---------- Móvil ---------- */
@media (max-width: 720px) {
  #qaw-echo-root { right: 12px; bottom: 12px; left: 12px; }
  #qaw-echo-root .qaw-launcher { margin-left: auto; }
  #qaw-echo-root .qaw-panel {
    width: 100%;
    height: min(78vh, 660px);
    max-height: calc(100vh - 24px);
    min-height: 420px;
    border-radius: 20px;
  }
  #qaw-echo-root .qaw-body { padding: 16px 14px 6px; }
  #qaw-echo-root .qaw-bubble { max-width: 88%; }
  #qaw-echo-root .qaw-intro-text { font-size: 15px; }
}

@media (max-height: 600px) and (min-width: 721px) {
  #qaw-echo-root .qaw-panel { height: calc(100vh - 36px); }
  #qaw-echo-root { bottom: 18px; }
}

.qaw-link{color:#0878c9;text-decoration:underline;word-break:break-all}
.qaw-message-row.qaw-user .qaw-link{color:#ffffff}


/* ---------- Expansión proactiva ---------- */
@keyframes qaw-gentle-expand {
  from { transform: scale(.72) translateY(14px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
#qaw-echo-root.qaw-proactive .qaw-panel {
  transform-origin: bottom right;
  animation: qaw-gentle-expand .62s cubic-bezier(.22, 1, .36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  #qaw-echo-root.qaw-proactive .qaw-panel { animation: none; }
}
