:root {
  color-scheme: light;
  --fondo: #f4f1ea;
  --papel: #fffdf8;
  --tinta: #1c1915;
  --suave: #5c564c;
  --linea: #e4ddd0;
  --acento: #0f6e56;
  --error: #8d2b2b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  background: var(--fondo);
  color: var(--tinta);
}

main {
  max-width: 42rem;
  margin: 0 auto;
  min-height: 100vh;
  padding: 1.5rem 1rem 2rem;
  display: flex;
  flex-direction: column;
}

h1 { font-size: 1.4rem; margin: 0 0 0.25rem; }
p.ayuda { color: var(--suave); margin-top: 0; }

form, .panel {
  background: var(--papel);
  border: 1px solid var(--linea);
  border-radius: 12px;
  padding: 1rem;
}

label { display: block; font-size: 0.85rem; margin-bottom: 0.75rem; }
input, textarea {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--linea);
  border-radius: 8px;
  font: inherit;
  background: white;
}

button {
  background: var(--acento);
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font: inherit;
  cursor: pointer;
}

button.secundario { background: transparent; color: var(--tinta); border: 1px solid var(--linea); }
button:disabled { opacity: 0.6; cursor: wait; }

.error { color: var(--error); font-size: 0.9rem; }

.cabecera { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.chat { display: flex; flex-direction: column; gap: 0.75rem; flex: 1; }
.mensajes { display: flex; flex-direction: column; gap: 0.6rem; min-height: 16rem; }
.burbuja { max-width: 90%; padding: 0.7rem 0.8rem; border-radius: 12px; white-space: pre-wrap; }
.usuario { align-self: flex-end; background: #e7f4ef; }
.asistente { align-self: flex-start; background: white; border: 1px solid var(--linea); }
.espera { color: var(--suave); font-size: 0.9rem; }
.envio { display: flex; gap: 0.5rem; align-items: flex-end; }
.envio textarea { resize: vertical; min-height: 3rem; }
