:root {
  --papel: #faf6ef;
  --tinta: #2b2620;
  --tinta-suave: #6b625a;
  --linea: #e2d9cc;
  --tarjeta: #ffffff;
  --ok: #3b7a4a;
  --error: #a53a2e;
  font-size: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.5;
}
.cabecera {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 3px solid var(--acento);
  background: var(--tarjeta);
}
.marca-nombre { font-size: 1.4rem; font-weight: bold; letter-spacing: .02em; }
.marca-sub { color: var(--tinta-suave); font-size: .9rem; }
.quien { display: flex; align-items: center; gap: .75rem; font-size: .95rem; }
.enlace { background: none; border: none; color: var(--acento); font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
.contenido { max-width: 46rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.tarjeta {
  background: var(--tarjeta);
  border: 1px solid var(--linea);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
h1 { margin: 0 0 .5rem; font-size: 1.7rem; }
h2 { font-size: 1.2rem; color: var(--tinta-suave); margin: 2rem 0 1rem; text-transform: uppercase; letter-spacing: .08em; }
h3 { margin: 0; font-size: 1.2rem; }
label { display: block; margin: 1rem 0; font-weight: bold; }
input, textarea {
  display: block; width: 100%; margin-top: .35rem;
  font: inherit; font-size: 1.05rem;
  padding: .7rem .8rem;
  border: 1px solid #c9bfb1; border-radius: 8px;
  background: #fffdf9; color: var(--tinta);
}
textarea { min-height: 6.5rem; resize: vertical; font-family: inherit; }
input:focus, textarea:focus { outline: 2px solid var(--acento); outline-offset: 1px; }
.boton {
  font: inherit; font-size: 1rem; font-weight: bold;
  padding: .7rem 1.2rem; border-radius: 8px; border: 2px solid var(--acento);
  cursor: pointer; min-height: 2.9rem;
}
.boton.principal { background: var(--acento); color: #fff; }
.boton.secundario { background: transparent; color: var(--acento); }
.boton:disabled { opacity: .5; cursor: default; }
.error { color: var(--error); font-weight: bold; }
.progreso { color: var(--tinta-suave); margin: 0 0 1rem; font-size: 1.05rem; }
.pregunta-cab { display: flex; gap: .75rem; align-items: baseline; margin-bottom: .5rem; }
.pregunta-id { font-family: ui-monospace, Menlo, monospace; font-size: .75rem; color: var(--tinta-suave); border: 1px solid var(--linea); border-radius: 4px; padding: .05rem .35rem; white-space: nowrap; }
.pregunta-texto { margin: 0 0 .75rem; font-size: 1.08rem; }
.contexto { margin-bottom: .75rem; color: var(--tinta-suave); font-size: .95rem; }
.contexto summary { cursor: pointer; color: var(--acento); }
.contexto p { margin: .5rem 0 0; }
.acciones { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .6rem; }
.estado { font-size: .9rem; color: var(--tinta-suave); }
.estado.ok { color: var(--ok); }
.estado.error { color: var(--error); }
.pregunta.contestada { border-left: 5px solid var(--ok); }
.pregunta.nolose { border-left: 5px solid #b9a98f; }
.pie { color: var(--tinta-suave); font-size: .9rem; margin-top: 2rem; text-align: center; }
.todas .una { border-top: 1px dashed var(--linea); padding: .6rem 0; }
.todas .una .de { font-weight: bold; }
.todas .una .cuando { color: var(--tinta-suave); font-size: .85rem; margin-left: .5rem; }
.todas .una .texto { white-space: pre-wrap; margin: .25rem 0 0; }
.todas .nadie { color: var(--tinta-suave); font-style: italic; }
@media (max-width: 480px) {
  :root { font-size: 17px; }
  .cabecera { flex-direction: column; align-items: flex-start; }
  .tarjeta { padding: 1rem; border-radius: 8px; }
  .boton { width: 100%; }
}
/* pestañas y aportaciones */
.pestanas { display: flex; gap: .5rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--linea); }
.pestana { padding: .6rem .9rem; color: var(--tinta-suave); text-decoration: none; border-bottom: 3px solid transparent; font-weight: bold; }
.pestana.activa { color: var(--acento); border-bottom-color: var(--acento); }
.etiqueta-notas { font-weight: normal; color: var(--tinta-suave); margin: .6rem 0 0; font-size: .95rem; }
.etiqueta-notas textarea { min-height: 3.2rem; }
.todas .una .notas { color: var(--tinta-suave); white-space: pre-wrap; margin: .25rem 0 0; font-size: .95rem; }
.ayuda { color: var(--tinta-suave); font-size: .95rem; }
input[type=file] { padding: .5rem; background: transparent; border-style: dashed; }
.previa { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.previa-item { font-size: .85rem; background: var(--papel); border: 1px solid var(--linea); border-radius: 6px; padding: .15rem .5rem; }
.previa-item.error { color: var(--error); border-color: var(--error); }
.aporte-cab { display: flex; gap: .75rem; align-items: baseline; margin-bottom: .4rem; }
.aporte-cab .de { font-weight: bold; }
.aporte-cab .cuando { color: var(--tinta-suave); font-size: .85rem; }
.aporte .texto { white-space: pre-wrap; margin: 0 0 .6rem; }
.adjuntos { display: flex; flex-wrap: wrap; gap: .6rem; }
.adjunto { display: flex; flex-direction: column; gap: .2rem; max-width: 12rem; color: var(--acento); text-decoration: none; font-size: .85rem; }
.adjunto img { width: 12rem; height: 9rem; object-fit: cover; border-radius: 6px; border: 1px solid var(--linea); }
.adjunto-nombre { word-break: break-all; }
/* árbol, historias, fotos, informes, novedades, anuncios */
.pestanas { flex-wrap: wrap; }
.chip { display: inline-block; font-size: .72rem; font-family: ui-sans-serif, system-ui, sans-serif; text-transform: uppercase; letter-spacing: .04em; padding: .05rem .45rem; border-radius: 999px; vertical-align: middle; border: 1px solid transparent; }
.chip.AXIOMA { background: #e8f0e9; color: #2f5d3b; border-color: #b7cdbb; }
.chip.PRUEBA { background: #e7eef7; color: #2b4f7c; border-color: #b7c9e2; }
.chip.INDICIO { background: #faf0dc; color: #7a5a12; border-color: #e5d2a3; }
.chip.SIN-NIVEL { background: #eee; color: #666; border-color: #ddd; }
.h2-en-tarjeta { margin: 0 0 .75rem; text-transform: none; letter-spacing: 0; color: var(--tinta); font-size: 1.35rem; }
.pedigri { display: flex; gap: .6rem; overflow-x: auto; padding: .25rem 0 1rem; align-items: stretch; }
.gen { display: flex; flex-direction: column; justify-content: space-around; gap: .4rem; min-width: 11rem; flex: 1; }
.gen-titulo { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--tinta-suave); text-align: center; min-height: 1rem; }
.persona { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 8px; padding: .5rem .6rem; cursor: pointer; font-size: .9rem; }
.persona:hover, .persona:focus { outline: 2px solid var(--acento); outline-offset: 1px; }
.persona.actual { border-color: var(--acento); border-width: 2px; }
.persona.vacia { color: var(--tinta-suave); font-style: italic; cursor: default; border-style: dashed; background: transparent; }
.persona .nombre { font-weight: bold; }
.persona .dato { color: var(--tinta-suave); font-size: .82rem; }
.ficha dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 .75rem; }
.ficha dt { color: var(--tinta-suave); font-size: .9rem; }
.ficha dd { margin: 0; }
.enlace-persona { color: var(--acento); }
.lista-personas { max-height: 24rem; overflow-y: auto; margin-top: .5rem; }
.fila-persona { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-top: 1px dashed var(--linea); font-size: .95rem; }
.fila-persona.actual { font-weight: bold; }
.fila-persona .cuando { color: var(--tinta-suave); font-size: .85rem; text-align: right; }
.historia-cab { display: flex; gap: .6rem; align-items: center; margin-bottom: .4rem; }
.historia-cab .cuando, .novedad .cuando, .anuncio .cuando { color: var(--tinta-suave); font-size: .85rem; }
.historia .texto, .novedad .texto { white-space: pre-wrap; margin: .5rem 0; }
.historia .quienes { font-size: .9rem; color: var(--tinta-suave); margin: .25rem 0; }
.historia .rotulo { font-size: .85rem; color: var(--tinta-suave); font-style: italic; margin: .25rem 0 0; }
.historia.INDICIO { border-left: 5px solid #e5d2a3; }
.historia.PRUEBA, .historia.AXIOMA { border-left: 5px solid #b7c9e2; }
.rejilla-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.foto { margin: 0; background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 10px; overflow: hidden; }
.foto img { width: 100%; height: 12rem; object-fit: cover; display: block; }
.foto figcaption { padding: .6rem .75rem; font-size: .9rem; }
.pie-foto { font-weight: bold; }
.informe { display: flex; flex-direction: column; gap: .2rem; padding: .8rem 0; border-top: 1px dashed var(--linea); text-decoration: none; color: var(--acento); }
.informe-titulo { font-weight: bold; font-size: 1.05rem; }
.informe .cuando { color: var(--tinta-suave); font-size: .85rem; }
.casilla { display: flex; gap: .6rem; align-items: flex-start; font-weight: normal; }
.casilla input { width: auto; margin: .3rem 0 0; }
.grupo-anuncios > summary { cursor: pointer; font-weight: bold; margin: 1rem 0 .5rem; color: var(--tinta-suave); }
.anuncio input, .anuncio textarea { margin-top: .5rem; }
.anuncio.aprobado { border-left: 5px solid var(--ok); }
.anuncio.descartado { opacity: .7; }
.anuncio.publicado { border-left: 5px solid #b7c9e2; }
