/* Fase y Neutro · sistema común v2.4
   Se carga la última en el portal y en las actividades. Define las variables
   compartidas y unifica botones, títulos, etiquetas, enlaces y acentos.
   Misión 50 Hz (juego a pantalla completa) mantiene su estética propia. */

:root{
  --fyn-ink:#102029;
  --fyn-ink-hover:#1f3a48;
  --fyn-muted:#526571;
  --fyn-line:#cbd6dd;
  --fyn-line-strong:#8a9ba5;
  --fyn-bg:#edf1f3;
  --fyn-surface:#fff;
  --fyn-accent:#f4b900;
  --fyn-accent-soft:#fff1c5;
  --fyn-link:#1261a0;
  --fyn-radius:6px;
  --fyn-radius-card:10px;
  --fyn-font:Montserrat,FynBody,"Segoe UI",Arial,sans-serif;
  --fyn-head:Bricolage,FynHeading,Arial,sans-serif;
  --fyn-mono:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  --fyn-h1:clamp(32px,3vw,41px);
  --fyn-h2:clamp(24px,2.3vw,30px);
  --fyn-h3:clamp(19px,1.6vw,22px);
}
/* Los módulos usan el mismo acento que el portal */
/* Guía C1–C5: el acento solo se usa como fondo, así que toma el amarillo del portal */
html:root[data-fyn-module="vivienda-teoria"]{--accent:var(--fyn-accent);--accent-ink:var(--fyn-ink)}
/* REBOBINA usa el acento también como color de texto: se oscurece para cumplir 4,5:1 */
html:root[data-fyn-module="rebobina"]{--accent:#8a6100}
html[data-fyn-module] :focus-visible{outline-color:var(--fyn-ink)}

/* ---------- Tipografía ---------- */
html body .module-frame,html body .module-frame button,html body .module-frame input,html body .module-frame select,html body .module-frame textarea{font-family:var(--fyn-font)}
html body .module-frame .num,html body .module-frame code,html body .module-frame kbd{font-family:var(--fyn-mono)}

html body .page-intro h1,html body .resource-hero h1,html body .games-intro21 h1,html body .legal h1,html body .module-frame h1,html body .topic-intro22 h1{
  font-family:var(--fyn-head);font-size:var(--fyn-h1);font-weight:750;line-height:1.08;letter-spacing:-.035em}
html body .home21 h1,html body .home-hero21 h1{letter-spacing:-.045em}
/* El entrenador tiene una barra de título compacta */
html[data-fyn-module="serieparalelo"] body .module-frame h1{font-size:clamp(22px,2vw,28px)}

html body .section-heading h2,html body .topic-section22 .section-heading h2,html body .module-frame .blk-head h2,html body .games-section21 h2,html body .route-list h2,html body .home21 h2{
  font-family:var(--fyn-head);font-size:var(--fyn-h2);font-weight:750;line-height:1.15;letter-spacing:-.025em}
html body .reading h2,html body .legal h2,html body .module-frame section h2:not(.blk-head h2){font-family:var(--fyn-head);font-size:clamp(22px,2vw,27px);font-weight:750;line-height:1.2;letter-spacing:-.02em}
html body .next-step22 h2,html body .checkpoint22 h2{font-family:var(--fyn-head);font-size:var(--fyn-h3);font-weight:750;line-height:1.25}

html body .eyebrow,html body .module-frame .eyebrow{font-family:var(--fyn-font);font-size:11px;font-weight:700;line-height:1.4;letter-spacing:.12em;text-transform:uppercase;color:var(--fyn-muted)}

/* ---------- Enlaces ---------- */
html body .reading a:not(.button),html body .legal a:not(.button),html body .breadcrumbs a,html body .module-frame p a:not(.btn):not(.button),html body .module-frame li a:not(.btn):not(.button),html body .topic-questions22 span,html body .next-step22 p a{color:var(--fyn-link)}

/* ---------- Botones: principal, secundario y enlace ---------- */
html body a.button,html body button.button,html body .module-frame .btn,html body .next-step22 .button{
  font-family:var(--fyn-font);font-size:14px;font-weight:700;line-height:1.2;letter-spacing:0;
  border-radius:var(--fyn-radius);min-height:44px;padding:10px 20px;text-decoration:none;
  display:inline-flex;align-items:center;justify-content:center;gap:8px;box-shadow:none}
html body a.button:not(.secondary),html body button.button:not(.secondary),html body .next-step22 .button:not(.secondary){background:var(--fyn-ink);color:#fff;border:1px solid var(--fyn-ink)}
html body a.button:not(.secondary):hover,html body button.button:not(.secondary):hover{background:var(--fyn-ink-hover)}
html body a.button.secondary,html body button.button.secondary{background:transparent;color:var(--fyn-ink);border:1px solid var(--fyn-line-strong)}
html body a.button.secondary:hover,html body button.button.secondary:hover{background:#fff}
/* En los módulos: amarillo = acción del juego; resto = secundario, salvo los que ya eran principales */
html body .module-frame .btn{background:#fff;color:var(--fyn-ink);border:1px solid var(--fyn-line-strong)}
html body .module-frame .btn.amber,html body .module-frame .btn.primary,html body .module-frame .btn.accent{background:var(--fyn-accent);color:var(--fyn-ink);border-color:var(--fyn-accent)}
html[data-fyn-module="vivienda-juegos"] body .module-frame .btn:not(.ghost):not(.amber):not(.primary):not(.accent),
html[data-fyn-module="vivienda-teoria"] body .module-frame .btn:not(.ghost):not(.amber):not(.primary):not(.accent){background:var(--fyn-ink);color:#fff;border-color:var(--fyn-ink)}
html body .module-frame .btn.danger{background:#b33530;color:#fff;border-color:#b33530}
html body .module-frame .btn[disabled]{opacity:.45}
html body .module-frame .btn.ghost{background:transparent;color:var(--fyn-ink);border-color:var(--fyn-line-strong)}

/* Selector de lectura legible y pulsable */
html body .reader-modes button{font-family:var(--fyn-font);font-size:13px;font-weight:700;min-height:44px;padding:8px 10px;border-radius:5px}

/* ---------- Tarjetas: misma caja en portada y catálogos ---------- */
html body .resource-card{background:var(--fyn-surface);border:1px solid rgba(16,32,41,.125);border-radius:var(--fyn-radius-card);overflow:hidden}
html body .resource-card .card-body{padding:18px}
html body .resource-card .card-body .format-tag{align-self:flex-start;width:auto;display:inline-flex}

/* ---------- Bloques de orientación y cierre ---------- */
html body .orientation22 .takeaway22{margin:10px 0 0;font-size:15px;line-height:1.55}
html body .next-actions23{display:flex;flex-wrap:wrap;gap:10px}
html body .route-done23{background:#e7f4ee;border-color:#9fcbb5}

/* ---------- Migas: una sola forma y alineada con el contenido ---------- */
html body .activity-path{max-width:1180px;margin:0 auto;padding:18px 24px 0}
@media(min-width:1200px){html body .activity-path{padding-inline:54px}}
html body .activity-path .breadcrumbs{margin:0}
html body .breadcrumbs{font-size:13px;color:var(--fyn-muted)}

/* ---------- Retícula: páginas legales alineadas a la izquierda como el resto ---------- */
html body .wrap.legal{max-width:1056px;margin-inline:auto}
html body .wrap.legal>*{max-width:74ch}

/* ---------- Tablas en móvil: desplazamiento horizontal en lugar de cortar palabras ---------- */
html body .reading table,html body .module-frame table,html body .blk table{word-break:normal;overflow-wrap:normal;hyphens:none}
@media(max-width:720px){
  html body .reading table,html body .comparison-table,html body .module-frame table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
  html body .reading table th,html body .reading table td,html body .module-frame table th,html body .module-frame table td{min-width:9.5em}
  html body .reading table th:first-child,html body .reading table td:first-child{min-width:7em}
}

/* ---------- Refuerzos: estas reglas deben ganar a los estilos propios de cada módulo ---------- */
html body a.button,html body button.button,html body .module-frame .btn,html body .next-step22 .button{font-size:14px!important;font-weight:700!important;border-radius:var(--fyn-radius)!important;min-height:44px!important}
html body .reader-toolbar .reader-modes button,html body .reader-modes button{font-size:13px!important;min-height:44px!important;font-weight:700!important}
html body .lab-content button,html body [data-fyn-module] .lab-content button{border-radius:var(--fyn-radius);font-weight:700}
html body .module-frame .hero h1,html body .module-frame header h1{font-size:var(--fyn-h1)}
html[data-fyn-module="serieparalelo"] body .module-frame header h1{font-size:clamp(22px,2vw,28px)}
/* Misma retícula que el portal: contenido a 1056 px */
html body .module-frame{max-width:1104px;padding-inline:24px}
html body .activity-path{max-width:1104px!important;padding:18px 24px 0!important}
html[data-fyn-module="vivienda-juegos"] body .module-frame .wrap{padding-inline:0}
html body .wrap.reading.legal{max-width:1056px!important;margin-inline:auto!important;padding-inline:0}
html body .portal-footer [data-analytics-settings]{min-height:32px}

html[data-fyn-module="vivienda-juegos"] body .module-frame .app{padding-inline:0}

/* Contraste de textos secundarios */
html body .portal-footer p{color:var(--fyn-muted)}
html body .door-number21{color:#5a6c77}
html[data-fyn-module="serieparalelo"] body .module-frame h1 span,html[data-fyn-module="serieparalelo"] body .module-frame .dim,html[data-fyn-module="serieparalelo"] body .module-frame p.units,html[data-fyn-module="serieparalelo"] body .module-frame .foot{color:var(--fyn-muted)}
html[data-fyn-module="serieparalelo"] body #foot{color:var(--fyn-muted)}
html body .lab .diagram .reading p,html body .lab .reading p{color:#d7e2e8}
/* Guía C1–C5: los colores amarillos de circuito no se usan como texto sobre blanco */
html[data-fyn-module="vivienda-teoria"] body h3 span[style*="var(--c1)"],html[data-fyn-module="vivienda-teoria"] body h3 span[style*="var(--c10)"]{color:#8a6100!important}

/* Tercer tipo: enlace de acción (pie de las tarjetas) */
html body a.button.card-action{background:transparent!important;color:var(--fyn-ink)!important;border:0!important;border-bottom:1px solid var(--fyn-line-strong)!important;border-radius:0!important;padding:10px 0!important;justify-content:space-between;width:100%}
html body a.button.card-action:hover{border-bottom-color:var(--fyn-ink)!important;background:transparent!important}
/* Selector de lectura: cabe en la columna lateral */
html body .reader-toolbar .reader-modes button,html body .reader-modes button{font-size:12px!important;padding:6px 4px!important;white-space:nowrap}
/* La cabecera y el pie del portal no heredan estilos de las apps */
html body header.site-header{display:block;margin:0;gap:0;flex-wrap:nowrap}
html body .portal-footer a,html body .portal-footer button{text-decoration:none}
html body .portal-footer a:hover,html body .portal-footer button:hover{text-decoration:underline}
/* Cabecera y pie idénticos en todas las páginas (valores de la portada) */
html body .site-header .header-inner{max-width:1120px!important;margin:0 auto!important;padding:14px 24px!important;gap:18px!important;flex-wrap:nowrap!important;line-height:1.55}
html body .portal-footer{padding:36px 0!important;font-size:13px}
html body .portal-footer .footer-inner{display:flex!important;max-width:1120px!important;width:auto!important;margin:0 auto!important;padding:0 24px!important;gap:24px!important;align-items:center!important;justify-content:space-between!important;flex-wrap:wrap!important}
html body .portal-footer nav{display:flex!important;gap:18px!important;flex-wrap:wrap!important;width:auto!important}
html body .portal-footer nav a,html body .portal-footer nav button,html body .portal-footer p{font-size:12px!important;line-height:1.6!important}
html body .portal-footer nav a,html body .portal-footer nav button{min-height:32px;display:inline-flex!important;align-items:center}
@media(max-width:760px){html body .portal-footer .footer-inner{flex-wrap:wrap!important;align-items:flex-start!important}html body .site-header .header-inner{flex-wrap:wrap!important;padding:12px 18px!important}}
html body footer.portal-footer{display:block!important;max-width:none!important;width:auto!important;margin:0!important;grid-template-columns:none!important;border-radius:0!important}
/* Tipografía única también en esquemas, fichas e infografía (los datos numéricos siguen en monoespaciada) */
html body .module-frame svg text:not(.num):not(.mono),html body .lab svg text:not(.num):not(.mono),html body .lab-content svg text:not(.num):not(.mono){font-family:var(--fyn-font)}
html body .lab .big{font-family:var(--fyn-head)}
html body .electric-sheet,html body .electric-sheet .lbl{font-family:var(--fyn-font)}
html body .module-frame .hero h1,html body .module-frame header h1,html body .module-frame h1{font-size:var(--fyn-h1)!important}
html[data-fyn-module="serieparalelo"] body .module-frame header h1,html[data-fyn-module="serieparalelo"] body .module-frame h1{font-size:clamp(22px,2vw,28px)!important}
html body .resource-grid .resource-card{background:var(--fyn-surface)!important;border:1px solid rgba(16,32,41,.125)!important;border-radius:var(--fyn-radius-card)!important;overflow:hidden}
html body .resource-grid .resource-card .card-body{padding:18px!important}
html body .resource-grid .resource-card .resource-media,html body .resource-grid .resource-card .resource-media img{border:0!important;border-radius:0!important}
html body .route-block h3 a,html body .route-steps h2 a,html body .topic-starts22 h3 a,html body .next-step22 h2 a{color:inherit;text-decoration:none}
html body .route-block h3 a:hover,html body .route-steps h2 a:hover,html body .topic-starts22 h3 a:hover,html body .next-step22 h2 a:hover{text-decoration:underline;text-underline-offset:4px;text-decoration-thickness:2px}
html body .route-block h3 a:focus-visible,html body .route-steps h2 a:focus-visible,html body .topic-starts22 h3 a:focus-visible,html body .next-step22 h2 a:focus-visible{outline:3px solid #e8ad00;outline-offset:3px;border-radius:3px}
/* v2.7.2: rutas en portada, barra de ruta y vista en lista */
html body .section-tools27{display:flex;align-items:center;gap:18px;flex-wrap:wrap;justify-content:flex-end}
html body .section-tools27 #resultCount{margin:0}
html body .view-toggle27{display:inline-flex;border:1px solid var(--line,#dedfd9);border-radius:999px;background:#fff;padding:3px}
html body .view-toggle27 button{display:inline-flex;align-items:center;gap:7px;border:0;background:transparent;color:#102132;font:700 13px/1 Montserrat,Arial,sans-serif;padding:9px 14px;border-radius:999px;cursor:pointer}
html body .view-toggle27 button svg{fill:currentColor}
html body .view-toggle27 button[aria-pressed=true]{background:#102132;color:#fff}
html body .view-toggle27 button:focus-visible{outline:3px solid #e8ad00;outline-offset:2px}
html body .resource-grid.is-list{grid-template-columns:1fr!important;gap:12px!important}
html body .resource-grid.is-list .resource-card{display:grid!important;grid-template-columns:210px minmax(0,1fr);align-items:stretch}
html body .resource-grid.is-list .resource-card .resource-media{height:100%;min-height:128px}
html body .resource-grid.is-list .resource-card .resource-media a,html body .resource-grid.is-list .resource-card .resource-media img{display:block;height:100%;width:100%;object-fit:cover}
html body .resource-grid.is-list .resource-card .card-body{display:grid!important;grid-template-columns:minmax(0,1fr) auto;column-gap:24px;row-gap:4px;align-content:center;padding:14px 20px!important}
html body .resource-grid.is-list .resource-card .card-body>*{grid-column:1}
html body .resource-grid.is-list .resource-card .card-body h3{font-size:19px;margin:2px 0 0}
html body .resource-grid.is-list .resource-card .card-body p{margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
html body .resource-grid.is-list .resource-card .card-action{grid-column:2;grid-row:1/span 4;align-self:center;white-space:nowrap}
@media(max-width:720px){
 html body .resource-grid.is-list .resource-card{grid-template-columns:104px minmax(0,1fr)}
 html body .resource-grid.is-list .resource-card .card-body{grid-template-columns:1fr;padding:12px 14px!important}
 html body .resource-grid.is-list .resource-card .card-body h3{font-size:16px}
 html body .resource-grid.is-list .resource-card .card-body p,html body .resource-grid.is-list .resource-card .card-body small,html body .resource-grid.is-list .resource-card .card-action{display:none!important}
 html body .view-toggle27 button span{display:none}
 html body .view-toggle27 button{padding:9px 12px}
}
html body .home-routes27{padding-block:8px 34px}
html body .route-cards27{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
html body .route-card27{display:flex;flex-direction:column;gap:10px;background:#fff;border:1px solid var(--line,#dedfd9);border-top:4px solid #e8ad00;border-radius:12px;padding:22px}
html body .route-card27 h3{margin:0;font-size:22px;line-height:1.2}
html body .route-card27 h3 a{color:inherit;text-decoration:none}
html body .route-card27 h3 a:hover{text-decoration:underline;text-underline-offset:4px;text-decoration-thickness:2px}
html body .route-card27 p{margin:0;color:#596574;font-size:14.5px;line-height:1.55}
html body .route-card27 .rc-steps{margin:4px 0 8px;padding:0;list-style:none;display:grid;gap:6px;counter-reset:rc;font-size:13.5px;font-weight:600}
html body .route-card27 .rc-steps li{counter-increment:rc;display:flex;gap:10px;align-items:baseline;line-height:1.35}
html body .route-card27 .rc-steps li::before{content:counter(rc);flex:none;width:22px;height:22px;border-radius:50%;background:#fff3c4;color:#102132;font-size:12px;font-weight:800;display:inline-grid;place-items:center}
html body .route-card27 .rc-steps .rc-more{color:#596574;font-weight:600}
html body .route-card27 .rc-steps .rc-more::before{content:"+";background:transparent}
html body .route-card27 .button{margin-top:auto;align-self:flex-start}
@media(max-width:980px){html body .route-cards27{grid-template-columns:1fr}}
html body .routebar27{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px 24px;align-items:center;margin:6px 0 18px;padding:12px 16px;background:#fff8dc;border:1px solid #f0dc8a;border-radius:12px}
html body .routebar27 .rb-head{display:flex;flex-wrap:wrap;gap:4px 14px;align-items:baseline}
html body .routebar27 .rb-name{color:#102132;font-weight:800;text-decoration:none;font-size:15px}
html body .routebar27 .rb-name span{font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:#7a5d00;margin-right:4px}
html body .routebar27 .rb-name:hover{text-decoration:underline}
html body .routebar27 .rb-count{font-size:13px;color:#596574;font-weight:600}
html body .routebar27 .rb-dots{display:flex;gap:6px;list-style:none;margin:0;padding:0;flex-wrap:wrap;grid-column:1}
html body .routebar27 .rb-dots a{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;border:2px solid #d9c46a;background:#fff;color:#102132;font-weight:800;font-size:13px;text-decoration:none}
html body .routebar27 .rb-dots a[aria-current=step]{background:#102132;border-color:#102132;color:#fff}
html body .routebar27 .rb-dots a:hover{border-color:#102132}
html body .routebar27 .rb-nav{grid-column:2;grid-row:1/span 2;display:flex;gap:8px;align-items:center}
html body .routebar27 .rb-nav a{font-weight:700;font-size:14px;color:#102132;text-decoration:none;padding:9px 14px;border:1px solid #102132;border-radius:999px;background:#fff}
html body .routebar27 .rb-nav a.rb-next{background:#102132;color:#fff}
html body .routebar27 a:focus-visible{outline:3px solid #e8ad00;outline-offset:2px}
@media(max-width:720px){html body .routebar27{grid-template-columns:1fr}html body .routebar27 .rb-nav{grid-column:1;grid-row:auto}}
html body .home-routes27 .section-heading{align-items:flex-end;margin-bottom:26px}
html body .resource-grid.is-list .resource-card{grid-template-columns:230px minmax(0,1fr)}
html body .resource-grid.is-list .resource-card .resource-media{height:auto;min-height:0;aspect-ratio:8/5;align-self:center}
html body .resource-grid.is-list .resource-card .card-body>.format-badge,html body .resource-grid.is-list .resource-card .card-body>span:first-child{justify-self:start}
html body .resource-grid.is-list .resource-card{overflow:hidden}
@media(max-width:720px){html body .resource-grid.is-list .resource-card{grid-template-columns:104px minmax(0,1fr)}html body .resource-grid.is-list .resource-card .resource-media{aspect-ratio:1/1}}
html body .card-actions27{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;margin-top:auto}
html body .card-actions27 .card-sheet27{font-size:13.5px;font-weight:700;color:#35495a;text-decoration:underline;text-underline-offset:3px}
html body .card-actions27 .card-sheet27:hover{color:#102132}
html body .resource-grid.is-list .resource-card .card-actions27{grid-column:2;grid-row:1/span 4;align-self:center;flex-direction:column;align-items:flex-end;gap:8px}
@media(max-width:720px){html body .resource-grid.is-list .resource-card .card-actions27{display:none}}

/* v2.7.3 · SEO y accesibilidad */
.topic-about273{max-width:68ch;margin:12px 0 0;font-size:15px;line-height:1.75;color:var(--fyn-muted)}
html body .site-header nav a,html body .text-link,html body .card-actions27 a{display:inline-block;padding-block:4px}
html body .site-header nav a{display:inline-flex;align-items:center;min-height:32px}
