/* Miqrá · estilos de la aplicación.
   Tokens: diseno/05-sistema-visual.md y diseno/mockup/index.html (fuente de verdad).
   Composición: «La página pautada» (documento 5): nada flota, todo cuelga de una línea;
   un hilo por pantalla de borde a borde; columna y margen; rectilíneo. */

/* Integrada en De cierto te digo: los tokens toman la paleta y las tipografías del sitio
   (/assets/css/site.css: tinta #0E1118, crema #F2ECE0, oro #B7882E). Los nombres se conservan para
   que el resto de la hoja no cambie. El hebreo sigue en Noto Serif Hebrew por los acentos (te'amim). */
:root {
  --lino: #F2ECE0; --lino-alto: #FAF7F0; --hilo: rgba(14, 17, 24, .13);
  --tinta: #0E1118; --tinta-suave: #474C57;
  --tejelet: #B7882E; --argaman: #7A2E73; --shani: #BF2A30; --oro: #B7882E; --olivo: #55742F;
  --sobre-accion: #FFFFFF;
  --bloque: #0E1118; --sobre-bloque: #F2ECE0; --hilo-bloque: #D7B35D;   /* como la cabecera y el pie del sitio */
  --sombra: 0 2px 4px rgba(14, 17, 24, .04), 0 28px 60px -22px rgba(14, 17, 24, .26);

  --f-he: "Noto Serif Hebrew", "Frank Ruhl Libre", "SBL Hebrew", "Ezra SIL", serif;
  --f-ui: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-glosa: "Lora", "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  --he-letra: clamp(140px, 30vw, 220px);
  --he-palabra: clamp(56px, 12vw, 88px);
  --he-frase: clamp(34px, 6vw, 44px);
  --he-lector: 30px;
  --r-control: 6px; --r-tarjeta: 10px;
  --curva: cubic-bezier(.2, .7, .2, 1);
  --cab-sitio: 64px;   /* alto de la cabecera fija del sitio (--nav-h en site.css) */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --lino: #0E1118; --lino-alto: #161A23; --hilo: #212733;
    --tinta: #ECE6DA; --tinta-suave: #A8ADB7;
    --tejelet: #D7B35D; --argaman: #D08BC9; --shani: #F0777B; --oro: #D7B35D; --olivo: #9DBE6C;
    --sobre-accion: #0E1118; --sombra: 0 2px 6px rgba(0, 0, 0, .45), 0 32px 70px -24px rgba(0, 0, 0, .8);
    --bloque: #161A23; --sobre-bloque: #F2ECE0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --lino: #0E1118; --lino-alto: #161A23; --hilo: #212733;
  --tinta: #ECE6DA; --tinta-suave: #A8ADB7;
  --tejelet: #D7B35D; --argaman: #D08BC9; --shani: #F0777B; --oro: #D7B35D; --olivo: #9DBE6C;
  --sobre-accion: #0E1118; --sombra: 0 2px 6px rgba(0, 0, 0, .45), 0 32px 70px -24px rgba(0, 0, 0, .8);
  --bloque: #161A23; --sobre-bloque: #F2ECE0;
  color-scheme: dark;
}

/* ───────── Base ───────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
/* Las reglas de elemento solo valen dentro de la aplicación, para no tocar la cabecera y el pie del sitio
   (:where no suma especificidad: .boton y compañía siguen mandando). */
body { margin: 0; background: var(--lino); color: var(--tinta); min-height: 100dvh; overflow-x: clip; }
.miqra-app, .toast { font: 400 17px/1.5 var(--f-ui); color: var(--tinta); }
:where(.miqra-app) :is(button, input, select) { font: inherit; color: inherit; }
:where(.miqra-app) button { cursor: pointer; }
:where(.miqra-app) a { color: var(--tejelet); }
:where(.miqra-app) :focus-visible { outline: 2px solid var(--tejelet); outline-offset: 2px; }
:where(.miqra-app) :is(h1, h2, h3, h4) { margin: 0; font-family: var(--f-glosa); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
:where(.miqra-app) p { margin: 0; }
.saltar { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--tejelet); color: var(--sobre-accion); padding: 8px 12px; border-radius: var(--r-control); }
.saltar:focus { left: 8px; }
.sin-js { padding: 24px; }
[hidden] { display: none !important; }

/* Todo hebreo pasa por .he (componente He) */
.he { font-family: var(--f-he); direction: rtl; unicode-bidi: isolate; font-size: 1.3em; line-height: 1.7; }
.pre { color: var(--tejelet); }
.suf { color: var(--argaman); }
.translit { font-family: var(--f-glosa); font-style: italic; color: var(--tinta-suave); }
.glosa { font-family: var(--f-glosa); }
.eti { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tinta-suave); }
.suave { color: var(--tinta-suave); }
/* Numeración hebrea: ordinal en letras, siempre junto a su texto en español */
.nhe { font: 600 1.15em/1 var(--f-he); direction: rtl; unicode-bidi: isolate; color: var(--tinta); display: inline-block; min-width: 1.5em; }

/* ───────── Armazón ─────────
   El lomo: franja de tinta a la izquierda; sus pestañas son letras (א–ה). */
.principal { padding: 0 24px 72px; max-width: 1180px; margin: 0 auto; outline: none; }
.arranque { display: grid; justify-items: center; align-content: start; min-height: 60dvh; padding-top: 22dvh; }
.arranque::before { content: ""; width: 300vw; height: 1px; background: var(--hilo); }
.arranque img { width: min(280px, 60vw); margin-top: -6px; }

/* Submenú de la sección, bajo la cabecera del sitio y con su mismo lenguaje: oscuro, texto claro, subrayado de oro */
.nav {
  position: sticky; top: var(--cab-sitio); z-index: 50;
  display: flex; justify-content: center; gap: 4px; padding: 0 12px;
  background: var(--bloque); border-bottom: 1px solid #212733;
  overflow-x: auto; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-logo { display: none; }
.nav a {
  position: relative; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 48px;
  color: #B9BDC6; text-decoration: none; white-space: nowrap;
  font: 500 14px/1.2 var(--f-ui); transition: color .18s ease;
}
.nav a:hover { color: #F2ECE0; }
.nav a .tab { font: 500 20px/1 var(--f-he); color: #D7B35D; opacity: .85; }
.nav a[aria-current="page"] { color: #F2ECE0; }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: #D7B35D; }
.nav a:focus-visible { outline: 2px solid #D7B35D; outline-offset: -4px; }
.nav .num { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #B7882E; color: #fff; font: 700 11px/20px var(--f-ui); text-align: center; }
body.en-sesion .nav { display: none; }
@media (max-width: 560px) {
  .nav { justify-content: flex-start; }
  .nav a { padding: 0 10px; gap: 6px; font-size: 13px; }
  .nav a .tab { display: none; }
  .nav a[aria-current="page"]::after { left: 10px; right: 10px; }
}

/* ───────── La página pautada ───────── */
/* Cabeza de página: datos en pequeño sobre el hilo; debajo cuelga el título */
.cabeza-linea { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; min-height: 60px; padding: 12px 0 10px; }
.cabeza-linea b { font-size: 17px; }
.hilo { height: 2px; background: var(--tejelet); margin-inline: -100vw; }
.titular { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 20px; }
.titular h1 { font-size: clamp(34px, 5vw, 52px); padding-top: 20px; }
.titular .indice { font: 600 clamp(84px, 13vw, 148px)/1 var(--f-he); margin-top: -.13em; padding-bottom: .12em; color: var(--tinta); }
.cabeza .entrada { font: italic 400 19px/1.5 var(--f-glosa); color: var(--tinta-suave); max-width: 56ch; margin: -36px 0 28px; }
@media (max-width: 719px) { .cabeza .entrada { margin-top: -8px; } }

/* Bloque: cuelga de una línea de pauta. Sin caja, sin fondo, sin esquinas */
.caja { border-top: 1px solid var(--tinta); padding: 14px 0 0; }
.caja.menor { border-top-color: var(--hilo); }
.aviso-caja { border-top: 1px solid var(--hilo); border-bottom: 1px solid var(--hilo); padding: 12px 0; color: var(--tinta-suave); }

/* Columna y margen */
.pagina { display: grid; gap: 32px; }
.pagina > * { min-width: 0; }
.margen-pagina { display: grid; align-content: start; }
.nota-m { position: relative; padding: 14px 0 16px 20px; border-top: 1px solid var(--hilo); display: grid; gap: 6px; justify-items: start; }
.nota-m::before { content: ""; position: absolute; left: 2px; top: 22px; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--shani); }
.nota-m strong { font: 400 22px/1.2 var(--f-glosa); }
.nota-m .suave { font-size: 15px; }
.heroe .pronunciar { margin-top: 16px; }
.heroe .pronunciar p { margin: 0; font-size: 16px; line-height: 1.45; }
.heroe .pronunciar .he { font-size: 22px; }
@media (min-width: 1040px) {
  .pagina { grid-template-columns: 264px 1fr; gap: 0 36px; }
  .pagina > .columna { order: 2; }
  .margen-pagina { border-inline-end: 1px solid var(--hilo); padding-inline-end: 24px; }
  .margen-pagina .nota-m:first-child { border-top: 0; }
}

/* Remate: la firma vocálica al pie de la columna */
.remate { display: block; width: 76px; margin: 56px auto 0; opacity: .55; }
.solo-oscuro { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .solo-claro { display: none; } :root:not([data-theme="light"]) .solo-oscuro { display: block; } }
:root[data-theme="dark"] .solo-claro { display: none; }
:root[data-theme="dark"] .solo-oscuro { display: block; }

/* ───────── Piezas comunes ───────── */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid #B7882E; border-radius: var(--r-control); padding: 11px 20px; min-height: 44px;
  font: 500 15px/1.2 var(--f-ui); text-decoration: none;
  background: #B7882E; color: #fff;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.boton:hover { background: #a3781f; border-color: #a3781f; transform: translateY(-1px); }
.boton:active { transform: none; }
.boton.sec { background: var(--lino-alto); color: var(--tinta); border-color: var(--hilo); }
.boton.sec:hover { border-color: var(--tejelet); color: var(--tejelet); }
.boton.txt { background: transparent; border-color: transparent; color: var(--tinta-suave); padding-inline: 8px; }
.boton.txt:hover { color: var(--tejelet); }
.boton.peligro { background: transparent; color: var(--shani); border-color: currentColor; }
.boton.peligro:hover { background: transparent; color: var(--shani); border-color: currentColor; }
.boton[disabled] { opacity: .35; cursor: not-allowed; }
.fila { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.dom {
  --p: 0; display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--tinta-suave);
  background: conic-gradient(var(--tinta-suave) calc(var(--p) * 1%), transparent 0);
}
.dom.q1 { --p: 25; } .dom.q2 { --p: 50; }
.dom.q4 { border-color: var(--oro); background: var(--oro); }
.dom.deb { border-style: dashed; }

.vacio { text-align: center; padding: 56px 16px; display: grid; justify-items: center; gap: 12px; }
.vacio img { width: 120px; opacity: .8; margin-bottom: 8px; }
.vacio h2 { font-size: 21px; }
.vacio p { color: var(--tinta-suave); max-width: 44ch; }

/* ───────── Inicio ───────── */
.meta { display: flex; align-items: center; gap: 10px; color: var(--tinta-suave); font-size: 15px; }
.anillo {
  --p: 0; width: 32px; height: 32px; border-radius: 50%;
  background: conic-gradient(var(--tejelet) calc(var(--p) * 1%), var(--hilo) 0);
  -webkit-mask: radial-gradient(circle, transparent 10px, #000 10.5px); mask: radial-gradient(circle, transparent 10px, #000 10.5px);
}
.anillo.lleno { background: var(--oro); }
/* La banda: un paño de tinta de borde a borde; de su hilo cuelga el hebreo de la lección, enorme, a la derecha */
.banda { background: var(--bloque); color: var(--sobre-bloque); margin-inline: -100vw; padding-inline: 100vw; padding-bottom: 28px; }
.banda .hilo { background: var(--hilo-bloque); }
.banda .eti, .banda .meta, .banda p { color: color-mix(in srgb, var(--sobre-bloque) 72%, transparent); }
.banda .nhe { color: var(--sobre-bloque); }
.banda .anillo { background: conic-gradient(var(--hilo-bloque) calc(var(--p) * 1%), color-mix(in srgb, var(--sobre-bloque) 22%, transparent) 0); }
.banda .anillo.lleno { background: var(--oro); }
.banda .boton.sec { background: transparent; color: var(--sobre-bloque); border-color: rgba(242, 236, 224, .28); }
.banda .boton.txt { background: none; color: color-mix(in srgb, var(--sobre-bloque) 75%, transparent); }
.banda :focus-visible { outline-color: var(--hilo-bloque); }
.sigue { display: grid; grid-template-columns: 1fr auto; gap: 8px 40px; align-items: start; }
.sigue > div { padding-top: 26px; }
.sigue h1 { font-size: clamp(34px, 4.6vw, 56px); margin: 10px 0 10px; }
.sigue p { margin-bottom: 22px; max-width: 46ch; font: italic 400 19px/1.5 var(--f-glosa); }
.sigue > .he { font-size: clamp(110px, 19vw, 232px); line-height: 1; font-weight: 600; padding-bottom: .16em; margin-top: -.13em; white-space: nowrap; }
/* El palo de la lámed sube por encima de la caja: sin este hueco cruzaría el hilo y taparía el tiempo del día. */
.sigue > .he.alta { margin-top: 0; padding-top: .14em; padding-bottom: 0; }
.barra { direction: rtl; width: 100%; height: 4px; background: var(--hilo); overflow: hidden; }   /* se llena desde la derecha */
.barra i { display: block; height: 100%; background: var(--tejelet); }
.pagina { margin-top: 36px; }

.rollo-cab { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 8px; }
.rollo {
  direction: rtl; display: flex;
  overflow-x: auto; border-block: 1px solid var(--tinta); background: var(--lino-alto);
  scroll-snap-type: x proximity;
}
.col { direction: ltr; flex: 1 0 92px; min-width: 0; padding: 0 10px 18px; border-inline-start: 1px solid var(--hilo); scroll-snap-align: start; }
.col.cerrada .unidad { font-size: 13px; gap: 6px; }
.col:last-child { border-inline-start: 0; }
.col .num { font: 600 52px/1 var(--f-he); display: block; margin: -.03em 0 2px; }   /* la letra cuelga de la línea superior del rollo */
.col h3 { font: 700 13px/1.25 var(--f-ui); letter-spacing: .02em; margin-bottom: 12px; }
.col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.col.actual { background: color-mix(in srgb, var(--tejelet) 7%, var(--lino-alto)); box-shadow: inset 0 3px 0 var(--tejelet); flex: 2.2 0 176px; }
.col.cerrada { opacity: .5; }
.unidad {
  width: 100%; display: flex; gap: 8px; align-items: center; text-align: start; padding: 4px 6px; margin-inline: -6px;
  background: none; border: 0; font-size: 14px; color: var(--tinta-suave); min-height: 32px; text-decoration: none;
}
a.unidad:hover { background: color-mix(in srgb, var(--tejelet) 8%, transparent); }
.unidad .he { font-size: 17px; line-height: 1.2; color: var(--tinta); white-space: nowrap; }
.unidad.ahora { color: var(--tinta); font-weight: 700; }
.unidad .marca-avance { color: var(--tejelet); margin-inline-start: auto; font-size: 11px; font-weight: 700; }

/* ───────── Alefbet ───────── */
.alefbet { direction: rtl; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); border-block: 1px solid var(--tinta); overflow: hidden; background: var(--lino-alto); }
.letra {
  direction: ltr; position: relative; padding: 12px 8px 10px; text-align: center; background: none; border: 0;
  box-shadow: 0 0 0 .5px var(--hilo); text-decoration: none; color: inherit; display: block;
}
.letra:hover { background: color-mix(in srgb, var(--tejelet) 7%, transparent); }
.letra .he { display: block; font-size: 46px; line-height: 1.25; }
.letra b { display: block; font-size: 14px; }
.letra .translit { font-size: 14px; }
.letra .dom { position: absolute; top: 8px; right: 8px; }
.letra .fin { position: absolute; top: 4px; left: 8px; font: 400 20px var(--f-he); color: var(--tinta-suave); }
/* Pestañas: texto que cuelga de la pauta, no píldoras */
.filtros { display: flex; gap: 20px; flex-wrap: wrap; }
.filtro { padding: 6px 0; min-height: 36px; font-size: 15px; color: var(--tinta-suave); text-decoration: none; border-top: 2px solid transparent; background: none; border-inline: 0; border-bottom: 0; }
.filtro[aria-pressed="true"], .filtro[aria-current="true"] { border-top-color: var(--tejelet); color: var(--tejelet); font-weight: 700; }
.grupo-parecidas { display: grid; }
.grupo-parecidas .caja { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; border-top-color: var(--hilo); padding: 10px 0; }
.grupo-parecidas .he { font-size: 44px; line-height: 1.2; white-space: nowrap; min-width: 2.4em; }

/* ───────── Hoja (lateral en escritorio, inferior en móvil): cuelga de su propio hilo ───────── */
.velo { position: fixed; inset: 0; background: rgb(17 19 31 / .35); z-index: 70; animation: aparecer 220ms var(--curva); }
.hoja {
  position: fixed; z-index: 71; background: var(--lino-alto); box-shadow: var(--sombra); overflow-y: auto;
  inset: auto 0 0 0; max-height: 88dvh; padding: 8px 20px calc(28px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--tejelet); animation: subir 220ms var(--curva);
}
.hoja:focus { outline: none; }
.hoja-cab { display: flex; justify-content: flex-end; position: sticky; top: -8px; padding-top: 4px; background: var(--lino-alto); z-index: 1; }
.cerrar { background: none; border: 0; font-size: 28px; line-height: 1; width: 44px; height: 44px; color: var(--tinta-suave); text-decoration: none; display: inline-grid; place-items: center; }
@media (min-width: 720px) {
  .hoja { inset: 0 0 0 auto; width: min(480px, 92vw); max-height: none; padding: 12px 32px 40px; animation-name: entrar; border-top: 0; border-inline-start: 3px solid var(--tejelet); }
}
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { transform: translateY(24px); opacity: 0; } }
@keyframes entrar { from { transform: translateX(24px); opacity: 0; } }

/* Hebreo de exhibición: cuelga del hilo, que cruza de borde a borde */
.colgada { position: relative; text-align: center; margin: 8px 0 4px; }
.colgada .he { font-size: var(--he-letra); line-height: 1; display: block; padding-bottom: .1em; }
.colgada::before { content: ""; position: absolute; inset-inline: -100vw; top: .15em; font-size: var(--he-letra); border-top: 2px solid var(--tejelet); }
.colgada.palabra .he, .colgada.palabra::before { font-size: var(--he-palabra); }
.colgada.frase .he, .colgada.frase::before { font-size: var(--he-frase); }
.colgada.palabra .he, .colgada.frase .he { padding-bottom: .45em; }
.hoja .colgada { overflow: hidden; margin-inline: -32px; }
.revela .he { animation: revelar 700ms var(--curva) both; }
@keyframes revelar { from { clip-path: inset(-20% 0 -40% 100%); } to { clip-path: inset(-20% 0 -40% 0); } }

.ficha h2 { font-size: 40px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ficha h2 .he { font-size: 26px; font-weight: 400; color: var(--tinta-suave); }
.ficha dl, .heroe dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 16px 0 0; }
.ficha dt, .heroe dt { color: var(--tinta-suave); }
.ficha dd, .heroe dd { margin: 0; }
.ficha dd .he, .heroe dd .he { font-size: 26px; line-height: 1.3; }
.ficha section { margin-top: 24px; border-top: 1px solid var(--hilo); padding-top: 12px; }
.ficha section > .eti { display: block; margin-bottom: 8px; }
.aviso { border-inline-start: 2px solid var(--shani); padding: 4px 0 4px 14px; color: var(--tinta-suave); font-size: 15px; display: grid; gap: 8px; }
.aviso .he { color: var(--tinta); font-size: 26px; line-height: 1; }
.lista-unidad { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.lista-unidad li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.lista-unidad .he { font-size: 24px; line-height: 1.3; min-width: 2.2em; }
.lista-lecciones { list-style: none; padding: 0; margin: 0; }
.lista-lecciones li { display: grid; grid-template-columns: 2em 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--hilo); }
.lista-lecciones li:first-child { border-top: 0; }
.lista-lecciones a { font-weight: 700; text-decoration: none; }
.palabras { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.palabras span { white-space: nowrap; }
.palabras .he { font-size: 22px; line-height: 1.4; }

/* ───────── Progreso y ajustes ───────── */
.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px 32px; }
.cifra strong { display: block; font: 400 52px/1.05 var(--f-glosa); }
.barras { display: grid; gap: 14px; }
.barra-niveles { direction: rtl; display: flex; height: 8px; overflow: hidden; background: var(--hilo); margin-top: 6px; }
.barra-niveles i { display: block; height: 100%; }
.leyenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--tinta-suave); align-items: center; }
.leyenda span { display: inline-flex; gap: 6px; align-items: center; }
.calor { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; justify-content: start; }
.calor i { width: 12px; height: 12px; background: var(--hilo); }
.calor i.n1 { background: color-mix(in srgb, var(--tejelet) 40%, var(--hilo)); }
.calor i.n2 { background: var(--tejelet); }
.calor i.n3 { background: var(--oro); }
.hitos { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.seccion { margin-top: 32px; display: grid; gap: 12px; }
.ajustes { display: grid; gap: 0; }
.ajustes > .eti { margin: 28px 0 8px; }
.ajustes > .eti:first-child { margin-top: 0; }
.ajuste { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: center; padding: 14px 0; border-top: 1px solid var(--hilo); }
.ajustes > .eti + .ajuste { border-top-color: var(--tinta); }
.ajuste .suave { font-size: 15px; }
.segmentado { display: inline-flex; border-top: 2px solid var(--tinta); }
.segmentado button { border: 0; background: none; padding: 8px 14px; min-height: 40px; color: var(--tinta-suave); font-size: 15px; }
.segmentado button + button { border-left: 1px solid var(--hilo); }
.segmentado button { font-weight: 700; letter-spacing: .04em; }
.segmentado button[aria-pressed="true"] { background: var(--tinta); color: var(--lino); font-weight: 700; }
.campo { border: 1px solid var(--tinta); border-radius: var(--r-control); background: var(--lino-alto); padding: 8px 12px; min-height: 44px; }
.toast {
  position: fixed; z-index: 80; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--tinta); color: var(--lino); padding: 10px 16px; border-radius: var(--r-control); font-size: 15px;
  animation: subir 220ms var(--curva); max-width: calc(100vw - 32px);
}
@media (min-width: 720px) { .toast { bottom: 24px; } }

/* ───────── Sesión: lección, repaso, refuerzo ─────────
   «El folio» (documento 5, tercera revisión): cabecera de tinta, y debajo una hoja escrita (lino claro)
   sobre la mesa pautada. Dentro de la hoja nada cruza el texto: el hilo es el borde superior de la vitrina
   y el hebreo cuelga por debajo, con aire para los puntos y acentos que suben. */
body.en-sesion .principal { max-width: none; margin: 0; padding: 0; }
.sesion {
  min-height: 100dvh; display: flex; flex-direction: column;
  /* La mesa: la pauta del escriba, renglón a renglón */
  background: repeating-linear-gradient(transparent 0 31px, color-mix(in srgb, var(--hilo) 60%, transparent) 31px 32px);
}
.sesion-cab { display: flex; align-items: center; gap: 16px; padding: 6px 16px 6px 6px; min-height: 56px; background: var(--bloque); color: var(--sobre-bloque); }
.sesion-cab .cerrar { color: color-mix(in srgb, var(--sobre-bloque) 70%, transparent); flex: none; }
.sesion-cab .cerrar:hover { color: var(--sobre-bloque); }
.sesion-cab :focus-visible { outline-color: var(--hilo-bloque); }
.sesion-tit { display: grid; min-width: 0; max-width: 34%; line-height: 1.2; }
.sesion-tit .eti { color: var(--hilo-bloque); font-size: 11px; }
.sesion-tit b { font: italic 400 18px/1.25 var(--f-glosa); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sesion-tit b:empty { display: none; }
.sesion-cab .cuenta { color: color-mix(in srgb, var(--sobre-bloque) 75%, transparent); font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sesion-cab .cuenta:empty { display: none; }
.avance { direction: rtl; flex: 1; display: grid; grid-template-columns: 3fr 5fr 5fr 2fr 1fr; gap: 5px; }
.avance.uno { grid-template-columns: 1fr; }
.avance i { --a: 0; height: 5px; background: linear-gradient(270deg, var(--hilo-bloque) calc(var(--a) * 100%), color-mix(in srgb, var(--sobre-bloque) 18%, transparent) 0); transition: --a 220ms; }

/* La hoja */
.sesion-hoja {
  position: relative; flex: 1; width: 100%; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column;
  background: var(--lino-alto); border-inline: 1px solid var(--hilo);
}
@media (min-width: 860px) {
  /* Los pinchazos, en el borde exterior de la hoja */
  .sesion-hoja::after {
    content: ""; position: absolute; inset-block: 0; inset-inline-end: -19px; width: 12px;
    background: radial-gradient(circle, color-mix(in srgb, var(--tinta-suave) 55%, transparent) 1.1px, transparent 1.7px) 0 0 / 12px 32px repeat-y;
  }
}
.sesion-ceja { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 0 28px; padding: 14px 0 9px; border-bottom: 1px solid var(--tinta); min-height: 50px; }
/* El número de paso va en cifras: en letras se confundía con las respuestas hebreas */
.sesion-ceja .folio { font: 600 15px/1 var(--f-ui); color: var(--tinta-suave); font-variant-numeric: tabular-nums; }
.sesion-cuerpo {
  flex: 1; width: 100%; padding: clamp(20px, 5vh, 44px) 28px 40px;
  display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center;
}
.sesion-cuerpo > * { max-width: 100%; }
.enunciado { font-size: clamp(26px, 4.2vw, 34px); font-style: italic; text-wrap: balance; }
.estado { min-height: 1.5em; color: var(--tinta-suave); font-size: 16px; text-wrap: balance; }
.estado.ok { color: var(--olivo); font: italic 400 20px/1.3 var(--f-glosa); }
.estado.alerta { color: var(--shani); }

/* La vitrina: el hilo arriba, y el hebreo colgando debajo sin tocarlo */
.sesion .colgada {
  position: relative; align-self: stretch; margin: 2px 0; padding: 0 16px; text-align: center;
  border-top: 2px solid var(--tejelet);
  background: linear-gradient(color-mix(in srgb, var(--tejelet) 8%, transparent), transparent 78%);
}
/* Los nudos del hilo, uno en cada extremo */
.sesion .colgada::before, .sesion .colgada::after {
  content: ""; position: absolute; top: -5px; width: 8px; height: 8px; border: 0; background: var(--tejelet); inset-inline: auto;
}
.sesion .colgada::before { inset-inline-start: 0; }
.sesion .colgada::after { inset-inline-end: 0; }
.sesion .colgada .he { line-height: 1.05; padding: .16em 0 .14em; overflow-wrap: anywhere; }
.sesion .colgada:not(.palabra, .frase) .he { font-size: clamp(120px, 22vw, 168px); }
.sesion .colgada.palabra .he { line-height: 1.25; padding: .22em 0 .42em; }
.sesion .colgada.frase .he { line-height: 1.8; padding: .3em 0 .35em; }

.heroe { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px; align-items: start; width: 100%; text-align: start; }
.heroe > div:last-child { border-top: 1px solid var(--tinta); padding-top: 14px; margin-top: 2px; }
.heroe h2 { font-size: 52px; margin-top: 2px; }
.heroe .aviso { margin-top: 20px; }
.pres { display: grid; gap: 14px; justify-items: center; width: 100%; }
.pres > .colgada { justify-self: stretch; }
.pres .cuerpo { max-width: 52ch; font-size: 19px; }
.pres .cuerpo .he { font-size: 1.5em; line-height: 1.4; }
.pres .lema { font-size: 24px; }
.pres .lema .translit { font-size: 24px; }
.pres ul.puntos { text-align: start; display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; max-width: 52ch; width: 100%; }
.pres ul.puntos li { border-top: 1px solid var(--hilo); padding-top: 10px; }
.cita { font-size: 15px; color: var(--tinta-suave); }
.silaba { display: inline-grid; justify-items: center; margin: 0 6px; padding: 6px 18px 12px; border-top: 2px solid var(--tejelet); background: linear-gradient(color-mix(in srgb, var(--tejelet) 8%, transparent), transparent 78%); }
.silaba .he { font-size: 64px; line-height: 1.5; }

/* Base: ficha pulsable (emparejar, letras parecidas) */
.opcion {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; min-height: 56px;
  background: var(--lino); border: 1px solid var(--tinta); border-bottom-width: 3px; border-radius: 0;
  font: italic 21px var(--f-glosa); text-align: start; transition: background-color 120ms, transform 120ms var(--curva);
}
.opcion:not([disabled]):hover { background: color-mix(in srgb, var(--tejelet) 7%, var(--lino)); }
.opcion:not([disabled]):active { transform: translateY(1px); }
.opcion.es { font: 500 18px var(--f-ui); }
.opcion .he { font-size: 34px; line-height: 1.5; font-style: normal; margin-inline: auto; }
.opcion kbd {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--tinta-suave);
  font: 600 18px/1 var(--f-ui); color: var(--tinta-suave); font-variant-numeric: tabular-nums;
}
.opcion[aria-checked="true"], .opcion[aria-pressed="true"] { border-color: var(--tejelet); box-shadow: inset 0 0 0 1px var(--tejelet); background: color-mix(in srgb, var(--tejelet) 11%, var(--lino-alto)); }
.opcion.bien { border-color: var(--olivo); box-shadow: inset 0 0 0 1px var(--olivo); background: color-mix(in srgb, var(--olivo) 13%, var(--lino-alto)); }
.opcion.mal { border-color: var(--shani); box-shadow: none; background: color-mix(in srgb, var(--shani) 9%, var(--lino-alto)); animation: temblar 240ms var(--curva); }
.opcion.tenue { opacity: .4; }
.opcion.hecha { visibility: hidden; }
/* Las respuestas: renglones de una lista pautada, cada uno con su número (las teclas 1–4) */
.opciones { display: grid; width: min(100%, 540px); border-top: 1px solid var(--tinta); }
.opciones .opcion { border: 0; border-bottom: 1px solid var(--hilo); background: none; min-height: 64px; padding: 10px 14px 10px 10px; box-shadow: none; font-size: 22px; }
.opciones .opcion.es { font-size: 19px; }
.opciones .opcion:not([disabled]):hover { background: color-mix(in srgb, var(--tejelet) 6%, transparent); }
.opciones .opcion:not([disabled]):hover kbd { border-color: var(--tinta); color: var(--tinta); }
.opciones .opcion .he { margin-inline: 0 auto; }
.opciones .opcion[aria-checked="true"] { background: color-mix(in srgb, var(--tejelet) 10%, transparent); box-shadow: inset 4px 0 0 var(--tejelet); }
.opciones .opcion[aria-checked="true"] kbd { background: var(--tejelet); border-color: var(--tejelet); color: var(--sobre-accion); }
.opciones .opcion.bien { background: color-mix(in srgb, var(--olivo) 13%, transparent); box-shadow: inset 4px 0 0 var(--olivo); }
.opciones .opcion.bien kbd { background: var(--olivo); border-color: var(--olivo); color: var(--sobre-accion); }
.opciones .opcion.mal { background: color-mix(in srgb, var(--shani) 9%, transparent); box-shadow: inset 4px 0 0 var(--shani); }
.opciones .opcion.mal kbd { border-color: var(--shani); color: var(--shani); }
@keyframes temblar { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
/* Emparejar: dos columnas; el hebreo a la derecha */
.pares { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; width: 100%; }
.pares > div { display: grid; gap: 10px; align-content: start; }
.pares .opcion { min-height: 72px; }
.pares .opcion .he { line-height: 1.3; }
/* Letras parecidas: una fila que se lee de derecha a izquierda */
.fila-letras { direction: rtl; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.fila-letras .opcion { direction: ltr; min-width: 72px; min-height: 80px; justify-content: center; padding: 6px; }
.fila-letras .opcion .he { font-size: 46px; line-height: 1.3; }
.contraste { display: flex; gap: 28px; justify-content: center; align-items: start; }
.contraste div { display: grid; justify-items: center; }
.contraste .he { font-size: 72px; line-height: 1.2; }

.pie {
  position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px max(20px, calc((100% - 760px) / 2 + 28px)) calc(12px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--tinta); background: var(--lino);
}
.pie > :only-child { margin-inline-start: auto; }
.franja { justify-content: flex-start; background: color-mix(in srgb, var(--shani) 10%, var(--lino-alto)); border-top-color: var(--shani); animation: subir 220ms var(--curva); }
.franja.ok { background: color-mix(in srgb, var(--olivo) 13%, var(--lino-alto)); border-top-color: var(--olivo); }
.franja b { color: var(--shani); font: italic 400 22px var(--f-glosa); } .franja.ok b { color: var(--olivo); }
.franja .he { font-size: 26px; line-height: 1.2; margin-inline: 4px; }
.franja p { text-align: start; flex: 1; min-width: 0; }
.franja small { display: block; color: var(--tinta-suave); font-size: 15px; }
/* La marca: el circulito carmesí de la nota al margen si hay que volver; un punto lleno si está bien */
.franja .marca { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--shani); }
.franja.ok .marca { border-color: var(--olivo); background: var(--olivo); }
.franja[data-pasa] { cursor: pointer; }      /* pasa sola tras la pausa; un toque adelanta */
/* Destello de corrección: el fondo se tiñe de verde o rojo y vuelve a su color (movimiento.js, destello) */
.destello-ok { animation: destello-ok 1100ms ease-out; }
.destello-mal { animation: destello-mal 1500ms ease-out; }
@keyframes destello-ok { from { background-color: color-mix(in srgb, var(--olivo) 34%, var(--lino-alto)); } }
@keyframes destello-mal { from { background-color: color-mix(in srgb, var(--shani) 28%, var(--lino-alto)); } }
.notas4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.notas4.tres { grid-template-columns: repeat(3, 1fr); }
.notas4 .boton { flex-direction: column; gap: 0; padding: 8px 6px; line-height: 1.2; }
.notas4 .boton small { font-weight: 400; font-size: 13px; opacity: .8; }

/* Lienzo de trazo: la letra cuelga del renglón. La guía y la tinta son dos lienzos superpuestos */
.lienzo {
  --renglon: 22%;
  position: relative; width: min(320px, 78vw); aspect-ratio: 1; touch-action: none; color: var(--tinta);
  background: var(--lino); border: 1px solid var(--tinta); border-bottom-width: 3px; transition: border-color 220ms, background-color 220ms;
}
.lienzo::before { content: ""; position: absolute; inset-inline: 0; top: var(--renglon); border-top: 2px solid var(--tejelet); pointer-events: none; }
.lienzo canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.lienzo [data-guia] { pointer-events: none; }
.lienzo [data-tinta] { cursor: crosshair; }
.lienzo.bien { border-color: var(--olivo); background: color-mix(in srgb, var(--olivo) 9%, var(--lino)); }
.lienzo.mal { border-color: var(--shani); }
.lienzo.bien [data-tinta], .lienzo.mal [data-tinta] { pointer-events: none; }
.medidor { direction: rtl; width: min(320px, 78vw); margin-top: -10px; }
.medidor { --a: 0; }
.medidor i { display: block; height: 4px; background: linear-gradient(270deg, var(--tejelet) calc(var(--a) * 100%), var(--hilo) 0); }

/* Voz: el micrófono es un punto, de la familia de los puntos vocálicos */
.voz { display: grid; justify-items: center; gap: 14px; }
.micro {
  position: relative; width: 84px; height: 84px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--tinta); color: var(--lino); transition: background-color 220ms, transform 120ms var(--curva);
}
.micro:active { transform: scale(.96); }
.micro::before, .micro::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--tejelet); opacity: 0; pointer-events: none; }
.micro.escuchando { background: var(--tejelet); color: var(--sobre-accion); }
.micro.escuchando::before { animation: onda 1.6s ease-out infinite; }
.micro.escuchando::after { animation: onda 1.6s ease-out .8s infinite; }
.micro.bien { background: var(--olivo); color: var(--sobre-accion); opacity: 1; }
.micro.mal { animation: temblar 240ms var(--curva); }
@keyframes onda { from { transform: scale(1); opacity: .7; } to { transform: scale(1.75); opacity: 0; } }
.oido { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; justify-content: center; border-top: 1px solid var(--hilo); padding-top: 8px; min-width: 200px; }
.oido .he { font-size: 30px; line-height: 1.4; }

/* Teclado hebreo: alfabético, de derecha a izquierda */
.escrito { min-height: 1.6em; min-width: 5em; border-bottom: 2px solid var(--tinta); font-size: 44px !important; line-height: 1.6 !important; padding: 0 12px; }
.teclado { direction: rtl; display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; width: min(100%, 460px); }
.teclado button { direction: ltr; font: 400 25px/46px var(--f-he); text-align: center; border: 1px solid var(--tinta); border-bottom-width: 3px; border-radius: var(--r-control); background: var(--lino); padding: 0; min-height: 50px; transition: background-color 120ms; }
.teclado button:not([disabled]):hover { background: color-mix(in srgb, var(--tejelet) 9%, var(--lino)); }
.teclado button:not([disabled]):active { transform: translateY(1px); border-bottom-width: 2px; }
.teclado button.no { opacity: .22; }
.teclado button.ancha { grid-column: span 2; font: 700 13px/46px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; }

.cierre { display: grid; gap: 18px; justify-items: center; width: 100%; }
.cierre h1 { font-size: clamp(34px, 6vw, 48px); }
.fichas { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.fichita { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--hilo); border-bottom-width: 2px; background: var(--lino); border-radius: var(--r-control); padding: 4px 12px; }
.fichita .he { font-size: 24px; line-height: 1.4; }
.resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px; width: 100%; text-align: start; }

@media (max-width: 719px) {
  .sesion-tit .eti { display: none; }
  .sesion-tit { max-width: 40%; }
  .sesion-ceja { margin: 0 16px; padding-top: 10px; min-height: 42px; }
  .sesion-cuerpo { padding: 18px 16px 28px; gap: 16px; }
  .sesion-hoja { border-inline: 0; }
  .heroe > div:last-child { margin-top: 0; }
  .teclado { gap: 4px; }
  .franja .boton { padding-inline: 16px; }
}

/* ───────── Lector: el margen de notas ───────── */
.lector-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 60px; padding: 10px 0; }
.lector-cab h1 { font-size: 21px; }
.lector-cab .suave { font-size: 15px; }
.lector-cab select { border: 0; background: none; font: 400 30px var(--f-glosa); padding: 2px 0; }
.lector-ctrl { display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; font-size: 15px; padding: 10px 0; border-bottom: 1px solid var(--hilo); }
.lector-ctrl label { display: inline-flex; gap: 6px; align-items: center; }
.lector { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; }
.margen { padding: 24px 20px 24px 0; border-inline-end: 1px solid var(--hilo); display: grid; gap: 4px; align-content: start; }
.margen > .eti { margin-bottom: 6px; }
.nota { padding: 10px 12px; border-inline-start: 2px solid transparent; font-size: 15px; line-height: 1.4; background: none; border-block: 0; border-inline-end: 0; text-align: start; width: 100%; display: block; }
.nota .he { font-size: 24px; line-height: 1.4; display: block; text-align: left; }
.nota .he.cabecera::before { content: "°"; color: var(--shani); font-family: var(--f-ui); margin-inline-end: 4px; }
.nota .glosa { display: block; font-size: 17px; }
.nota .an { color: var(--tinta-suave); }
.nota .an .he { display: inline; font-size: 19px; }
.nota.activa { border-inline-start-color: var(--argaman); background: var(--lino-alto); }
.nota:not(.activa) .an, .nota:not(.activa) .acc, .nota:not(.activa) .translit { display: none; }
.acc { display: flex; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.acc a, .acc button { color: var(--tejelet); font-weight: 700; font-size: 14px; text-decoration: none; background: none; border: 0; padding: 0; min-height: 32px; }
.texto { padding: 24px 0 40px 32px; --he-lector: 30px; }
.vers { font-family: var(--f-he); direction: rtl; font-size: var(--he-lector); line-height: 2.1; margin: 0 0 12px; }
.vers sup { font: 700 12px var(--f-ui); color: var(--tinta-suave); margin-inline-end: 6px; unicode-bidi: isolate; direction: ltr; }
.vers .union { white-space: nowrap; }
.w { position: relative; cursor: pointer; border-radius: 2px; padding: 0 2px; white-space: nowrap; background: none; border: 0; font: inherit; color: inherit; line-height: inherit; }
.w:hover { background: color-mix(in srgb, var(--tejelet) 8%, transparent); }
.w.sel { background: color-mix(in srgb, var(--tejelet) 14%, transparent); }
.w.nueva::before, .w.sel::before {      /* el circulito masorético */
  content: ""; position: absolute; top: -.04em; left: 50%; translate: -50% 0;
  width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--shani);
}
.w .tl { display: block; margin-top: .3em; font: italic 13px/1 var(--f-glosa); color: var(--tinta-suave); direction: ltr; text-align: center; white-space: nowrap; }
/* Con transliteración, cada palabra es un bloque en línea (hebreo arriba, lectura debajo) tan ancho como la más
   larga de las dos: la lectura no pisa los puntos de abajo ni a la palabra vecina. Prefijos y sufijos siguen
   dentro de la palabra, en línea, con su color. */
.vers.con-translit { line-height: 1.5; }
.vers.con-translit .w { display: inline-block; text-align: center; vertical-align: top; margin-bottom: .45em; }
.vers.con-translit .w .hw { display: block; white-space: nowrap; padding-top: .1em; }
.pasajes { list-style: none; margin: 0; padding: 0; }
.pasajes li { display: grid; grid-template-columns: 2em 1fr auto; gap: 6px 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--hilo); }
.pasajes li:first-child { border-top: 1px solid var(--tinta); }
.pasajes a.titulo { font: 400 26px var(--f-glosa); text-decoration: none; color: var(--tinta); }
.pasajes .he { font-size: 24px; line-height: 1.5; display: block; }
.atribucion { font-size: 13px; color: var(--tinta-suave); margin-top: 32px; max-width: 70ch; }

@media (max-width: 719px) {
  .sigue { grid-template-columns: 1fr; }
  .sigue > .he { order: -1; justify-self: end; }
  .sigue > div { padding-top: 0; }
  .titular .indice { margin-inline-end: -4px; }
  .ajuste { grid-template-columns: 1fr; }
  .heroe { grid-template-columns: 1fr; gap: 12px; }
  .lector { grid-template-columns: 1fr; }
  .texto { padding: 20px 0 45dvh; }
  .margen {
    position: fixed; inset: auto 0 env(safe-area-inset-bottom) 0; z-index: 55; max-height: 38dvh; overflow-y: auto;
    background: var(--lino-alto); border-inline-end: 0; border-top: 2px solid var(--tejelet); box-shadow: var(--sombra); padding: 8px 12px;
  }
  .margen:not(.con-nota) { display: none; }
  .margen .nota:not(.activa), .margen > .eti { display: none; }
  .notas4 .boton { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ───────── Ejercicios de las etapas 2–6 (E14–E23) y de oído ───────── */
.oir { display: grid; justify-items: center; gap: 6px; }
.oir-grande { width: 96px; height: 96px; border-radius: 50%; border: 2px solid var(--tinta); background: var(--lino-alto); color: var(--tinta); display: grid; place-items: center; cursor: pointer; }
.oir-grande:hover { border-color: var(--tejelet); color: var(--tejelet); }
.oir-grande.sonando, .audio.sonando { color: var(--tejelet); border-color: var(--tejelet); animation: latir 900ms var(--curva) infinite; }
@keyframes latir { 50% { transform: scale(1.06); } }
.audio { border: 0; background: none; color: var(--tinta-suave); cursor: pointer; padding: 4px; vertical-align: middle; }
.audio:hover { color: var(--tejelet); }
.vers .audio.vers-audio { padding: 0 4px; vertical-align: baseline; opacity: .55; }
.vers .audio.vers-audio:hover, .vers .audio.vers-audio.sonando { opacity: 1; }
.nota .translit .audio { padding: 0 4px; }
.opciones.muchas { grid-template-columns: 1fr 1fr; }
.opciones.muchas .opcion { min-height: 52px; }
.pistas { display: grid; gap: 8px; justify-items: center; width: min(100%, 540px); }

.cortes { display: flex; align-items: stretch; justify-content: center; gap: 0; font-size: var(--he-palabra); line-height: 1.4; }
.cortes .g { font-size: 1em; line-height: 1.4; padding: 0 .02em; }
.corte { width: 22px; border: 0; background: none; cursor: pointer; position: relative; padding: 0; margin: 0 -2px; }
.corte::after { content: ""; position: absolute; inset-block: 18%; left: 50%; border-left: 2px dashed var(--hilo); }
.corte:hover::after { border-left-color: var(--tejelet); }
.corte[aria-pressed="true"]::after { border-left: 3px solid var(--shani); }
.etiquetado { display: flex; flex-wrap: wrap; gap: 12px 18px; justify-content: center; direction: rtl; }
.pieza { display: grid; justify-items: center; gap: 4px; direction: ltr; }
.pieza .he { font-size: 34px; line-height: 1.4; }
.pieza select { font-size: 15px; min-height: 40px; }
.pieza.bien small { color: var(--olivo); font-size: 14px; }
.correcto { display: flex; gap: 18px; direction: rtl; justify-content: center; width: 100%; border-top: 1px solid var(--olivo); padding-top: 8px; }

.contexto { font-size: 15px; color: var(--tinta-suave); text-align: center; }
.contexto .he { font-size: 26px; }
.selectores { display: grid; gap: 12px; width: min(100%, 620px); }
.selector { border: 0; border-top: 1px solid var(--hilo); padding: 8px 0 0; margin: 0; display: grid; gap: 6px; }
.selector legend { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tinta-suave); padding: 0; }
.selector > div { display: flex; flex-wrap: wrap; gap: 6px; }
.selector .opcion { min-height: 40px; padding: 6px 12px; font-size: 16px; border: 1px solid var(--hilo); background: var(--lino-alto); border-radius: var(--r-control); }

table.paradigma { border-collapse: collapse; width: min(100%, 560px); margin: 0 auto; border-top: 1px solid var(--tinta); }
table.paradigma caption { text-align: start; font: 400 19px var(--f-glosa); padding-bottom: 8px; }
table.paradigma caption .he { font-size: 22px; }
table.paradigma th, table.paradigma td { border-bottom: 1px solid var(--hilo); padding: 6px 10px; text-align: start; font-weight: 400; }
table.paradigma th { color: var(--tinta-suave); font-size: 15px; }
table.paradigma thead th { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
table.paradigma td .he { font-size: 30px; line-height: 1.4; }
table.paradigma td.glosa { color: var(--tinta-suave); font-style: italic; }
table.paradigma .diag { color: var(--shani); }
.nota-tabla { font-size: 15px; max-width: 56ch; margin: 8px auto 0; }
.hueco { min-width: 140px; min-height: 52px; border: 1px dashed var(--tinta-suave); background: var(--lino-alto); border-radius: var(--r-control); cursor: pointer; }
.hueco[aria-pressed="true"] { border: 2px solid var(--tejelet); }
.hueco.bien { border: 1px solid var(--olivo); background: color-mix(in srgb, var(--olivo) 12%, var(--lino-alto)); }
.hueco.mal { border: 1px solid var(--shani); background: color-mix(in srgb, var(--shani) 9%, var(--lino-alto)); }
.hueco .he { font-size: 28px; }

.banco { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; direction: rtl; width: min(100%, 620px); }
.banco.es { direction: ltr; }
.ficha.opcion, .opcion.ficha { width: auto; min-height: 48px; padding: 6px 14px; display: inline-grid; justify-items: center; gap: 0; }
.opcion.ficha .he { font-size: 30px; line-height: 1.3; margin: 0; }
.opcion.ficha small { font-size: 12px; color: var(--tinta-suave); }
.opcion.ficha.usada { opacity: .25; pointer-events: none; }
.fila-fichas { min-height: 60px; width: min(100%, 620px); border-bottom: 2px solid var(--tinta); display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; padding-bottom: 6px; }
.fila-fichas.he-fila { justify-content: flex-start; }
.armado { min-height: 1.4em; font-size: var(--he-palabra); line-height: 1.3; }

textarea.traduccion { width: min(100%, 620px); min-height: 96px; font: 400 19px/1.4 var(--f-glosa); resize: vertical; }
.modelo .cuerpo { font-size: 21px; }
.modelo mark.falta { background: none; color: var(--shani); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Presentación gramatical */
.observa .ejemplos { list-style: none; padding: 0; margin: 0; width: min(100%, 640px); display: grid; gap: 4px; }
.observa .ejemplos li { border-top: 1px solid var(--hilo); padding: 10px 0 6px; }
.vers-ej { text-align: center; }
.vers-ej .he { font-size: var(--he-frase); line-height: 1.6; }
.vers-ej mark { background: none; color: var(--argaman); }
.vers-ej .he:has(mark) { color: color-mix(in srgb, var(--tinta) 55%, transparent); }
.regla-oculta { width: min(100%, 640px); display: grid; justify-items: center; }
.regla-oculta > summary { list-style: none; cursor: pointer; }
.regla-oculta > summary::-webkit-details-marker { display: none; }
.regla-oculta[open] > summary { display: none; }
.regla-oculta .cuerpo { border-inline-start: 2px solid var(--argaman); padding-inline-start: 14px; text-align: start; }
.a-demanda summary { cursor: pointer; color: var(--tinta-suave); font-size: 15px; }
.tabla-pres { width: 100%; }

/* Lector: lecturas graduadas */
.titulo-lectura { font-size: 28px; }
.w.anotada::before { color: var(--argaman); }
.nota-autor { border-inline-start: 2px solid var(--argaman); padding-inline-start: 10px; margin: 6px 0; font-size: 15px; }
.nota .nota-autor .he { display: inline; font-size: 1.35em; line-height: 1.2; }
.preguntas { margin-top: 32px; display: grid; gap: 16px; }
.pregunta p { margin: 0 0 8px; }
.pregunta .opciones { width: 100%; }
.pregunta .razon { margin-top: 8px; }

/* Referencia: paradigmas, glosario, léxico */
.indice-par { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.indice-par ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.indice-par li { border-top: 1px solid var(--hilo); padding-top: 4px; }
.ficha-par table.paradigma { margin-top: 12px; }
.buscar { width: min(100%, 480px); margin-bottom: 12px; }
.glosario { margin: 0; display: grid; gap: 0; }
.entrada-glosario { border-top: 1px solid var(--hilo); padding: 12px 0; display: grid; gap: 4px; }
.entrada-glosario dt { font-size: 18px; }
.entrada-glosario dd { margin: 0; max-width: 64ch; }
.entrada-glosario .he { font-size: 1.35em; line-height: 1.3; }
.entrada-glosario .ejemplo { display: block; color: var(--tinta-suave); margin-top: 4px; }
.aviso-etapa { display: block; font-size: 14px; margin-top: 4px; }
.buscador { display: grid; gap: 8px; }
.teclado-mini summary { cursor: pointer; color: var(--tinta-suave); font-size: 15px; }
ol.lexico { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--tinta); }
ol.lexico a { display: grid; grid-template-columns: 7em 1fr auto; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--hilo); color: inherit; text-decoration: none; }
ol.lexico a:hover { background: color-mix(in srgb, var(--tejelet) 6%, transparent); }
ol.lexico .he { font-size: 26px; line-height: 1.3; text-align: right; }
ol.lexico .suave { font-size: 14px; }

/* Escritura y ejercicio suelto */
.alefbet.escritura .letra { padding-block: 14px; }
.suelto { display: grid; gap: 16px; justify-items: center; }
.cuerpo-suelto { display: grid; gap: 14px; justify-items: center; width: 100%; }
.pie-suelto { display: flex; gap: 12px; align-items: center; justify-content: space-between; width: 100%; border-top: 1px solid var(--hilo); padding-top: 12px; flex-wrap: wrap; }
.franja-suelta { margin: 0; border-inline-start: 4px solid var(--shani); padding-inline-start: 10px; display: grid; gap: 2px; }
.franja-suelta.ok { border-color: var(--olivo); }
.franja-suelta small { color: var(--tinta-suave); }
.franja-suelta { text-align: start; flex: 1; min-width: 0; }
.franja-suelta > span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.franja-suelta .he { font-size: 26px; line-height: 1.2; }
.franja-suelta b { color: var(--shani); } .franja-suelta.ok b { color: var(--olivo); }
.copia-cab { display: grid; justify-items: center; gap: 6px; }
.copia-fila { display: flex; gap: 10px; font: 400 32px var(--f-he); }
.copia-fila span { color: var(--hilo); }
.copia-fila .hecha { color: var(--olivo); }
.copia-fila .actual { color: var(--tinta); border-bottom: 2px solid var(--tejelet); }

/* Bienvenida y prueba de nivel */
.bienvenida { min-height: 100dvh; display: grid; grid-template-rows: 1fr auto; justify-items: center; padding: 24px 16px 32px; }
.bienvenida-hoja { width: min(100%, 620px); display: grid; gap: 18px; align-content: center; justify-items: center; text-align: center; }
.bienvenida-hoja h1 { font-size: clamp(28px, 6vw, 40px); }
.bienvenida-ops { width: 100%; }
.bienvenida-ops a.opcion { text-decoration: none; color: inherit; justify-content: center; }
.segmentado.grande button { font-size: 18px; padding: 12px 18px; min-height: 52px; }
.portada-bienvenida { display: grid; gap: 22px; justify-items: center; }
.encendida { display: flex; flex-direction: row-reverse; justify-content: center; font-size: clamp(64px, 16vw, 110px); }
.encendida .he { font-size: 1em; opacity: .15; animation: encender 600ms var(--curva) forwards; animation-delay: calc(var(--i) * 260ms + 300ms); line-height: 1.4; }
@keyframes encender { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .encendida .he { animation: none; opacity: 1; } }
.logo-bienvenida { width: min(60%, 240px); }
.lema-bienvenida { font: 400 22px var(--f-glosa); margin: 0; }
.puntos-paso { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0; }
.puntos-paso li { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--tinta-suave); }
.puntos-paso li.actual { background: var(--tinta); border-color: var(--tinta); }
.puntos-paso li.hecho { background: var(--tinta-suave); }
.prueba-cab { display: flex; justify-content: space-between; width: 100%; border-bottom: 1px solid var(--hilo); padding-bottom: 6px; }
@media (max-width: 719px) { .opciones.muchas { grid-template-columns: 1fr; } ol.lexico a { grid-template-columns: 5.5em 1fr auto; } }

/* ───────── Movimiento ─────────
   Documento 5, «Movimiento»: 120 ms para responder a un toque, 220 ms para lo que entra o sale, curva --curva.
   Lo que entra llega avanzando hacia la izquierda, como el libro. La revelación de derecha a izquierda (.revela)
   es solo del hebreo nuevo. Las clases las pone src/app/movimiento.js; con movimiento reducido, nada se anima. */
@property --a { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }
:root { --t-toque: 120ms; --t-entrada: 220ms; }

@keyframes avanzar { from { opacity: 0; transform: translateX(14px); } }
@keyframes bajar { from { opacity: 0; transform: translateY(-8px); } }
@keyframes bajar-fuera { to { opacity: 0; transform: translateY(24px); } }
@keyframes lado-fuera { to { opacity: 0; transform: translateX(24px); } }
@keyframes desvanecer { to { opacity: 0; } }
@keyframes llenar-p { from { --p: 0; } }
@keyframes crecer { from { transform: scaleX(0); } }
@keyframes marcar { from { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.15); } }
@keyframes asentir { 40% { transform: scale(1.025); } }

/* Respuesta al toque: color, fondo, filo y opacidad cambian en 120 ms en todo lo pulsable */
a, button, .nav a, .unidad, .letra, .filtro, .segmentado button, .nota, .w, .audio, .cerrar, .campo, .teclado button, .corte::after, .opcion kbd, .fichita {
  transition: color var(--t-toque) var(--curva), background-color var(--t-toque) var(--curva), box-shadow var(--t-toque) var(--curva),
    border-color var(--t-toque) var(--curva), opacity var(--t-toque) var(--curva), transform var(--t-toque) var(--curva);
}
.boton:not([disabled]):hover { filter: brightness(1.12); }
.boton.sec:hover, .boton.txt:hover, .boton.peligro:hover { filter: none; }
.boton.txt:not([disabled]):hover { color: var(--tinta); }
.boton[disabled] { transition: opacity var(--t-entrada) var(--curva); }
.segmentado button:active, .filtro:active, .unidad:active, .letra:active, .nota:active, .cerrar:active { transform: translateY(1px); }
.letra:hover .he { transform: translateY(-2px); }
.letra .he { transition: transform var(--t-entrada) var(--curva); }
.cerrar:hover { color: var(--tinta); }
.nav a:hover { color: #F2ECE0; }
.nav a .tab { transition: transform var(--t-entrada) var(--curva); }
.nav a:hover .tab { transform: translateY(-2px); }
.nav a:active .tab { transform: translateY(0) scale(.94); }
/* La pestaña recién elegida: su hilo se traza */
.nav a[aria-current="page"].recien::after { animation: pestana var(--t-entrada) var(--curva); }
@keyframes pestana { from { transform: scaleX(0); } }

/* Cambio de pantalla: los bloques entran escalonados, 40 ms uno tras otro */
.principal.pasa > *, .principal.pasa .pagina > .columna > *, .principal.pasa .margen-pagina > * {
  animation: avanzar var(--t-entrada) var(--curva) both;
}
.principal.pasa > :nth-child(2), .principal.pasa .columna > :nth-child(2), .principal.pasa .margen-pagina > :nth-child(2) { animation-delay: 40ms; }
.principal.pasa > :nth-child(3), .principal.pasa .columna > :nth-child(3), .principal.pasa .margen-pagina > :nth-child(3) { animation-delay: 80ms; }
.principal.pasa > :nth-child(4), .principal.pasa .columna > :nth-child(4), .principal.pasa .margen-pagina > :nth-child(4) { animation-delay: 120ms; }
.principal.pasa > :nth-child(5), .principal.pasa .columna > :nth-child(5), .principal.pasa .margen-pagina > :nth-child(5) { animation-delay: 160ms; }
.principal.pasa > :nth-child(n+6), .principal.pasa .columna > :nth-child(n+6), .principal.pasa .margen-pagina > :nth-child(n+6) { animation-delay: 200ms; }
/* Lo que mide se llena al llegar: anillo de la meta, barras, dominio y calor */
.principal.pasa .anillo, .principal.pasa .dom, .cierre .dom { animation: llenar-p 900ms var(--curva) both; animation-delay: 160ms; }
.principal.pasa .barra i, .principal.pasa .barra-niveles i { transform-origin: right; animation: crecer 700ms var(--curva) both; animation-delay: 160ms; }
.principal.pasa .calor i { animation: aparecer 600ms var(--curva) both; animation-delay: 200ms; }
.principal.pasa .hilo { transform-origin: right; animation: crecer 600ms var(--curva) both; }
/* La sesión entra: la cabecera de tinta baja, la hoja avanza */
.principal.pasa > .sesion { animation: none; }
.principal.pasa .sesion-cab { animation: bajar var(--t-entrada) var(--curva) both; }
.principal.pasa .sesion-hoja { animation: avanzar var(--t-entrada) var(--curva) both; animation-delay: 60ms; }

/* Cada paso de la sesión: el folio pasa y su contenido entra escalonado */
.sesion-cuerpo.paso > * { animation: avanzar var(--t-entrada) var(--curva) both; }
.sesion-cuerpo.paso > :nth-child(2) { animation-delay: 50ms; }
.sesion-cuerpo.paso > :nth-child(3) { animation-delay: 100ms; }
.sesion-cuerpo.paso > :nth-child(n+4) { animation-delay: 150ms; }
.sesion-ceja.paso > * { animation: aparecer var(--t-entrada) var(--curva) both; }
.pie.paso > * { animation: aparecer var(--t-entrada) var(--curva) both; animation-delay: 80ms; }
.cierre > * { animation: avanzar var(--t-entrada) var(--curva) both; }
.cierre > :nth-child(2) { animation-delay: 60ms; } .cierre > :nth-child(3) { animation-delay: 120ms; } .cierre > :nth-child(n+4) { animation-delay: 180ms; }
.cierre .fichita { animation: marcar 320ms var(--curva) both; animation-delay: 300ms; }
.resumen .cifra strong { animation: bajar 320ms var(--curva) both; animation-delay: 200ms; }
.avance i { transition: --a 420ms var(--curva); }
.medidor i { transition: --a var(--t-entrada) var(--curva); }

/* Ejercicios: lo elegido se marca, el acierto se asienta, el fallo tiembla una vez (ya en .opcion.mal) */
.opcion { transition: background-color var(--t-toque), transform var(--t-toque) var(--curva), box-shadow var(--t-toque) var(--curva), border-color var(--t-toque), opacity var(--t-entrada) var(--curva), visibility var(--t-entrada); }
.opcion.hecha { visibility: hidden; opacity: 0; transform: scale(.96); }
.opcion[aria-checked="true"] kbd, .opcion[aria-pressed="true"] kbd { animation: marcar var(--t-toque) var(--curva); }
.opcion.bien { animation: asentir 320ms var(--curva); }
.opcion.bien kbd { animation: marcar var(--t-entrada) var(--curva); }
.franja .marca { animation: marcar 320ms var(--curva) both; animation-delay: 80ms; }
.franja > p, .franja > .boton { animation: avanzar var(--t-entrada) var(--curva) both; animation-delay: 60ms; }
.estado { transition: color var(--t-entrada) var(--curva); }
.estado.ok, .estado.alerta { animation: aparecer var(--t-entrada) var(--curva); }
.lienzo.bien { animation: asentir 420ms var(--curva); }
.lienzo.mal { animation: temblar 240ms var(--curva); }
.lienzo [data-guia] { transition: opacity var(--t-entrada) var(--curva); }
.micro.bien { animation: asentir 320ms var(--curva); }
.teclado button:not([disabled]):active { transform: translateY(1px) scale(.97); }
.oir-grande { transition: color var(--t-toque), border-color var(--t-toque), transform var(--t-toque) var(--curva); }
.oir-grande:active { transform: scale(.96); }
.corte[aria-pressed="true"]::after { animation: aparecer var(--t-toque) var(--curva); }
.pieza select { transition: border-color var(--t-toque); }

/* Hoja, velo y avisos: salen como entraron */
.velo.sale { animation: desvanecer var(--t-entrada) var(--curva) forwards; }
.hoja.sale { animation: bajar-fuera var(--t-entrada) var(--curva) forwards; }
@media (min-width: 720px) { .hoja.sale { animation-name: lado-fuera; } }
.hoja > :not(.hoja-cab) { animation: avanzar var(--t-entrada) var(--curva) both; animation-delay: 60ms; }
.toast.sale { animation: bajar-fuera var(--t-entrada) var(--curva) forwards; }

/* Lector: la nota que se abre entra en el margen; la palabra elegida se ilumina */
.nota.activa { animation: avanzar var(--t-entrada) var(--curva); }
.w.sel::before { animation: marcar var(--t-entrada) var(--curva); }
@media (max-width: 719px) { .margen.con-nota { animation: subir var(--t-entrada) var(--curva); } }
.respuestas .opcion, details > summary { transition: background-color var(--t-toque); }
details[open] > :not(summary) { animation: bajar var(--t-entrada) var(--curva); }

/* Arranque: el hilo se traza y la marca aparece */
.arranque::before { transform-origin: right; animation: crecer 700ms var(--curva) both; }
.arranque img { animation: aparecer 500ms var(--curva) both; animation-delay: 250ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.velo.quieta, .hoja.quieta, .hoja.quieta > * { animation: none; }
.lienzo { overflow: hidden; }      /* el dibujo, al encajarse sobre el modelo, no se sale del lienzo */

/* ───────── Integración en De cierto te digo ─────────
   Durante una lección o la bienvenida, la cabecera y el pie del sitio se apartan: la sesión ocupa la pantalla
   y se sale con su propio botón de cerrar, como antes. */
body.miqra.en-sesion .site-head, body.miqra.en-sesion .site-foot { display: none; }
.miqra .saltar { left: -999px; }
.miqra .saltar:focus { left: 8px; top: calc(var(--cab-sitio) + 8px); }

/* E10 por partes: la parte que toca se lee; las demás esperan atenuadas. */
.colgada.partes .he.parte { display: inline; padding-bottom: 0; opacity: .32; transition: opacity 200ms var(--curva), color 200ms var(--curva); }
.colgada.partes { line-height: 1.6; padding-bottom: .3em; }
.colgada.partes .he.parte.actual { opacity: 1; }
.colgada.partes .he.parte.leida { opacity: .6; color: var(--olivo); }
.colgada.partes .he.parte.perdida { opacity: .6; color: var(--shani); }
.cuenta-partes { text-align: center; margin: 0 0 6px; font-size: 14px; }
/* Palabra por palabra: cada palabra respira un poco más y la que toca lleva el hilo debajo. */
.colgada.partes.por-palabra { word-spacing: .25em; }
.colgada.partes.por-palabra .he.parte.actual { text-decoration: underline 2px var(--tejelet); text-underline-offset: .35em; }

/* Las palabras falladas se pueden tocar para ver su lectura. */
.colgada.partes .he.parte.con-fallo { cursor: pointer; text-decoration: underline dotted 2px var(--shani); text-underline-offset: .35em; }
.colgada.partes .he.parte.con-fallo.actual { text-decoration: underline 2px var(--shani); }
.colgada.partes .he.parte.vista { opacity: 1; }
.pista-lectura { display: flex; gap: 12px; align-items: baseline; justify-content: center; flex-wrap: wrap; margin: 0 0 8px; }
.pista-lectura .he { font-size: 30px; line-height: 1.4; }
.pista-lectura .translit { font-size: 20px; }
