.js-highlight .uk-container { 
    margin-top:90px;
}
#system-message-container {
  position: absolute;
  margin:30px;
  z-index: 999;
  left: 50%;
  transform: translateX(-50%);
}
/* Contenedor del historial */
#chat-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Burbujas base */
.preguntas,
.respuesta {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px;
  overflow-wrap: anywhere;
  /*white-space: pre-wrap;*/
  
}

/* Usuario → derecha */
.preguntas {
  align-self: flex-end;
  background: #dddddd;
  color: #000;
}

/* Bot → izquierda */
.respuesta {
  align-self: flex-start;
  background: transparent;
  color: #333;
}

/* Loader del bot */
.respuesta.loading {
  opacity: .8;
  position: relative;
}
.respuesta.loading::after {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: 8px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.15);
  border-top-color: rgba(0,0,0,.5);
  animation: spin 0.9s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Tablas dentro de respuestas: estilo "burbuja" */
.respuesta table{
  border-collapse: collapse;
  margin: 6px 0;
  width: auto;              /* clave para que no ocupe 100% */
  max-width: 100%;
  background: #fff;
  overflow: hidden;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  display: inline-block;    /* mantiene la burbuja */
}
.respuesta thead th{
  background: #fafafa;
  font-weight: 600;
  border-bottom: 1px solid #e5e5e5;
}
.respuesta th, .respuesta td{
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
}
.respuesta tr:last-child td{ border-bottom: 0; }
.respuesta a{ color:#1e87f0; text-decoration: underline; }