/* palette.css - retoques de color y cabecera. Va despues de lessons.css (y de theme.css). */

/* Cabecera: con los enlaces nuevos (Practica, Editor) no debe partir las palabras en dos lineas */
.main-header .nav-links a, .main-header .nav-links .nav-login, .main-header .nav-links .nav-signup { white-space: nowrap; }
@media (min-width: 901px) and (max-width: 1180px) { .main-header .nav-links { gap: 1rem; } }

/* Banner del curso: indigo -> violeta (el mismo degradado que el reto del dia) */
.course-banner {
    background:
        radial-gradient(28rem 14rem at 100% 0%, rgba(255, 255, 255, .14), transparent 60%),
        linear-gradient(135deg, #312e81 0%, #4f46e5 55%, #7c3aed 100%);
}
html[data-theme="dark"] .course-banner {
    background:
        radial-gradient(28rem 14rem at 100% 0%, rgba(255, 255, 255, .08), transparent 60%),
        linear-gradient(135deg, #1e1b4b 0%, #3730a3 55%, #5b21b6 100%);
}

/* Cabecera de leccion y de ejercicio: toman el color del bloque de la leccion (el mismo de su icono) */
.lesson-hero, .exercise-hero {
    background:
        radial-gradient(28rem 14rem at 100% 0%, rgba(255, 255, 255, .16), transparent 60%),
        linear-gradient(135deg, color-mix(in srgb, var(--c, #4f46e5) 58%, #0f172a), color-mix(in srgb, var(--c, #4f46e5) 92%, #312e81));
}
html[data-theme="dark"] .lesson-hero, html[data-theme="dark"] .exercise-hero {
    background:
        radial-gradient(28rem 14rem at 100% 0%, rgba(255, 255, 255, .08), transparent 60%),
        linear-gradient(135deg, color-mix(in srgb, var(--c, #3730a3) 38%, #0b1020), color-mix(in srgb, var(--c, #3730a3) 66%, #0b1020));
}
.lesson-hero-icon .count-badge { color: var(--c, #4f46e5); border-color: var(--c, #4f46e5); }
.lesson-start { color: color-mix(in srgb, var(--c, #3730a3) 70%, #0f172a); }

/* ---- columna del indice: continuar, reto del dia y progreso ---- */
.side-widget { margin-bottom: 1rem; }
.side-widget.panel { padding: 1rem 1.1rem; }
.side-widget h2 { margin: 0 0 .7rem; font-size: .95rem; text-align: left; color: var(--c-text); }
.side-continue-link { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--c-text); }
.side-continue-icon .lesson-bubble { width: 62px; height: 62px; }
.side-continue-icon .lesson-bubble::before { inset: 5px; }
.side-continue-icon .lesson-bubble .li { width: 32px; height: 32px; }
.side-continue-icon .count-badge { display: none; }
.side-continue-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.side-continue-text strong { line-height: 1.25; }
.side-continue-text small { color: var(--c-muted); font-size: .8rem; }
.side-bar { height: 7px; border-radius: 999px; margin: .8rem 0 .2rem; background: color-mix(in srgb, var(--c-text) 10%, var(--c-panel)); overflow: hidden; }
.side-bar[hidden] { display: none; }
.side-bar-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #4f46e5, #7c3aed); transition: width .4s; }
.side-btn { display: block; margin-top: .8rem; padding: .55rem 1rem; border-radius: 999px; background: var(--c-primary); color: #fff; font-weight: 700; font-size: .9rem; text-align: center; text-decoration: none; }
.side-btn:hover { background: var(--c-primary-dark); color: #fff; }
.side-btn[hidden] { display: none; }
.side-link { display: inline-block; margin-top: .5rem; font-size: .85rem; font-weight: 600; color: var(--c-primary); text-decoration: none; }
.side-progress-text { margin: 0; font-size: .9rem; color: var(--c-text); }
.side-daily { display: flex; flex-direction: column; gap: .35rem; }
.side-daily h2 { margin: 0 0 .2rem; }
.side-daily-title { font-size: 1.05rem; line-height: 1.3; color: var(--c-text); }
.side-daily-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .8rem; color: var(--c-muted); }
.side-daily-go { align-self: flex-start; margin-top: .4rem; padding: .45rem 1rem; border-radius: 999px; background: transparent; color: var(--c-text); border: 1px solid var(--c-border); font-weight: 700; font-size: .88rem; text-decoration: none; }
.side-daily-go:hover { border-color: #d97706; color: #b45309; }
.side-daily-go.is-done::after { content: ' ✓'; color: #16a34a; }
.side-daily-go .solved-mark { display: none; }

/* ---- cabecera del indice del curso: va dentro de la tarjeta de lecciones, con brillo suave, etiqueta, titulo, descripcion y tres cifras ---- */
.course-path { overflow: hidden; }
.course-head { margin: -1.5rem -1.75rem 0; padding: 1.6rem 1.75rem 1.5rem; border-bottom: 1px solid var(--c-border); background: radial-gradient(34rem 14rem at 100% 0%, color-mix(in srgb, var(--c-primary) 11%, transparent), transparent 70%); }
.course-head + .roadmap { margin-top: 2.25rem; }
.course-head .breadcrumbs ol { margin: 0 0 1rem; }
.course-head .breadcrumbs li { display: inline-flex; }
.course-head .breadcrumbs li + li::before { content: none; }
.course-head .breadcrumbs a, .course-head .breadcrumbs [aria-current] { display: inline-block; padding: .22rem .7rem; border-radius: 999px; background: var(--c-primary-soft); color: var(--c-primary); font-size: .7rem; font-weight: 700; letter-spacing: .08em; line-height: 1.3; text-transform: uppercase; text-decoration: none; }
.course-head .breadcrumbs a:hover { text-decoration: none; background: color-mix(in srgb, var(--c-primary) 18%, var(--c-panel)); }
.course-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem 2.5rem; flex-wrap: wrap; }
.course-head-text { flex: 1 1 24rem; min-width: 0; }
.course-head .page-title { font-size: 2rem; line-height: 1.15; margin: 0 0 .6rem; padding: 0; letter-spacing: -.02em; }
.course-head .page-lead { max-width: 56ch; margin: 0; font-size: 1.02rem; line-height: 1.55; }
.course-head-stats { list-style: none; display: flex; margin: 0; padding: 0; }
.course-head-stats li { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; padding: .1rem 1.5rem; border-left: 1px solid var(--c-border); }
.course-head-stats li:first-child { padding-left: 0; border-left: 0; }
.course-head-stats li:last-child { padding-right: 0; }
.course-head-stats strong { font-size: 1.75rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--c-primary); font-variant-numeric: tabular-nums; }
.course-head-stats span { font-size: .78rem; color: var(--c-muted); line-height: 1.25; }
@media (max-width: 900px) {
  .course-head { margin: -1.1rem -1.1rem 0; padding: 1.25rem 1.1rem 1.2rem; }
}
@media (max-width: 640px) {
  .course-head .page-title { font-size: 1.6rem; }
  .course-head-row { align-items: stretch; }
  .course-head-stats { width: 100%; padding-top: 1.1rem; border-top: 1px dashed var(--c-border); }
  .course-head-stats li { flex: 1; padding: .1rem .8rem; }
  .course-head-stats strong { font-size: 1.45rem; }
}

/* ---- tarjetas Entrada/Salida: claras en tema claro, oscuras en tema oscuro ---- */
html[data-theme="dark"] .io-card header { background: #1e293b; color: #94a3b8; border-bottom: 0; }
html[data-theme="dark"] .io-card .code-block { color: #e2e8f0; }

/* ---- columna lateral del indice: una sola tarjeta con tres secciones + anuncio aparte ---- */
.rail-card { padding: 0; overflow: hidden; margin-bottom: 1rem; }
.rail-sec { padding: 1.05rem 1.15rem; }
.rail-sec + .rail-sec { border-top: 1px solid var(--c-border); }
.rail-sec h2 { margin: 0 0 .7rem; font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; text-align: left; color: var(--c-muted); }
.rail-sec.side-continue { background: linear-gradient(180deg, color-mix(in srgb, var(--c-primary) 8%, var(--c-panel)), var(--c-panel) 85%); }
.rail-sec .side-btn { margin-top: .9rem; padding: .6rem 1rem; border-radius: 10px; }
.side-btn-ghost { background: transparent; color: var(--c-primary); border: 1px solid color-mix(in srgb, var(--c-primary) 45%, var(--c-border)); margin-top: .7rem; }
.side-btn-ghost:hover { background: var(--c-primary-soft); color: var(--c-primary); }
.rail-sec .side-bar { height: 8px; }
.rail-daily-row { display: flex; align-items: flex-start; gap: .75rem; }
.rail-daily-ico { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, #d97706 14%, var(--c-panel)); color: #d97706; }
.rail-daily-ico svg { width: 20px; height: 20px; fill: currentColor; }
.rail-daily-body { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.rail-sec .side-daily-go { align-self: flex-start; margin-top: .75rem; padding: 0; border: 0; border-radius: 0; background: none; color: var(--c-primary); font-size: .88rem; font-weight: 700; }
.rail-sec .side-daily-go:hover { color: var(--c-primary-dark); text-decoration: underline; }
.rail-sec .side-daily-go.is-done::after { content: ' ✓'; color: #16a34a; }
.rail-sec .side-progress-text { font-size: .92rem; font-weight: 600; margin-bottom: .1rem; }
.rail-ad { margin-bottom: 1rem; padding: .6rem .6rem .8rem; text-align: center; border: 1px solid var(--c-border); border-radius: 14px; background: var(--c-panel); }
.rail-ad:not(:has(.ad-mock, .ad-slot:not(:empty))) { display: none; }
.rail-ad-label { display: block; margin-bottom: .45rem; font-size: .66rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--c-muted); }
.rail-ad .ad-mock, .rail-ad .ad-slot { margin: 0; }
/* En pantallas bajas la columna (tarjeta + anuncio) no cabe entera: que se desplace con la pagina en vez de tener su propio scroll. */
@media (max-height: 859px) { body:has(.rail-card) .course-side { position: static; max-height: none; overflow: visible; } }

/* ---- footer: marca y columnas de enlaces arriba, copyright e idioma abajo ---- */
.site-footer.ft { padding: 3.25rem 1.5rem 1.5rem; text-align: left; font-size: .92rem; }
.ft-inner { max-width: 1120px; margin: 0 auto; }
.ft-top { display: grid; grid-template-columns: 1.7fr repeat(4, minmax(0, 1fr)); gap: 2.5rem 2rem; }
.ft-brand { display: flex; flex-direction: column; align-items: flex-start; gap: .9rem; }
.ft-brand .logo-container { margin-left: -.25rem; }
.ft-tag { margin: 0; max-width: 28ch; line-height: 1.55; color: var(--c-muted); }
.ft-play { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .85rem; border: 1px solid var(--c-border); border-radius: 10px; background: var(--c-panel); color: var(--c-text); font-size: .85rem; font-weight: 600; text-decoration: none; }
.ft-play svg { width: 15px; height: 15px; fill: currentColor; color: #16a34a; }
.ft-play:hover { border-color: var(--c-primary); color: var(--c-primary); }
.ft-col h3 { margin: 0 0 .9rem; font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--c-text); }
.ft-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.ft-col a { color: var(--c-muted); text-decoration: none; line-height: 1.35; }
.ft-col a:hover { color: var(--c-primary); text-decoration: underline; text-underline-offset: 3px; }
.ft-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem 1.5rem; margin-top: 2.75rem; padding-top: 1.25rem; border-top: 1px solid var(--c-border); }
.ft-copy { margin: 0; font-size: .85rem; color: var(--c-muted); }
.ft-copy a { color: var(--c-muted); text-decoration: underline; text-underline-offset: 3px; }
.ft-copy a:hover { color: var(--c-primary); }
.ft .language-switch { align-self: auto; margin: 0; display: flex; justify-content: flex-end; }
.ft .lang-dropdown summary { color: var(--c-muted); padding: .3rem .1rem; }
.ft .lang-dropdown summary::after { border-top-color: var(--c-muted); }
@media (max-width: 900px) {
  .ft-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ft-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .site-footer.ft { padding: 2.5rem 1.25rem 1.25rem; }
  .ft-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ft-bottom { flex-direction: column; align-items: flex-start; }
}

/* =====================================================================
   Paginas de leccion y de ejercicio: misma cabecera clara que curso y practica (etiqueta, titulo, cifras),
   con el color de la leccion solo como acento (brillo, etiqueta, boton, barras de las tarjetas).
   ===================================================================== */
html:not(.zz) .lesson-hero, html:not(.zz) .exercise-hero {
  position: relative; overflow: hidden; margin-bottom: 1rem; color: var(--c-text);
  padding: 1.6rem 1.75rem 1.5rem; border: 1px solid var(--c-border); border-radius: var(--c-radius); box-shadow: var(--c-shadow);
  background: radial-gradient(34rem 14rem at 100% 0%, color-mix(in srgb, var(--c, var(--c-primary)) 15%, transparent), transparent 70%), var(--c-panel);
}
html:not(.zz) .lesson-hero .breadcrumbs ol, html:not(.zz) .exercise-hero .breadcrumbs ol { margin: 0 0 1rem; }
html:not(.zz) .lesson-hero .breadcrumbs li, html:not(.zz) .exercise-hero .breadcrumbs li { display: inline-flex; }
html:not(.zz) .lesson-hero .breadcrumbs li + li::before, html:not(.zz) .exercise-hero .breadcrumbs li + li::before { content: none; }
html:not(.zz) .lesson-hero .breadcrumbs a, html:not(.zz) .lesson-hero .breadcrumbs [aria-current],
html:not(.zz) .exercise-hero .breadcrumbs a, html:not(.zz) .exercise-hero .breadcrumbs [aria-current] {
  display: inline-block; padding: .22rem .7rem; border-radius: 999px; background: var(--c-primary-soft); color: var(--c-primary);
  font-size: .7rem; font-weight: 700; letter-spacing: .08em; line-height: 1.3; text-transform: uppercase; text-decoration: none;
}
html:not(.zz) .lesson-hero .breadcrumbs a:hover, html:not(.zz) .exercise-hero .breadcrumbs a:hover { background: color-mix(in srgb, var(--c-primary) 18%, var(--c-panel)); text-decoration: none; }

html:not(.zz) .lesson-kicker {
  display: inline-block; padding: .22rem .7rem; border-radius: 999px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; line-height: 1.3; text-transform: uppercase;
  background: color-mix(in srgb, var(--c, var(--c-primary)) 14%, var(--c-panel)); color: color-mix(in srgb, var(--c, var(--c-primary)) 78%, var(--c-text));
}
html:not(.zz) .lesson-hero .page-title, html:not(.zz) .exercise-hero .page-title { color: var(--c-text); font-size: 2rem; line-height: 1.15; letter-spacing: -.02em; margin: .7rem 0 .5rem; }
html:not(.zz) .exercise-hero .page-title { margin-bottom: 0; }
html:not(.zz) .lesson-hero .page-lead { color: var(--c-muted); max-width: 62ch; font-size: 1rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.lesson-hero-body { gap: 2rem; align-items: center; }
.lesson-hero-icon .lesson-bubble { width: 116px; height: 116px; border: 0; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .12), 0 8px 18px color-mix(in srgb, var(--c) 30%, transparent); }
.lesson-hero-icon .lesson-bubble::before { inset: 21px; }
.lesson-hero-icon .lesson-bubble img { width: 56px; height: 56px; }

html:not(.zz) .lesson-stats { gap: 0; margin: 1.1rem 0 0; font-size: .78rem; color: var(--c-muted); }
html:not(.zz) .lesson-stats li { display: inline-flex; flex-direction: column; gap: .2rem; padding: .1rem 1.5rem; border-left: 1px solid var(--c-border); line-height: 1.25; }
html:not(.zz) .lesson-stats li:first-child { padding-left: 0; border-left: 0; }
html:not(.zz) .lesson-stats strong { margin: 0; font-size: 1.75rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; color: color-mix(in srgb, var(--c, var(--c-primary)) 85%, var(--c-text)); font-variant-numeric: tabular-nums; }
html:not(.zz) .lesson-start { margin-top: 1.25rem; padding: .62rem 1.3rem; border-radius: 10px; background: color-mix(in srgb, var(--c, var(--c-primary)) 88%, #000); color: #fff; box-shadow: none; }
html:not(.zz) .lesson-start:hover { transform: none; box-shadow: 0 6px 16px color-mix(in srgb, var(--c, var(--c-primary)) 35%, transparent); filter: brightness(1.06); }

html:not(.zz) .lesson-hero .chip, html:not(.zz) .exercise-hero .chip { background: transparent; border-color: var(--c-border); color: var(--c-muted); }
html:not(.zz) .lesson-hero .chip-theory, html:not(.zz) .exercise-hero .chip-theory { background: var(--c-primary-soft); border-color: transparent; color: var(--c-primary-dark); }
html:not(.zz) .lesson-hero .chip::before, html:not(.zz) .exercise-hero .chip::before { box-shadow: none; }

/* acento de la leccion en tarjetas, titulos de seccion y enunciado */
.ex-practice, .ex-theory { --ex: var(--c, #4f46e5); }
.lesson-content .section-heading::before, .exercise-section h2::before { background: var(--c, #4f46e5); }
.exercise-problem ul.lead { border-left-color: var(--c, #4f46e5); }
.exercise-problem ol.instructions-exercise > li::before { background: var(--c, #4f46e5); }
.start-card a.start-btn { border-radius: 10px; box-shadow: none; background: color-mix(in srgb, var(--c, var(--c-primary)) 88%, #000); }
.start-card a.start-btn:hover { background: color-mix(in srgb, var(--c, var(--c-primary)) 78%, #000); }

@media (max-width: 640px) {
  html:not(.zz) .lesson-hero, html:not(.zz) .exercise-hero { padding: 1.25rem 1.1rem 1.2rem; }
  .lesson-hero-body { flex-direction: column; align-items: flex-start; text-align: left; gap: 1rem; }
  .lesson-hero-icon .lesson-bubble { width: 92px; height: 92px; }
  .lesson-hero-icon .lesson-bubble img { width: 44px; height: 44px; }
  html:not(.zz) .lesson-hero .page-title, html:not(.zz) .exercise-hero .page-title { font-size: 1.6rem; }
  html:not(.zz) .lesson-stats { justify-content: flex-start; }
  html:not(.zz) .lesson-stats li { padding: .1rem 1.1rem; }
}

/* =====================================================================
   Consistencia entre paginas: un unico radio de tarjeta, un unico fondo y una unica escala para el h1 de pagina.
   ===================================================================== */
:root { --c-radius: 12px; --c-bg: #f3f6fc; }
.ex-card, .ex-card::before, .pager-link, .io-card, .solution-box, .start-card, .lesson-node, .roadmap-card { border-radius: var(--c-radius); }
.ex-card::before { border-radius: 0 0 4px 4px; }
.btn-read::after { border-radius: var(--c-radius); }
.exercise-problem pre, .code-block { border-radius: 8px; }

html:not(.zz) main .features-header h1, html:not(.zz) main .legal-page h1, html:not(.zz) main .contact-section h1, html:not(.zz) main .contact-left h1, html:not(.zz) main .plat-title {
  font-size: 2rem; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; color: var(--c-text);
}
@media (max-width: 640px) {
  html:not(.zz) main .features-header h1, html:not(.zz) main .legal-page h1, html:not(.zz) main .contact-section h1, html:not(.zz) main .contact-left h1, html:not(.zz) main .plat-title { font-size: 1.6rem; }
}
html:not(.zz) main .page-title { color: var(--c-text); }

/* menu: enlace activo en oscuro con el acento de la web (antes rojo) */
html[data-theme="dark"]:not(.zz) .main-header .nav-links a.active { border-bottom-color: #818cf8; }

/* Cabecera a todo el ancho (logo a la izquierda y enlaces a la derecha, como en el editor); el contenido sigue centrado. */
.main-header .navbar-container { max-width: none; padding: 1rem 1.25rem; }
@media (max-width: 900px) { .main-header .navbar-container { padding: .8rem 1rem; } }

/* Descripcion de la leccion: aprovecha todo el ancho del hero (ya no hay panel lateral) */
html:not(.zz) .lesson-hero .page-lead { max-width: none; }
.lesson-hero-text { flex: 1 1 0; min-width: 0; }

/* Burbuja con el total de ejercicios: mismo aspecto que en el indice del curso (relleno indigo) */
html:not(.zz) .lesson-hero-icon .count-badge { background: #4f46e5; color: #fff; border-color: #fff; }
html[data-theme="dark"]:not(.zz) .lesson-hero-icon .count-badge { background: #6366f1; color: #fff; border-color: #131a2e; }

/* ---- Ejercicios de la leccion como filas a ancho completo ---- */
.ex-path { margin: 0 0 .5rem; padding: 0; }
.ex-step { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; column-gap: 1rem; align-items: center; margin-bottom: .6rem; padding: .85rem 1rem; border: 1px solid var(--c-border); border-radius: var(--c-radius); background: var(--c-panel); transition: border-color .15s ease, box-shadow .15s ease; }
.ex-step:hover { border-color: var(--c, #4f46e5); box-shadow: 0 6px 18px color-mix(in srgb, var(--c, #4f46e5) 14%, transparent); }
.ex-box, .ex-body { display: contents; }
.ex-node { grid-column: 1; grid-row: 1 / span 2; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c, #4f46e5) 12%, var(--c-panel)); color: var(--c, #4f46e5); font-weight: 800; font-size: .9rem; }
.ex-step h3 { grid-column: 2; grid-row: 1; margin: 0; font-size: 1.02rem; line-height: 1.3; }
.ex-step .ex-summary { grid-column: 2; grid-row: 2; margin: .15rem 0 0; -webkit-line-clamp: 2; line-clamp: 2; }
.ex-step .ex-card-meta { grid-column: 3; grid-row: 1 / span 2; margin: 0; padding: 0; border: 0; display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.ex-go { grid-column: 4; grid-row: 1 / span 2; padding: .45rem 1rem; border-radius: 999px; background: var(--c, #4f46e5); color: #fff; font-size: .86rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
/* sin filter: un filter convierte al enlace en bloque contenedor y rompe el enlace extendido */
.ex-step:hover .ex-go { background: color-mix(in srgb, var(--c, #4f46e5) 86%, #000); color: #fff; }
.ex-step.is-done:hover .ex-go { background: color-mix(in srgb, var(--c, #4f46e5) 10%, transparent); color: var(--c, #4f46e5); }
.ex-go .solved-mark { display: none; }
.ex-step.is-done .ex-node { background: #16a34a; color: transparent; font-size: 0; }
.ex-step.is-done .ex-node { position: relative; }
.ex-step.is-done .ex-node::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 12px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translate(-50%, -58%) rotate(45deg); }
.ex-step.is-done .ex-go { background: transparent; color: var(--c, #4f46e5); border: 1px solid var(--c, #4f46e5); }
.ex-step.is-next { border-color: var(--c, #4f46e5); background: linear-gradient(90deg, color-mix(in srgb, var(--c, #4f46e5) 8%, var(--c-panel)), var(--c-panel)); }
@media (max-width: 700px) {
  .ex-step { grid-template-columns: 34px minmax(0, 1fr); column-gap: .75rem; }
  .ex-node { width: 32px; height: 32px; font-size: .8rem; }
  .ex-step .ex-card-meta { grid-column: 2; grid-row: 3; justify-content: flex-start; margin-top: .5rem; }
  .ex-go { grid-column: 2; grid-row: 4; justify-self: start; margin-top: .6rem; }
  .ex-node { grid-row: 1 / span 4; align-self: start; }
}

/* ---- Estados de leccion en el curso: anillo de progreso + camino ---- */
.lesson-node { --p: 0; }
.lesson-ring { --rs: 124px; position: relative; width: var(--rs); height: var(--rs); display: grid; place-items: center; border-radius: 50%; }
.lesson-ring .ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--rc, var(--c-primary)) calc(var(--p) * 1%), color-mix(in srgb, var(--c-text) 10%, transparent) 0); -webkit-mask: radial-gradient(circle, transparent calc(var(--rs) / 2 - 7px), #000 calc(var(--rs) / 2 - 6px)); mask: radial-gradient(circle, transparent calc(var(--rs) / 2 - 7px), #000 calc(var(--rs) / 2 - 6px)); }
.lesson-node.is-done .ring { --rc: #16a34a; }
.lesson-node .lesson-bubble { width: 96px; height: 96px; }
.lesson-node .lesson-bubble::before { inset: 8px; }
.lesson-node .count-badge { display: none; }
.lesson-chk { position: absolute; right: 2px; bottom: 4px; width: 32px; height: 32px; border-radius: 50%; background: #16a34a; color: #fff; display: grid; place-items: center; border: 3px solid var(--c-panel); font-weight: 800; font-size: .9rem; }
.lesson-state { margin-top: .35rem; font-size: .76rem; font-weight: 700; color: var(--c-primary); }
.lesson-node.is-done .lesson-state { color: #16a34a; }
.lesson-detail { display: block; margin-top: .15rem; font-size: .72rem; color: var(--c-muted); }
.lesson-node.is-todo { opacity: .75; }
.lesson-node.is-todo:hover { opacity: 1; }
.lesson-node.is-next .lesson-ring { animation: lesson-pulse 2.2s ease-in-out infinite; }
@keyframes lesson-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-primary) 35%, transparent); } 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--c-primary) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .lesson-node.is-next .lesson-ring { animation: none; } }
.roadmap-row.conn-ok::before { border-left-style: solid; border-left-color: #16a34a; }
.roadmap-row.pair::after { content: ""; position: absolute; top: calc(1.1rem + 62px); left: calc(12% + 175px); right: calc(12% + 175px); height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--c-text) 12%, transparent); }
.roadmap-row.pair.pair-ok::after { background: #16a34a; }
html[data-theme="dark"] .lesson-node.is-done .ring { --rc: #22c55e; }
html[data-theme="dark"] .lesson-chk { background: #22c55e; border-color: #131a2e; }
html[data-theme="dark"] .lesson-node.is-done .lesson-state { color: #22c55e; }
html[data-theme="dark"] .roadmap-row.conn-ok::before { border-left-color: #22c55e; }
html[data-theme="dark"] .roadmap-row.pair.pair-ok::after { background: #22c55e; }
@media (max-width: 700px) {
  .lesson-ring { --rs: 112px; }
  .lesson-node .lesson-bubble { width: 88px; height: 88px; }
  .roadmap-row.pair::after { display: none; }
}

/* Toda la fila del ejercicio es clicable (enlace extendido: un solo <a>, accesible y sin enlaces anidados) */
.ex-step { position: relative; cursor: pointer; }
.ex-go::after { content: ""; position: absolute; inset: 0; border-radius: var(--c-radius); }
.ex-go:focus-visible { outline: none; }
.ex-step:has(.ex-go:focus-visible) { outline: 3px solid var(--c, #4f46e5); outline-offset: 2px; }

/* Todas las filas de ejercicio con la misma altura (titulo en una linea, resumen en dos como maximo) */
.ex-step { min-height: 6rem; align-content: center; }
.ex-step h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) {
  .ex-step { min-height: 0; }
  .ex-step h3 { white-space: normal; }
}

/* ---- Compartir la leccion (menu desplegable con el mismo estilo que el menu de usuario) ---- */
html:not(.zz) .lesson-hero { overflow: visible; }
.share-menu { position: absolute; top: 1rem; right: 1rem; z-index: 5; }
.lsh-btn { width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--c-border); background: var(--c-panel); color: var(--c-text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; list-style: none; }
.lsh-btn::-webkit-details-marker { display: none; }
.lsh-btn:hover, .share-menu[open] .lsh-btn { color: var(--c-primary); border-color: var(--c-primary); }
.share-menu .user-menu-list { right: 0; left: auto; min-width: 12rem; }
.share-copy { border-top: 1px solid var(--c-border); }
@media (max-width: 900px) { .share-menu .user-menu-list { position: absolute; border: 1px solid var(--c-border); box-shadow: 0 8px 24px rgba(16, 24, 40, .18); padding: .3rem 0; background: var(--c-panel); } }
html[data-theme="dark"] .lsh-btn { background: #131a2e; border-color: #26304f; color: #e5e7eb; }

/* El icono de compartir no debe heredar el color blanco del bloque superior ni el del menu de usuario */
html:not(.zz) .share-menu > summary.lsh-btn { background: #fff; color: #344054; border: 1px solid #d0d5dd; }
html:not(.zz) .share-menu > summary.lsh-btn:hover, html:not(.zz) .share-menu[open] > summary.lsh-btn { color: #4f46e5; border-color: #4f46e5; }
html[data-theme="dark"]:not(.zz) .share-menu > summary.lsh-btn { background: #131a2e; color: #e5e7eb; border-color: #26304f; }
html[data-theme="dark"]:not(.zz) .share-menu > summary.lsh-btn:hover, html[data-theme="dark"]:not(.zz) .share-menu[open] > summary.lsh-btn { color: #c7d2fe; border-color: #818cf8; }
.lsh-btn svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; }

/* Compartir tambien en los ejercicios de teoria: sin recorte y con hueco para el boton */
html:not(.zz) .exercise-hero { overflow: visible; }
.lesson-hero:has(.share-menu), .exercise-hero:has(.share-menu) { padding-right: 4.5rem; }

/* ---- Casillas de verificacion de acceso, registro y ajustes: mas grandes y con el estilo de la web ---- */
html:not(.zz) .auth-check { align-items: center; gap: .7rem; font-size: .92rem !important; line-height: 1.4; cursor: pointer; }
html:not(.zz) .auth-check input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; flex: 0 0 auto; width: 22px; height: 22px; margin: 0;
  border: 2px solid color-mix(in srgb, var(--c-text) 35%, transparent); border-radius: 6px; background: var(--c-panel);
  display: inline-grid; place-content: center; cursor: pointer; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
html:not(.zz) .auth-check input[type="checkbox"]:hover { border-color: var(--c-primary); }
html:not(.zz) .auth-check input[type="checkbox"]::before {
  content: ""; width: 6px; height: 11px; margin-top: -2px; border: solid #fff; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0); transition: transform .12s ease;
}
html:not(.zz) .auth-check input[type="checkbox"]:checked { background: var(--c-primary); border-color: var(--c-primary); }
html:not(.zz) .auth-check input[type="checkbox"]:checked::before { transform: rotate(45deg) scale(1); }
html:not(.zz) .auth-check input[type="checkbox"]:focus-visible { outline: 3px solid color-mix(in srgb, var(--c-primary) 40%, transparent); outline-offset: 2px; }
html[data-theme="dark"]:not(.zz) .auth-check input[type="checkbox"] { background: #0f1530; border-color: #3a4670; }
html[data-theme="dark"]:not(.zz) .auth-check input[type="checkbox"]:checked { background: var(--c-primary); border-color: var(--c-primary); }
html[data-theme="dark"]:not(.zz) .auth-check input[type="checkbox"]::before { border-color: #0b1020; }

/* Insignia oficial de Google Play: sin modificarla, solo ajustando la altura */
.ft-play-badge { display: inline-block; line-height: 0; }
.ft-play-badge img { height: 46px; width: auto; display: block; }

/* Insignia oficial de Google Play en la home y en Caracteristicas */
.play-badge { display: inline-block; line-height: 0; margin-top: .4rem; transition: transform .15s ease; }
.play-badge:hover { transform: translateY(-2px); }
.play-badge img { height: 56px; width: auto; display: block; }

/* Caja de la app de Android en la columna del indice del curso */
.rail-sec.side-app .side-app-text { margin: 0 0 .6rem; font-size: .86rem; line-height: 1.5; color: var(--c-muted); }
.rail-sec.side-app .play-badge { margin-top: 0; }
.rail-sec.side-app .play-badge img { height: 46px; }
