/* Curso de Excel · Fusionik — prototipo de escritorio
   Sistema: neutros fríos + un solo acento (el azul de Fusionik). El verde de Excel vive solo
   dentro de la hoja simulada, que es «el producto» y tiene que parecerse a Excel.
   Tipografía: Inter (texto), Inter Tight (titulares), JetBrains Mono (fórmulas). */
:root {
  --ink: #0b1220; --ink-2: #1d2939; --text: #344054; --muted: #667085; --faint: #98a2b3;
  --bg: #f7f8fa; --surface: #ffffff; --line: #e4e7ec; --line-2: #d0d5dd; --tint: #f2f4f7;
  --primary: #2563eb; --primary-dark: #1d4ed8; --primary-tint: #eef4ff; --primary-line: #c7d7fe;
  --ok: #12805c; --ok-tint: #ecfdf3; --warn: #b54708; --warn-tint: #fffaeb; --err: #b42318; --err-tint: #fef3f2;
  --oro: #c99700; --plata: #8a94a6; --bronce: #b5651d;
  --xl: #107c41; --xl-claro: #e7f3ec; --xl-sel: rgba(16, 124, 65, .10);
  --cinta: #f8f8f8; --cinta-borde: #e1e1e1; --cab: #f3f3f3; --cab-borde: #d6d6d6; --rejilla: #e2e2e2;
  --r-sm: 6px; --r: 10px; --r-lg: 14px;
  --sh-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --sh: 0 1px 3px rgba(16, 24, 40, .06), 0 4px 12px -4px rgba(16, 24, 40, .08);
  --sh-lg: 0 24px 48px -12px rgba(16, 24, 40, .18);
  --sombra: var(--sh-lg);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-h: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', Consolas, monospace;
  --hoja-font: 'Aptos', 'Calibri', 'Segoe UI', Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
a { color: var(--primary-dark); }
h1, h2, h3, h4 { font-family: var(--font-h); color: var(--ink); letter-spacing: -.015em; }
code { font-family: var(--mono); font-size: .86em; background: var(--tint); color: var(--ink-2); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); }
kbd { font-family: var(--font); font-size: .8em; font-weight: 600; background: #fff; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--ink); white-space: nowrap; }
button { font-family: inherit; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.mini { font-size: 13px; color: var(--muted); }
.kicker { margin: 0 0 14px; font-size: 14px; font-weight: 600; color: var(--primary-dark); }
.lead { font-size: 18px; line-height: 1.6; color: var(--text); }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: 14.5px; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; white-space: nowrap; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-pri { background: var(--primary); color: #fff; box-shadow: var(--sh-sm), inset 0 -1px 0 rgba(0, 0, 0, .12); }
.btn-pri:hover { background: var(--primary-dark); }
.btn-pri svg:last-child { transition: transform .15s var(--ease); }
.btn-pri:hover svg:last-child { transform: translateX(2px); }
.btn-sec { background: #fff; color: var(--ink-2); border-color: var(--line-2); box-shadow: var(--sh-sm); }
.btn-sec:hover { background: var(--tint); }
.btn-ghost { background: none; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: var(--tint); }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15.5px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn:disabled { opacity: .5; cursor: default; }
button.link { border: 0; background: none; padding: 0; color: var(--primary-dark); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.barra { height: 6px; background: var(--tint); border-radius: 9px; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--nv, var(--primary)); border-radius: 9px; transition: width .6s var(--ease); }

/* ---------- cabecera ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1200px; margin: 0 auto; padding: 0 32px; height: 64px; display: flex; align-items: center; gap: 28px; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.marca img { display: block; }
.marca b { display: block; font-family: var(--font-h); font-size: 16px; line-height: 1.1; letter-spacing: -.01em; }
.marca small { display: block; font-size: 12.5px; color: var(--muted); }
.top-nav { display: flex; gap: 4px; flex: 1; }
.top-nav a { padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; font-size: 14.5px; }
.top-nav a:hover { background: var(--tint); color: var(--ink); }
.top-nav a[aria-current] { color: var(--ink); background: var(--tint); }
.top-stats { display: flex; align-items: center; gap: 14px; }
.stat { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stat b { color: var(--ink); font-weight: 600; }
.stat small { font-size: 12.5px; }
.stat svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.stat.viva svg { color: #e8590c; fill: #ffedd5; }
.stat .rango-bar { width: 54px; }
.stat.rango { flex-direction: column; align-items: flex-start; gap: 3px; }
.rango-bar { height: 4px; background: var(--tint); border-radius: 9px; overflow: hidden; }
.rango-bar i { display: block; height: 100%; background: var(--primary); }

/* ---------- portada ---------- */
.portada, .sp, .muro, .exp { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; padding: 72px 0 64px; }
.hero h1 { font-size: 50px; line-height: 1.08; margin: 0 0 20px; letter-spacing: -.022em; font-weight: 700; }
.hero .lead { margin: 0 0 28px; max-width: 560px; }
.hero-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-lista { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--muted); }
.hero-lista li { display: flex; align-items: center; gap: 7px; }
.hero-lista svg { width: 16px; height: 16px; fill: none; stroke: var(--ok); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* la miniatura del producto */
.demo { position: relative; padding: 70px 0 96px; }
.demo-win { background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--sh-lg); overflow: hidden; font-family: var(--hoja-font); }
.demo-fx { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.demo-nb { width: 44px; padding: 2px 6px; border: 1px solid var(--line-2); border-radius: 3px; color: var(--ink); }
.demo-sep { width: 1px; height: 16px; background: var(--line); }
.demo-fx i { font-family: Georgia, serif; color: var(--muted); }
.demo-f { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; overflow: hidden; }
.demo-hoja { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.demo-hoja th { background: var(--cab); color: #555; font-weight: 400; font-size: 12px; border: 1px solid var(--cab-borde); height: 22px; }
.demo-hoja thead th:first-child { width: 34px; }
.demo-hoja td { border: 1px solid var(--rejilla); height: 28px; padding: 0 8px; color: #111; }
.demo-hoja td.cab { font-weight: 700; background: #f7f9fc; }
.demo-hoja td.num { text-align: right; font-variant-numeric: tabular-nums; }
.demo-hoja td.sel { outline: 2px solid var(--xl); outline-offset: -2px; background: var(--xl-claro); }
.demo-mision { position: absolute; right: -18px; top: 0; width: 236px; display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--sh-lg); }
.demo-mision small, .demo-ex small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.demo-mision p, .demo-ex p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.demo-ok { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); }
.demo-ok svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.demo-ex { position: absolute; left: -22px; bottom: 0; width: 340px; background: var(--ink); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--sh-lg); }
.demo-ex small { color: #93c5fd; }
.demo-ex p { color: #e4e7ec; }
.demo-ex code { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .15); color: #fff; }

.como { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 72px; }
.como > div { background: #fff; padding: 26px 26px 24px; }
.como-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: var(--primary-tint); color: var(--primary-dark); margin-bottom: 14px; }
.como-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.como h3 { font-size: 17px; margin: 0 0 6px; }
.como p { margin: 0; font-size: 14.5px; color: var(--muted); }

.progreso { display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 72px; }
.pg-bloque, .pg-sigue { background: #fff; padding: 22px 24px; }
.pg-bloque > small { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.pg-bloque > small.ok { color: var(--ok); }
.pg-num { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.pg-num b { font-family: var(--font-h); font-size: 30px; color: var(--ink); letter-spacing: -.02em; }
.pg-num span { font-size: 14px; color: var(--muted); }
.semana { display: flex; gap: 6px; margin-bottom: 8px; }
.semana span { flex: 1; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--faint); }
.semana span i { display: grid; place-items: center; height: 26px; border-radius: 6px; background: var(--tint); margin-bottom: 4px; }
.semana span i svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.semana span.on i { background: var(--ok); }
.semana span.hoy { color: var(--ink); }
.semana span.hoy i { box-shadow: inset 0 0 0 1.5px var(--ink); }
.pg-sigue { position: relative; display: block; text-decoration: none; color: var(--ink); transition: background .15s; }
a.pg-sigue:hover { background: var(--primary-tint); }
.pg-sigue small { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.pg-sigue b { display: block; font-family: var(--font-h); font-size: 18px; letter-spacing: -.01em; margin-bottom: 4px; padding-right: 30px; }
.pg-sigue span { font-size: 13.5px; color: var(--muted); }
.pg-sigue svg { position: absolute; right: 22px; top: 50%; width: 20px; height: 20px; margin-top: -10px; fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.nivel { margin: 0 0 72px; scroll-margin-top: 88px; }
.nivel-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.nivel-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--nv); margin-bottom: 6px; }
.nivel-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--nv); }
.nivel-cab h2 { font-size: 28px; margin: 0; letter-spacing: -.02em; }
.nivel-prog { width: 200px; text-align: right; font-size: 13.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.nivel-prog .barra { margin-top: 8px; }
.sub { font-size: 17px; margin: 36px 0 14px; display: flex; align-items: baseline; gap: 12px; }
.sub small { font-family: var(--font); font-size: 13.5px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tarjeta { position: relative; display: flex; flex-direction: column; padding: 18px 18px 20px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
a.tarjeta:hover { border-color: var(--line-2); box-shadow: var(--sh); transform: translateY(-2px); }
.t-cab { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.t-num { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-weight: 600; font-size: 13.5px; background: var(--tint); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.t-num svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.t-tipo { font-size: 12px; font-weight: 600; color: var(--nv); }
.t-meta { margin-left: auto; font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.tarjeta h3 { font-size: 16px; margin: 0 0 6px; letter-spacing: -.01em; }
.tarjeta p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.tarjeta.hecha .t-num { background: var(--nv); color: #fff; }
.tarjeta.hecha .t-meta { color: var(--nv); font-weight: 600; }
.tarjeta.jefe, .tarjeta.prueba { border-color: color-mix(in srgb, var(--nv) 30%, var(--line)); }
.tarjeta.pronto { background: transparent; border-style: dashed; }
.tarjeta.pronto h3, .tarjeta.pronto p { color: var(--faint); }
.candado { position: absolute; top: 18px; right: 16px; width: 18px; height: 18px; color: var(--faint); }
.candado svg, .lv svg, .menu-cinta svg, .backstage svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.medalla { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--ink-2); }
.medalla i { width: 10px; height: 10px; border-radius: 50%; background: var(--m); box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .12); }
.m-oro { --m: var(--oro); } .m-plata { --m: var(--plata); } .m-bronce { --m: var(--bronce); }
.paso-sig { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 36px 40px; border-radius: var(--r-lg); background: var(--ink); color: #c7cdd8; text-decoration: none; margin: 0 0 72px; transition: background .2s; }
.paso-sig:hover { background: #111a2e; }
.paso-sig small { font-size: 13.5px; font-weight: 600; color: #8fb3ff; }
.paso-sig h2 { font-size: 28px; color: #fff; margin: 8px 0 8px; letter-spacing: -.02em; }
.paso-sig p { margin: 0; max-width: 680px; }
.paso-flecha { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .2); }
.paso-flecha svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease); }
.paso-sig:hover .paso-flecha svg { transform: translateX(3px); }
.pie { border-top: 1px solid var(--line); background: #fff; }
.pie-in { max-width: 1200px; margin: 0 auto; padding: 24px 32px 32px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

/* ---------- lección ---------- */
.lv { height: 100vh; display: flex; flex-direction: column; background: #fff; overflow: hidden; }
.lv-top { flex: none; display: flex; align-items: center; gap: 16px; padding: 0 10px 0 6px; height: 46px; background: var(--xl); color: #fff; }
.lv-volver { display: flex; align-items: center; gap: 4px; color: #fff; text-decoration: none; font-size: 13.5px; font-weight: 600; padding: 6px 10px 6px 6px; border-radius: 6px; }
.lv-volver:hover, .lv-ico:hover { background: rgba(255, 255, 255, .14); }
.lv-volver svg { width: 18px; height: 18px; }
.lv-tit { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; white-space: nowrap; overflow: hidden; }
.lv-tit b { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.lv-nivel { font-size: 12.5px; opacity: .75; }
.lv-puntos { display: flex; gap: 5px; }
.lv-puntos i { width: 22px; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .25); transition: background .3s; }
.lv-puntos i.act { background: rgba(255, 255, 255, .65); }
.lv-puntos i.ok { background: #fff; }
.lv-reloj { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 14px; background: rgba(0, 0, 0, .18); padding: 4px 10px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.lv-reloj svg { width: 15px; height: 15px; }
.lv-stats { display: flex; gap: 12px; }
.lv-stat { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.lv-stat svg { width: 16px; height: 16px; }
.lv-ico { background: none; border: 0; color: #fff; cursor: pointer; padding: 6px; border-radius: 6px; display: grid; }
.lv-ico svg { width: 19px; height: 19px; }
.lv-main { flex: 1; display: flex; min-height: 0; }
.lv-hoja { flex: 1; min-width: 0; display: flex; }
.lv-panel { flex: none; width: 360px; border-left: 1px solid var(--cinta-borde); background: var(--bg); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.pn-intro { font-size: 14px; line-height: 1.6; color: var(--text); padding: 2px 2px 0; }
.pn-mision { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--nv); border-radius: var(--r); padding: 16px; box-shadow: var(--sh); }
.pn-mision.entra { animation: entra .4s var(--ease); }
@keyframes entra { from { transform: translateY(10px); } to { transform: none; } }
.pn-cab { display: flex; align-items: center; gap: 12px; font-size: 12.5px; font-weight: 600; color: var(--nv); margin-bottom: 10px; }
.pn-bar { flex: 1; height: 4px; background: var(--tint); border-radius: 9px; overflow: hidden; }
.pn-bar i { display: block; height: 100%; background: var(--nv); transition: width .4s var(--ease); }
.pn-texto { font-size: 15px; line-height: 1.6; color: var(--ink); }
.pn-texto small { color: var(--muted); }
.pn-ayuda { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pn-ayuda button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: #fff; padding: 5px 10px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--ink-2); }
.pn-ayuda button:hover { background: var(--tint); }
.pn-ayuda button[aria-pressed="true"] { background: var(--tint); border-color: var(--faint); }
.pn-ayuda svg { width: 15px; height: 15px; }
.pn-explicar { color: var(--primary-dark) !important; border-color: var(--primary-line) !important; }
.pn-explicar:hover { background: var(--primary-tint) !important; }
.pn-caja { margin-top: 10px; padding: 10px 12px; border-radius: 8px; font-size: 14px; line-height: 1.5; }
.pn-caja.pista { background: var(--warn-tint); border: 1px solid #fedf89; }
.pn-caja.sol { background: var(--tint); border: 1px solid var(--line); }
.pn-caja.sol code { display: block; background: none; border: 0; padding: 0; word-break: break-all; }
.pn-porque { margin-top: 8px; border: 0; background: none; padding: 0; color: var(--primary-dark); font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.pn-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pn-lista li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; font-size: 13px; line-height: 1.45; color: var(--muted); border-radius: 6px; }
.pn-lista li > span { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--tint); color: var(--muted); border: 1px solid var(--line); }
.pn-lista li > span svg { width: 12px; height: 12px; stroke-width: 2.6; }
.pn-lista li.act { background: #fff; color: var(--ink); }
.pn-lista li.act > span { background: var(--nv); border-color: var(--nv); color: #fff; }
.pn-lista li.ok > span { background: var(--ok); border-color: var(--ok); color: #fff; }
.pn-pie { margin-top: auto; font-size: 12.5px; color: var(--muted); text-align: center; padding-top: 6px; }

/* panel de explicación */
.pn-ex { display: flex; flex-direction: column; gap: 10px; }
.pn-volver { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 4px 6px 4px 2px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-radius: 6px; }
.pn-volver:hover { color: var(--ink); background: var(--tint); }
.pn-volver svg { width: 16px; height: 16px; }
.pn-ex-tit { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pn-ex-tit h3 { margin: 0; font-size: 17px; }
.pn-ex-celda { font-size: 12.5px; font-weight: 600; color: var(--xl); background: var(--xl-claro); padding: 2px 8px; border-radius: 5px; }
.pn-ex-in { width: 100%; height: 36px; border: 1px solid var(--line-2); border-radius: 7px; padding: 0 10px; font-family: var(--mono); font-size: 13px; color: var(--ink); background: #fff; }
.pn-ex-in:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.pn-ex-ayuda { margin: 0; font-size: 12.5px; color: var(--muted); }
.hj-explicar { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid #b9c9f5; background: #f3f6ff; color: #1d4ed8; border-radius: 4px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: var(--font); }
.hj-explicar:hover { background: #e6edff; }
.hj-explicar svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* la explicación en sí (panel de lección y página del explicador) */
.ex { display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.ex-formula { font-family: var(--mono); font-size: 13.5px; line-height: 1.6; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 8px; word-break: break-all; color: var(--ink); }
.ex-igual { color: var(--muted); }
.ex-fn { color: var(--ink); font-weight: 600; }
.ex-ref { font-weight: 600; }
.ex-str { color: #a15c07; }
.ex-num { color: #0e7490; }
.ex-sep { color: var(--faint); padding: 0 1px; }
.ex-res { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 8px; background: var(--xl-claro); color: var(--xl); font-size: 13px; }
.ex-res b { color: #0b4f2b; font-size: 14px; text-align: right; word-break: break-word; }
.ex-frase { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink); }
.ex-frase code, .ex-args code, .ex-notas code { white-space: nowrap; }
.ex-h { margin: 8px 0 0; font-size: 13px; font-family: var(--font); font-weight: 600; color: var(--muted); letter-spacing: 0; }
.ex-fn-caja { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.ex-fn-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.ex-fn-cab code { font-weight: 700; font-size: 13px; background: var(--primary-tint); border-color: var(--primary-line); color: var(--primary-dark); }
.ex-fn-cab span { font-size: 12px; color: var(--muted); }
.ex-fn-caja > p { margin: 0 0 8px; color: var(--text); line-height: 1.5; }
.ex-args { width: 100%; border-collapse: collapse; font-size: 13px; }
.ex-args th, .ex-args td { text-align: left; vertical-align: top; padding: 7px 6px 7px 0; border-top: 1px solid var(--line); line-height: 1.45; }
.ex-args th { font-weight: 600; color: var(--ink-2); width: 30%; padding-right: 8px; }
.ex-args td:nth-child(2) { width: 30%; padding-right: 8px; word-break: break-all; }
.ex-args td:nth-child(3) { color: var(--muted); }
.ex-pasos { margin: 0; padding: 0; list-style: none; counter-reset: p; display: flex; flex-direction: column; gap: 6px; }
.ex-pasos li { counter-increment: p; position: relative; padding: 8px 10px 8px 36px; background: #fff; border: 1px solid var(--line); border-radius: 8px; line-height: 1.5; }
.ex-pasos li::before { content: counter(p); position: absolute; left: 10px; top: 9px; width: 18px; height: 18px; border-radius: 50%; background: var(--tint); color: var(--muted); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.ex-pasos li code { background: none; border: 0; padding: 0; word-break: break-all; }
.ex-pasos .ex-sust { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.ex-pasos .ex-v { display: block; font-weight: 600; color: var(--xl); word-break: break-word; }
.ex-pasos small { display: block; color: var(--muted); font-size: 12.5px; }
.ex-pasos li.ex-saltado { opacity: .55; }
.ex-notas { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
.ex-err { padding: 10px 12px; border-radius: 8px; background: var(--err-tint); border: 1px solid #fecdca; color: #912018; line-height: 1.5; }
.ex-vacio { padding: 18px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 8px; font-size: 14px; }

/* recorrido de bienvenida */
.tour { position: fixed; inset: 0; z-index: 140; }
.tour-foco { position: fixed; border-radius: 8px; box-shadow: 0 0 0 9999px rgba(11, 18, 32, .55); transition: all .3s var(--ease); pointer-events: none; }
.tour-caja { position: fixed; background: #fff; border-radius: var(--r); padding: 18px 18px 14px; box-shadow: var(--sh-lg); transition: left .3s var(--ease), top .3s var(--ease); }
.tour-caja small { font-size: 12px; font-weight: 600; color: var(--muted); }
.tour-caja h3 { margin: 4px 0 6px; font-size: 17px; }
.tour-caja p { margin: 0 0 14px; font-size: 14px; line-height: 1.55; }
.tour-btns { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.tour-saltar { margin-right: auto; border: 0; background: none; color: var(--muted); font-size: 13.5px; cursor: pointer; padding: 6px 2px; }
.tour-saltar:hover { color: var(--ink); }

/* ---------- cinta ---------- */
.cinta { flex: none; background: var(--cinta); border-bottom: 1px solid var(--cinta-borde); user-select: none; }
.c-pest { display: flex; gap: 2px; padding: 4px 10px 0; background: #fff; }
.c-tab { border: 0; background: none; padding: 7px 14px 8px; font-size: 13px; color: #333; cursor: pointer; border-radius: 6px 6px 0 0; position: relative; }
.c-tab:hover { background: #f0f0f0; }
.c-tab.act { color: var(--xl); font-weight: 600; }
.c-tab.act::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 3px; border-radius: 3px; background: var(--xl); }
.c-tab.archivo { background: var(--xl); color: #fff; font-weight: 600; border-radius: 6px; margin: 0 6px 4px 0; }
.c-tab.archivo:hover { background: #0b6a36; }
.c-cuerpo { height: 96px; }
.c-panel { display: none; height: 100%; padding: 4px 8px 0; gap: 0; align-items: stretch; }
.c-panel.act { display: flex; }
.grupo { display: flex; flex-direction: column; justify-content: space-between; padding: 0 10px; border-right: 1px solid var(--cinta-borde); }
.g-fila { display: flex; align-items: flex-start; gap: 2px; }
.g-col { display: flex; flex-direction: column; gap: 1px; }
.g-col > .cb { height: 22px; }
.g-nom { font-size: 11px; color: #666; text-align: center; padding: 2px 0 4px; }
.g-fuente, .g-cats { flex-wrap: wrap; max-width: 380px; }
.g-cats { max-width: 520px; }
.cb { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 28px; height: 26px; padding: 0 6px; border: 1px solid transparent; background: none; border-radius: 4px; cursor: pointer; color: #222; font-size: 12px; position: relative; }
.cb:hover { background: #e6e6e6; border-color: #d0d0d0; }
.cb.on { background: #d6e8dc; border-color: #9ccbb0; }
.cb svg { width: 18px; height: 18px; }
.cb.grande { flex-direction: column; height: 66px; min-width: 56px; padding: 4px 6px; gap: 3px; }
.cb.grande svg { width: 26px; height: 26px; color: var(--xl); }
.cb.grande span { font-size: 11.5px; line-height: 1.15; max-width: 76px; text-align: center; }
.cb.cat { height: 28px; font-size: 12px; padding: 0 8px; }
.cb .t { font-size: 15px; font-family: Georgia, 'Times New Roman', serif; color: #222; }
.cb .t.sm { font-size: 11px; font-family: var(--font); }
.cb .t.letra { font-family: var(--font); }
.barra-color { position: absolute; left: 6px; right: 6px; bottom: 2px; height: 3px; border-radius: 1px; }
.fmt-sel { height: 26px; width: 150px; font-size: 12px; border: 1px solid #c8c8c8; border-radius: 4px; background: #fff; padding: 0 6px; }
.menu-cinta { position: fixed; z-index: 60; min-width: 220px; max-height: 60vh; overflow-y: auto; background: #fff; border: 1px solid #d0d0d0; border-radius: 8px; box-shadow: var(--sombra); padding: 4px; }
.menu-cinta button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; background: none; text-align: left; font-size: 13px; border-radius: 5px; cursor: pointer; color: #222; }
.menu-cinta button:hover { background: #ececec; }
.menu-cinta button span { flex: 1; }
.menu-cinta svg { width: 16px; height: 16px; }
.menu-cinta kbd { font-size: 11px; }
.menu-cinta hr { border: 0; border-top: 1px solid #e5e5e5; margin: 4px 0; }
.paleta { display: grid; grid-template-columns: repeat(7, 24px); gap: 5px; padding: 8px; }
.paleta span { width: 24px; height: 24px; border-radius: 4px; border: 1px solid #ccc; cursor: pointer; }
.paleta span:hover { transform: scale(1.12); }
.tip { position: fixed; z-index: 70; max-width: 260px; background: #fff; border: 1px solid #c8c8c8; box-shadow: 0 6px 18px rgba(0, 0, 0, .15); border-radius: 6px; padding: 8px 10px; font-size: 12px; pointer-events: none; opacity: 0; transition: opacity .12s; }
.tip.ver { opacity: 1; }
.tip b { display: block; color: #111; }
.tip span { display: block; color: #555; margin-top: 3px; line-height: 1.4; }

/* ---------- hoja de cálculo ---------- */
.hj { flex: 1; display: flex; flex-direction: column; min-width: 0; font-family: var(--hoja-font); }
.hj-fx { flex: none; display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-bottom: 1px solid var(--cinta-borde); background: #fff; }
.hj-nombre { width: 90px; height: 26px; border: 1px solid #c8c8c8; border-radius: 3px; padding: 0 6px; font-size: 13px; font-family: var(--hoja-font); }
.hj-fxbtns { display: flex; align-items: center; color: #777; }
.hj-fxbtns button { border: 0; background: none; width: 26px; height: 26px; cursor: pointer; color: #555; border-radius: 4px; font-size: 13px; }
.hj-fxbtns button:hover { background: #ececec; }
.hj-fxi i { font-family: Georgia, serif; font-weight: 600; }
.hj-barra { flex: 1; height: 26px; border: 1px solid #c8c8c8; border-radius: 3px; padding: 0 8px; font-size: 13.5px; font-family: var(--hoja-font); }
.hj-barra:focus, .hj-nombre:focus { outline: none; border-color: var(--xl); }
.hj-zona { flex: 1; overflow: auto; position: relative; background: #fff; }
.hj-lienzo { position: relative; display: inline-block; min-width: 100%; }
.hj-tabla { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 14px; color: #000; user-select: none; }
.hj-tabla th { position: sticky; z-index: 3; background: var(--cab); color: #444; font-weight: 400; font-size: 12.5px; border-right: 1px solid var(--cab-borde); border-bottom: 1px solid var(--cab-borde); cursor: default; }
.hj-tabla thead th { top: 0; height: 22px; text-align: center; }
.hj-tabla .hj-rh { left: 0; z-index: 2; text-align: center; height: 24px; }
.hj-tabla .hj-esq { left: 0; z-index: 4; background: var(--cab) linear-gradient(135deg, transparent 60%, #bdbdbd 60%, #bdbdbd 70%, transparent 70%); }
.hj-tabla th.act { background: #d2e7da; color: var(--xl); font-weight: 600; border-bottom-color: var(--xl); }
.hj-tabla .hj-rh.act { border-bottom-color: var(--cab-borde); border-right: 2px solid var(--xl); }
.hj-tabla .hj-rh.filtrada { color: #1d4ed8; }
.hj-tabla .hj-ch { cursor: s-resize; }
.hj-tabla td { height: 24px; padding: 0 4px; border-right: 1px solid var(--rejilla); border-bottom: 1px solid var(--rejilla); white-space: nowrap; overflow: hidden; vertical-align: bottom; line-height: 22px; cursor: cell; position: relative; }
.hj-tabla.sin-cuadricula td { border-color: transparent; }
.hj-tabla td.desb { overflow: visible; }
.hj-tabla td.desb .hj-t { position: relative; z-index: 1; }
.hj-tabla td.al-der { text-align: right; }
.hj-tabla td.al-cen { text-align: center; }
.hj-tabla td.al-izq { text-align: left; }
.hj-tabla td.b { font-weight: 700; }
.hj-tabla td.i { font-style: italic; }
.hj-tabla td.u .hj-t { text-decoration: underline; }
.hj-tabla td.err { color: #b91c1c; }
.hj-tabla td.sel { background-color: var(--xl-sel) !important; background-image: linear-gradient(var(--xl-sel), var(--xl-sel)); }
.hj-tabla tr.oculta { display: none; }
.hj-tabla td.con-filtro { padding-right: 22px; }
.hj-fbtn { position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px; border: 1px solid #b9b9b9; background: #fff; border-radius: 3px; font-size: 11px; line-height: 16px; text-align: center; color: #444; cursor: pointer; z-index: 2; }
.hj-fbtn.activo { color: var(--xl); border-color: var(--xl); }
.hj-capa { position: absolute; inset: 0; pointer-events: none; }
.hj-selbox { position: absolute; display: none; border: 2px solid var(--xl); z-index: 5; }
.hj-asa { position: absolute; right: -5px; bottom: -5px; width: 8px; height: 8px; background: var(--xl); border: 1px solid #fff; cursor: crosshair; pointer-events: auto; }
.hj-spillbox { position: absolute; display: none; border: 1px solid #3b82f6; z-index: 4; }
.hj-hormigas { position: absolute; display: none; z-index: 6; border: 2px dashed var(--xl); animation: hormigas .6s linear infinite; }
@keyframes hormigas { 50% { border-color: #9fd3b3; } }
.hj-relleno { position: absolute; display: none; border: 1px dashed #555; z-index: 6; }
.hj-ref { position: absolute; border: 2px solid; z-index: 5; }
.hj-marca.objetivo { position: absolute; z-index: 4; border: 2px dashed #f59e0b; background: rgba(245, 158, 11, .07); border-radius: 2px; animation: latido 1.6s ease-in-out infinite; }
@keyframes latido { 50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, .18); } }
.hj-destello { position: absolute; z-index: 7; background: rgba(22, 163, 74, .35); border: 2px solid var(--ok); animation: destello 1.2s ease-out forwards; }
@keyframes destello { 0% { opacity: 0; transform: scale(.96); } 15% { opacity: 1; transform: scale(1.02); } 100% { opacity: 0; } }
.hj-ed { position: absolute; z-index: 8; pointer-events: auto; border: 2px solid var(--xl); outline: none; padding: 0 3px; font-family: var(--hoja-font); font-size: 14px; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.hj-ed.oculto { opacity: 0; width: 1px !important; height: 1px !important; padding: 0; border: 0; box-shadow: none; }
.hj-auto { position: fixed; z-index: 80; display: none; min-width: 230px; max-width: 360px; background: #fff; border: 1px solid #c8c8c8; box-shadow: 0 8px 22px rgba(0, 0, 0, .18); font-family: var(--hoja-font); font-size: 13px; }
.hj-auto-it { padding: 4px 10px; cursor: pointer; }
.hj-auto-it b { color: #7c3aed; font-family: Georgia, serif; margin-right: 4px; }
.hj-auto-it.act, .hj-auto-it:hover { background: #d2e7da; }
.hj-auto-desc { padding: 6px 10px; border-top: 1px solid #e5e5e5; background: #fafafa; color: #555; font-size: 12px; line-height: 1.4; }
.hj-sint { position: fixed; z-index: 80; display: none; background: #fffef0; border: 1px solid #c8c8a0; padding: 3px 8px; font-size: 12px; font-family: var(--hoja-font); box-shadow: 0 3px 10px rgba(0, 0, 0, .12); white-space: nowrap; }
.hj-sint b { font-weight: 700; color: #000; }
.hj-pie { flex: none; display: flex; align-items: center; justify-content: space-between; height: 30px; background: var(--cab); border-top: 1px solid var(--cab-borde); font-size: 12.5px; color: #444; user-select: none; }
.hj-pestanas { display: flex; align-items: stretch; height: 100%; }
.hj-nav { padding: 0 12px; display: flex; align-items: center; color: #999; }
.hj-pest { display: flex; align-items: center; padding: 0 18px; background: #fff; color: var(--xl); font-weight: 600; border-bottom: 3px solid var(--xl); }
.hj-mas { display: flex; align-items: center; padding: 0 12px; color: #888; font-size: 16px; }
.hj-estado { display: flex; gap: 24px; padding: 0 16px; }
.hj-calc { white-space: pre; color: #222; }
.hj-menu-filtro { position: fixed; z-index: 90; width: 250px; background: #fff; border: 1px solid #c8c8c8; box-shadow: var(--sombra); border-radius: 6px; padding: 6px; font-size: 13px; font-family: var(--hoja-font); }
.hj-menu-filtro .mf-ord { display: flex; gap: 8px; width: 100%; border: 0; background: none; padding: 6px 8px; text-align: left; cursor: pointer; border-radius: 4px; font-size: 13px; }
.hj-menu-filtro .mf-ord:hover { background: #ececec; }
.hj-menu-filtro .mf-ord span { font-size: 11px; color: var(--xl); font-weight: 700; width: 30px; }
.hj-menu-filtro hr { border: 0; border-top: 1px solid #e5e5e5; margin: 4px 0; }
.mf-buscar { width: 100%; height: 26px; border: 1px solid #c8c8c8; border-radius: 3px; padding: 0 6px; margin: 4px 0; font-size: 13px; }
.mf-lista { max-height: 200px; overflow-y: auto; border: 1px solid #e0e0e0; border-radius: 3px; padding: 4px; }
.mf-lista label { display: flex; align-items: center; gap: 6px; padding: 2px 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mf-lista input { accent-color: var(--xl); }
.mf-botones { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.mf-botones button { border: 1px solid #c8c8c8; background: #fff; padding: 5px 14px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.mf-botones .mf-ok { background: var(--xl); color: #fff; border-color: var(--xl); }
.hj-dialogo-fondo { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, .28); display: grid; place-items: center; }
.hj-dialogo, .dlg-fx { background: #fff; border-radius: 10px; box-shadow: var(--sombra); padding: 18px 20px; width: min(440px, 92vw); font-size: 14px; line-height: 1.5; }
.hj-dialogo-tit { font-weight: 700; color: var(--dark); margin-bottom: 8px; font-size: 15px; }
.hj-dialogo p { margin: 0 0 10px; }
.hj-dialogo-nota { background: #eef2ff; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.hj-dialogo button { float: right; border: 0; background: var(--xl); color: #fff; padding: 7px 18px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.dlg-fx { width: min(560px, 94vw); }
.dlg-fx label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.dlg-fx input, .dlg-fx select { display: block; width: 100%; margin-top: 4px; height: 32px; border: 1px solid #c8c8c8; border-radius: 6px; padding: 0 8px; font-size: 14px; }
.dlg-fx label:nth-of-type(2) select { display: inline-block; width: auto; }
.fx-lista { height: 180px; overflow-y: auto; border: 1px solid #ddd; border-radius: 6px; padding: 4px; font-family: var(--hoja-font); }
.fx-it { padding: 4px 8px; cursor: pointer; border-radius: 4px; }
.fx-it small { font-size: 10px; background: #ede9fe; color: #6d28d9; padding: 0 5px; border-radius: 4px; }
.fx-it.act { background: #d2e7da; }
.fx-info { min-height: 70px; padding: 10px 2px; }
.fx-info p { margin: 6px 0 0; }
.fx-btns { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- final de lección ---------- */
.fin-fondo { position: fixed; inset: 0; z-index: 110; background: rgba(11, 18, 32, .5); display: grid; place-items: center; animation: aparece .2s; }
@keyframes aparece { from { opacity: 0; } }
.fin { position: relative; width: min(500px, 92vw); background: #fff; border-radius: 16px; padding: 32px 30px 24px; text-align: center; box-shadow: var(--sh-lg); animation: salta .35s var(--ease); }
@keyframes salta { from { transform: translateY(12px) scale(.97); opacity: 0; } }
.fin-ico { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; box-shadow: 0 0 0 8px var(--ok-tint); }
.fin-ico svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.fin-ico[class*="m-"] { background: var(--m); box-shadow: 0 0 0 8px color-mix(in srgb, var(--m) 18%, #fff); }
.fin-ico span { font-family: var(--font-h); font-weight: 700; font-size: 14px; }
.fin h2 { font-size: 26px; margin: 0 0 2px; letter-spacing: -.02em; }
.fin-sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.fin-datos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 16px; }
.fin-datos span { background: #fff; padding: 12px 6px; font-size: 12.5px; color: var(--muted); }
.fin-datos b { display: block; font-family: var(--font-h); font-size: 24px; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fin-datos .cuenta { color: var(--primary-dark); }
.fin-nota { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.fin-nivel { display: inline-block; margin-bottom: 12px; padding: 5px 12px; border-radius: 6px; background: color-mix(in srgb, var(--nv) 12%, #fff); color: var(--nv); font-weight: 600; font-size: 13.5px; }
.fin-cierre { font-size: 15px; line-height: 1.6; margin: 0 0 18px; color: var(--text); }
.fin-guardar { font-size: 13.5px; background: var(--primary-tint); border: 1px solid var(--primary-line); border-radius: 8px; padding: 10px 12px; margin: 0 0 16px; text-align: left; }
.fin-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.confeti { position: fixed; inset: 0; z-index: 120; pointer-events: none; }
.toast { position: fixed; left: 50%; bottom: 46px; z-index: 150; transform: translate(-50%, 16px); opacity: 0; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; box-shadow: var(--sh-lg); transition: opacity .2s, transform .2s var(--ease); }
.toast.ver { opacity: 1; transform: translate(-50%, 0); }
.toast.aviso { background: #7a2e0e; }

/* ---------- ventanas (guardar progreso, recuperar) ---------- */
.modal-fondo { position: fixed; inset: 0; z-index: 130; background: rgba(11, 18, 32, .5); display: grid; place-items: center; animation: aparece .2s; }
.modal { position: relative; width: min(520px, 92vw); background: #fff; border-radius: 16px; padding: 28px; box-shadow: var(--sh-lg); animation: salta .3s var(--ease); }
.modal h2 { margin: 0 0 8px; font-size: 22px; }
.modal > p { margin: 0 0 16px; }
.modal-x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border: 0; background: none; border-radius: 6px; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.modal-x:hover { background: var(--tint); color: var(--ink); }
.modal-btns { display: flex; gap: 8px; }
.mp-resumen { display: flex; gap: 20px; padding: 12px 14px; background: var(--tint); border-radius: 8px; margin-bottom: 18px; font-size: 13.5px; color: var(--muted); }
.mp-resumen b { color: var(--ink); font-size: 15px; }
.mp-lab { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.mp-enlace { display: flex; gap: 8px; }
.mp-enlace input { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; font-family: var(--mono); font-size: 12px; color: var(--text); background: var(--bg); }
.m-progreso .mini { margin: 8px 0 18px; }
.mp-archivo { display: flex; gap: 8px; padding-top: 14px; }
.mp-form .mp-sub { margin: -2px 0 10px; }
.mp-check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--text); cursor: pointer; }
.mp-check input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--primary); }
.mp-check em { font-style: normal; color: var(--muted); }
.mp-err { min-height: 0; margin: 10px 0 0; font-size: 13px; color: var(--err); }
.mp-err:empty { display: none; }
.mp-legal { margin: 14px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--faint); }
.mp-trampa { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.mp-otras { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.mp-otras summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink-2); list-style: none; }
.mp-otras summary::-webkit-details-marker { display: none; }
.mp-otras summary::before { content: '›'; display: inline-block; width: 14px; color: var(--muted); transition: transform .15s var(--ease); }
.mp-otras[open] summary::before { transform: rotate(90deg); }
.mp-otras[open] summary { margin-bottom: 12px; }
.mp-cuenta .mini { margin: 10px 0 0; }
.mp-ok { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid #abefc6; background: var(--ok-tint); border-radius: 10px; }
.mp-ok svg { flex: none; width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--ok); fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mp-ok div { display: flex; flex-direction: column; line-height: 1.3; }
.mp-ok b { color: var(--ink); font-size: 14px; }
.mp-ok span { font-size: 13px; color: var(--text); word-break: break-all; }
.mp-acc { display: flex; gap: 8px; margin-top: 14px; }
.btn-peligro { background: var(--err); color: #fff; }
.btn-peligro:hover { background: #912018; }
.mp-borrar { background: none; color: var(--err); border-color: transparent; }
.mp-borrar:hover { background: var(--err-tint); }
.js-guardar.con-cuenta { color: var(--ok); border-color: #abefc6; }
.js-guardar.con-cuenta svg { stroke: var(--ok); }

/* ---------- backstage (Archivo) ---------- */
.backstage { position: fixed; inset: 0; z-index: 100; display: flex; background: #fff; animation: aparece .2s; }
.bs-menu { width: 280px; background: var(--xl); padding: 16px 10px; display: flex; flex-direction: column; gap: 4px; }
.bs-menu button, .bs-menu a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 0; background: none; color: #fff; font-size: 14px; text-align: left; cursor: pointer; border-radius: 6px; text-decoration: none; }
.bs-menu button:hover, .bs-menu a:hover { background: rgba(255, 255, 255, .15); }
.bs-menu svg { width: 18px; height: 18px; }
.bs-volver { margin-bottom: 14px; font-weight: 600; }
.bs-info { padding: 40px 48px; max-width: 640px; }
.bs-info h2 { font-size: 30px; margin: 0 0 10px; }

/* ---------- muro ---------- */
.muro { display: grid; place-items: center; min-height: 70vh; padding-top: 48px; padding-bottom: 48px; }
.muro-caja { max-width: 540px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--nv); border-radius: var(--r-lg); padding: 32px; box-shadow: var(--sh); }
.muro-caja h1 { font-size: 30px; margin: 0 0 14px; letter-spacing: -.02em; }
.muro-caja ul { list-style: none; padding: 0; margin: 0 0 18px; line-height: 1.9; }
.muro-precio { font-size: 16px; color: var(--muted); }
.muro-precio b { font-family: var(--font-h); font-size: 34px; color: var(--ink); }
.muro-lanz { background: var(--ok-tint); border-radius: 8px; padding: 10px 12px; }
.muro-form { display: flex; gap: 8px; margin: 12px 0 8px; }
.muro-form input { flex: 1; height: 40px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 12px; font-size: 15px; }
.muro-rgpd { display: flex; gap: 8px; font-size: 13px; color: var(--muted); align-items: flex-start; }
.muro-nota { font-size: 12px; color: var(--warn); margin-top: 14px; }

/* ---------- explicador (página) ---------- */
.exp { max-width: 860px; padding-top: 64px; padding-bottom: 72px; }
.exp-cab h1 { font-size: 42px; margin: 0 0 12px; letter-spacing: -.022em; }
.exp-cab .lead { margin: 0 0 28px; }
.exp-caja { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh); margin-bottom: 28px; }
.exp-lab { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.exp-in { width: 100%; height: 50px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 14px; font-family: var(--mono); font-size: 15px; color: var(--ink); }
.exp-in:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.exp-ej { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.exp-ej span { margin-right: 4px; }
.exp-ej button { border: 1px solid var(--line-2); background: #fff; border-radius: 6px; padding: 4px 10px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.exp-ej button:hover { background: var(--tint); }
.exp-res .ex { font-size: 15px; gap: 14px; }
.exp-res .ex-formula { font-size: 15px; padding: 14px 16px; }
.exp-res .ex-frase { font-size: 17px; }
.exp-res .ex-args { font-size: 14px; }
.exp-nota { margin-top: 24px; }

/* ---------- el siguiente paso ---------- */
.sp-hero { max-width: 820px; padding: 72px 0 40px; }
.sp-hero h1 { font-size: 46px; line-height: 1.08; margin: 0 0 18px; letter-spacing: -.022em; }
.sp-hero .lead { margin: 0; }
.caso { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--sh); margin-bottom: 64px; }
.caso-cab { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; align-items: end; margin-bottom: 22px; }
.caso-cab h2 { font-size: 28px; margin: 0; letter-spacing: -.02em; }
.caso-cab p { margin: 0; color: var(--muted); }
.caso-tabs { display: inline-flex; padding: 3px; background: var(--tint); border-radius: 9px; margin-bottom: 16px; }
.caso-tabs button { border: 0; background: none; padding: 7px 16px; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.caso-tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: var(--sh-sm); }
.caso-cuerpo { display: grid; grid-template-columns: 1.75fr 1fr; gap: 24px; align-items: start; }
.caso-video { position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); background: #f3f3f3; aspect-ratio: 16 / 9; }
.caso-video video { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.caso-play { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: var(--sh-lg); transition: transform .15s var(--ease); }
.caso-play:hover { transform: scale(1.05); }
.caso-play svg { width: 28px; height: 28px; fill: currentColor; margin-left: 4px; }
.caso-caps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.caso-caps button { display: flex; gap: 12px; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 8px; font-size: 14.5px; line-height: 1.5; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.caso-caps button span { flex: none; font-family: var(--mono); font-size: 12px; color: var(--faint); padding-top: 3px; font-variant-numeric: tabular-nums; }
.caso-caps button:hover { background: var(--tint); }
.caso-caps li.visto button { color: var(--text); }
.caso-caps li.act button { background: var(--primary-tint); color: var(--ink); box-shadow: inset 3px 0 0 var(--primary); }
.caso-caps li.act button span { color: var(--primary-dark); }
.caso-sig button { margin-top: 6px; color: var(--primary-dark); font-weight: 600; align-items: center; }
.caso-sig button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.caso-sig.act button { background: var(--primary); color: #fff; box-shadow: none; }
.caso-cifras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-top: 24px; }
.caso-cifras div { background: #fff; padding: 18px 20px; }
.caso-cifras b { display: block; font-family: var(--font-h); font-size: 30px; color: var(--ink); letter-spacing: -.02em; margin-bottom: 4px; }
.caso-cifras span { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.caso-codigo { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.caso-codigo summary { cursor: pointer; font-weight: 600; color: var(--ink-2); font-size: 14.5px; }
.caso-codigo pre { margin: 12px 0 0; background: var(--ink); color: #d0d5dd; border-radius: var(--r); padding: 18px 20px; overflow-x: auto; font-size: 12.5px; line-height: 1.65; }
.caso-codigo pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.sp-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 64px; }
.sp-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }
.sp-ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; font-family: var(--mono); font-weight: 600; font-size: 13px; color: #fff; }
.sp-ico.vba { background: var(--xl); }
.sp-ico.pa { background: #0b5cd5; }
.sp-card h2 { margin: 16px 0 6px; font-size: 22px; }
.sp-lema { font-weight: 500; color: var(--ink-2); margin: 0 0 14px; }
.sp-card ul { padding-left: 18px; line-height: 1.85; margin: 0; color: var(--text); }
.sp-tabla { margin-bottom: 64px; }
.sp-tabla h2, .sp-calc h2, .sp-cta h2 { font-size: 26px; margin: 0 0 16px; letter-spacing: -.02em; }
.sp-tabla table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.sp-tabla th, .sp-tabla td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.sp-tabla tr:last-child th, .sp-tabla tr:last-child td { border-bottom: 0; }
.sp-tabla thead th { background: var(--bg); color: var(--ink); font-size: 14px; }
.sp-tabla tbody th { color: var(--ink-2); width: 180px; font-weight: 600; }
.sp-calc { display: grid; grid-template-columns: 1fr 1.6fr; gap: 32px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; margin-bottom: 64px; }
.sp-calc h2 { margin-bottom: 6px; }
.calc { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 22px; align-items: center; }
.calc label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.calc input { accent-color: var(--primary); }
.calc label b { font-family: var(--font-h); font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
.calc-res { text-align: center; background: var(--primary-tint); border-radius: var(--r); padding: 16px; font-weight: 600; color: var(--ink-2); }
.calc-res .horas { display: block; font-family: var(--font-h); font-size: 40px; color: var(--primary-dark); line-height: 1.05; letter-spacing: -.02em; }
.calc-res small { display: block; color: var(--muted); font-weight: 500; margin-top: 4px; }
.sp-cta { text-align: center; padding: 24px 0 80px; }
.sp-cta h2 { font-size: 32px; }
.sp-cta p { max-width: 640px; margin: 0 auto 24px; font-size: 17px; line-height: 1.6; }
.sp-cta .hero-btns { justify-content: center; }

@media (max-width: 1080px) {
  .top-nav a { padding: 8px; font-size: 14px; }
  .stat.rango { display: none; }
}
@media (max-width: 900px) {
  .hero, .sp-dos, .calc, .caso-cuerpo, .caso-cab, .sp-calc, .como, .progreso, .caso-cifras { grid-template-columns: 1fr; }
  .hero { padding: 40px 0; gap: 40px; }
  .hero h1, .sp-hero h1 { font-size: 36px; }
  .portada, .sp, .muro, .exp { padding-left: 16px; padding-right: 16px; }
  .top-in { padding: 0 16px; gap: 12px; }
  .top-nav { display: none; }
  .lv-panel { width: 300px; }
}
/* Móvil (entrada desde la bio de Instagram): que la cabecera quepa en 360-414 px sin scroll lateral */
@media (max-width: 600px) {
  .top-stats { margin-left: auto; gap: 10px; }
  .marca small { display: none; }
  .top .js-guardar .txt { display: none; }
  .demo-mision { right: 0; }
  /* Lección: misión arriba (acotada) y la hoja a todo el ancho debajo, en vez de lado a lado */
  .lv { height: 100dvh; }
  .lv-top { gap: 8px; }
  .lv-volver span, .lv-stats { display: none; }
  .lv-puntos i { width: 14px; }
  .lv-main { flex-direction: column; }
  .lv-panel { order: -1; width: auto; max-height: 38dvh; border-left: 0; border-bottom: 1px solid var(--cinta-borde); padding: 10px 12px; gap: 10px; }
  .lv-hoja { flex: 1; min-height: 0; }
  /* Cinta: los grupos no se encogen (se apilaban y pisaban el texto); se desliza en horizontal */
  .c-pest, .c-panel { overflow-x: auto; scrollbar-width: none; }
  .c-tab { flex: none; }
  .grupo { flex: none; }
  /* Teclado abierto (clase que pone app.js): solo la misión, la barra de fórmulas y las celdas */
  .teclado .lv { height: var(--vvh, 100dvh); }
  .teclado .lv-top, .teclado .cinta, .teclado .pn-intro, .teclado .pn-ayuda, .teclado .pn-caja,
  .teclado .pn-lista, .teclado .pn-pie, .teclado .pn-cab, .teclado .hj-pie { display: none; }
  .teclado .lv-panel { max-height: 22dvh; padding: 6px 10px; }
  .teclado .pn-mision { padding: 8px 12px; }
  .teclado .pn-texto { font-size: 14px; line-height: 1.35; }
}
/* Ruta móvil (portada en pantallas táctiles) */
.ruta-movil { margin: 20px 0 8px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--ok); border-radius: var(--r); padding: 14px 16px; }
.ruta-movil > b { font-family: var(--font-h); font-size: 16px; color: var(--ink); }
.ruta-movil ol { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.ruta-movil li a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--tint); color: var(--ink); text-decoration: none; font-weight: 500; }
.ruta-movil li a span { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid var(--line-2); font-size: 13px; }
.ruta-movil li.ok a span { background: var(--ok); border-color: var(--ok); color: #fff; }
.ruta-movil li a span svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.ruta-movil p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.fin-pc { line-height: 1.5; }
/* Con el dedo, el cuadradito de relleno se coge por una zona más grande que el dibujo */
@media (pointer: coarse) {
  .hj-asa { width: 12px; height: 12px; right: -7px; bottom: -7px; }
  .hj-asa::after { content: ''; position: absolute; inset: -14px; }
}

/* ---------- formato condicional (diálogo) ---------- */
.dlg-cf { width: min(460px, 94vw); }
.dlg-cf p { margin: 0 0 8px; font-size: 13.5px; color: var(--text); }
.dlg-cf .cf-rango { font-size: 12.5px; color: var(--muted); }
.cf-vals { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.cf-vals input { flex: 1; min-width: 0; height: 32px; border: 1px solid #c8c8c8; border-radius: 6px; padding: 0 8px; font-size: 14px; font-family: var(--hoja-font); }
.cf-vals span { color: var(--muted); font-size: 13px; }
.dlg-cf label select { display: inline-block; width: auto; margin-left: 6px; }
.mp-form #mp-email { font-family: var(--font); font-size: 14.5px; }
