/* Humabot: estilos acotados a .humabot para no chocar con el tema de WordPress */
.humabot, .humabot * { box-sizing: border-box; }
.humabot {
  --hb-color: #a3123f;
  --hb-fondo: #f6f4f5; --hb-papel: #ffffff; --hb-texto: #1d1f2b; --hb-suave: #625d66; --hb-linea: #e3dde0; --hb-propio: #f8e9ef;
  display: flex; flex-direction: column; background: var(--hb-fondo); color: var(--hb-texto);
  border: 1px solid var(--hb-linea); border-radius: 10px; overflow: hidden;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; text-align: left;
}
.humabot-incrustado { height: 560px; max-height: 80vh; width: 100%; margin: 1em 0; }

.humabot-cabecera { display: flex; align-items: center; gap: 10px;
  background: var(--hb-color); color: #fff; padding: 10px 14px; }
.humabot-avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.humabot-nombre { flex: 1; min-width: 0; }
.humabot-titulo { display: block; font-size: 1.05em; font-weight: 600; line-height: 1.3; }
.humabot-subtitulo { display: block; font-size: .82em; opacity: .85; line-height: 1.3; }

.humabot-conv { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.humabot-msg { padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; min-width: 0; }
.humabot-fila { display: flex; align-items: flex-end; gap: 8px; align-self: flex-start; max-width: 92%; }
.humabot-fila > img { width: 28px; height: 28px; border-radius: 50%; flex: none; margin: 0; }
.humabot-bot { background: var(--hb-papel); border: 1px solid var(--hb-linea); border-bottom-left-radius: 4px; }
.humabot-yo { background: var(--hb-propio); align-self: flex-end; max-width: 85%; border-bottom-right-radius: 4px; }
.humabot-msg a { color: var(--hb-color); text-decoration: underline; }
.humabot-esperando { color: var(--hb-suave); font-style: italic; transition: opacity .25s; }

.humabot-form { display: flex; gap: 8px; margin: 0; padding: 10px 12px; border-top: 1px solid var(--hb-linea); background: var(--hb-papel); }
.humabot-form textarea { flex: 1; min-width: 0; resize: none; margin: 0; font: inherit; color: inherit; background: var(--hb-fondo);
  border: 1px solid var(--hb-linea); border-radius: 8px; padding: 9px 11px; max-height: 120px; box-shadow: none; }
.humabot-form textarea:focus { outline: 2px solid var(--hb-color); outline-offset: -1px; }
.humabot-form button, .humabot-cerrar, .humabot-burbuja { font: inherit; cursor: pointer; border: 0; margin: 0; text-transform: none; letter-spacing: normal; }
.humabot-form button { background: var(--hb-color); color: #fff; font-weight: 600; border-radius: 8px; padding: 0 16px; }
.humabot-form button:disabled { opacity: .5; cursor: default; }
.humabot-aviso { margin: 0; padding: 0 12px 10px; background: var(--hb-papel); font-size: .74em; line-height: 1.4; color: var(--hb-suave); }
.humabot-creditos { margin: 0; padding: 0 12px 8px; background: var(--hb-papel); font-size: .7em; line-height: 1.4; color: var(--hb-suave); }
.humabot-creditos a { color: inherit; text-decoration: underline; }
.humabot-form + .humabot-creditos { padding-top: 2px; }

/* Burbuja flotante */
.humabot-flotante { --hb-abajo: 20px; --hb-derecha: 20px; }
.humabot-burbuja { position: fixed !important; right: var(--hb-derecha, 20px); bottom: var(--hb-abajo, 20px); z-index: 99998; width: 64px; height: 64px; border-radius: 50%;
  background: var(--hb-color, #a3123f); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25); overflow: hidden; }
.humabot-burbuja img { width: 100%; height: 100%; display: block; border-radius: 50%; margin: 0; }
.humabot-burbuja:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.humabot-panel { position: fixed !important; right: var(--hb-derecha, 20px); bottom: calc(var(--hb-abajo, 20px) + 76px); z-index: 99999; width: 380px; height: 560px; max-height: calc(100vh - 110px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25); display: none; }
.humabot-panel.humabot-abierto { display: flex; }
.humabot-cerrar { background: transparent; color: #fff; font-size: 26px; line-height: 1; padding: 0 4px; }

@media (max-width: 600px) {
  .humabot-panel { right: 0; bottom: 0; width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .humabot-burbuja { right: 16px; bottom: 16px; }
}
