.chat-input-area {
  display: flex;
  justify-content: center;
  padding: 1rem;
  background-color: white;
  border-top: 1px solid #e0e0e0;
  position: sticky;
  bottom: 0;
  z-index: 100;
  box-shadow: none !important;
  outline: none !important;
  border: none;
}

.chat-input-container {
  display: flex;
  background-color: white;
  border: 1px solid #d0d0d0;
  border-radius: 2.0rem; /* O incluso 0.5rem */
  padding: 0.25rem 0.5rem 0.25rem 1rem;
  width: 100%;

  align-items: center;
}


#mensaje {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  padding: 0.6rem 1rem;            /* Menos padding vertical */
  resize: none;
  background-color: white;
  color: var(--color-texto);
  min-height: 3em;      /* altura mínima de aprox. 3 líneas */
  max-height: 6em;      /* altura máxima, aprox. 3 líneas también */
  overflow-y: auto;     /* habilitar scroll interno */
  scrollbar-color: transparent transparent; /* Ocultar scrollbar en navegadores compatibles */

  transition: height 0.2s ease;    /* Transición suave al crecer */
  line-height: 1.4;                /* Altura de línea equilibrada */
  vertical-align: middle;   /* IMPORTANTE para centrar visualmente */

}

#mensaje::-webkit-scrollbar {
  width: 6px;
}

#mensaje::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.2);
  border-radius: 3px;
}



/* === BOTÓN DE ENVÍO === */


.button:hover {
  background-color: var(--color-btn-enviar-hover);
}


.svgIcon {
  width: 14px;
  height: 14px;
}

.svgIcon path {
  fill: white;
}

.send-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background-color: var(--color-btn-enviar);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 0.5rem;
  flex-shrink: 0;
}



.popover-confirmacion {
  background: white;
  border: 1px solid #d0d0d0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 9999;
}

.popover-confirmacion .acciones {
  display: flex;
  gap: 0.5rem;
}

.popover-confirmacion button {
  padding: 0.3rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.popover-confirmacion .confirmar {
  background-color: #F55135;
  color: white;
}

.popover-confirmacion .cancelar {
  background-color: #e0e0e0;
  color: #333;
}

/* Área del input */
.chat-input-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background-color: white;
  border-top: 1px solid #e0e0e0;
}

/* El bloque referencia ocupa todo el ancho disponible */
.chat-input-area > #referencia {
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.referencia-container {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background-color: #f7f7f8;
  border: 1px solid #d9d9e3;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.95rem;
  color: #333;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.5em * 3); /* Máximo 3 líneas de altura */
  min-height: 2.5rem; /* Mantiene altura mínima si hay poco texto */
}


.referencia-cerrar {
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  background: none !important;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #000 !important;
  padding: 0;
  line-height: 1;
  z-index: 2; /* 🔹 Asegura que quede arriba del texto */
}

/* Botón flotante al seleccionar texto */
.seleccion-referencia-btn {
  position: absolute;
  background-color: var(--color-principal);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.message-reference {
  font-size: 0.9rem;
  background: #f0f0f0;
  border-left: 3px solid var(--color-principal);
  padding: 0.3rem 0.6rem;
  margin-bottom: 0.5rem;
  white-space: pre-wrap;
  border-radius: 0.4rem;
}



/* BOTON ADJUNTAR */

.attach-button {
  width: 40px;                /* mismo ancho y alto que el botón enviar */
  height: 40px;
  border-radius: 50%;         /* lo hace redondo */
  border: none;
  background: transparent;    /* fondo transparente */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary-green); /* el verde corporativo */
  font-size: 18px;
  transition: background 0.2s, transform 0.1s;
}
.attach-button:hover { opacity: 0.8;transform: scale(1.05); }
.attach-button i {
  pointer-events: none; /* para que el click sea en todo el botón */
}
.chat-input-container {
  display: flex;
  align-items: center;  /* centra verticalmente textarea y botones */
  gap: 8px;             /* espacio uniforme entre clip, input y enviar */
}


.chat-input-container textarea {
  flex: 1;              /* ocupa todo el espacio restante */
  resize: none;
}

.files-preview {
  grid-column: 1 / span 3; /* que ocupe todo el ancho, arriba del textarea */
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: -4px; /* compactar */
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  background: #f2f2f2;
  border-radius: 12px;
  padding: 4px 8px;
}

.file-chip button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
/*END BOTON ADJUNTAR */