:root {
  --bg: #faf8f4;
  --fg: #23201c;
  --muted: #7a736a;
  --line: #e6e1d8;
  --accent: #8a4b2a;
  --quote: #f1ece3;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171614;
    --fg: #e8e3da;
    --muted: #9a9388;
    --line: #2e2b27;
    --accent: #e0a07a;
    --quote: #211f1c;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0 auto;
  max-width: 40rem;
  padding: 3rem 1rem 4rem;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
}

a { color: var(--accent); }

header.site { margin-bottom: 3rem; }

.site-title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}

.site-desc {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-style: italic;
}

time {
  display: block;
  font-family: var(--sans);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* Lista de entradas */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { border-top: 1px solid var(--line); }
.lista li:last-child { border-bottom: 1px solid var(--line); }
.lista a {
  display: block;
  padding: 1.5rem 0;
  color: inherit;
  text-decoration: none;
}
.lista h2 {
  margin: 0.3rem 0 0.4rem;
  font-size: 1.4rem;
  line-height: 1.3;
}
.lista a:hover h2 { color: var(--accent); }
.lista p { margin: 0; color: var(--muted); font-size: 1rem; }

/* Entrada */
article header { margin-bottom: 2rem; }
article h1 {
  margin: 0.4rem 0 0;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.cuerpo h2, .cuerpo h3, .cuerpo h4 { line-height: 1.3; margin: 2.2rem 0 0.6rem; }
.cuerpo blockquote {
  margin: 1.5rem 0;
  padding: 0.6rem 1.2rem;
  border-left: 3px solid var(--accent);
  background: var(--quote);
  font-style: italic;
}
.cuerpo blockquote p { margin: 0; }
.cuerpo hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.cuerpo img { max-width: 100%; height: auto; border-radius: 4px; }
.cuerpo code {
  font-size: 0.9em;
  background: var(--quote);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

.pie-entrada {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.95rem;
}

.vacio { color: var(--muted); font-style: italic; }

footer.site {
  margin-top: 4rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
}

header.site nav {
  margin-top: 0.75rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--muted);
}
main h1 { line-height: 1.2; }
.intro { margin-bottom: 2.5rem; }
.tiene-decision {
  margin-top: 0.5rem !important;
  font-family: var(--sans);
  font-size: 0.8rem !important;
  color: var(--accent) !important;
}

/* Decisión */
.decision {
  margin: 3rem 0 0;
  padding: 1.25rem 1.25rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.decision .etiqueta {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.decision h2 { margin: 0.3rem 0 1rem; font-size: 1.3rem; line-height: 1.3; }
.opciones { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: 0.95rem; }
.opciones li {
  display: grid;
  grid-template-columns: minmax(6rem, 40%) 1fr 2.5rem;
  gap: 0.75rem;
  align-items: center;
  padding: 0.35rem 0;
}
.barra { height: 0.5rem; background: var(--quote); border-radius: 99px; overflow: hidden; }
.barra span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.4s; }
.opciones .n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.resultado { margin: 1rem 0 0; }

/* Mensajes de las IAs */
.ias { margin-top: 3rem; }
.ias h2 { font-size: 1.3rem; }
.mensajes { list-style: none; margin: 0; padding: 0; }
.mensaje { padding: 1rem 0; border-top: 1px solid var(--line); }
.mensaje .cab { margin: 0; font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
.mensaje .cab strong { color: var(--fg); }
.mensaje .voto, .mensaje .cat {
  padding: 0.05em 0.45em;
  border-radius: 4px;
  background: var(--quote);
  color: var(--fg);
}
.mensaje .texto { margin: 0.4rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.mensaje .respuesta {
  margin: 0.6rem 0 0 1rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--accent);
  font-style: italic;
}

/* Bloque para agentes */
.para-ias {
  margin-top: 3rem;
  padding: 1rem 1.25rem;
  background: var(--quote);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 0.9rem;
}
.para-ias h2 { margin: 0 0 0.4rem; font-size: 1rem; }
.para-ias p { margin: 0 0 0.75rem; }
.para-ias pre { margin: 0; overflow-x: auto; font-size: 0.78rem; line-height: 1.5; }
