/* TTV, la app.
   Idea: una mesa de cotejo que se lee como un libro. El texto ocupa una
   columna limpia, sin marcas (el versículo se lee siempre limpio); todo lo
   demás —el original, la evidencia, las otras versiones— se abre aparte, en
   hojas que suben desde abajo. Lapislázuli para lo que se toca, ocre para lo
   que agrega el traductor, verde óxido para lo que difiere entre copias.
   Nada se distingue sólo por el color. */

:root {
  --papel: #f5f7fa;
  --hoja: #ffffff;
  --tinta: #18202c;
  --tenue: #566173;
  --filete: #dbe0e7;
  --lapis: #27499a;
  --lapis-suave: #e7ecf8;
  --sobre-lapis: #ffffff;
  --ocre: #8a5a10;
  --verdin: #0c6b61;
  --aviso-fondo: #fff4d6;
  --aviso-tinta: #634400;
  --mar: #dfe8f2;
  --tierra: #f3f1ea;
  --costa: #a9b4c2;
  --rio: #7aa2cf;
  --res-amarillo: #fde68a;
  --res-verde: #bbf7d0;
  --res-celeste: #bae6fd;
  --res-rosa: #fbcfe8;
  --res-violeta: #ddd6fe;
  --sombra: 0 -8px 40px rgb(16 24 40 / 0.16);

  --letra-texto: "Literata", Georgia, "Times New Roman", serif;
  --letra-hebreo: "Noto Serif Hebrew", "SBL Hebrew", "Ezra SIL", "Times New Roman", serif;
  --letra-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --letra-legible: "Atkinson Hyperlegible", "IBM Plex Sans", system-ui, sans-serif;

  --escala: 1;
  --interlineado: 1.75;
  --texto: calc(1.18rem * var(--escala));
  --chico: 0.875rem;
  --mini: 0.78rem;
  --columna: 40rem;
  --alto-pestanas: 3.75rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papel: #0f1318; --hoja: #171c23; --tinta: #e4e8ef; --tenue: #9ba5b5; --filete: #2a313c;
    --lapis: #93aef4; --lapis-suave: #1c2539; --sobre-lapis: #0f1318; --ocre: #e1b665; --verdin: #62cdbf;
    --aviso-fondo: #2a2312; --aviso-tinta: #f0d18c; --mar: #13202e; --tierra: #1f252d; --costa: #3b4655; --rio: #3f6d9c;
    --res-amarillo: #5c4a0b; --res-verde: #134a2c; --res-celeste: #0d3d57; --res-rosa: #5a1d3d; --res-violeta: #3b2f6b;
    --sombra: 0 -8px 40px rgb(0 0 0 / 0.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --papel: #0f1318; --hoja: #171c23; --tinta: #e4e8ef; --tenue: #9ba5b5; --filete: #2a313c;
  --lapis: #93aef4; --lapis-suave: #1c2539; --sobre-lapis: #0f1318; --ocre: #e1b665; --verdin: #62cdbf;
  --aviso-fondo: #2a2312; --aviso-tinta: #f0d18c; --mar: #13202e; --tierra: #1f252d; --costa: #3b4655; --rio: #3f6d9c;
  --res-amarillo: #5c4a0b; --res-verde: #134a2c; --res-celeste: #0d3d57; --res-rosa: #5a1d3d; --res-violeta: #3b2f6b;
  --sombra: 0 -8px 40px rgb(0 0 0 / 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--letra-ui);
  font-size: 1rem;
  line-height: 1.5;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--hoja);
}
.legible { --letra-texto: var(--letra-legible); --letra-ui: var(--letra-legible); }
a { color: var(--lapis); text-underline-offset: 0.18em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--lapis); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { text-wrap: balance; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.saltar { position: absolute; left: max(16px, env(safe-area-inset-left, 0px)); top: -4rem; z-index: 30; background: var(--lapis); color: var(--sobre-lapis); padding: 0.5rem 0.9rem; border-radius: 6px; }
.saltar:focus { top: calc(env(safe-area-inset-top, 0px) + 0.5rem); }
.enlace-boton { background: none; border: 0; color: var(--lapis); font-weight: 500; cursor: pointer; padding: 0.5rem 0.25rem; min-height: 2.75rem; }
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 2.75rem; padding: 0.5rem 1rem; border-radius: 999px; border: 1px solid var(--filete); background: var(--hoja); cursor: pointer; text-decoration: none; color: var(--tinta); font-weight: 500; }
.boton.primario { background: var(--lapis); color: var(--sobre-lapis); border-color: var(--lapis); }
.boton-icono { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; background: none; border-radius: 999px; cursor: pointer; color: var(--tinta); }
.boton-icono svg { width: 1.4rem; height: 1.4rem; }
.boton-icono:hover, .boton-icono[aria-pressed="true"] { background: var(--lapis-suave); color: var(--lapis); }

/* ------------------------------------------------------------- barra --- */

.barra { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--hoja); border-bottom: 1px solid var(--filete); }
.barra-dentro {
  display: flex; align-items: center; gap: 0.5rem;
  max-width: 64rem; margin: 0 auto;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  padding-block: 0.4rem;
  min-height: 3.25rem;
}
.marca { font-family: var(--letra-texto); font-weight: 600; font-size: 1.25rem; letter-spacing: 0.05em; color: var(--tinta); text-decoration: none; padding: 0.25rem 0.4rem; }
.barra-lectura { display: flex; gap: 0.4rem; min-width: 0; flex: 1 1 auto; }
.barra-acciones { display: flex; gap: 0.1rem; margin-left: auto; }
.pastilla { display: inline-flex; align-items: center; gap: 0.3rem; min-height: 2.5rem; padding: 0.3rem 0.8rem; border-radius: 999px; border: 1px solid var(--filete); background: var(--papel); cursor: pointer; font-weight: 500; white-space: nowrap; min-width: 0; }
.pastilla span:first-child { overflow: hidden; text-overflow: ellipsis; }
.flecha { color: var(--tenue); font-size: 0.8em; }
@media (max-width: 440px) {
  .barra.leyendo .marca { display: none; }
  .barra-dentro { gap: 0.3rem; }
  .pastilla { padding: 0.3rem 0.55rem; font-size: 0.95rem; }
  .barra-acciones .boton-icono { width: 2.4rem; }
}

/* ------------------------------------------------------------- vistas --- */

main {
  max-width: 64rem;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 1.25rem calc(var(--alto-pestanas) + env(safe-area-inset-bottom, 0px) + var(--extra-abajo, 0px) + 2rem);
  outline: none;
}
.cargando, .fallo { color: var(--tenue); }
.columna { max-width: var(--columna); margin: 0 auto; }
.seccion-titulo { font-family: var(--letra-texto); font-weight: 600; font-size: 1.6rem; margin: 0.5rem 0 1rem; }
.rotulo { font-size: var(--mini); text-transform: uppercase; letter-spacing: 0.09em; color: var(--tenue); font-weight: 500; margin: 0; }

/* Inicio */
.inicio { display: grid; gap: 1.25rem; max-width: var(--columna); margin: 0 auto; }
.tarjeta { background: var(--hoja); border: 1px solid var(--filete); border-radius: 14px; padding: 1.1rem 1.15rem; display: grid; gap: 0.7rem; min-width: 0; }
.tarjeta h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.tarjeta p { margin: 0; }
.del-dia { background: var(--lapis); color: var(--sobre-lapis); border-color: var(--lapis); }
.del-dia .rotulo { color: inherit; opacity: 0.85; }
.del-dia blockquote { margin: 0; font-family: var(--letra-texto); font-size: calc(1.3rem * var(--escala)); line-height: 1.5; }
.del-dia cite { font-style: normal; font-weight: 600; }
.del-dia .boton { background: transparent; color: inherit; border-color: currentColor; }
.fila-botones { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.progreso { width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--lapis-suave); overflow: hidden; accent-color: var(--lapis); }
.progreso::-webkit-progress-bar { background: var(--lapis-suave); border-radius: 999px; }
.progreso::-webkit-progress-value { background: var(--lapis); border-radius: 999px; }
.progreso::-moz-progress-bar { background: var(--lapis); border-radius: 999px; }
a.tarjeta { color: inherit; text-decoration: none; }
a.tarjeta h2 { color: var(--lapis); }
.borrador { background: var(--aviso-fondo); color: var(--aviso-tinta); border-radius: 12px; padding: 0.85rem 1rem; display: grid; gap: 0.35rem; }
.borrador p { margin: 0; }

/* Lectura */
.capitulo { max-width: var(--columna); margin: 0 auto; }
.capitulo.ancho { max-width: 64rem; }
.cap-cabeza { display: grid; gap: 0.35rem; margin-bottom: 1.25rem; }
.cap-titulo { font-family: var(--letra-texto); font-weight: 600; font-size: clamp(1.8rem, 1.4rem + 2vw, 2.4rem); line-height: 1.15; margin: 0; }
.version-nota { margin: 0; font-size: var(--chico); color: var(--tenue); }
.version-nota.no-ttv { color: var(--aviso-tinta); background: var(--aviso-fondo); padding: 0.5rem 0.75rem; border-radius: 10px; }
.texto { font-family: var(--letra-texto); font-size: var(--texto); line-height: var(--interlineado); }
.texto p { margin: 0 0 1em; }
.texto p.poesia { padding-left: 1.5em; text-indent: -1em; margin-bottom: 0.35em; }
.texto p.poesia.fin { margin-bottom: 1em; }
.v { border-radius: 3px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.v[data-color="amarillo"] { background: var(--res-amarillo); }
.v[data-color="verde"] { background: var(--res-verde); }
.v[data-color="celeste"] { background: var(--res-celeste); }
.v[data-color="rosa"] { background: var(--res-rosa); }
.v[data-color="violeta"] { background: var(--res-violeta); }
.v.elegido { text-decoration: underline dotted var(--lapis) 2px; text-underline-offset: 0.3em; }
.v.leyendo { box-shadow: 0 0 0 2px var(--lapis); background: var(--lapis-suave); }
.vn { font-family: var(--letra-ui); font-size: 0.62em; font-weight: 600; color: var(--lapis); vertical-align: super; line-height: 0; background: none; border: 0; padding: 0 0.2em 0 0.1em; cursor: pointer; }
.sin-numeros .vn { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.marca-v { font-size: 0.6em; vertical-align: super; color: var(--ocre); margin-right: 0.15em; }
.agregado { color: var(--ocre); }
.sin-agregado .agregado { display: none; }
.pasar-capitulo { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; }

/* Paralelo */
.fila-paralela { display: grid; gap: 0.25rem 2rem; padding-block: 0.6rem; border-bottom: 1px solid var(--filete); scroll-margin-top: 6rem; }
@media (min-width: 720px) { .fila-paralela { grid-template-columns: 1fr 1fr; } }
.fila-paralela .col { min-width: 0; }
.fila-paralela .col p { margin: 0; font-family: var(--letra-texto); font-size: var(--texto); line-height: 1.6; }
.fila-paralela .col .rotulo { display: none; }
@media (max-width: 719px) { .fila-paralela .col .rotulo { display: block; } }
.cabeza-paralela { display: none; }
@media (min-width: 720px) { .cabeza-paralela { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 3.3rem); background: var(--papel); padding-block: 0.5rem; z-index: 1; } }

/* Estudio */
.estudio-v { display: grid; gap: 0.5rem; padding-block: 1.1rem; border-bottom: 1px solid var(--filete); scroll-margin-top: 6rem; }
.estudio-cabeza { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.estudio-num { margin: 0; font-size: var(--chico); font-weight: 600; }
.estudio-num a { color: var(--lapis); text-decoration: none; }
.estudio-num .otra { font-weight: 400; color: var(--tenue); margin-left: 0.4rem; font-size: var(--mini); }
.original { margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 0.55rem; }
.pal { display: inline-grid; justify-items: center; gap: 0.05rem; padding: 0.2rem 0.3rem; border: 0; border-radius: 8px; background: none; cursor: pointer; color: inherit; }
.pal:hover { background: var(--lapis-suave); }
.pal .f { font-size: calc(1.5rem * var(--escala)); line-height: 1.5; }
.pal .f[lang="he"] { font-family: var(--letra-hebreo); }
.pal .f[lang="grc"] { font-family: var(--letra-texto); font-size: calc(1.25rem * var(--escala)); }
.pal .t, .pal .g { font-size: var(--mini); line-height: 1.2; color: var(--tenue); max-width: 8rem; text-align: center; }
.pal .t { font-style: italic; }
.pal.con-error .f { text-decoration: underline wavy var(--ocre); text-underline-offset: 0.35em; }
.pal.var .f { color: var(--verdin); }
.sin-transliteracion .pal .t, .sin-glosa .pal .g { display: none; }
.sigla { color: var(--verdin); font-size: 0.8rem; align-self: flex-start; }
.estudio-trad { display: grid; gap: 0.5rem 2rem; }
@media (min-width: 720px) { .estudio-trad.dos { grid-template-columns: 1fr 1fr; } }
.estudio-trad p { margin: 0; font-family: var(--letra-texto); font-size: var(--texto); line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip { display: inline-flex; align-items: center; gap: 0.3rem; font-size: var(--mini); border: 1px solid var(--filete); border-radius: 999px; padding: 0.25rem 0.65rem; background: var(--hoja); color: var(--tinta); cursor: pointer; min-height: 2rem; }
.chip.copias { border-color: var(--verdin); color: var(--verdin); }
.chip.decision { border-color: var(--ocre); color: var(--ocre); }

/* Listas y búsqueda */
.campo { width: 100%; font: inherit; font-size: 1.05rem; padding: 0.75rem 1rem; border: 1px solid var(--filete); border-radius: 12px; background: var(--hoja); color: var(--tinta); }
.filtros { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0 1rem; }
.filtro { border: 1px solid var(--filete); background: var(--hoja); border-radius: 999px; padding: 0.35rem 0.8rem; cursor: pointer; min-height: 2.25rem; font-size: var(--chico); }
.filtro[aria-pressed="true"] { background: var(--lapis); color: var(--sobre-lapis); border-color: var(--lapis); }
.resultados { list-style: none; margin: 0; padding: 0; display: grid; }
.resultados li > a, .resultados li > button { display: grid; gap: 0.2rem; padding: 0.75rem 0.25rem; border: 0; border-bottom: 1px solid var(--filete); text-decoration: none; color: inherit; background: none; width: 100%; text-align: left; cursor: pointer; }
.resultados .ref { font-weight: 600; color: var(--lapis); font-size: var(--chico); }
.resultados .cita { font-family: var(--letra-texto); }
.resultados mark { background: var(--res-amarillo); color: inherit; border-radius: 2px; }
.vacio { color: var(--tenue); }
.segmentos { display: inline-flex; border: 1px solid var(--filete); border-radius: 999px; padding: 0.2rem; gap: 0.2rem; background: var(--hoja); margin-bottom: 1rem; flex-wrap: wrap; }
.segmentos button { border: 0; background: none; border-radius: 999px; padding: 0.45rem 0.9rem; cursor: pointer; min-height: 2.5rem; }
.segmentos button[aria-pressed="true"] { background: var(--lapis); color: var(--sobre-lapis); }
.punto-color { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; vertical-align: middle; margin-right: 0.35rem; border: 1px solid var(--filete); }
.punto-color[data-color="amarillo"] { background: var(--res-amarillo); }
.punto-color[data-color="verde"] { background: var(--res-verde); }
.punto-color[data-color="celeste"] { background: var(--res-celeste); }
.punto-color[data-color="rosa"] { background: var(--res-rosa); }
.punto-color[data-color="violeta"] { background: var(--res-violeta); }
.menu { list-style: none; margin: 0 0 1.5rem; padding: 0; background: var(--hoja); border: 1px solid var(--filete); border-radius: 14px; overflow: hidden; }
.menu li + li { border-top: 1px solid var(--filete); }
.menu a, .menu button { display: flex; justify-content: space-between; align-items: center; gap: 1rem; width: 100%; padding: 0.95rem 1rem; text-decoration: none; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; min-height: 3rem; }
.menu .detalle { color: var(--tenue); font-size: var(--chico); text-align: right; }
.prosa { max-width: var(--columna); margin: 0 auto; display: grid; gap: 1rem; }
.prosa > *, .inicio > *, .columna > * { min-width: 0; }
.prosa, #hoja-cuerpo, .resultados { overflow-wrap: break-word; }
.prosa li, #hoja-cuerpo li, .resultados li { min-width: 0; }
.prosa h2 { font-size: 1.1rem; margin: 1rem 0 0; }
.prosa p, .prosa ul { margin: 0; }
.prosa ul { padding-left: 1.2rem; display: grid; gap: 0.3rem; }
.tabla-envoltura { overflow-x: auto; }
table { border-collapse: collapse; font-size: var(--chico); min-width: 100%; }
th, td { text-align: left; padding: 0.4rem 0.75rem 0.4rem 0; border-bottom: 1px solid var(--filete); vertical-align: top; }
th { font-weight: 500; color: var(--tenue); }
td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; }
.huella { font-family: ui-monospace, Consolas, monospace; font-size: var(--mini); word-break: break-all; }

/* Mapa */
.mapa { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--filete); background: var(--mar); }
.mapa .tierra { fill: var(--tierra); stroke: var(--costa); stroke-width: 0.8; }
.mapa .rios { fill: none; stroke: var(--rio); stroke-width: 1.1; }
.mapa .punto { fill: var(--lapis); stroke: var(--hoja); stroke-width: 3; }
.mapa .punto.resaltado { fill: var(--ocre); }
.mapa .propuesta { fill: var(--ocre); fill-opacity: 0.3; stroke: var(--ocre); stroke-width: 1.2; }
.mapa text { font-family: var(--letra-ui); font-size: 30px; font-weight: 500; fill: var(--tinta); paint-order: stroke; stroke: var(--tierra); stroke-width: 7px; stroke-linejoin: round; }
.mapa text.chico { font-size: 12px; fill: var(--tenue); }

/* ----------------------------------------------------- apoyo inferior --- */

.apoyo-inferior { position: fixed; inset: auto 0 0; z-index: 6; display: grid; }
.pestanas {
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--hoja); border-top: 1px solid var(--filete);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.pestanas a { display: grid; justify-items: center; align-content: center; gap: 0.1rem; padding: 0.4rem 0.25rem; text-decoration: none; color: var(--tenue); font-size: 0.72rem; min-height: var(--alto-pestanas); }
.pestanas svg { width: 1.45rem; height: 1.45rem; }
.pestanas a[aria-current="page"] { color: var(--lapis); font-weight: 600; }
.acciones-versiculo, .reproductor {
  background: var(--hoja); border-top: 1px solid var(--filete); box-shadow: var(--sombra);
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
}
.acciones-versiculo { display: grid; gap: 0.5rem; padding-block: 0.6rem 0.7rem; }
.acciones-cabeza { display: flex; justify-content: space-between; align-items: center; gap: 1rem; max-width: 64rem; width: 100%; margin: 0 auto; }
.acciones-cabeza p { margin: 0; font-weight: 600; }
.acciones-botones { flex-wrap: wrap; }
.colores, .acciones-botones { display: flex; gap: 0.5rem; overflow-x: auto; max-width: 64rem; width: 100%; margin: 0 auto; padding-bottom: 0.15rem; scrollbar-width: none; }
.color { flex: 0 0 auto; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 2px solid var(--filete); cursor: pointer; }
.color[data-color="amarillo"] { background: var(--res-amarillo); }
.color[data-color="verde"] { background: var(--res-verde); }
.color[data-color="celeste"] { background: var(--res-celeste); }
.color[data-color="rosa"] { background: var(--res-rosa); }
.color[data-color="violeta"] { background: var(--res-violeta); }
.color.sin-color { background: var(--hoja); color: var(--tenue); }
.acciones-botones button { flex: 0 0 auto; border: 1px solid var(--filete); background: var(--papel); border-radius: 999px; padding: 0.45rem 0.85rem; cursor: pointer; min-height: 2.6rem; font-weight: 500; }
.reproductor { display: flex; align-items: center; gap: 0.25rem; padding-block: 0.35rem; }
.reproductor .grande { background: var(--lapis); color: var(--sobre-lapis); }
.reproductor-texto { flex: 1 1 auto; min-width: 0; margin: 0 0.25rem; font-size: var(--chico); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.aviso {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--alto-pestanas) + env(safe-area-inset-bottom, 0px) + var(--extra-abajo, 0px) + 0.75rem);
  background: var(--tinta); color: var(--papel); padding: 0.6rem 1rem; border-radius: 999px; z-index: 40;
  max-width: calc(100vw - 2rem); font-size: var(--chico);
}

/* ------------------------------------------------------------- hojas --- */

dialog#hoja {
  border: 0; padding: 0; background: var(--hoja); color: var(--tinta);
  width: min(40rem, 100vw); max-width: 100vw; max-height: 88vh;
  margin: auto auto 0; border-radius: 18px 18px 0 0; box-shadow: var(--sombra);
  overflow: auto; overscroll-behavior: contain;
}
@media (min-width: 760px) { dialog#hoja { margin: auto; border-radius: 16px; max-height: 84vh; } }
dialog#hoja::backdrop { background: rgb(10 14 20 / 0.45); }
.hoja-dentro { display: grid; gap: 1rem; padding: 0.75rem max(16px, env(safe-area-inset-right, 0px)) calc(1.25rem + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.hoja-cabeza { display: flex; justify-content: space-between; align-items: center; gap: 1rem; position: sticky; top: 0; background: var(--hoja); padding-top: 0.25rem; z-index: 1; }
.hoja-cabeza h2 { margin: 0; font-size: 1.05rem; }
#hoja-cuerpo { display: grid; gap: 1rem; min-width: 0; }
#hoja-cuerpo section { display: grid; gap: 0.4rem; min-width: 0; }
#hoja-cuerpo h3 { margin: 0; font-size: var(--mini); text-transform: uppercase; letter-spacing: 0.08em; color: var(--tenue); font-weight: 500; }
#hoja-cuerpo p { margin: 0; }
#hoja-cuerpo ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; }
.lista-libros { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 0.5rem; }
.lista-libros button { width: 100%; text-align: left; display: grid; gap: 0.15rem; padding: 0.8rem 1rem; border-radius: 12px; border: 1px solid var(--filete); background: var(--papel); cursor: pointer; }
.lista-libros .nombre { font-weight: 600; font-size: 1.05rem; }
.lista-libros .detalle { color: var(--tenue); font-size: var(--chico); }
.grilla-capitulos { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.25rem, 1fr)); gap: 0.5rem; }
.grilla-capitulos a { display: grid; place-items: center; min-height: 3.25rem; border-radius: 12px; border: 1px solid var(--filete); text-decoration: none; color: var(--tinta); font-weight: 600; font-variant-numeric: tabular-nums; }
.grilla-capitulos a[aria-current="true"] { background: var(--lapis); color: var(--sobre-lapis); border-color: var(--lapis); }
.opciones { list-style: none; margin: 0; padding: 0 !important; display: grid; gap: 0.4rem; }
.opciones label { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.7rem 0.85rem; border: 1px solid var(--filete); border-radius: 12px; cursor: pointer; }
.opciones input { margin-top: 0.25rem; accent-color: var(--lapis); width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
.opciones .detalle { display: block; color: var(--tenue); font-size: var(--chico); }
.comparar-version { display: grid; gap: 0.2rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--filete); }
.comparar-version p { font-family: var(--letra-texto); font-size: 1.05rem; line-height: 1.6; }
.griego { font-family: var(--letra-texto); }
.hebreo { font-family: var(--letra-hebreo); font-size: 1.35rem; line-height: 1.9; }
.dif { color: var(--verdin); font-weight: 500; }
.fuente-nota { color: var(--tenue); font-size: var(--chico); }
.enlaces { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: var(--chico); }
.enlaces a { display: inline-flex; align-items: center; min-height: 2.25rem; }
.palabra-grande { font-size: 2.6rem; line-height: 1.35; margin: 0; }
.palabra-grande[lang="he"] { font-family: var(--letra-hebreo); }
.palabra-grande[lang="grc"] { font-family: var(--letra-texto); font-size: 2.1rem; }
.palabra-tr { font-style: italic; color: var(--tenue); font-size: 1.1rem; }
.palabra-glosa { font-family: var(--letra-texto); font-size: 1.25rem; }
.partes { display: grid; gap: 0.5rem; margin: 0; padding: 0 !important; list-style: none; }
.partes li { display: grid; grid-template-columns: minmax(3.5rem, auto) 1fr; gap: 0.75rem; align-items: baseline; }
.partes .parte { font-family: var(--letra-hebreo); font-size: 1.4rem; text-align: right; }
.partes .parte[lang="grc"] { font-family: var(--letra-texto); text-align: left; }
.codigo { font-family: ui-monospace, Consolas, monospace; font-size: var(--mini); color: var(--tenue); }
.aviso-dato { background: var(--aviso-fondo); color: var(--aviso-tinta); border-radius: 10px; padding: 0.7rem 0.85rem; font-size: var(--chico); }
.aviso-dato a { color: inherit; }
.apariciones { list-style: none; padding: 0 !important; display: grid; gap: 0.6rem; }
.apariciones a { font-weight: 600; font-size: var(--chico); }
.apariciones span { display: block; font-family: var(--letra-texto); font-size: 0.95rem; }
.variantes td:first-child { white-space: nowrap; }
.variantes .difiere { color: var(--verdin); font-weight: 600; }
.nota-campo { width: 100%; min-height: 8rem; font: inherit; padding: 0.75rem; border-radius: 12px; border: 1px solid var(--filete); background: var(--papel); color: var(--tinta); resize: vertical; }
.lienzo { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--filete); display: block; }
.estilos-imagen { display: flex; gap: 0.5rem; }
.estilos-imagen button { width: 2.75rem; height: 2.75rem; border-radius: 10px; border: 2px solid var(--filete); cursor: pointer; }
.estilo-lapis { background: linear-gradient(135deg, #27499a, #1b3474); }
.estilo-noche { background: linear-gradient(135deg, #151a22, #0b0e13); }
.estilo-papel { background: linear-gradient(135deg, #f7f8fa, #e9edf2); }
.estilo-arena { background: linear-gradient(135deg, #efe5d3, #e2d3b8); }
.estilos-imagen button[aria-pressed="true"] { outline: 3px solid var(--lapis); outline-offset: 2px; }
.control { display: grid; gap: 0.4rem; }
.control-fila { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.control-fila output { min-width: 3.5rem; text-align: center; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
