/* Un solo diseño para todo el sitio (Rulas 2026-11-01): el de la barra del curso y la app de Flutter.
   --acento y --fondo vienen del sitio (Piensa) o, dentro de un curso, de los colores de su app.json. */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { display: flex; font: 15px/1.6 "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
       color: var(--texto); background: var(--pagina); overflow: hidden; }
html[data-tema="oscuro"] { color-scheme: dark;
  --pagina: var(--fondo); --lado: color-mix(in srgb, var(--fondo) 85%, #000);
  --tarjeta: color-mix(in srgb, var(--fondo) 88%, #fff); --campo: color-mix(in srgb, var(--fondo) 80%, #000);
  --texto: #e9edf3; --suave: #9aa6b5; --borde: rgba(255,255,255,.11); --encima: rgba(255,255,255,.07);
  --acento-suave: color-mix(in srgb, var(--acento) 22%, transparent);
  --bien: #4cc38a; --mal: #ff6b6b; --bien-fondo: rgba(76,195,138,.12); --mal-fondo: rgba(255,107,107,.12);
  --aviso-fondo: rgba(240,213,138,.10); --aviso-borde: rgba(240,213,138,.35); }
html[data-tema="claro"] { color-scheme: light;
  --pagina: #f5f6fa; --lado: #fff; --tarjeta: #fff; --campo: #fff;
  --texto: #1b1f24; --suave: #5b6470; --borde: #dde2e8; --encima: #f1f4f8;
  --acento-suave: color-mix(in srgb, var(--acento) 12%, #fff);
  --bien: #1e7a46; --mal: #b3261e; --bien-fondo: #eaf6ef; --mal-fondo: #fbeceb;
  --aviso-fondo: #fff8e1; --aviso-borde: #f0d58a; }

/* --- Barra fija de arriba --- */
body { flex-direction: column; }
.superior { flex: none; height: 56px; display: flex; align-items: center; gap: .5rem; padding: 0 .75rem 0 .5rem;
            background: var(--lado); color: var(--texto); border-bottom: 1px solid var(--borde); position: relative; z-index: 10; }
.superior .marca { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em;
                   color: var(--texto); text-decoration: none; white-space: nowrap; }
.superior .marca img { border-radius: 7px; }
.superior .logo-lottie { display: block; height: 34px; }
.superior .logo-lottie[hidden], .superior .logo-fijo[hidden] { display: none; }
.superior .logo-fijo { display: flex; align-items: center; gap: .55rem; }
.titulo-barra { flex: 1; min-width: 0; padding-left: .75rem; margin-left: .25rem; border-left: 1px solid var(--borde);
                color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titulo-barra:empty { border: 0; }
.acciones { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.icono-boton { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0;
               border: 0; border-radius: 10px; background: none; color: var(--texto); cursor: pointer; }
.icono-boton:hover { background: var(--encima); }
.icono-boton svg, .op svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
                            stroke-linecap: round; stroke-linejoin: round; }
.cuenta { position: relative; }
.cuenta summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .25rem .5rem .25rem .25rem;
                  border-radius: 99px; }
.cuenta summary::-webkit-details-marker { display: none; }
.cuenta summary:hover { background: var(--encima); }
.cuenta .avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
                  background: linear-gradient(135deg, var(--primario), var(--acento)); color: #fff; font-weight: 700; }
.cuenta .nombre { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.menu-cuenta { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--tarjeta); border: 1px solid var(--borde);
               border-radius: 12px; padding: .4rem 0; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.menu-cuenta a { display: block; padding: .5rem .9rem; color: var(--texto); text-decoration: none; }
.menu-cuenta a:hover { background: var(--encima); }
.cuerpo { flex: 1; min-height: 0; display: flex; }

/* --- Barra lateral --- */
.lateral { width: 232px; flex: none; display: flex; flex-direction: column; background: var(--lado); color: var(--texto);
           border-right: 1px solid var(--borde); transition: width .15s; overflow: hidden auto; }
html[data-lateral="chica"] .lateral { width: 56px; }
html[data-lateral="chica"] .lateral .txt { display: none; }
.op { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .6rem 1rem; margin: 0;
      color: var(--texto); text-decoration: none; background: none; border: 0; font: inherit; text-align: left; cursor: pointer;
      white-space: nowrap; border-left: 3px solid transparent; }
.op:hover { background: var(--encima); }
.op.activa { border-left-color: var(--acento); background: var(--acento-suave); }
.op.comprar { color: var(--acento); font-weight: 600; }
.grupo { padding: .4rem 0; }
.grupo + .grupo { border-top: 1px solid var(--borde); }
.titulo-grupo { padding: .3rem 1rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); }
@media (max-width: 700px) {
  .lateral { width: 56px; } .lateral .txt { display: none; }
  .cuenta .nombre, .titulo-barra, .solo-ancho { display: none; }
}

/* --- Página --- */
.principal { flex: 1; min-width: 0; height: 100%; overflow-y: auto; }
.contenido { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; margin: 2rem 0 .75rem; }
a { color: var(--acento); }
.suave { color: var(--suave); }
.franja { height: 4px; border-radius: 4px; margin: .75rem 0 1.5rem; width: 96px;
          background: var(--acento); }

/* --- Tarjetas de curso --- */
.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.tarjeta { position: relative; display: flex; flex-direction: column; gap: .5rem; background: var(--tarjeta);
           border: 1px solid var(--borde); border-radius: 14px; padding: 1.1rem; overflow: hidden; }
.tarjeta::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--color-curso, var(--acento)); }
.tarjeta .icono { width: 56px; height: 56px; border-radius: 13px; }
.tarjeta h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.tarjeta .pie { margin-top: auto; display: flex; align-items: center; gap: .75rem; padding-top: .5rem; }
.etiqueta { display: inline-block; font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 99px;
            background: var(--acento-suave); color: var(--texto); }

/* --- Botones y formularios --- */
.boton { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; background: var(--acento); color: #fff;
         border: 1px solid transparent; border-radius: 10px; padding: .55rem 1.1rem; text-decoration: none; cursor: pointer;
         font: inherit; font-weight: 600; }
.boton:hover { filter: brightness(1.08); }
.boton:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.boton.secundario { background: transparent; color: var(--texto); border-color: var(--borde); }
.boton.secundario:hover { background: var(--encima); }
.boton.chico { padding: .3rem .7rem; font-size: .85rem; }
.boton.peligro { background: transparent; color: var(--mal); border-color: var(--mal); }
.boton.ancho { width: 100%; padding: .75rem 1rem; }
input, select, textarea { font: inherit; color: var(--texto); background: var(--campo); border: 1px solid var(--borde);
                          border-radius: 10px; padding: .55rem .75rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--acento); outline-offset: -1px; }
label { display: block; font-weight: 600; margin: .9rem 0 .35rem; }
.fila { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
.fila > * { margin: 0; }
.caja { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 14px; padding: 1.25rem; margin-bottom: 1.25rem; }
.caja h2 { margin-top: 0; }

/* --- Avisos --- */
.aviso { background: var(--aviso-fondo); border: 1px solid var(--aviso-borde); padding: .7rem .9rem; border-radius: 10px; }
.aviso.success { background: var(--bien-fondo); border-color: var(--bien); }
.aviso.error { background: var(--mal-fondo); border-color: var(--mal); }

/* --- Tablas (administración) --- */
.tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabla th, .tabla td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla th { color: var(--suave); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.tabla tr.apagada td { opacity: .5; }
.tabla code, .codigo { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
.pestanas { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* --- Entrar --- */
.entrada { max-width: 420px; margin: 4vh auto 0; }
.entrada .logo { display: flex; align-items: center; justify-content: center; gap: .7rem; margin-bottom: 1.75rem;
                 font-weight: 800; font-size: 1.7rem; letter-spacing: -.02em; }
.entrada .logo img { width: 52px; height: 52px; border-radius: 12px; }
.entrada h1 { font-size: 1.6rem; margin-bottom: 1.25rem; }
.entrada input { width: 100%; padding: .75rem .9rem; }
.boton.google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.boton.apple { background: #000; color: #fff; }
html[data-tema="oscuro"] .boton.apple { background: #fff; color: #000; }
.boton.google svg, .boton.apple svg { width: 20px; height: 20px; flex: none; }
.separador { display: flex; align-items: center; gap: 1rem; color: var(--suave); margin: 1.25rem 0 .25rem; font-size: .9rem; }
.separador::before, .separador::after { content: ""; flex: 1; border-top: 1px solid var(--borde); }
.enlaces { display: flex; justify-content: space-between; margin-top: 1rem; }
.pila { display: grid; gap: .75rem; }

/* --- Vista HTML del curso (respaldo) --- */
.modulo { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; }
.pasos { list-style: none; padding: 0; margin: 0; }
.pasos li { padding: .4rem 0; border-top: 1px solid var(--borde); display: flex; justify-content: space-between; }
.pasos a { text-decoration: none; color: var(--texto); }
.visto { color: var(--bien); }
.candado { color: var(--suave); }
.tema { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 12px; padding: 1.25rem; }
.tema img { max-width: 100%; }
.pregunta { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 12px; padding: 1rem; margin-top: 1rem; }
.opcion { display: block; padding: .5rem .75rem; border: 1px solid var(--borde); border-radius: 8px; margin: .4rem 0; cursor: pointer; }
.opcion.bien { border-color: var(--bien); background: var(--bien-fondo); }
.opcion.mal { border-color: var(--mal); background: var(--mal-fondo); }
.artefacto { width: 100%; height: 480px; border: 1px solid var(--borde); border-radius: 10px; background: #fff; }
.ia { background: var(--acento-suave); border-left: 4px solid var(--acento); padding: .75rem 1rem; margin-top: .5rem; border-radius: 6px; }

/* --- Curso (la app en el iframe) --- */
#curso { flex: 1; height: 100%; border: 0; display: block; min-width: 0; background: var(--pagina); color-scheme: normal; }

/* --- Portada / landing (Rulas 2026-11-02; en lugar del WordPress de MiGuía) --- */
.menu-portada { display: flex; gap: .25rem; margin-right: .5rem; }
.menu-portada a { color: var(--texto); text-decoration: none; font-weight: 600; font-size: .92rem; padding: .45rem .7rem; border-radius: 8px; }
.menu-portada a:hover { background: var(--encima); color: var(--acento); }
.portada { scroll-behavior: smooth; position: relative; }
.portada > section, .pie-portada { max-width: 1160px; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }
.pildora { display: inline-flex; align-items: center; gap: .5rem; font-size: .78rem; font-weight: 700; letter-spacing: .08em;
           text-transform: uppercase; color: var(--acento); background: var(--acento-suave); border: 1px solid color-mix(in srgb, var(--acento) 40%, transparent);
           padding: .35rem .8rem; border-radius: 99px; }
.pildora::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pildora.chica { font-size: .68rem; padding: .2rem .6rem; align-self: flex-start; }
.pildora.chica::before { display: none; }
.resalta { color: var(--acento); }
html[data-tema="claro"] .resalta { color: color-mix(in srgb, var(--acento) 70%, #000); }
.titulo-grande { font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.05; letter-spacing: -.03em; margin: 1rem 0; font-weight: 800; }
.boton.grande { padding: .85rem 1.5rem; font-size: 1rem; border-radius: 12px; letter-spacing: .02em; }
.boton.grande svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.boton.grande:not(.secundario) { box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--acento) 70%, transparent); }

.heroe { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 2rem; align-items: center;
         padding-top: clamp(2.5rem, 7vh, 5rem) !important; padding-bottom: clamp(2.5rem, 7vh, 4.5rem) !important; }
.portada::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 720px; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 60% at 80% 20%, color-mix(in srgb, var(--acento) 18%, transparent), transparent 70%),
              radial-gradient(50% 50% at 0% 90%, rgba(28,126,214,.14), transparent 70%); }
.heroe > * { position: relative; z-index: 1; }
.heroe .lazo { position: absolute; left: -2rem; bottom: -2.5rem; width: 260px; opacity: .85; z-index: 0; }
.heroe h1 { font-size: clamp(2.3rem, 5.5vw, 3.7rem); line-height: 1.06; letter-spacing: -.03em; margin: 1.1rem 0 1rem; font-weight: 800; }
.entrada-texto { font-size: 1.08rem; color: var(--suave); max-width: 56ch; margin: 0 0 1.75rem; }
.botones { display: flex; flex-wrap: wrap; gap: .75rem; }
.datos { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: 0; margin: 1.75rem 0 0; color: var(--suave); font-size: .92rem; }
.datos b { color: var(--texto); }

.telefono { justify-self: center; width: min(300px, 80%); aspect-ratio: 9 / 18.5; border-radius: 44px; padding: 12px;
            background: linear-gradient(160deg, #3a4048, #121519); box-shadow: 0 40px 80px -30px rgba(0,0,0,.7), inset 0 0 0 2px rgba(255,255,255,.08);
            transform: rotate(8deg); }
.pantalla { height: 100%; border-radius: 34px; overflow: hidden; padding: 2.4rem 1rem 1rem;
            background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--acento) 45%, var(--fondo)), var(--fondo) 75%); }
.pantalla .hora { color: #fff; font-weight: 700; font-size: .8rem; text-align: center; margin: -1.6rem 0 1.4rem; opacity: .9; }
.iconos-app { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem .5rem; }
.iconos-app .app { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.iconos-app img, .iconos-app i { width: 54px; height: 54px; border-radius: 14px; box-shadow: 0 6px 14px rgba(0,0,0,.35); background: var(--color-curso); }
.iconos-app i { display: flex; align-items: center; justify-content: center; color: #fff; font-style: normal; font-weight: 800; font-size: 1.4rem; }
.iconos-app small { color: #fff; font-size: .62rem; text-align: center; line-height: 1.2; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bloque { padding-top: 3.5rem; padding-bottom: 3.5rem; border-top: 1px solid var(--borde); position: relative; }
.bloque h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.15; letter-spacing: -.02em; margin: .9rem 0 .75rem; }
.titulo-centro { text-align: center; }
.materias { display: grid; grid-template-columns: .8fr 1.2fr; gap: 2.5rem; align-items: start; }
.materias-intro { position: sticky; top: 1.5rem; }
.materias-intro h2 { color: var(--primario-texto); margin-top: 0; }
.materias-intro .franja { margin: 1rem 0 1.25rem; }
.destacado { color: var(--acento); font-weight: 700; }
.filtros { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.25rem; }
.filtro { font: inherit; font-size: .88rem; font-weight: 600; color: var(--texto); background: transparent; border: 1px solid var(--borde);
          padding: .4rem .9rem; border-radius: 99px; cursor: pointer; }
.filtro:hover:not(:disabled) { background: var(--encima); }
.filtro.activo { background: var(--acento); border-color: var(--acento); color: #fff; }
.filtro:disabled { opacity: .5; cursor: default; }
.rejilla-materias { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); background: var(--lado); gap: 0;
                    border: 1px solid var(--borde); border-radius: 16px; overflow: hidden; }
.materia { display: flex; gap: 1rem; padding: 1.4rem 1.25rem; background: var(--lado); box-shadow: 1px 0 0 var(--borde), 0 1px 0 var(--borde); color: var(--texto); text-decoration: none; transition: background .15s; }
.materia[hidden] { display: none; }
.materia:hover { background: color-mix(in srgb, var(--color-curso) 10%, var(--lado)); }
.icono-materia { flex: none; width: 60px; height: 60px; border-radius: 15px; display: flex; align-items: center; justify-content: center;
                 background: color-mix(in srgb, var(--color-curso) 18%, transparent); color: var(--color-curso); font-weight: 800; font-size: 1.5rem; }
.icono-materia img { width: 60px; height: 60px; border-radius: 15px; }
.texto-materia { display: flex; flex-direction: column; gap: .3rem; min-width: 0; font-size: .92rem; }
.nombre-materia { font-weight: 700; font-size: 1.12rem; color: var(--color-curso); }
html[data-tema="claro"] .nombre-materia { color: color-mix(in srgb, var(--color-curso) 75%, #000); }
.nivel-materia { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); margin-top: .2rem; }

.niveles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.nivel { display: flex; flex-direction: column; gap: .5rem; padding: 1.5rem; border-radius: 16px; background: var(--tarjeta);
         border: 1px solid var(--borde); color: var(--texto); text-decoration: none; transition: transform .15s, border-color .15s; }
.nivel:hover { transform: translateY(-3px); border-color: var(--acento); }
.nivel svg { width: 40px; height: 40px; fill: none; stroke: var(--acento); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nombre-nivel { font-size: 1.4rem; font-weight: 800; }
.nivel .ir { margin-top: auto; color: var(--acento); font-weight: 600; }

.rejilla-artefactos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; margin: 1.75rem 0; }
.artefacto-tarjeta { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--tarjeta);
                     border: 1px solid var(--borde); color: var(--texto); text-decoration: none; transition: transform .15s, border-color .15s; }
.artefacto-tarjeta:hover { transform: translateY(-3px); border-color: var(--acento); }
.artefacto-tarjeta .vista { position: relative; height: 180px; overflow: hidden; background: #fff; border-bottom: 1px solid var(--borde); }
.artefacto-tarjeta iframe { width: 200%; height: 360px; border: 0; transform: scale(.5); transform-origin: 0 0; pointer-events: none; }
.cuerpo-tarjeta { display: flex; flex-direction: column; gap: .55rem; padding: 1.1rem 1.2rem 1.3rem; }
.cuerpo-tarjeta b { font-size: 1.08rem; line-height: 1.3; }
.cuerpo-tarjeta .suave { font-size: .9rem; }

.pasos-portada { list-style: none; counter-reset: paso; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.pasos-portada li { counter-increment: paso; display: flex; flex-direction: column; gap: .4rem; padding: 1.4rem; border-radius: 16px; background: var(--tarjeta); border: 1px solid var(--borde); }
.pasos-portada li::before { content: counter(paso); width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
                            background: var(--acento); color: #fff; font-weight: 800; margin-bottom: .4rem; }
.pasos-portada b { font-size: 1.08rem; }
.cierre { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.cierre img { border-radius: 16px; margin-bottom: .5rem; }
.cierre .boton { margin-top: 1rem; }
.pie-portada { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; padding-bottom: 2rem;
               border-top: 1px solid var(--borde); color: var(--suave); font-size: .9rem; }
.pie-portada nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.pie-portada a { color: var(--suave); text-decoration: none; }
.pie-portada a:hover { color: var(--acento); }

@media (max-width: 900px) {
  .heroe, .materias { grid-template-columns: 1fr; }
  .materias-intro { position: static; }
  .telefono { width: 220px; transform: rotate(4deg); }
}
@media (max-width: 700px) {
  .portada > section, .pie-portada { padding-left: 1rem; padding-right: 1rem; }
  .heroe .lazo { width: 160px; left: -3rem; }
  .menu-portada, .telefono { display: none; }
  .boton.grande { width: 100%; }
  .rejilla-materias { grid-template-columns: 1fr; }
}
.continuar { margin-top: 1.4rem; background: rgba(255,255,255,.08); border-radius: 16px; padding: .8rem .9rem; color: #fff; }
.continuar small { display: block; font-size: .62rem; opacity: .7; text-transform: uppercase; letter-spacing: .06em; }
.continuar b { display: block; font-size: .85rem; margin-bottom: .5rem; }
.continuar .u { display: flex; align-items: center; gap: .5rem; font-size: .66rem; margin-top: .45rem; opacity: .95; }
.continuar .u span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continuar .u i { flex: none; width: 46px; height: 5px; border-radius: 9px; background: rgba(255,255,255,.18); overflow: hidden; }
.continuar .u i::after { content: ""; display: block; height: 100%; width: var(--p); background: var(--color-curso, var(--acento)); }

/* --- MiGuía (Rulas 2026-11-02): azul noche, títulos azules en Poppins, botones verdes en mayúsculas, logo en texto --- */
html[data-tema="oscuro"] { --lado: #161616; --tarjeta: #1B2238; --suave: #9AA0AE; --primario-texto: color-mix(in srgb, var(--primario) 80%, #fff); }
html[data-tema="claro"] { --primario-texto: var(--primario); }
h1, h2, h3, .heroe h1, .titulo-grande, .nombre-materia, .nombre-nivel, .cuerpo-tarjeta b, .pasos-portada b { font-family: Poppins, "Open Sans", system-ui, sans-serif; }
.boton { font-family: "Open Sans", system-ui, sans-serif; }
.boton.grande { text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.boton.grande.secundario { text-transform: none; letter-spacing: 0; }
.logo-texto { font-family: Poppins, system-ui, sans-serif; font-weight: 800; letter-spacing: -.02em; font-size: 1.5rem; line-height: 1; white-space: nowrap; text-decoration: none; }
.logo-texto .logo-mi { color: var(--primario-texto); }
.logo-texto .logo-guia { color: var(--acento); }
html[data-tema="claro"] .logo-texto .logo-guia { color: color-mix(in srgb, var(--acento) 75%, #000); }
.superior .marca.logo-texto { font-size: 1.55rem; padding: 0 .35rem; gap: 0; }
.entrada .logo.logo-texto { font-size: 2.4rem; gap: 0; }
.logo-grande { font-size: 2.6rem; margin-bottom: .5rem; }
.pildora { color: var(--primario-texto); background: color-mix(in srgb, var(--primario) 16%, transparent); border-color: color-mix(in srgb, var(--primario) 45%, transparent); }
.portada::before { background: radial-gradient(60% 60% at 80% 15%, color-mix(in srgb, var(--primario) 22%, transparent), transparent 70%),
                                radial-gradient(50% 50% at 0% 90%, color-mix(in srgb, var(--acento) 10%, transparent), transparent 70%); }
.pantalla { background: radial-gradient(120% 80% at 50% 0%, #7b3fe4, #2a1a5e 55%, var(--fondo)); }
.materias-intro .franja { width: 50px; }
.nivel svg { stroke: var(--primario-texto); }
.nivel .ir, .menu-portada a:hover { color: var(--acento); }
.pasos-portada li::before { background: var(--primario); }
.filtro.activo, .boton:not(.secundario):not(.google):not(.apple):not(.peligro) { color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.25); }

/* --- Páginas de texto (aviso de privacidad) --- */
.pagina-texto { max-width: 72ch; }
.pagina-texto h2 { font-size: 1.15rem; margin: 2rem 0 .5rem; color: var(--primario-texto); }
.pagina-texto p, .pagina-texto li { color: var(--texto); }
.pagina-texto ul { padding-left: 1.2rem; }
.pagina-texto li { margin: .35rem 0; }

/* --- Listón de abajo en todas las páginas (Rulas 2026-11-02) --- */
.principal { display: flex; flex-direction: column; }
.principal > .contenido { flex: 1 0 auto; width: 100%; }
.pie { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; padding: 1.25rem 1.5rem;
       border-top: 1px solid var(--borde); color: var(--suave); font-size: .88rem; background: color-mix(in srgb, var(--pagina) 70%, #000); }
html[data-tema="claro"] .pie { background: var(--lado); }
.pie-enlaces { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; flex: 1 1 auto; }
.pie a { color: var(--suave); text-decoration: none; }
.pie a:hover { color: var(--acento); }
.pie-redes { display: flex; gap: .35rem; }
.pie-redes a { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 8px; }
.pie-redes a:hover { background: var(--encima); }
.pie-redes svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pie-redes svg .lleno { fill: currentColor; stroke: none; }
.pie-derechos { width: 100%; font-size: .8rem; opacity: .8; }
@media (min-width: 701px) { .pie-derechos { width: auto; } }
.portada .pie { margin-top: 2rem; }

/* --- La app del curso centrada, con ancho máximo (Rulas 2026-11-02) --- */
.marco-curso { flex: 1; min-width: 0; height: 100%; display: flex; justify-content: center; background: var(--pagina); }
.marco-curso #curso { width: 100%; flex: 1 1 auto; }
html[data-tema="oscuro"] .marco-curso #curso { box-shadow: 0 0 0 1px var(--borde); }
