/* Academia LT-GPS — un solo :root para todas las vistas.
   Mismo sistema visual que el Centro de documentación (ltgps-docs, docs.sycgps.com): estilo TypeUI «Premium»
   (sombras suaves en capas, radios 6/8/16/24), Open Sans, degradado azul a azul noche con cuadrícula y mancha
   naranja difuminada, botón principal naranja con letra azul, «waypoints» con línea punteada.
   Claro y oscuro (pedido de Joe): los MISMOS tokens redefinidos. El botón de sol y luna guarda la elección en la
   cookie tlt_tema y el servidor pinta <html data-tema>. Sin elegir: el aprendiz sigue al aparato y el panel va en
   oscuro, como el «Centro de control» de docs. */

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/open-sans-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --navy: #0033A0; --navy-oscuro: #00216B; --navy-claro: #2A5BC7;
  --naranja: #FCB514; --naranja-claro: #FFC83D;          /* solo relleno o texto sobre azul: sobre claro reprueba */
  --noche: #0A1330; --noche-2: #0F1B45; --noche-linea: #20305F; --noche-tinta: #EEF2FB; --noche-apagado: #9FB0D8;
  --primary: var(--navy); --primary-suave: #EEF3FD;
  --bg: #F6F8FC; --surface: #FFFFFF; --surface-2: #FBFCFE;
  --fg: #1F2A44; --fg-2: #3A4456; --titulo: var(--navy-oscuro);
  --muted-fg: #5B6476;          /* 5.6:1 sobre el fondo (el #64748b de docs da 4.38) */
  --border: #D5DEEF; --border-suave: #E3E9F5;
  --borde-control: #7D879A;     /* 3.62:1 sobre blanco y 3.4 sobre el fondo: un campo pide 3:1 */
  --ok: #15803D;   --ok-bg: #ECFDF3; --ok-border: #A7E3BE;
  --warn: #6E4100; --warn-bg: #FFF7E0; --warn-border: #F5D27A;
  --bad: #B42318;  --bad-bg: #FEF2F2; --bad-border: #FCA5A5;
  --info-bg: #EEF3FD; --info-border: #C9D6F5;
  --ring: var(--navy); --ring-shadow: 0 0 0 3px rgb(42 91 199 / .15);
  --link: var(--navy); --link-hover: var(--navy-oscuro); --acento-txt: var(--navy);
  --boton-fg: var(--navy); --boton-hover-borde: var(--navy-claro); --boton-hover-bg: var(--primary-suave);
  --contorno-borde: var(--navy); --contorno-fg: var(--navy);
  --barra-bg: rgb(255 255 255 / .85); --pie-bg: rgb(255 255 255 / .92); --borde-tarjeta: rgb(213 222 239 / .8);
  --sh-card: 0 1px 2px rgb(2 8 23 / .06), 0 8px 24px -12px rgb(2 8 23 / .18);
  --sh-card-h: 0 2px 4px rgb(2 8 23 / .08), 0 18px 40px -16px rgb(2 8 23 / .28);
  --sh-panel: 0 24px 60px -24px rgb(2 8 23 / .35);
  --glow: 0 0 0 1px rgb(252 181 20 / .18), 0 18px 50px -16px rgb(252 181 20 / .45);
  --sombra: var(--sh-card); --sombra-h: var(--sh-card-h); --logo: var(--navy-oscuro);
  --font: "Open Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  --t-xs: .8125rem; --t-sm: .875rem; --t-base: .9375rem; --t-lee: 1rem;
  --t-md: 1.1875rem; --t-lg: 1.25rem; --t-xl: 1.5rem;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px;
  --r-xs: 6px; --r-sm: 8px; --r-md: 10px; --r-lg: 12px; --r-xl: 16px; --r-2xl: 24px; --r-pill: 999px;
  --dur: .25s; --ease: cubic-bezier(.16, 1, .3, 1);
  --control: 40px;
  --ancho: 72rem;
}
@media (pointer: coarse) { :root { --control: 44px; } }
/* En compu y tablet grande: 15 % de aire por lado (pedido de Joe), con tope para monitores muy anchos. */
@media (min-width: 1024px) { :root { --ancho: min(70vw, 92rem); } }

html[data-tema="oscuro"], html:not([data-tema="claro"]):has(> body.panel) {
  color-scheme: dark;
  --primary: var(--naranja); --primary-suave: rgb(252 181 20 / .12);
  --bg: var(--noche); --surface: var(--noche-2); --surface-2: var(--noche);
  --fg: var(--noche-tinta); --fg-2: #C9D3EC; --titulo: #FFFFFF; --muted-fg: var(--noche-apagado);
  --border: var(--noche-linea); --border-suave: var(--noche-linea); --borde-control: #5D72AE;   /* 3.55:1 */
  --ok: #4ADE80;   --ok-bg: rgb(74 222 128 / .12);  --ok-border: rgb(74 222 128 / .4);
  --warn: #FDE68A; --warn-bg: rgb(252 181 20 / .12); --warn-border: rgb(252 181 20 / .45);
  --bad: #FCA5A5;  --bad-bg: rgb(220 38 38 / .16);   --bad-border: rgb(252 165 165 / .45);
  --info-bg: rgb(42 91 199 / .18); --info-border: rgb(157 185 245 / .35);
  --ring: var(--naranja); --ring-shadow: 0 0 0 3px rgb(252 181 20 / .25);
  --link: var(--naranja-claro); --link-hover: var(--naranja); --acento-txt: var(--naranja);
  --boton-fg: var(--noche-tinta); --boton-hover-borde: var(--noche-apagado); --boton-hover-bg: rgb(255 255 255 / .05);
  --contorno-borde: rgb(252 181 20 / .6); --contorno-fg: var(--naranja-claro);
  --barra-bg: rgb(10 19 48 / .85); --pie-bg: rgb(10 19 48 / .92); --borde-tarjeta: var(--noche-linea);
  --sombra: none; --sombra-h: 0 18px 40px -16px rgb(0 0 0 / .6); --logo: #FFFFFF;
}
@media (prefers-color-scheme: dark) { html:not([data-tema]) {
  color-scheme: dark;
  --primary: var(--naranja); --primary-suave: rgb(252 181 20 / .12);
  --bg: var(--noche); --surface: var(--noche-2); --surface-2: var(--noche);
  --fg: var(--noche-tinta); --fg-2: #C9D3EC; --titulo: #FFFFFF; --muted-fg: var(--noche-apagado);
  --border: var(--noche-linea); --border-suave: var(--noche-linea); --borde-control: #5D72AE;   /* 3.55:1 */
  --ok: #4ADE80;   --ok-bg: rgb(74 222 128 / .12);  --ok-border: rgb(74 222 128 / .4);
  --warn: #FDE68A; --warn-bg: rgb(252 181 20 / .12); --warn-border: rgb(252 181 20 / .45);
  --bad: #FCA5A5;  --bad-bg: rgb(220 38 38 / .16);   --bad-border: rgb(252 165 165 / .45);
  --info-bg: rgb(42 91 199 / .18); --info-border: rgb(157 185 245 / .35);
  --ring: var(--naranja); --ring-shadow: 0 0 0 3px rgb(252 181 20 / .25);
  --link: var(--naranja-claro); --link-hover: var(--naranja); --acento-txt: var(--naranja);
  --boton-fg: var(--noche-tinta); --boton-hover-borde: var(--noche-apagado); --boton-hover-bg: rgb(255 255 255 / .05);
  --contorno-borde: rgb(252 181 20 / .6); --contorno-fg: var(--naranja-claro);
  --barra-bg: rgb(10 19 48 / .85); --pie-bg: rgb(10 19 48 / .92); --borde-tarjeta: var(--noche-linea);
  --sombra: none; --sombra-h: 0 18px 40px -16px rgb(0 0 0 / .6); --logo: #FFFFFF;
} }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { margin: 0; font-family: var(--font); font-size: var(--t-base); line-height: 1.55; color: var(--fg);
  background: var(--bg); min-height: 100dvh; display: flex; flex-direction: column; }
::selection { background: var(--naranja); color: var(--navy-oscuro); }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; color: var(--titulo); }
h1 { font-size: var(--t-xl); }
h2 { font-size: var(--t-md); }
p { margin: 0; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
html:has(.pie-ficha) { scroll-padding-bottom: 160px; }     /* el pie fijo tapaba lo enfocado con el teclado */
.sr-solo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.saltar { position: absolute; left: var(--s-4); top: -60px; z-index: 60; background: var(--surface); color: var(--fg);
  padding: var(--s-2) var(--s-4); border-radius: var(--r-sm); font-weight: 700; box-shadow: var(--sh-card); }
.saltar:focus { top: var(--s-2); }
.apagado { color: var(--muted-fg); }
.chico { font-size: var(--t-xs); }

/* Cuadrícula y mancha naranja de las superficies azules (igual que docs). Van como capas propias. */
.cuadricula { position: absolute; inset: 0; pointer-events: none; opacity: .1;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 20px 20px; }
.mancha { position: absolute; width: 22rem; height: 22rem; border-radius: 50%; pointer-events: none;
  background: rgb(252 181 20 / .15); filter: blur(70px); }

/* ---------- Encabezado (con desenfoque, como docs) ---------- */
.barra { position: sticky; top: 0; z-index: 50; background: var(--barra-bg); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-suave); }
.barra__dentro { max-width: var(--ancho); margin: 0 auto; min-height: 60px; padding: 0 var(--s-4);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
@media (min-width: 640px) { .barra__dentro { padding: 0 var(--s-6); } }
@media (min-width: 1024px) { .barra__dentro { padding: 0; } }
.logo { display: inline-block; font-weight: 800; font-size: 1rem; letter-spacing: -.02em; line-height: 1.2;
  color: var(--logo); text-decoration: none; white-space: nowrap; }
.logo:hover { color: var(--logo); }
.logo em { font-style: normal; color: var(--naranja); }
.logo small { display: block; font-size: .68rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted-fg); margin-top: 2px; }
.barra__acciones { display: flex; align-items: center; gap: var(--s-2); }
main { flex: 1 0 auto; display: flex; flex-direction: column; }
.contenedor { width: 100%; max-width: var(--ancho); margin: 0 auto; padding: var(--s-6) var(--s-4) var(--s-8);
  display: flex; flex-direction: column; gap: var(--s-5); flex: 1 0 auto; }
@media (min-width: 640px) { .contenedor { padding: var(--s-8) var(--s-6) 48px; } }
@media (min-width: 1024px) { .contenedor { padding-inline: 0; } }
.regresar { min-height: var(--control); display: inline-flex; align-items: center; gap: 6px; font-weight: 700;
  font-size: var(--t-sm); text-decoration: none; color: var(--link); border: 1.5px solid var(--border); border-radius: var(--r-pill);
  padding: 0 14px 0 10px; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease); }
.regresar:hover { color: var(--link); border-color: var(--boton-hover-borde); background: var(--boton-hover-bg); transform: translateX(-2px); }
.regresar--oscuro { color: var(--noche-tinta); border-color: var(--noche-linea); }
.regresar--oscuro:hover { color: #fff; border-color: var(--noche-apagado); background: rgb(255 255 255 / .06); }
.encabezado { display: flex; flex-direction: column; gap: 6px; }
.encabezado__fila { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-3); }
.rotulo { font-size: var(--t-xs); font-weight: 700; color: var(--acento-txt); }
.migas { font-size: var(--t-xs); color: var(--muted-fg); }
.migas b { color: var(--acento-txt); }

/* Botón de tema (sol y luna): enseña lo que vas a poner, no lo que tienes. */
.tema-boton span { display: grid; place-items: center; }
.tema-boton .icono-sol { display: none; }
.tema-boton[data-actual="oscuro"] .icono-sol { display: block; }
.tema-boton[data-actual="oscuro"] .icono-luna { display: none; }

/* ---------- Banda azul (inicio, buscar) y banda clara (bloque, ficha) ---------- */
.banda { position: relative; overflow: hidden; color: var(--noche-tinta);
  background: linear-gradient(160deg, var(--navy) 0%, var(--noche) 78%); }
.banda .mancha { bottom: -8rem; right: -3rem; }
.banda__dentro { position: relative; max-width: var(--ancho); margin: 0 auto; padding: 28px var(--s-4) 30px;
  display: grid; gap: var(--s-5); align-items: center; }
@media (min-width: 640px) { .banda__dentro { padding: 32px var(--s-6) 34px; } }
@media (min-width: 1024px) { .banda__dentro { padding-inline: 0; } }
@media (min-width: 900px) { .banda__dentro { grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); gap: 48px; } }
.banda h1 { color: #fff; font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.15; }
.banda__sub { margin-top: 6px; color: var(--noche-apagado); font-size: var(--t-base); }
.banda :focus-visible { outline-color: var(--naranja); }
.banda .progreso { margin-top: 16px; background: rgb(255 255 255 / .14); }
.banda__cifras { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.banda__cifras li { display: inline-flex; align-items: baseline; gap: 6px; border: 1px solid var(--noche-linea);
  background: rgb(255 255 255 / .05); border-radius: var(--r-pill); padding: 5px 12px; font-size: .8rem; color: var(--noche-apagado); }
.banda__cifras b { color: #fff; font-size: .875rem; }
.banda__seguir { display: flex; flex-direction: column; gap: 12px; background: rgb(15 27 69 / .65); border: 1px solid var(--noche-linea);
  border-radius: var(--r-xl); padding: 16px 18px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.banda__ficha { color: var(--noche-apagado); font-size: var(--t-sm); display: flex; flex-direction: column; gap: 2px; }
.banda__ficha b { color: #fff; font-weight: 700; font-size: var(--t-base); }
.banda__seguir .boton--primario { width: 100%; }
.banda--sola .banda__dentro { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
.banda .buscador { border-color: transparent; box-shadow: var(--sh-panel); background: #FFFFFF; }
.banda .buscador input { color: #1F2A44; }
.banda .buscador .boton--primario { min-height: var(--control); padding: 0 16px; font-size: var(--t-sm); align-self: center; }
.banda .buscador :focus-visible { outline-color: var(--navy); }   /* adentro de la caja blanca: el naranja no se ve */
.banda-clara { background: var(--surface); border-bottom: 1px solid var(--border-suave); }
.banda-clara__dentro { max-width: var(--ancho); margin: 0 auto; padding: 22px var(--s-4) 26px; display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 640px) { .banda-clara__dentro { padding: 26px var(--s-6) 30px; } }
@media (min-width: 1024px) { .banda-clara__dentro { padding-inline: 0; } }
.banda-clara h1 { font-size: clamp(1.35rem, 2.6vw, 1.85rem); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: var(--t-xs); color: var(--muted-fg); }
.pastilla { display: inline-flex; align-items: center; background: var(--primary-suave); color: var(--acento-txt); border-radius: var(--r-pill);
  font-weight: 700; font-size: .75rem; padding: 4px 11px; }

/* ---------- Botones (docs: radio 8, sin relieve; el principal es naranja con letra azul) ---------- */
.boton { min-height: var(--control); padding: 0 var(--s-4); border-radius: var(--r-sm); border: 1.5px solid var(--border);
  background: var(--surface); color: var(--boton-fg); font: inherit; font-weight: 700; font-size: var(--t-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); cursor: pointer; text-decoration: none;
  white-space: nowrap; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
  box-shadow var(--dur) var(--ease), transform .12s var(--ease); }
.boton:hover { border-color: var(--boton-hover-borde); background: var(--boton-hover-bg); color: var(--boton-fg); }
.boton:active { transform: translateY(1px); }
.boton--primario, .boton--acento { background: var(--naranja); border-color: var(--naranja); color: var(--navy-oscuro); }
.boton--primario:hover, .boton--acento:hover { background: var(--naranja-claro); border-color: var(--naranja-claro);
  color: var(--navy-oscuro); box-shadow: var(--glow); }
/* Verde fijo: el --ok del tema oscuro es verde claro y el blanco encima no se leería. */
.boton--exito { background: #15803D; border-color: #15803D; color: #fff; }
.boton--exito:hover { background: #127A39; border-color: #127A39; color: #fff; }   /* 5.43:1 */
.boton--contorno { border-color: var(--contorno-borde); color: var(--contorno-fg); }
.boton--contorno:hover { color: var(--contorno-fg); }
.boton--peligro { border-color: var(--bad-border); color: var(--bad); }
.boton--peligro:hover { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.boton--grande { min-height: 48px; font-size: var(--t-base); padding: 0 var(--s-5); }
.boton--ancho { width: 100%; }
.boton--icono { padding: 0; width: var(--control); }
.boton[disabled], .boton[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.boton[aria-busy="true"] { pointer-events: none; opacity: .85; }
.boton[aria-busy="true"]::after { content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: girar .7s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Tarjetas, progreso, chips, avisos ---------- */
.tarjeta { background: var(--surface); border: 1px solid var(--borde-tarjeta); border-radius: var(--r-xl);
  box-shadow: var(--sombra); padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.tarjeta--marca { position: relative; overflow: hidden; color: var(--noche-tinta); border: 0;
  background: linear-gradient(160deg, var(--navy) 0%, var(--noche) 80%); }
.tarjeta--marca .apagado { color: var(--noche-apagado); }
.tarjeta--marca :focus-visible { outline-color: var(--naranja); }
.tarjeta--fiesta { background: var(--ok-bg); border-color: var(--ok-border); box-shadow: none; }
.fila { display: flex; align-items: center; gap: var(--s-3); }
.fila--entre { justify-content: space-between; }
.fila--envuelve { flex-wrap: wrap; }
.crece { flex: 1 1 auto; min-width: 0; }
.cifra { font-weight: 800; font-size: var(--t-lg); color: var(--acento-txt); }
.progreso { display: block; height: 6px; border-radius: var(--r-pill); background: var(--border-suave); overflow: hidden; }
.progreso__barra { display: block; height: 100%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--navy-claro), var(--naranja)); transition: width .5s var(--ease); }
.progreso--grueso { height: 8px; }
.progreso--repaso .progreso__barra { background: var(--naranja); }
.progreso__barra--ok { background: var(--ok); }
.chip { display: inline-flex; align-items: center; font-size: .75rem; font-weight: 700; padding: 4px 11px;
  border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface-2); color: var(--muted-fg); }
.chip--ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-border); }
.chip--aviso { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-border); }
.chip--mal { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-border); }
a.chip { text-decoration: none; color: var(--acento-txt); background: var(--primary-suave); border-color: transparent; min-height: var(--control); }
a.chip:hover { color: var(--acento-txt); border-color: var(--boton-hover-borde); }
.aviso { border-radius: var(--r-sm); border: 1px solid; padding: 12px 14px; display: flex; gap: var(--s-3);
  align-items: flex-start; font-size: var(--t-sm); line-height: 1.5; }
.aviso--ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-border); }
.aviso--aviso { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-border); }
.aviso--error { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-border); }
.aviso--info { color: var(--fg-2); background: var(--info-bg); border-color: var(--info-border); }
.aviso a { color: inherit; font-weight: 700; }

/* ---------- Tu ruta (bloques) y fichas: waypoints con línea punteada, como las guías de docs ---------- */
.seccion__cabeza { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); }
.seccion__cabeza h2 { font-size: 1.3rem; }
.ruta, .fichas { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ruta::before, .fichas::before { content: ""; position: absolute; left: 31px; top: 26px; bottom: 26px; width: 2px; opacity: .45;
  background: repeating-linear-gradient(180deg, var(--navy-claro) 0 6px, transparent 6px 12px); }
.paso { position: relative; display: flex; gap: 14px; align-items: center; background: var(--surface);
  border: 1px solid var(--borde-tarjeta); border-radius: var(--r-xl); box-shadow: var(--sombra); padding: 14px 16px 14px 12px;
  text-decoration: none; color: var(--fg); transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
a.paso:hover { color: var(--fg); transform: translateY(-2px); border-color: rgb(252 181 20 / .45); box-shadow: var(--sombra-h); }
.paso--curso { border-color: rgb(252 181 20 / .7); box-shadow: var(--glow); }
.paso--cambio { border-color: var(--warn-border); }
.paso__circulo { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: var(--navy); color: var(--naranja);
  font-family: var(--mono); font-weight: 700; font-size: .72rem; letter-spacing: -.03em; display: grid; place-items: center;
  box-shadow: 0 0 0 4px var(--bg), var(--sh-card); }
.paso--completo .paso__circulo, .paso__circulo--ok { background: #15803D; color: #fff; }
.paso--cambio .paso__circulo { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-border); }
.paso--curso .paso__circulo { background: var(--naranja); color: var(--navy-oscuro); }
.paso__cuerpo { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.paso__titulo { font-weight: 700; color: var(--titulo); }
.paso__meta { font-size: var(--t-xs); color: var(--muted-fg); font-weight: 600; }
.siguiente-bloque { border: 1.5px dashed var(--border); border-radius: var(--r-xl); padding: var(--s-4); background: transparent; }
a.siguiente-bloque { box-shadow: none; }

/* ---------- Contenido de una ficha (se lee como un blog) ---------- */
.ficha { background: var(--surface); border: 1px solid var(--borde-tarjeta); border-radius: var(--r-xl);
  box-shadow: var(--sombra); padding: var(--s-5) var(--s-4); }
@media (min-width: 640px) { .ficha { padding: 32px 36px; } }
@media (min-width: 1024px) { .ficha { padding: 40px 56px; } }
.contenido { font-size: var(--t-lee); line-height: 1.7; display: flex; flex-direction: column; gap: 14px; color: var(--fg); }
@media (min-width: 1024px) { .contenido { font-size: 1.0625rem; line-height: 1.75; } }   /* a lo ancho, letra un poco mayor */
.contenido h2 { font-size: 1.25rem; margin-top: 12px; }
.contenido h3 { font-size: 1.08rem; margin-top: 6px; }
.contenido strong { color: var(--titulo); }
.contenido ul, .contenido ol { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 6px; }
.contenido li::marker { color: var(--acento-txt); font-weight: 700; }
.contenido blockquote { margin: 0; padding: 12px 16px; border-radius: var(--r-sm); background: var(--info-bg);
  border-left: 3px solid var(--navy-claro); color: var(--fg-2); }
.contenido code { font-family: var(--mono); font-size: .9em; background: var(--primary-suave); padding: 1px 6px; border-radius: var(--r-xs); }
.contenido em { color: var(--muted-fg); }
.contenido img { border-radius: var(--r-lg); border: 1px solid var(--border-suave); background: #fff; box-shadow: var(--sombra); }
.imagen-zoom { display: block; border-radius: var(--r-lg); text-decoration: none; position: relative; cursor: zoom-in; }
.imagen-zoom img { display: block; }
/* Chip «Ver en grande» sobre la imagen (como docs): abre el visor. */
.imagen-zoom::after { content: "Ver en grande"; position: absolute; right: 10px; bottom: 10px; padding: 6px 12px;
  border-radius: var(--r-pill); background: rgb(10 19 48 / .86); color: #fff; font-size: .75rem; font-weight: 700;
  box-shadow: 0 2px 8px rgb(0 0 0 / .25); transition: background .2s, color .2s; }
.imagen-zoom:hover::after, .imagen-zoom:focus-visible::after { background: var(--naranja); color: var(--navy-oscuro); }
@media (max-width: 639px) { .imagen-zoom::after { right: 6px; bottom: 6px; padding: 3px 9px; font-size: .6875rem; } }
.contenido hr { border: 0; border-top: 1px solid var(--border-suave); width: 100%; }
.contenido .task-list-item { list-style: none; margin-left: -1.4em; }
.contenido .task-list-item input { width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; accent-color: var(--navy); }
.tabla-caja { overflow-x: auto; overflow-y: hidden; border: 1px solid var(--border-suave); border-radius: var(--r-lg); }
.contenido table, .tabla { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.contenido th, .tabla th { background: var(--surface-2); text-align: left; padding: 11px 14px; font-size: .72rem;
  font-weight: 700; color: var(--muted-fg); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border-suave); }
.contenido td, .tabla td { padding: 11px 14px; border-top: 1px solid var(--border-suave); vertical-align: middle; }
.contenido tbody tr:first-child td, .tabla tbody tr:first-child td { border-top: 0; }
/* Debajo de 820 px una tabla se vuelve tarjetas (una por renglón), con su encabezado como etiqueta. */
@media (max-width: 819px) {
  .contenido .tabla-caja { border: 0; overflow: visible; }
  .contenido table thead, .tabla--tarjetas thead { display: none; }
  .contenido table, .contenido tbody, .contenido tr, .contenido td,
  .tabla--tarjetas, .tabla--tarjetas tbody, .tabla--tarjetas tr, .tabla--tarjetas td { display: block; width: 100%; }
  .contenido tr, .tabla--tarjetas tr { border: 1px solid var(--border-suave); border-radius: var(--r-lg); margin-bottom: 10px;
    overflow: hidden; background: var(--surface); box-shadow: var(--sombra); }
  .contenido td, .tabla--tarjetas td { border-top: 1px solid var(--border-suave); }
  .contenido td:first-child, .tabla--tarjetas td:first-child { border-top: 0; font-weight: 700; }
  .contenido td[data-label]::before, .tabla--tarjetas td[data-label]::before { content: attr(data-label);
    display: block; font-size: .72rem; font-weight: 700; color: var(--muted-fg); text-transform: uppercase; letter-spacing: .06em; }
}
.pie-ficha { position: sticky; bottom: 0; z-index: 5; background: var(--pie-bg); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border-suave);
  padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom)); }
.pie-ficha__dentro { max-width: var(--ancho); margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
/* Un solo renglón [‹] [Ya la leí] [›]; con repaso, en el celular baja a dos y en tablet/compu vuelve a uno.
   La separación va como margen de cada botón (no column-gap): si falta uno (primera ficha, última, o la › escondida
   mientras se ve «Siguiente») no queda un hueco de 10 px. */
.pie-ficha__botones { display: grid; row-gap: 10px; column-gap: 0; align-items: center; grid-template-columns: auto 1fr auto;
  grid-template-areas: "ant leida sig"; }
.pie-ficha__botones--repaso { grid-template-areas: "leida leida leida" "ant repaso sig"; }
.pie-ficha__ant { grid-area: ant; margin-right: 10px; }
.pie-ficha__leida { grid-area: leida; }
.pie-ficha__repaso { grid-area: repaso; }
.pie-ficha__sig { grid-area: sig; margin-left: 10px; }
/* De tablet para arriba (Joseph, 15-nov: «un poco más grande y del lado derecho»): la flecha ‹ a la izquierda y la
   acción a la derecha «Ya la leí · Siguiente · Repasar · ›», con botones de 48 px. En el celular sigue a lo ancho.
   Mismo orden visual que el Tab (sin `order`). Antes medía 1,230 px a lo ancho y luego quedó chico al centro. */
.pie-ficha .boton--grande.boton--icono { width: 48px; padding: 0; flex: 0 0 auto; }   /* ‹ y ›: 48 px en todos los tamaños, no se encogen */
@media (min-width: 640px) {
  .pie-ficha__botones, .pie-ficha__botones--repaso { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
  .pie-ficha__botones .pie-ficha__leida { display: contents; }   /* le gana al flex del final del archivo */
  .pie-ficha__ant { margin: 0 auto 0 0; }                        /* ‹ se queda a la izquierda; lo demás, a la derecha */
  .pie-ficha__repaso, .pie-ficha__sig { margin: 0; }
  /* Con `.pie-ficha__botones` delante: las reglas del celular del final del archivo (form y «Siguiente» que crecen)
     les ganaban por estar más abajo y el botón quedaba pegado a la izquierda (así se veía en producción). */
  .pie-ficha__botones .pie-ficha__leida form { flex: 0 0 auto; }
  .pie-ficha__botones .pie-ficha__siguiente { flex: 0 1 auto; min-width: 0; }   /* se encoge con «…» antes que encimarse */
  .pie-ficha .boton--grande { min-height: 48px; font-size: var(--t-base); padding: 0 22px; }
  .pie-ficha__leida .boton--ancho { width: auto; min-width: 13rem; }
}
/* Con «Siguiente» a la vista, la flecha › hace lo mismo (y serían dos paradas de Tab a la misma ficha). */
.pie-ficha__botones:has(.pie-ficha__siguiente:not([hidden])) .pie-ficha__sig { display: none; }
.cambio-aviso { margin-bottom: var(--s-3); }

/* ---------- Repaso ---------- */
.opciones { display: flex; flex-direction: column; gap: 10px; }
.opcion { text-align: left; min-height: 56px; padding: 12px 14px; border-radius: var(--r-lg); border: 1.5px solid var(--border);
  background: var(--surface); box-shadow: var(--sombra); font: inherit; font-weight: 600; color: var(--fg);
  display: flex; gap: var(--s-3); align-items: center; cursor: pointer; width: 100%;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.opcion:hover:not(:disabled) { border-color: var(--boton-hover-borde); transform: translateY(-1px); }
.opcion__letra { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; background: var(--navy); color: var(--naranja);
  font-family: var(--mono); font-weight: 700; font-size: .8rem; display: grid; place-items: center; }
.opcion--correcta { border-color: var(--ok); background: var(--ok-bg); font-weight: 700; }
.opcion--correcta .opcion__letra { background: #15803D; color: #fff; }
.opcion--incorrecta { border-color: var(--bad); background: var(--bad-bg); }
.opcion--incorrecta .opcion__letra { background: #B42318; color: #fff; }
.opcion:disabled { cursor: default; }

/* ---------- Buscar (barra grande, como la de docs) ---------- */
.buscador { display: flex; align-items: center; gap: 10px; min-height: 52px; border: 1.5px solid var(--borde-control);
  border-radius: var(--r-sm); padding: 0 6px 0 14px; background: var(--surface); box-shadow: var(--sombra); color: var(--muted-fg); }
.buscador:focus-within { border-color: var(--ring); box-shadow: var(--ring-shadow); }
.buscador input, .campo .buscador input { min-height: 0; padding: 0; border-radius: 0; box-shadow: none; flex: 1 1 auto; min-width: 0;
  border: 0; outline: none; font: inherit; font-size: 16px; background: transparent; color: var(--fg); }
.resultados { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.resultado { text-decoration: none; color: var(--fg); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
a.resultado:hover { color: var(--fg); transform: translateY(-2px); box-shadow: var(--sombra-h); }
.resultado__texto { font-size: var(--t-sm); color: var(--fg-2); line-height: 1.6; }
mark { background: #FFE7A3; color: #1F2A44; border-radius: 4px; padding: 0 2px; }

/* ---------- Formularios ---------- */
.formulario { display: flex; flex-direction: column; gap: var(--s-4); }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > label, .campo__etiqueta { font-size: .8125rem; font-weight: 700; color: var(--fg); }
.campo input, .campo select, .campo textarea { min-height: 44px; border: 1.5px solid var(--borde-control);
  border-radius: var(--r-sm); padding: 0 12px; font: inherit; font-size: 16px; color: var(--fg); background: var(--surface-2); width: 100%;
  transition: border-color .2s, box-shadow .2s; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--ring); box-shadow: var(--ring-shadow); }
.campo .buscador input:focus { box-shadow: none; }
.campo input[aria-invalid="true"] { border-color: var(--bad); }
.campo input:disabled { opacity: .6; }
.campo__fijo { min-height: 44px; border-radius: var(--r-sm); background: var(--primary-suave); padding: 0 12px;
  display: flex; align-items: center; font-weight: 700; color: var(--acento-txt); }
.campo__error { font-size: var(--t-xs); color: var(--bad); font-weight: 700; }
/* Contraseña con el ojito DENTRO de la caja (pedido de Joe: nada de botón completo al lado). */
.clave { position: relative; }
.campo .clave input { padding-right: 52px; }
.clave__ojo { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 40px; height: 40px;
  border: 0; border-radius: var(--r-xs); background: transparent; color: var(--muted-fg); display: grid; place-items: center; cursor: pointer; }
.clave__ojo:hover { color: var(--fg); background: var(--boton-hover-bg); }
input[type="password"]::-ms-reveal, input[type="password"]::-ms-clear { display: none; }   /* Edge pondría su propio ojo */
.clave__ojo .icono-ocultar { display: none; }
.clave__ojo[aria-pressed="true"] .icono-ocultar { display: block; }
.clave__ojo[aria-pressed="true"] .icono-ver { display: none; }
@media (pointer: coarse) { .clave__ojo { width: 44px; height: 44px; right: 2px; } }
.rejilla-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.rejilla-2 > .todo { grid-column: 1 / -1; }
@media (max-width: 639px) { .rejilla-2 { grid-template-columns: minmax(0, 1fr); } }
.opcion-tipo { display: flex; gap: var(--s-3); align-items: flex-start; padding: 14px; border-radius: var(--r-lg);
  border: 1.5px solid var(--border); cursor: pointer; transition: border-color .2s, background .2s; }
.opcion-tipo:has(input:checked) { border-color: var(--primary); background: var(--primary-suave); }
.opcion-tipo input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary); }

/* ---------- Modales (<dialog>: se cierra con Escape, X o botón; NUNCA con clic afuera) ---------- */
.modal { width: min(960px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 0;
  border: 1px solid var(--border); border-radius: var(--r-2xl); background: var(--surface); color: var(--fg); box-shadow: var(--sh-panel); }
.modal--corto { width: min(720px, calc(100vw - 32px)); }
.modal::backdrop { background: rgb(2 8 23 / .72); backdrop-filter: blur(6px); }
.modal__cabeza { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border-suave);
  position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal__cabeza h2 { flex: 1 1 auto; font-size: 1.05rem; }
.modal__cuerpo { padding: 20px; display: flex; flex-direction: column; gap: var(--s-4); }
.modal__cuerpo.rejilla-2 { display: grid; }   /* sin esto el flex de arriba ganaba y los modales salían en una columna */
.modal__pie { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border-suave); }
.ayuda-lista { margin: 0; display: grid; grid-template-columns: minmax(140px, max-content) minmax(0, 1fr); gap: 10px 20px; }
.ayuda-lista dt { font-weight: 700; color: var(--titulo); }
.ayuda-lista dd { margin: 0; color: var(--fg-2); }
@media (max-width: 639px) { .ayuda-lista { grid-template-columns: minmax(0, 1fr); } .ayuda-lista dd { margin-bottom: 6px; } }

/* ---------- Panel («Centro de control»; oscuro si no eliges claro) ---------- */
/* Siempre dos renglones: logo y botones arriba, pestañas abajo (en el celular se deslizan de lado). Con 7 pestañas
   y el 70 % de ancho, un solo renglón cortaba «Avance» hasta en 1600 px (revisión de interfaz 2026-11-14). */
.barra--panel .barra__dentro { padding-block: var(--s-2); display: grid; gap: var(--s-2) var(--s-4);
  grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "marca acciones" "nav nav"; }
.barra--panel .logo { grid-area: marca; }
.barra--panel .panel-nav { grid-area: nav; }
.barra--panel .barra__acciones { grid-area: acciones; }
.panel-nav { display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding-block: 4px;
  position: relative; }   /* ancla del texto oculto del contador: sin ella se salía y desbordaba la página */   /* que el foco no salga cortado */
.panel-nav::-webkit-scrollbar { display: none; }
.panel-nav a { flex-shrink: 0; min-height: var(--control); padding: 0 14px; border-radius: var(--r-pill); color: var(--muted-fg);
  font-weight: 700; font-size: var(--t-sm); display: flex; align-items: center; text-decoration: none; border: 1px solid transparent;
  transition: color .2s, border-color .2s; }
.panel-nav a:hover { color: var(--fg); border-color: var(--border); }
.panel-nav a[aria-current="page"] { background: var(--naranja); color: var(--navy-oscuro); }
.panel-nav .panel-nav__aparte { margin-left: auto; }
.caja-tabla { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); overflow-x: auto; overflow-y: hidden; }
.tabla td .acciones { display: flex; gap: var(--s-2); justify-content: flex-end; flex-wrap: wrap; }
.mini-barras { display: flex; gap: 4px; align-items: flex-end; height: 28px; }
.mini-barras span { width: 14px; border-radius: 4px; background: var(--border); min-height: 4px; }
.mini-barras .lleno { background: var(--navy-claro); }
.mini-barras .completo { background: #15803D; }
.rejilla-bloques { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 200px) 80px; gap: 10px 16px; align-items: center; }
.columnas { display: flex; flex-wrap: wrap; gap: var(--s-5); }
.columnas > .ancha { flex: 999 1 520px; min-width: 0; }
.columnas > .angosta { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: var(--s-4); }
.tarjetas-preguntas { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--s-4); }
.pregunta--borrador { border-style: dashed; }
.lista-opciones { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.lista-opciones li { padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid transparent; }
.lista-opciones li.correcta { background: var(--ok-bg); border-color: var(--ok-border); font-weight: 700; }

/* ---------- Editor ---------- */
.editor { display: flex; flex-wrap: wrap; gap: var(--s-4); }
.editor__panel { flex: 1 1 460px; min-width: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); display: flex; flex-direction: column; overflow: hidden; }
.editor__herramientas { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.editor__texto { flex: 1 1 auto; min-height: 480px; border: 0; padding: var(--s-4); font-family: var(--mono); font-size: 14px;
  line-height: 1.6; color: var(--fg); background: var(--surface-2); resize: vertical; width: 100%; }
.editor__texto:focus { outline: none; }
.editor__texto:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
/* La vista previa enseña la ficha en claro, aunque el panel esté en oscuro. */
.editor__vista { padding: var(--s-4); flex: 1 1 auto; background: #FFFFFF; color: #1F2A44;
  --fg: #1F2A44; --fg-2: #3A4456; --titulo: #00216B; --muted-fg: #5B6476; --border-suave: #E3E9F5; --acento-txt: #0033A0;
  --surface: #FFFFFF; --surface-2: #FBFCFE; --primary-suave: #EEF3FD; --info-bg: #EEF3FD; --sombra: var(--sh-card); --link: #0033A0; }
.soltar { border: 2px dashed rgb(252 181 20 / .5); border-radius: var(--r-xl); padding: var(--s-4); display: flex;
  flex-wrap: wrap; align-items: center; gap: var(--s-3); background: rgb(252 181 20 / .05); }
.soltar:focus-within, .soltar--encima { border-color: var(--naranja); background: rgb(252 181 20 / .12); }
.soltar--rechazo { border-color: var(--bad); background: var(--bad-bg); }
.historial { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

/* ---------- Entrar y crear contraseña: pantalla dividida, como el login de docs ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
@media (min-width: 900px) { .login { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.login__marca { position: relative; overflow: hidden; color: var(--noche-tinta); display: flex; flex-direction: column;
  justify-content: space-between; gap: var(--s-6); padding: 40px var(--s-6); min-height: 15rem;
  background: linear-gradient(165deg, var(--navy) 0%, var(--noche) 70%); }
@media (min-width: 900px) { .login__marca { padding: 56px 48px; } }
.login__marca .mancha { top: -4rem; right: -4rem; width: 20rem; height: 20rem; filter: blur(60px); background: rgb(252 181 20 / .16); }
.login__marca .logo { position: relative; color: #fff; font-size: 1.15rem; }
.login__marca .logo small { color: var(--noche-apagado); }
.login__copia { position: relative; max-width: 34rem; }
.login__copia h1 { color: #fff; font-size: clamp(1.5rem, 3.4vw, 2.3rem); line-height: 1.12; }
.login__copia h1 span { color: var(--naranja); }
.login__copia p { margin-top: 14px; color: var(--noche-apagado); line-height: 1.6; font-size: var(--t-base); }
.login__etiquetas { position: relative; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.login__etiquetas span { border: 1px solid var(--noche-linea); color: var(--noche-tinta); border-radius: var(--r-pill);
  padding: 5px 13px; font-size: .78rem; font-weight: 700; background: rgb(255 255 255 / .05); }
.login__etiquetas b { color: var(--naranja); font-size: .85rem; font-weight: 700; margin-left: 4px; }
.login__lado { position: relative; display: grid; place-items: center; padding: 40px 20px; background: var(--surface); }
.login__lado .tema-boton { position: absolute; top: 16px; right: 16px; }
.login__tarjeta { width: 100%; max-width: 25rem; display: flex; flex-direction: column; gap: 18px; }
.login__tarjeta h2 { font-size: 1.45rem; }
.login__intro { color: var(--muted-fg); font-size: .9rem; line-height: 1.55; margin-top: -10px; }
.login__tarjeta .boton--primario { width: 100%; min-height: 48px; font-size: var(--t-base); margin-top: 4px; }
.login__ayuda { font-size: .82rem; color: var(--muted-fg); text-align: center; line-height: 1.6; }
@media (max-width: 899px) { .login__lado { place-items: start center; padding-top: 56px; } }

/* ---------- Pie ---------- */
.pie { border-top: 1px solid var(--border-suave); background: var(--surface); margin-top: auto; }
.pie__dentro { max-width: var(--ancho); margin: 0 auto; padding: 20px var(--s-4); display: flex; flex-wrap: wrap; gap: 8px 16px;
  justify-content: space-between; font-size: .78rem; color: var(--muted-fg); }
@media (min-width: 640px) { .pie__dentro { padding: 22px var(--s-6); } }
@media (min-width: 1024px) { .pie__dentro { padding-inline: 0; } }

/* ---------- Celular ---------- */
/* En el celular la barra no se queda pegada: con el pie de la ficha tapaban el 27 % de la pantalla al leer. */
@media (max-width: 639px) { .barra { position: static; } }
@media (max-width: 479px) {
  .logo { font-size: .875rem; }
  .logo small { font-size: .6rem; letter-spacing: .12em; }
  .barra__acciones { gap: 6px; margin-left: auto; }
  .barra__dentro { flex-wrap: wrap; row-gap: 6px; padding-block: 8px; }   /* con «Panel» (admin) no cabe en uno */
}

/* ---------- Anchos y altos en % (la CSP no deja style= en línea; las barras usan estas clases) ---------- */
.w-0{width:0%}.w-1{width:1%}.w-2{width:2%}.w-3{width:3%}.w-4{width:4%}.w-5{width:5%}.w-6{width:6%}.w-7{width:7%}.w-8{width:8%}.w-9{width:9%}.w-10{width:10%}.w-11{width:11%}.w-12{width:12%}.w-13{width:13%}.w-14{width:14%}.w-15{width:15%}.w-16{width:16%}.w-17{width:17%}.w-18{width:18%}.w-19{width:19%}
.w-20{width:20%}.w-21{width:21%}.w-22{width:22%}.w-23{width:23%}.w-24{width:24%}.w-25{width:25%}.w-26{width:26%}.w-27{width:27%}.w-28{width:28%}.w-29{width:29%}.w-30{width:30%}.w-31{width:31%}.w-32{width:32%}.w-33{width:33%}.w-34{width:34%}.w-35{width:35%}.w-36{width:36%}.w-37{width:37%}.w-38{width:38%}.w-39{width:39%}
.w-40{width:40%}.w-41{width:41%}.w-42{width:42%}.w-43{width:43%}.w-44{width:44%}.w-45{width:45%}.w-46{width:46%}.w-47{width:47%}.w-48{width:48%}.w-49{width:49%}.w-50{width:50%}.w-51{width:51%}.w-52{width:52%}.w-53{width:53%}.w-54{width:54%}.w-55{width:55%}.w-56{width:56%}.w-57{width:57%}.w-58{width:58%}.w-59{width:59%}
.w-60{width:60%}.w-61{width:61%}.w-62{width:62%}.w-63{width:63%}.w-64{width:64%}.w-65{width:65%}.w-66{width:66%}.w-67{width:67%}.w-68{width:68%}.w-69{width:69%}.w-70{width:70%}.w-71{width:71%}.w-72{width:72%}.w-73{width:73%}.w-74{width:74%}.w-75{width:75%}.w-76{width:76%}.w-77{width:77%}.w-78{width:78%}.w-79{width:79%}
.w-80{width:80%}.w-81{width:81%}.w-82{width:82%}.w-83{width:83%}.w-84{width:84%}.w-85{width:85%}.w-86{width:86%}.w-87{width:87%}.w-88{width:88%}.w-89{width:89%}.w-90{width:90%}.w-91{width:91%}.w-92{width:92%}.w-93{width:93%}.w-94{width:94%}.w-95{width:95%}.w-96{width:96%}.w-97{width:97%}.w-98{width:98%}.w-99{width:99%}
.w-100{width:100%}
.h-0{height:0%}.h-1{height:1%}.h-2{height:2%}.h-3{height:3%}.h-4{height:4%}.h-5{height:5%}.h-6{height:6%}.h-7{height:7%}.h-8{height:8%}.h-9{height:9%}.h-10{height:10%}.h-11{height:11%}.h-12{height:12%}.h-13{height:13%}.h-14{height:14%}.h-15{height:15%}.h-16{height:16%}.h-17{height:17%}.h-18{height:18%}.h-19{height:19%}
.h-20{height:20%}.h-21{height:21%}.h-22{height:22%}.h-23{height:23%}.h-24{height:24%}.h-25{height:25%}.h-26{height:26%}.h-27{height:27%}.h-28{height:28%}.h-29{height:29%}.h-30{height:30%}.h-31{height:31%}.h-32{height:32%}.h-33{height:33%}.h-34{height:34%}.h-35{height:35%}.h-36{height:36%}.h-37{height:37%}.h-38{height:38%}.h-39{height:39%}
.h-40{height:40%}.h-41{height:41%}.h-42{height:42%}.h-43{height:43%}.h-44{height:44%}.h-45{height:45%}.h-46{height:46%}.h-47{height:47%}.h-48{height:48%}.h-49{height:49%}.h-50{height:50%}.h-51{height:51%}.h-52{height:52%}.h-53{height:53%}.h-54{height:54%}.h-55{height:55%}.h-56{height:56%}.h-57{height:57%}.h-58{height:58%}.h-59{height:59%}
.h-60{height:60%}.h-61{height:61%}.h-62{height:62%}.h-63{height:63%}.h-64{height:64%}.h-65{height:65%}.h-66{height:66%}.h-67{height:67%}.h-68{height:68%}.h-69{height:69%}.h-70{height:70%}.h-71{height:71%}.h-72{height:72%}.h-73{height:73%}.h-74{height:74%}.h-75{height:75%}.h-76{height:76%}.h-77{height:77%}.h-78{height:78%}.h-79{height:79%}
.h-80{height:80%}.h-81{height:81%}.h-82{height:82%}.h-83{height:83%}.h-84{height:84%}.h-85{height:85%}.h-86{height:86%}.h-87{height:87%}.h-88{height:88%}.h-89{height:89%}.h-90{height:90%}.h-91{height:91%}.h-92{height:92%}.h-93{height:93%}.h-94{height:94%}.h-95{height:95%}.h-96{height:96%}.h-97{height:97%}.h-98{height:98%}.h-99{height:99%}
.h-100{height:100%}

/* ---------- Movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Dudas al administrador ---------- */
.duda__texto { white-space: pre-line; overflow-wrap: anywhere; }
.ficha__duda { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border-suave); display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between; gap: 10px; }
.contador { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px;
  border-radius: var(--r-pill); background: var(--naranja); color: var(--navy-oscuro); font-size: .72rem; font-weight: 800; }
.panel-nav a[aria-current="page"] .contador { background: var(--navy-oscuro); color: var(--naranja); }
a.aviso { text-decoration: none; }
a.aviso:hover { border-color: var(--boton-hover-borde); }
.tarjeta__acciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tarjeta__acciones .boton, .tarjeta__acciones form { width: 100%; }
.pie__enlace, a.pastilla { min-height: var(--control); display: inline-flex; align-items: center; }
.aviso__accion { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.vacio { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Ficha: barra del bloque y «Siguiente» al palomear ---------- */
.avance-bloque { max-width: 32rem; }
.avance-bloque .chico { white-space: nowrap; }
.pie-ficha__leida { display: flex; gap: 10px; min-width: 0; }
.pie-ficha__leida form { flex: 1 1 auto; min-width: 0; }
.pie-ficha__leida:has(.pie-ficha__siguiente:not([hidden])) form { flex: 0 0 auto; }   /* «Leída» nunca se encoge debajo de su ancho: se encimaba con «Siguiente» */
.pie-ficha__siguiente { flex: 1 1 auto; min-width: 0; }
.pie-ficha__sig-texto { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 639px) {
  /* En el celular se ve «Siguiente: 2.4»; el título se oculta a la vista, no al lector de pantalla. */
  .pie-ficha__sig-titulo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  /* «· deshacer» se oculta a la vista pero el lector de pantalla lo sigue leyendo; así «Siguiente» cabe completo. */
  .pie-ficha__deshacer { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .pie-ficha .boton--grande:not(.boton--icono) { padding: 0 14px; }
}
/* Hasta 1199 px el título de la siguiente ficha no cabe completo: se ve «Siguiente: 2.4» (como en el celular) y el
   lector de pantalla sigue leyendo el título, en vez de cortarlo con «…». */
@media (min-width: 640px) and (max-width: 767px) {   /* ficha leída: «Leída» sin «· deshacer» para que «Siguiente» quepa */
  .pie-ficha__deshacer { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .pie-ficha__leida:has(.pie-ficha__siguiente:not([hidden])) .boton--ancho { min-width: 0; }
}
@media (min-width: 640px) and (max-width: 1199px) {
  .pie-ficha__sig-titulo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 340px) { .pie-ficha__siguiente { font-size: .8125rem; } }
@media (max-width: 340px) {   /* celulares muy chicos: «Leída» queda en la palomita (el lector la sigue diciendo) */
  .pie-ficha__leida:has(.pie-ficha__siguiente:not([hidden])) .pie-ficha__leida-txt {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---------- Visor de imágenes (como el de docs): pantalla completa, oscuro en los dos temas ---------- */
.visor { width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #050B1D; color: var(--noche-tinta); overscroll-behavior: contain; }
/* Con el visor abierto la página de atrás no se mueve (al cerrar, sigues donde ibas). */
html:has(.visor[open]) { overflow: hidden; }
.visor[open] { display: flex; flex-direction: column; }
.visor::backdrop { background: #050B1D; }
.visor :focus-visible { outline-color: var(--naranja); }
.visor__cabeza { display: flex; align-items: center; gap: 14px; padding: 12px 18px; }
.visor__cabeza small { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; color: var(--naranja); }
.visor__cabeza b { display: block; font-size: 1rem; margin-top: 2px; overflow-wrap: anywhere; }
.visor__x { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgb(255 255 255 / .1);
  color: var(--noche-tinta); display: grid; place-items: center; cursor: pointer; }
.visor__x:hover { background: rgb(255 255 255 / .18); }
.visor__escenario { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 16px; overflow: auto;
  overscroll-behavior: contain; }
.visor__error { color: var(--noche-tinta); text-align: center; max-width: 28rem; }
.visor__escenario img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff;
  box-shadow: 0 10px 40px rgb(0 0 0 / .5); cursor: zoom-in; }
.visor--real .visor__escenario { justify-content: safe center; align-items: safe center; }   /* si ya cabe, se queda centrada */
.visor--real .visor__escenario img { max-width: none; max-height: none; border-radius: 0; cursor: zoom-out; }
.visor__pie { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.visor__boton { background: transparent; color: var(--noche-tinta); border-color: #5D72AE; min-height: 44px; flex: 1 1 0; max-width: 12rem; }
.visor__boton[aria-pressed="true"] { border-color: var(--naranja); color: var(--naranja-claro); }
.visor__boton:hover { background: rgb(255 255 255 / .06); border-color: var(--noche-apagado); color: var(--noche-tinta); }
.visor__boton:disabled { opacity: .35; cursor: default; }
.visor__pista { display: none; margin: 0; padding: 8px 16px 0; text-align: center; font-size: var(--t-xs); color: var(--noche-apagado); }
@media (max-width: 639px) and (orientation: portrait) { .visor__pista { display: block; } }
.visor--real .visor__pista { display: none; }
