/* ================================================================
   Need English Now · capa de diseño (v2)
   Se carga después de app.css: redefine los tokens y los componentes con un estilo cercano y lúdico
   (tipografía redondeada, colores vivos, botones "3D", tarjetas con borde de 2px) y añade el nuevo
   armazón: barra lateral + barra superior en escritorio, barra inferior en móvil.
   ================================================================ */

/* Nunito (SIL Open Font License), servida en local: la CSP solo permite fuentes propias. */
@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
    src: url("../fonts/nunito-latin-var.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
                   U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
    src: url("../fonts/nunito-latin-ext-var.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
                   U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --brand: #1c7ed6;
    --brand-strong: #1971c2;
    --brand-shadow: #1864ab;
    --brand-soft: #e7f2fd;
    --brand-line: #a5d8ff;

    --green: #58a700;
    --green-bg: #58cc02;
    --green-shadow: #46a302;
    --green-soft: #eafbe0;

    --red: #e03131;
    --red-bg: #ff4b4b;
    --red-shadow: #d33131;
    --red-soft: #ffe3e3;

    --orange: #ff9600;
    --gold: #ffc800;
    --gold-shadow: #e0a800;
    --purple: #9b5de5;
    --purple-soft: #f3eafe;

    --ink: #3c3c3c;
    --ink-strong: #1f2328;
    --ink-muted: #777777;
    --surface: #ffffff;
    --canvas: #f7f8fa;
    --line: #e5e5e5;
    --line-strong: #d8d8d8;
    --radius: 18px;
    --radius-lg: 24px;

    --sidebar-w: 252px;
    --topbar-h: 68px;
    --tabbar-h: 68px;

    --bs-body-font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --bs-body-font-weight: 600;
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--canvas);
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: 28, 126, 214;
    --bs-link-hover-color: var(--brand-strong);
    --bs-link-hover-color-rgb: 25, 113, 194;
    --bs-border-color: var(--line);
    --bs-secondary-color: var(--ink-muted);
}

body {
    font-family: var(--bs-body-font-family);
    font-weight: 600;
    background: var(--canvas);
    color: var(--ink);
}

h1, h2, h3, .page-title, .welcome-title, .auth-title, .summary-title, .unit-title {
    font-weight: 900;
    color: var(--ink-strong);
    letter-spacing: -.01em;
}

a {
    font-weight: 700;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

strong, b {
    font-weight: 800;
}

::selection {
    background: var(--brand-line);
}

:focus-visible {
    outline: 3px solid var(--brand-line);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: .5rem;
    z-index: 100;
    background: var(--surface);
    padding: .5rem 1rem;
    border-radius: 12px;
    border: 2px solid var(--brand);
}

.skip-link:focus {
    left: .5rem;
}

.icon {
    width: 1.5rem;
    height: 1.5rem;
    flex: none;
}

/* ---------------------------------------------------------------- Botones "3D" */

.btn {
    --btn-shadow: transparent;
    font-weight: 800;
    border-radius: 14px;
    border-width: 2px;
    letter-spacing: .03em;
    padding: .7rem 1.25rem;
    box-shadow: 0 4px 0 var(--btn-shadow);
    transition: transform .08s ease, box-shadow .08s ease, filter .12s ease, background-color .12s ease;
}

.btn:not(.btn-link):not(.btn-audio) {
    text-transform: uppercase;
    font-size: .92rem;
}

.btn:active:not(:disabled) {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--btn-shadow);
}

.btn-sm {
    border-radius: 12px;
    padding: .45rem .9rem;
    font-size: .8rem !important;
    box-shadow: 0 3px 0 var(--btn-shadow);
}

.btn-lg {
    padding: .85rem 1.6rem;
    font-size: 1rem !important;
}

.btn-primary {
    --btn-shadow: var(--brand-shadow);
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: #228be6;
    --bs-btn-hover-border-color: #228be6;
    --bs-btn-active-bg: var(--brand);
    --bs-btn-active-border-color: var(--brand);
    --bs-btn-disabled-bg: #e5e5e5;
    --bs-btn-disabled-border-color: #e5e5e5;
    --bs-btn-disabled-color: #afafaf;
    --bs-btn-disabled-opacity: 1;
}

.btn-success {
    --btn-shadow: var(--green-shadow);
    --bs-btn-bg: var(--green-bg);
    --bs-btn-border-color: var(--green-bg);
    --bs-btn-hover-bg: #61e002;
    --bs-btn-hover-border-color: #61e002;
    --bs-btn-active-bg: var(--green-bg);
    --bs-btn-active-border-color: var(--green-bg);
}

.btn-danger {
    --btn-shadow: var(--red-shadow);
    --bs-btn-bg: var(--red-bg);
    --bs-btn-border-color: var(--red-bg);
    --bs-btn-hover-bg: #ff5c5c;
    --bs-btn-hover-border-color: #ff5c5c;
}

.btn-primary:disabled,
.btn-primary.disabled {
    box-shadow: none;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger {
    --btn-shadow: var(--line);
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: var(--line);
    --bs-btn-hover-bg: #f7f7f7;
    --bs-btn-hover-border-color: var(--line);
    --bs-btn-active-bg: #f1f1f1;
    --bs-btn-active-border-color: var(--line);
    --bs-btn-disabled-bg: var(--surface);
    --bs-btn-disabled-border-color: var(--line);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-hover-color: var(--brand-strong);
    --bs-btn-active-color: var(--brand-strong);
    --bs-btn-disabled-color: var(--brand);
}

.btn-outline-secondary {
    --bs-btn-color: var(--ink-muted);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-active-color: var(--ink);
}

.btn-outline-danger {
    --bs-btn-color: var(--red);
    --bs-btn-hover-color: var(--red);
}

.btn-light {
    --btn-shadow: rgba(0, 0, 0, .18);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #fff;
    --bs-btn-color: var(--brand-strong);
    --bs-btn-hover-bg: #f1f8ff;
    --bs-btn-hover-border-color: #f1f8ff;
    --bs-btn-hover-color: var(--brand-strong);
}

.btn-outline-light {
    --btn-shadow: rgba(0, 0, 0, .12);
    --bs-btn-color: #fff;
    --bs-btn-border-color: rgba(255, 255, 255, .7);
    --bs-btn-hover-bg: rgba(255, 255, 255, .15);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-border-color: #fff;
}

.btn-link {
    box-shadow: none !important;
    font-weight: 800;
}

.btn-audio {
    --btn-shadow: var(--brand-shadow);
    border-radius: 16px;
    padding: .75rem 1.2rem;
    font-weight: 800;
}

.btn-audio-slow {
    --btn-shadow: var(--brand-line);
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink-muted);
}

.icon-btn:hover {
    color: var(--red);
    border-color: var(--red-soft);
}

.icon-btn .icon {
    width: 1.2rem;
    height: 1.2rem;
}

/* ---------------------------------------------------------------- Formularios */

.form-control,
.form-select {
    border: 2px solid var(--line);
    border-radius: 14px;
    background-color: #f7f7f7;
    padding: .75rem .95rem;
    font-weight: 600;
    color: var(--ink-strong);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-line);
    background-color: #fff;
    box-shadow: 0 0 0 .2rem rgba(28, 126, 214, .12);
}

.form-label {
    font-weight: 800;
    color: var(--ink-strong);
}

.alert {
    border-width: 2px;
    border-radius: 16px;
    font-weight: 700;
}

.badge {
    border-radius: 10px;
    font-weight: 800;
    padding: .4em .65em;
}

/* ---------------------------------------------------------------- Barras de progreso */

progress {
    height: 12px;
    background: #e5e5e5;
}

progress::-webkit-progress-bar {
    background: #e5e5e5;
}

progress::-webkit-progress-value {
    background: var(--brand);
}

progress::-moz-progress-bar {
    background: var(--brand);
}

.skill-bar::-webkit-progress-value,
.game-bar.is-mission::-webkit-progress-value,
.player-progress::-webkit-progress-value,
.course-progress::-webkit-progress-value,
.course-mini-bar::-webkit-progress-value { background: var(--green-bg); }
.skill-bar::-moz-progress-bar,
.game-bar.is-mission::-moz-progress-bar,
.player-progress::-moz-progress-bar,
.course-progress::-moz-progress-bar,
.course-mini-bar::-moz-progress-bar { background: var(--green-bg); }

.game-bar.is-level::-webkit-progress-value { background: var(--purple); }
.game-bar.is-level::-moz-progress-bar { background: var(--purple); }
.game-bar.is-goal::-webkit-progress-value { background: var(--orange); }
.game-bar.is-goal::-moz-progress-bar { background: var(--orange); }

/* ---------------------------------------------------------------- Tarjetas (borde de 2px, sin sombras difusas) */

.dash-card,
.auth-card,
.course-card,
.course-mini,
.flashcard,
.stat-tile,
.summary-stat,
.achievement,
.source-text,
.passage {
    border: 2px solid var(--line);
    border-radius: var(--radius);
    box-shadow: none;
}

.dash-card {
    padding: 1.25rem 1.35rem;
}

.course-card,
.course-mini {
    box-shadow: 0 4px 0 var(--line);
    transition: transform .1s ease, border-color .12s ease, box-shadow .1s ease;
}

.course-card:hover,
.course-mini:hover {
    border-color: var(--brand-line);
    box-shadow: 0 4px 0 var(--brand-line);
}

.section-title {
    font-weight: 900;
    font-size: .78rem;
    letter-spacing: .08em;
    color: #8a8a8a;
}

.page-title {
    font-size: 2rem;
}

.back-link {
    font-weight: 800;
    text-transform: uppercase;
    font-size: .8rem;
    letter-spacing: .05em;
}

/* ---------------------------------------------------------------- Armazón: barra lateral, barra superior, barra inferior */

.app-body {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.4rem 1rem 1rem;
    background: var(--surface);
    border-right: 2px solid var(--line);
    z-index: 30;
    overflow-y: auto;
}

.sidebar-brand,
.topbar-brand {
    text-decoration: none;
    padding: 0 .6rem;
}

.brand-mark {
    width: 36px;
    height: 36px;
    color: var(--brand);
}

.brand-name {
    font-weight: 900;
    font-size: 1.08rem;
    letter-spacing: -.015em;
    white-space: nowrap;   /* «Need English Now» en una sola línea */
    color: var(--ink-strong);
}

.side-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .3rem;
}

.side-link {
    display: flex;
    align-items: center;
    gap: .95rem;
    padding: .65rem .8rem;
    border: 2px solid transparent;
    border-radius: 14px;
    color: var(--ink-muted);
    text-decoration: none;
    font-weight: 800;
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.side-link:hover {
    background: #f4f4f4;
    color: var(--ink-strong);
}

.side-link.is-active {
    background: var(--brand-soft);
    border-color: var(--brand-line);
    color: var(--brand-strong);
}

.side-link .icon,
.tab .icon,
.sheet-link .icon {
    width: 1.7rem;
    height: 1.7rem;
    stroke-width: 2.2;
}

/* Cada sección con su color (identidad visual) */
.icon-home { color: #ff9600; }
.icon-courses { color: #1cb0f6; }
.icon-practice { color: #ff4b4b; }
.icon-vocabulary { color: #9b5de5; }
.icon-conversation { color: #2bb673; }
.icon-speaking { color: #ff6fae; }
.icon-writing { color: #14b8a6; }
.icon-achievements { color: #f0b400; }
.icon-placement { color: #6366f1; }
.icon-more { color: var(--ink-muted); }
.icon-logout { color: var(--ink-muted); }

.sidebar-user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .7rem .6rem 0;
    border-top: 2px solid var(--line);
}

.avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #1cb0f6, #9b5de5);
    color: #fff;
    font-weight: 900;
}

.sidebar-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
    color: var(--ink-strong);
}

.shell-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
    background: rgba(247, 248, 250, .92);
    backdrop-filter: blur(8px);
    border-bottom: 2px solid var(--line);
}

.topbar-brand {
    visibility: hidden;
}

.topbar-stats {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .35rem .75rem;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-muted);
    text-decoration: none;
    font-weight: 800;
    font-size: .95rem;
    white-space: nowrap;
}

.stat-chip:hover {
    border-color: var(--line-strong);
    color: var(--ink-strong);
}

.stat-chip .icon {
    width: 1.3rem;
    height: 1.3rem;
}

.stat-chip.is-streak .icon { color: #c7c7c7; }
.stat-chip.is-streak.is-lit { color: var(--orange); }
.stat-chip.is-streak.is-lit .icon { color: var(--orange); }
.stat-chip.is-xp, .stat-chip.is-xp .icon { color: #e3a008; }
.stat-chip.is-level, .stat-chip.is-level .icon { color: var(--purple); }
.stat-chip.is-english { color: var(--brand-strong); background: var(--brand-soft); border-color: var(--brand-line); }

.stat-chip.is-voice {
    cursor: pointer;
}

.stat-chip.is-voice .icon {
    color: var(--brand);
}

/* Selector de voz */
.voice-dialog {
    width: min(30rem, calc(100vw - 2rem));
    border: 2px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .18);
}

.voice-dialog::backdrop {
    background: rgba(20, 24, 31, .45);
}

.voice-title {
    font-size: 1.3rem;
    margin-bottom: .35rem;
}

.voice-list {
    list-style: none;
    padding: 0;
    margin: 0 0 .75rem;
    max-height: 22rem;
    overflow-y: auto;
    display: grid;
    gap: .4rem;
}

.voice-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .7rem;
    padding: .55rem .75rem;
    border: 2px solid var(--line);
    border-radius: 14px;
}

.voice-item:has(input:checked) {
    border-color: var(--brand-line);
    background: var(--brand-soft);
}

.voice-name {
    display: grid;
    font-weight: 800;
    color: var(--ink-strong);
    cursor: pointer;
}

.voice-meta {
    font-size: .78rem;
    font-weight: 700;
    color: var(--ink-muted);
}

/* Todas las páginas con menú usan el ancho completo del área de contenido, con los mismos márgenes. */
.app-main {
    max-width: none;
    margin: 0;
    padding: 2rem 2.5rem 4rem;
}

.tabbar {
    display: none;
}

/* Lecciones y práctica: pantalla completa, sin navegación */
.is-focus .shell-main {
    margin-left: 0;
}

.is-focus .app-main {
    max-width: 760px;
    margin: 0 auto;
    padding-top: 1.75rem;
    padding-bottom: 9rem;
}

@media (max-width: 1023.98px) {
    .sidebar {
        display: none;
    }

    .shell-main {
        margin-left: 0;
    }

    .topbar {
        padding: 0 1rem;
        height: 60px;
    }

    .topbar-brand {
        visibility: visible;
        padding: 0;
    }

    .app-main {
        padding: 1.25rem 1rem calc(var(--tabbar-h) + 2rem);
    }

    .app-body:not(.is-focus) .tabbar {
        position: fixed;
        inset: auto 0 0 0;
        z-index: 40;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        height: var(--tabbar-h);
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--surface);
        border-top: 2px solid var(--line);
    }

    .tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: .15rem;
        height: 100%;
        color: var(--ink-muted);
        text-decoration: none;
        font-size: .68rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .03em;
        cursor: pointer;
        list-style: none;
    }

    .tab::-webkit-details-marker {
        display: none;
    }

    .tab.is-active {
        color: var(--brand-strong);
        background: var(--brand-soft);
        border-top: 3px solid var(--brand);
    }

    .tab-more {
        position: relative;
    }

    .tab-more[open] > .tab {
        color: var(--ink-strong);
        background: #f4f4f4;
    }

    .tab-sheet {
        position: fixed;
        right: .6rem;
        bottom: calc(var(--tabbar-h) + .6rem);
        width: min(18rem, calc(100vw - 1.2rem));
        display: grid;
        gap: .2rem;
        padding: .5rem;
        background: var(--surface);
        border: 2px solid var(--line);
        border-radius: 20px;
        box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
    }

    .sheet-link {
        display: flex;
        align-items: center;
        gap: .8rem;
        width: 100%;
        padding: .65rem .75rem;
        border: 0;
        border-radius: 12px;
        background: none;
        color: var(--ink-strong);
        text-decoration: none;
        font-weight: 800;
        text-align: left;
    }

    .sheet-link:hover,
    .sheet-link.is-active {
        background: var(--brand-soft);
    }
}

@media (max-width: 480px) {
    .brand-name {
        display: none;
    }

    .stat-chip {
        padding: .3rem .55rem;
        font-size: .88rem;
    }

    /* En pantallas estrechas el nivel de inglés ya se ve en el inicio: se ocultan del menú superior */
    .stat-chip.is-english {
        display: none;
    }

    .topbar-stats {
        gap: .35rem;
    }
}

/* ---------------------------------------------------------------- Dashboard */

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.welcome-title {
    font-size: 2.1rem;
    margin-bottom: .15rem;
}

.hero-sub {
    margin: 0;
    color: var(--ink-muted);
    font-weight: 700;
}

.hero-level {
    display: flex;
    align-items: center;
    gap: .9rem;
    flex-wrap: wrap;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: var(--radius);
    padding: .75rem 1.1rem;
}

.hero-level-label {
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #8a8a8a;
}

.hero-level .level-badge-lg {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--brand);
}

.hero-level .level-badge-lg.is-pending {
    font-size: 1.1rem;
    color: var(--ink-muted);
}

.continue-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1.6rem 1.75rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #1cb0f6 0%, #1c7ed6 55%, #5b5bd6 100%);
    color: #fff;
    box-shadow: 0 6px 0 #1864ab;
}

.continue-card::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    pointer-events: none;
}

.continue-kicker {
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .8);
    margin-bottom: .35rem;
}

.continue-card .next-lesson-course {
    color: rgba(255, 255, 255, .85);
    font-weight: 700;
}

.continue-card .next-lesson-title {
    font-size: 1.65rem;
    font-weight: 900;
    line-height: 1.2;
    color: #fff;
    margin-bottom: 1.1rem;
}

.continue-practice {
    position: relative;
    z-index: 1;
    align-self: stretch;
    background: rgba(255, 255, 255, .14);
    border: 2px solid rgba(255, 255, 255, .25);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
}

.continue-practice p {
    color: rgba(255, 255, 255, .9);
}

.continue-practice strong {
    color: #fff;
}

/* Ruta recomendada (Fase 8.5) */
.path-steps {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    padding: 0;
    margin: .2rem 0 .8rem;
}

.path-step {
    padding: .2rem .65rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 900;
    background: rgba(255, 255, 255, .14);
    color: rgba(255, 255, 255, .75);
}

.path-step.is-done {
    background: rgba(255, 255, 255, .28);
    color: #fff;
}

.path-step.is-current {
    background: #fff;
    color: var(--brand-strong);
    box-shadow: 0 3px 0 rgba(0, 0, 0, .15);
}

.path-title {
    font-size: 1.05rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: .25rem;
}

.path-progress {
    height: 10px;
    max-width: 22rem;
    margin: .1rem 0 .8rem;
    background: rgba(255, 255, 255, .25);
}

.path-progress::-webkit-progress-bar { background: rgba(255, 255, 255, .25); }
.path-progress::-webkit-progress-value { background: #fff; }
.path-progress::-moz-progress-bar { background: #fff; }

.path-note {
    font-size: .85rem;
    color: rgba(255, 255, 255, .85);
    margin: .8rem 0 0;
}

.path-note a {
    color: #fff;
}

.hero-level .level-badge-lg.is-starter {
    color: var(--green);
}

/* Test de nivel: «Empiezo desde cero» y Writing guiado */
.zero-card {
    margin-top: 1.75rem;
    padding: 1.1rem 1.25rem;
    border: 2px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
}

.zero-title {
    font-size: 1.1rem;
    font-weight: 900;
}

.writing-guide {
    display: grid;
    gap: .35rem;
    margin-bottom: .75rem;
}

.writing-guide:empty {
    display: none;
}

.writing-model,
.writing-hint {
    margin: 0;
    padding: .55rem .8rem;
    border-radius: 12px;
    background: var(--green-soft);
    color: var(--ink-strong);
}

.writing-hint {
    background: var(--brand-soft);
}

.dash-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 1.5rem;
    align-items: start;
}

.dash-main,
.dash-side {
    display: grid;
    gap: 1.25rem;
    min-width: 0;
}

.dash-main > .dash-grid,
.dash-main > .dash-section {
    margin-bottom: 0;
}

@media (max-width: 1199.98px) {
    .dash-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .dash-side {
        order: -1;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 640px) {
    .continue-card {
        grid-template-columns: 1fr;
        padding: 1.3rem;
    }

    .welcome-title {
        font-size: 1.7rem;
    }

    .hero-level {
        width: 100%;
    }
}

/* Today's Focus */
.focus-card {
    border-color: var(--line);
}

.focus-list {
    display: grid;
    gap: .65rem;
}

.focus-item {
    border: 2px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    padding: .85rem 1rem;
    position: relative;
}

.focus-item::before {
    content: "";
    position: absolute;
    left: -2px;
    top: 14px;
    bottom: 14px;
    width: 5px;
    border-radius: 0 6px 6px 0;
    background: var(--brand);
}

.focus-item.is-weak_topic::before,
.focus-item.is-recent_errors::before { background: var(--red-bg); }
.focus-item.is-vocabulary::before { background: var(--purple); }
.focus-item.is-placement::before { background: #6366f1; }
.focus-item.is-next_lesson::before { background: var(--green-bg); }
.focus-item.is-comeback::before { background: var(--orange); }
.focus-item.is-weak_skill::before { background: var(--orange); }

.focus-item.is-weak_topic,
.focus-item.is-recent_errors,
.focus-item.is-placement {
    background: var(--surface);
}

.focus-title {
    font-weight: 800;
    color: var(--ink-strong);
}

/* Habilidades */
.skill-row {
    padding: .35rem 0;
}

.skill-name {
    font-weight: 800;
}

.skill-level {
    display: inline-grid;
    place-items: center;
    min-width: 2.3rem;
    padding: .1rem .35rem;
    border-radius: 8px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-weight: 900;
    font-size: .8rem;
}

.skill-pct {
    font-weight: 800;
}

.topic-list li {
    border-bottom: 2px solid #f0f0f0;
}

/* Vocabulario en el dashboard */
.dash-vocab-stats {
    margin: .75rem 0 1rem;
}

.dash-vocab-stats dd {
    font-weight: 900;
    color: var(--ink-strong);
}

/* ---------------------------------------------------------------- Progreso del jugador */

.game-card {
    margin-bottom: 1.5rem;
}

.game-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: .75rem;
}

.dash-side .game-stats {
    grid-template-columns: 1fr 1fr;
}

.dash-side .game-stat.game-level {
    grid-column: 1 / -1;
}

.game-stat,
.game-goal {
    position: relative;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 16px;
    padding: .8rem .95rem;
}

.game-stat-icon {
    position: absolute;
    top: .7rem;
    right: .75rem;
}

.game-stat-icon .icon {
    width: 1.6rem;
    height: 1.6rem;
}

.game-stat-icon.is-level { color: var(--purple); }
.game-stat-icon.is-xp { color: #e3a008; }
.game-stat-icon.is-streak { color: #cfcfcf; }
.game-stat-icon.is-streak.is-lit { color: var(--orange); }

.game-label {
    font-size: .72rem;
    font-weight: 900;
    color: #8a8a8a;
}

.game-stat .game-label {
    display: block;
    padding-right: 1.9rem;   /* deja sitio al icono de la esquina */
}

.game-value {
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--ink-strong);
}

.game-level .game-value {
    color: var(--purple);
}

.game-sub {
    font-weight: 700;
    color: var(--ink-muted);
}

.game-sub.is-risk {
    color: var(--orange);
}

.game-bar {
    height: 10px;
    margin: .35rem 0 .15rem;
}

.game-goals {
    gap: .75rem;
}

.game-goal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.goal-badge {
    font-size: .7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #fff;
    background: var(--green-bg);
    border-radius: 999px;
    padding: .15rem .55rem;
}

.game-goal[data-goal-met="1"] .game-sub {
    color: var(--green);
}

.game-subtitle {
    font-weight: 900;
}

.game-period {
    font-weight: 900;
}

.mission {
    display: grid;
    grid-template-columns: 1.9rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .7rem;
    padding: .55rem 0;
    border-bottom: 2px solid #f0f0f0;
}

.mission:last-child {
    border-bottom: 0;
}

.mission-check {
    display: grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    border: 2px solid var(--line);
    color: #fff;
    font-weight: 900;
}

.mission.is-done .mission-check {
    background: var(--green-bg);
    border-color: var(--green-shadow);
}

.mission-body {
    display: grid;
    min-width: 0;
}

.mission-title {
    font-weight: 800;
    color: var(--ink-strong);
    line-height: 1.25;
}

.mission.is-done .mission-title {
    color: var(--green);
}

.mission .game-bar {
    grid-column: auto;
    height: 8px;
}

.mission-meta {
    text-align: right;
    line-height: 1.2;
    font-weight: 700;
}

.mission-meta strong {
    color: #e3a008;
}

.achievement-mini-list li {
    border-bottom: 2px solid #f0f0f0;
}

.achievement-mini-list li:last-child {
    border-bottom: 0;
}

.achievement {
    box-shadow: 0 4px 0 var(--line);
}

.achievement.is-unlocked {
    border-color: #ffd900;
    background: #fffbea;
    box-shadow: 0 4px 0 #ffd900;
}

.achievement-icon {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 14px;
    background: #f4f4f4;
    font-size: 1.4rem;
}

.achievement.is-unlocked .achievement-icon {
    background: #fff1b8;
}

.achievement-name {
    font-weight: 900;
    color: var(--ink-strong);
}

.game-note {
    border-top-width: 2px;
}

/* ---------------------------------------------------------------- Cursos: camino de lecciones */

.course-card {
    padding: 1.3rem 1.4rem;
}

.course-card .course-title {
    font-weight: 900;
}

.course-levels {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-weight: 900;
}

.course-progress {
    height: 14px;
    margin-top: .5rem;
}

.unit {
    --unit: var(--green-bg);
    --unit-dark: var(--green-shadow);
    --unit-soft: var(--green-soft);
    margin-bottom: 2.5rem;
}

/* Starter: todas sus unidades son A0, así que el color rota por unidad para distinguirlas en el camino. */
.unit.is-a0:nth-of-type(8n + 2) { --unit: #1cb0f6; --unit-dark: #1899d6; --unit-soft: #ddf4ff; }
.unit.is-a0:nth-of-type(8n + 3) { --unit: #ce82ff; --unit-dark: #a568cc; --unit-soft: #f6e9ff; }
.unit.is-a0:nth-of-type(8n + 4) { --unit: #ff9600; --unit-dark: #cd7900; --unit-soft: #fff1dd; }
.unit.is-a0:nth-of-type(8n + 5) { --unit: #ff4b4b; --unit-dark: #d33131; --unit-soft: #ffe3e3; }
.unit.is-a0:nth-of-type(8n + 6) { --unit: #14b8a6; --unit-dark: #0f8f81; --unit-soft: #dcfaf6; }
.unit.is-a0:nth-of-type(8n + 7) { --unit: #ff6fae; --unit-dark: #d9558f; --unit-soft: #ffe6f1; }
.unit.is-a0:nth-of-type(8n + 8) { --unit: #6366f1; --unit-dark: #4f46e5; --unit-soft: #e8e9ff; }

.path-exit {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: .9rem;
}

.unit.is-a2 { --unit: #1cb0f6; --unit-dark: #1899d6; --unit-soft: #ddf4ff; }
.unit.is-b1 { --unit: #ce82ff; --unit-dark: #a568cc; --unit-soft: #f6e9ff; }
.unit.is-b2 { --unit: #ff9600; --unit-dark: #cd7900; --unit-soft: #fff1dd; }
.unit.is-c1 { --unit: #ff4b4b; --unit-dark: #d33131; --unit-soft: #ffe3e3; }
.unit.is-c2 { --unit: #2b70c9; --unit-dark: #1f5aa6; --unit-soft: #e1edfb; }

.unit-header {
    align-items: center;
    background: var(--unit);
    color: #fff;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 0 var(--unit-dark);
    margin-bottom: 1.25rem;
}

.level-pill {
    width: auto;
    min-width: 2.6rem;
    padding: 0 .55rem;
}

.unit-header .level-pill {
    background: rgba(255, 255, 255, .25);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, .5);
}

.unit.is-completed .level-pill {
    background: #fff;
    color: var(--unit-dark);
}

.unit-title {
    color: #fff;
    font-size: 1.25rem;
}

.unit-desc {
    color: rgba(255, 255, 255, .9);
    font-weight: 700;
}

.lesson-path {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.6rem;
    padding: .5rem 0 1rem;
}

.lesson-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .45rem;
    width: 15rem;
    max-width: 100%;
    background: none;
    border: 0;
    padding: 0;
    text-align: center;
}

.lesson-row.is-locked {
    background: none;
    border: 0;
}

/* Zigzag del camino */
.lesson-row:nth-child(4n + 2) { transform: translateX(70px); }
.lesson-row:nth-child(4n + 4) { transform: translateX(-70px); }

.lesson-node {
    position: relative;
    display: grid;
    place-items: center;
    width: 76px;
    height: 70px;
    border-radius: 50%;
    background: var(--unit);
    box-shadow: 0 7px 0 var(--unit-dark);
    color: #fff;
    text-decoration: none;
    transition: transform .08s ease, box-shadow .08s ease, filter .12s ease;
}

a.lesson-node:hover {
    filter: brightness(1.06);
}

a.lesson-node:active {
    transform: translateY(5px);
    box-shadow: 0 2px 0 var(--unit-dark);
}

.lesson-row.is-locked .lesson-node {
    background: #e5e5e5;
    box-shadow: 0 7px 0 #c9c9c9;
    cursor: not-allowed;
}

.lesson-row.is-completed .lesson-node {
    background: var(--gold);
    box-shadow: 0 7px 0 var(--gold-shadow);
}

.lesson-row.is-available .lesson-node,
.lesson-row.is-in_progress .lesson-node {
    outline: 6px solid var(--unit-soft);
    outline-offset: 5px;
}

/* Espacio para el globo «Empezar» sobre la lección actual */
.lesson-row.is-available,
.lesson-row.is-in_progress {
    margin-top: 2.6rem;
}

.lesson-node .lesson-icon {
    width: auto;
    height: auto;
    background: none !important;
    color: #fff !important;
    font-size: 1.9rem;
    font-weight: 900;
    line-height: 1;
}

.lesson-row.is-locked .lesson-icon {
    filter: grayscale(1);
    opacity: .6;
    font-size: 1.5rem;
}

.lesson-start {
    position: absolute;
    bottom: calc(100% + 16px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: .45rem .85rem;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 12px;
    color: var(--unit);
    font-weight: 900;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    animation: bob 1.6s ease-in-out infinite;
}

.lesson-start::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    background: var(--surface);
    border-right: 2px solid var(--line);
    border-bottom: 2px solid var(--line);
    transform: rotate(45deg);
}

@keyframes bob {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -5px); }
}

@media (prefers-reduced-motion: reduce) {
    .lesson-start { animation: none; }
}

.lesson-body {
    gap: 0;
}

.lesson-title {
    font-weight: 900;
    color: var(--ink-strong);
}

.lesson-row.is-locked .lesson-title {
    color: #afafaf;
}

.lesson-meta {
    font-weight: 700;
}

.lesson-hint {
    display: none;
}

@media (max-width: 480px) {
    .lesson-row:nth-child(4n + 2) { transform: translateX(45px); }
    .lesson-row:nth-child(4n + 4) { transform: translateX(-45px); }
}

/* ---------------------------------------------------------------- Reproductor de lecciones */

.player {
    max-width: 720px;
}

.player-top {
    gap: 1.1rem;
    margin-bottom: 1rem;
}

.player-close {
    font-size: 1.5rem;
    font-weight: 700;
    color: #afafaf;
}

.player-close:hover {
    color: var(--ink-muted);
}

.player-progress {
    height: 18px;
}

.player-combo {
    color: var(--orange);
    font-weight: 900;
}

.player-lesson-title {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: .78rem;
    color: #afafaf;
}

.exercise-meta {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 8px;
    background: var(--purple-soft);
    color: var(--purple);
    font-weight: 900;
}

.exercise-prompt {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--ink-strong);
    line-height: 1.25;
}

.choice {
    border: 2px solid var(--line);
    border-bottom-width: 4px;
    border-radius: 16px;
    padding: .9rem 1.1rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ink-strong);
    transition: background .1s ease, border-color .1s ease, transform .06s ease;
}

.choice:hover:not(:disabled) {
    background: #f7f7f7;
    border-color: var(--line);
}

.choice:active:not(:disabled) {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

.choice.is-selected {
    background: var(--brand-soft);
    border-color: var(--brand-line);
    color: var(--brand-strong);
}

.choice-key {
    border: 2px solid var(--line);
    border-radius: 8px;
    font-weight: 800;
}

.choice.is-selected .choice-key {
    border-color: var(--brand-line);
    color: var(--brand-strong);
}

.choice.is-right {
    background: var(--green-soft);
    border-color: var(--green-bg);
    color: var(--green);
}

.choice.is-wrong {
    background: var(--red-soft);
    border-color: var(--red-bg);
    color: var(--red);
}

.wo-token,
.wo-slot {
    border-radius: 14px;
    border-bottom-width: 4px;
    font-weight: 700;
    padding: .5rem .9rem;
}

.blank-input {
    border-bottom-width: 3px;
    font-weight: 800;
}

.player-footer {
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 1.1rem 1.25rem;
}

/* Lecciones y práctica (modo foco): barra inferior a todo el ancho, como en las apps móviles */
.is-focus .player-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    margin: 0;
    padding: 1.1rem max(1.25rem, calc((100vw - 720px) / 2)) calc(1.1rem + env(safe-area-inset-bottom));
    border: 0;
    border-top: 2px solid var(--line);
    border-radius: 0;
}

.player-footer.is-correct {
    background: #d7ffb8;
    border-color: #d7ffb8;
}

.player-footer.is-incorrect {
    background: #ffdfe0;
    border-color: #ffdfe0;
}

.feedback-title {
    font-size: 1.3rem;
    font-weight: 900;
}

.is-correct .feedback-title,
.is-correct .feedback-answer { color: var(--green); }
.is-incorrect .feedback-title,
.is-incorrect .feedback-answer { color: var(--red); }

.player-action {
    min-width: 11rem;
    padding-block: .8rem;
}

.player-footer.is-correct .player-action {
    --btn-shadow: var(--green-shadow);
    --bs-btn-bg: var(--green-bg);
    --bs-btn-border-color: var(--green-bg);
    --bs-btn-hover-bg: #61e002;
    --bs-btn-hover-border-color: #61e002;
    --bs-btn-active-bg: var(--green-bg);
}

.player-footer.is-incorrect .player-action {
    --btn-shadow: var(--red-shadow);
    --bs-btn-bg: var(--red-bg);
    --bs-btn-border-color: var(--red-bg);
    --bs-btn-hover-bg: #ff5c5c;
    --bs-btn-hover-border-color: #ff5c5c;
    --bs-btn-active-bg: var(--red-bg);
}

.player-footer[hidden] {
    display: none;
}

.summary-icon {
    font-size: 4rem;
}

.summary-title {
    font-size: 2rem;
}

.summary-stat {
    border-radius: 16px;
    box-shadow: 0 4px 0 var(--line);
}

.summary-stat dd {
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--ink-strong);
}

.summary-stat:nth-child(1) { border-color: var(--gold); box-shadow: 0 4px 0 var(--gold-shadow); }
.summary-stat:nth-child(2) { border-color: var(--green-bg); box-shadow: 0 4px 0 var(--green-shadow); }
.summary-stat:nth-child(3) { border-color: #1cb0f6; box-shadow: 0 4px 0 #1899d6; }

/* ---------------------------------------------------------------- Vocabulario */

.vocab-chip {
    border: 2px solid var(--line);
    font-weight: 700;
}

.flashcard {
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 0 var(--line);
}

.flashcard-word {
    font-weight: 900;
    color: var(--ink-strong);
}

.rating-btn {
    border-radius: 16px;
    font-weight: 800;
    box-shadow: 0 4px 0 rgba(0, 0, 0, .18);
    transition: transform .08s ease, box-shadow .08s ease;
}

.rating-btn:active:not(:disabled) {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .18);
}

.rating-btn.is-again { background: var(--red-bg); }
.rating-btn.is-hard { background: var(--orange); }
.rating-btn.is-good { background: var(--green-bg); }
.rating-btn.is-easy { background: #1cb0f6; }

.stat-tile {
    border-radius: 16px;
}

.stat-value {
    font-weight: 900;
    color: var(--ink-strong);
}

/* ---------------------------------------------------------------- Páginas de visitante */

.auth-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
}

.auth-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 3rem;
    background: linear-gradient(145deg, #1cb0f6 0%, #1c7ed6 50%, #6b4bd6 100%);
    color: #fff;
}

.auth-panel::before,
.auth-panel::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}

.auth-panel::before {
    width: 380px;
    height: 380px;
    right: -120px;
    top: -120px;
}

.auth-panel::after {
    width: 260px;
    height: 260px;
    left: -80px;
    bottom: -80px;
}

.auth-panel-inner {
    position: relative;
    z-index: 1;
    max-width: 440px;
    margin: 0 auto;
}

.auth-panel-title {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.auth-points {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    display: grid;
    gap: .75rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.auth-points li {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.auth-point-icon {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, .18);
    font-size: 1.2rem;
}

.auth-bubbles {
    display: grid;
    gap: .5rem;
}

.bubble {
    max-width: 80%;
    padding: .6rem .95rem;
    border-radius: 18px;
    font-weight: 700;
}

.bubble.is-tutor {
    justify-self: start;
    background: #fff;
    color: var(--ink-strong);
    border-bottom-left-radius: 4px;
}

.bubble.is-user {
    justify-self: end;
    background: var(--green-bg);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.auth-shell {
    align-self: center;
    padding: 3rem 1.5rem;
}

.auth-card {
    padding: 2rem 1.9rem;
    box-shadow: 0 6px 0 var(--line);
}

.auth-title {
    font-size: 1.8rem;
}

.auth-tagline {
    font-weight: 700;
}

@media (max-width: 899.98px) {
    .auth-split {
        grid-template-columns: 1fr;
    }

    .auth-panel {
        display: none;
    }
}

/* ---------------------------------------------------------------- Errores */

.error-code {
    font-weight: 900;
    font-size: 3.5rem;
}

/* ---------------------------------------------------------------- Itinerario por bloques y exámenes */

.tier {
    margin-bottom: 2.25rem;
}

.tier-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .6rem;
    margin-bottom: .9rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--line);
}

.tier-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--ink-strong);
}

.tier-levels {
    color: var(--ink-muted);
    font-weight: 800;
}

.tier.is-pro .tier-title { color: var(--purple); }

.tier-soon {
    color: var(--ink-muted);
    font-weight: 700;
    margin: 0;
}

.course-card.is-locked {
    background: var(--canvas);
    border-style: dashed;
}

.course-card.is-locked .course-title {
    color: var(--ink-muted);
}

.course-hint {
    color: var(--ink-muted);
    font-weight: 700;
    font-size: .9rem;
}

/* Exámenes en el camino: nodo cuadrado para el de capítulo, más grande y dorado para el final de nivel. */
.lesson-row.is-exam .lesson-node {
    border-radius: 22px;
}

.lesson-row.is-level-exam .lesson-node {
    width: 92px;
    height: 84px;
    border-radius: 26px;
}

.lesson-row.is-level-exam:not(.is-locked):not(.is-completed) .lesson-node {
    background: var(--purple);
    box-shadow: 0 7px 0 #7b3fc4;
}

.exam-tag {
    display: inline-block;
    margin-right: .35rem;
    padding: .05rem .5rem;
    border-radius: 999px;
    background: var(--purple-soft);
    color: var(--purple);
    font-size: .75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    vertical-align: middle;
}

.exam-banner {
    margin: 0 0 1rem;
    padding: .6rem .9rem;
    border-radius: 12px;
    background: var(--purple-soft);
    color: #6a2fb0;
    font-weight: 800;
}

.level-up {
    padding: .75rem 1rem;
    border-radius: 14px;
    background: var(--gold);
    color: var(--ink-strong);
    font-weight: 900;
}

/* ── Práctica sin IA: diálogos, escritura guiada y shadowing ─────────────────────────────── */
.pr-chapter { --unit: var(--green-bg); --unit-dark: var(--green-shadow); --unit-soft: var(--green-soft); }
.pr-chapter.is-a2 { --unit: #1cb0f6; --unit-dark: #1899d6; --unit-soft: #ddf4ff; }
.pr-chapter.is-b1 { --unit: #ce82ff; --unit-dark: #a568cc; --unit-soft: #f6e9ff; }
.pr-chapter.is-b2 { --unit: #ff9600; --unit-dark: #cd7900; --unit-soft: #fff1dd; }
.pr-chapter.is-c1 { --unit: #ff4b4b; --unit-dark: #d33131; --unit-soft: #ffe3e3; }
.pr-chapter.is-c2 { --unit: #2b70c9; --unit-dark: #1f5aa6; --unit-soft: #e1edfb; }

.pr-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

.pr-tab {
    min-width: 3.5rem;
    padding: .45rem .9rem;
    border: 2px solid var(--line);
    border-bottom-width: 4px;
    border-radius: 14px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 900;
}

.pr-tab:hover { border-color: var(--brand-line); }
.pr-tab.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }

.pr-chapters {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: .85rem;
}

.pr-chapter-link {
    display: flex;
    align-items: center;
    gap: .85rem;
    height: 100%;
    padding: .9rem 1rem;
    border: 2px solid var(--line);
    border-bottom-width: 4px;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
}

a.pr-chapter-link:hover { border-color: var(--unit); background: var(--unit-soft); color: var(--ink); }

.pr-chapter-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    background: var(--unit);
    box-shadow: 0 3px 0 var(--unit-dark);
    color: #fff;
    font-weight: 900;
}

.pr-chapter.is-done .pr-chapter-icon { background: var(--gold); box-shadow: 0 3px 0 var(--gold-shadow); color: var(--ink-strong); }
.pr-chapter.is-locked .pr-chapter-link { opacity: .6; cursor: not-allowed; }
.pr-chapter.is-locked .pr-chapter-icon { background: var(--line); box-shadow: 0 3px 0 var(--line-strong); }

.pr-chapter-body { display: flex; flex-direction: column; min-width: 0; }
.pr-chapter-num { font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); }
.pr-chapter-title { font-weight: 800; color: var(--ink-strong); }
.pr-chapter-meta { font-size: .85rem; color: var(--ink-muted); }

/* Diálogo */
.dlg-partner { margin: 0 0 1rem; color: var(--ink-muted); font-weight: 800; }
.dlg-intro .dlg-partner { margin: 0; }
/* Tarjeta de introducción común a las tres prácticas (diálogo, escritura y shadowing). */
.dlg-intro, .wt-task, .sh-intro { display: grid; gap: .75rem; justify-items: start; margin-bottom: 1.5rem; padding: 1.25rem 1.35rem; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.dlg-howto { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; }

.dlg-log { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .75rem; }

.dlg-msg {
    max-width: 85%;
    padding: .75rem 1rem;
    border-radius: 18px;
    border: 2px solid var(--line);
    background: var(--surface);
}

.dlg-msg.is-partner { justify-self: start; border-bottom-left-radius: 6px; }
.dlg-msg.is-learner { justify-self: end; border-color: var(--brand-line); background: var(--brand-soft); border-bottom-right-radius: 6px; }
.dlg-text { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--ink-strong); }
.dlg-tools { display: flex; gap: .35rem; margin-top: .4rem; }
.dlg-es { margin: .4rem 0 0; color: var(--ink-muted); font-style: italic; }
.dlg-note { margin: .35rem 0 0; font-size: .85rem; color: var(--green); }

.dlg-icon {
    min-width: 2.2rem;
    padding: .15rem .5rem;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    font-size: .8rem;
    font-weight: 900;
    color: var(--brand-strong);
}

.dlg-msg.is-learner .dlg-icon { margin-top: .4rem; }

.dlg-choices { display: grid; gap: .6rem; }
.dlg-choices-label { margin: 0; font-weight: 900; color: var(--ink-muted); }

.dlg-choice {
    text-align: left;
    padding: .8rem 1rem;
    border: 2px solid var(--line);
    border-bottom-width: 4px;
    border-radius: 16px;
    background: var(--surface);
    color: var(--ink-strong);
    font-size: 1.05rem;
    font-weight: 700;
}

.dlg-choice:hover:not(:disabled) { border-color: var(--brand-line); background: var(--brand-soft); }
.dlg-choice.is-wrong { border-color: var(--red-bg); background: var(--red-soft); color: var(--red); text-decoration: line-through; }

.dlg-why { margin-bottom: .75rem; padding: .75rem 1rem; border-radius: 14px; background: var(--red-soft); color: #a61e1e; }

.dlg-summary { display: grid; gap: .35rem; justify-items: center; padding: 1.25rem; border-radius: var(--radius); background: var(--green-soft); text-align: center; }
.dlg-summary p { margin: 0; }
.dlg-summary-score { font-size: 2.2rem; font-weight: 900; color: var(--green); }
.dlg-summary-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .5rem; }

/* Escritura guiada */
.wt-instructions { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--ink-strong); }
.wt-form { display: grid; gap: 1.25rem; }
.wt-label { font-weight: 900; }
.wt-editor { font-size: 1.05rem; line-height: 1.6; border: 2px solid var(--line); border-radius: 14px; }
.wt-counter { margin: -.4rem 0 0; font-size: .9rem; color: var(--ink-muted); }
.wt-counter.is-ok { color: var(--green); }
.wt-counter.is-off { color: var(--orange); }
.wt-panel { padding: .9rem 1.1rem; border-radius: 14px; background: var(--canvas); border: 2px solid var(--line); }
.wt-panel.is-reminder { background: #fff8e1; border-color: #ffe08a; }
.wt-panel-title { margin: 0 0 .5rem; font-size: 1rem; font-weight: 900; }
.wt-required, .wt-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.wt-required li, .wt-checks li { padding: .25rem .7rem; border-radius: 999px; background: var(--surface); border: 2px solid var(--line); font-weight: 800; }
.wt-required li.is-ok, .wt-checks li.is-ok { border-color: var(--green-bg); background: var(--green-soft); color: var(--green); }
.wt-checks li.is-off { border-color: var(--red-bg); background: var(--red-soft); color: var(--red); }
.wt-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.wt-result { margin-top: 1.5rem; display: grid; gap: .9rem; }
.wt-result:empty { display: none; }
.wt-score { margin: 0; font-size: 1.2rem; font-weight: 900; color: var(--orange); }
.wt-score.is-ok { color: var(--green); }
.wt-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.wt-compare-col { padding: 1rem; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); min-width: 0; }
.wt-compare-col.is-model { border-color: var(--green-bg); background: var(--green-soft); }
.wt-compare-col h3 { margin: 0 0 .5rem; font-size: .95rem; font-weight: 900; }
.wt-text { margin: 0; white-space: pre-line; line-height: 1.6; overflow-wrap: anywhere; }

/* Shadowing */
.sh-steps { margin: 0; padding-left: 1.2rem; display: grid; gap: .25rem; }
.sh-progress { margin: 0; font-weight: 900; color: var(--brand-strong); }
.sh-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
.sh-card { display: grid; gap: .6rem; padding: 1rem 1.1rem; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: var(--radius); background: var(--surface); min-width: 0; }
.sh-text { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--ink-strong); }
.sh-hide-text .sh-text { filter: blur(6px); user-select: none; }
.sh-hide-text .sh-text:hover { filter: none; }
.sh-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.sh-status { font-size: .85rem; color: var(--ink-muted); }
.sh-audio { width: 100%; max-width: 360px; height: 36px; }
.btn.is-recording { background: var(--red-bg); border-color: var(--red-bg); color: #fff; }
.sh-ratings { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.sh-ratings-label { font-size: .85rem; font-weight: 800; color: var(--ink-muted); margin-right: .25rem; }
.sh-rate { padding: .3rem .75rem; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 800; }
.sh-rate.is-selected[data-rating="good"] { border-color: var(--green-bg); background: var(--green-soft); color: var(--green); }
.sh-rate.is-selected[data-rating="almost"] { border-color: var(--gold); background: #fff8db; color: #9a6b00; }
.sh-rate.is-selected[data-rating="again"] { border-color: var(--red-bg); background: var(--red-soft); color: var(--red); }

@media (max-width: 640px) {
    .wt-compare { grid-template-columns: 1fr; }
    .dlg-msg { max-width: 100%; }
}

/* ── Maquetación común ──────────────────────────────────────────────────────────────────────
   Todas las páginas con menú comparten el mismo armazón: el contenido ocupa el ancho completo del área
   (sin columnas estrechas centradas), con los mismos márgenes y la misma cabecera:
     .page-header > [.back-link] [.page-eyebrow] .page-header-row > (.page-title + .page-subtitle) [.page-actions]
   Los flujos de ejercicio (lección, práctica adaptativa y test de nivel) van a pantalla completa, sin menú. */

/* El borde del contenido no se mueve cuando aparece la barra de desplazamiento. */
html { scrollbar-gutter: stable; }

.page-header {
    display: grid;
    gap: .35rem;
    margin-bottom: 1.75rem;
}

.page-header .page-title,
.page-header .page-subtitle {
    margin: 0;
}

.page-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: .75rem 1.5rem;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.back-link {
    display: block;
    width: fit-content;
    margin-bottom: .35rem;
}

.page-eyebrow {
    margin: 0;
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--brand-strong);
}

/* Diálogo: la conversación usa todo el ancho; las respuestas, en dos columnas cuando caben. */
.dlg-msg { max-width: min(70%, 760px); }
.dlg-choices { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.dlg-choices-label,
.dlg-summary { grid-column: 1 / -1; }

/* Escritura guiada: editor a la izquierda y lo que hay que usar / revisar a la derecha. */
.wt-main,
.wt-side {
    display: grid;
    gap: .9rem;
    align-content: start;
    min-width: 0;
}

@media (min-width: 1200px) {
    .wt-form {
        grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr);
        align-items: start;
    }
    .wt-editor { min-height: 22rem; }
}

/* Shadowing: frase y acciones en una fila; la autoevaluación, a la derecha. */
.sh-ratings { margin-left: auto; }

@media (max-width: 1023.98px) {
    .sh-ratings { margin-left: 0; }
}

@media (max-width: 640px) {
    .dlg-msg { max-width: 100%; }
}

/* ── Estadísticas (Fase 9): tarjetas de gráficos con el mismo armazón que el resto ─────────────────────────── */
.an-kpis { margin-bottom: 1.25rem; }

@media (min-width: 1200px) {
    .an-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.chart-grid {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 1100px) {
    .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.chart-card {
    display: grid;
    align-content: start;
    gap: .35rem;
    min-width: 0;
}

.chart-title { margin: 0; font-size: 1.05rem; font-weight: 900; color: var(--ink-strong); }
.chart-desc { margin: 0 0 .5rem; font-size: .88rem; color: var(--ink-muted); }
.chart-box { position: relative; width: 100%; }
.chart-empty { margin: 0; padding: 2.5rem 0; text-align: center; color: var(--ink-muted); }

.chart-details { margin-top: .5rem; font-size: .88rem; }
.chart-details summary { width: fit-content; color: var(--brand-strong); font-weight: 800; cursor: pointer; }
.chart-table { margin: .5rem 0 0; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { padding: .3rem .5rem; }

.an-delta { font-weight: 800; }
.an-delta.is-up { color: var(--green); }
.an-delta.is-down { color: var(--red); }
.an-delta.is-flat { color: var(--ink-muted); }

.an-courses, .an-topics { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.an-courses li { display: grid; gap: .45rem; }
.an-course-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-weight: 800; color: var(--ink-strong); }
.an-courses .course-progress { margin: 0; }
.an-course-num, .an-topic-num { flex: 0 0 auto; color: var(--ink-muted); font-weight: 800; font-variant-numeric: tabular-nums; }

.an-summary { display: grid; grid-template-columns: 1fr auto; gap: .55rem 1rem; margin: 0; }
.an-summary dt { font-weight: 700; color: var(--ink); }
.an-summary dd { margin: 0; text-align: right; font-weight: 800; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.an-vocab { margin: .75rem 0 0; padding-top: .75rem; border-top: 1px solid var(--line); font-size: .88rem; color: var(--ink-muted); }

.an-topics li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.an-topics li:last-child { border-bottom: 0; padding-bottom: 0; }
.an-topic-name { display: grid; font-weight: 800; color: var(--ink-strong); }
.an-topic-skill { font-size: .8rem; font-weight: 700; color: var(--ink-muted); }

/* ── Bienvenida tras el registro (pantalla completa, como el test de nivel) ─────────────────────────────── */
.welcome { display: grid; gap: 1.5rem; padding-top: 2rem; }
.welcome-header { display: grid; gap: .35rem; }
.welcome-header .page-title, .welcome-header .page-subtitle { margin: 0; }
.welcome-hello { margin: 0; font-weight: 900; color: var(--brand-strong); }
.welcome-options { display: grid; gap: 1rem; }
@media (min-width: 640px) { .welcome-options { grid-template-columns: 1fr 1fr; } }

.welcome-option {
    display: grid;
    align-content: start;
    gap: .45rem;
    padding: 1.35rem 1.4rem;
    border: 2px solid var(--line);
    border-bottom-width: 4px;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    text-align: left;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}

.welcome-option:hover, .welcome-option:focus-visible { border-color: var(--brand-line); background: var(--brand-soft); color: var(--ink); outline: none; }
.welcome-option:disabled { opacity: .6; cursor: progress; }
.welcome-icon { font-size: 2rem; line-height: 1; }
.welcome-option-title { font-size: 1.2rem; font-weight: 900; color: var(--ink-strong); }
.welcome-option-text { color: var(--ink-muted); }
.welcome-option-cta { margin-top: .35rem; font-weight: 900; color: var(--brand-strong); }
.welcome-status { margin: 0; min-height: 1.5rem; color: var(--ink-muted); }
.welcome-later { margin: 0; text-align: center; font-weight: 800; }
.welcome-later a { color: var(--ink-muted); }

/* ---------------------------------------------------------------- Modo administrador */

.adm-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px 200px;
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.adm-table-card { padding: .5rem 0; }
.adm-table { margin: 0; font-variant-numeric: tabular-nums; }
.adm-table th { font-size: .78rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); white-space: nowrap; }
.adm-table th, .adm-table td { padding: .7rem 1rem; border-color: var(--line); }
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-user-name { display: block; font-weight: 800; color: var(--ink-strong); }
a.adm-user-name { color: var(--brand-strong); text-decoration: none; }
a.adm-user-name:hover { text-decoration: underline; }
.adm-user-email { display: block; font-size: .85rem; color: var(--ink-muted); overflow-wrap: anywhere; }
.adm-activity { display: block; font-weight: 700; }

.adm-badges { display: flex; flex-wrap: wrap; gap: .35rem; }
.adm-badge {
    display: inline-block;
    padding: .2em .6em;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
    border: 2px solid var(--line);
    color: var(--ink);
    background: var(--surface);
    white-space: nowrap;
}
.adm-badge.is-active { border-color: #b2f2bb; background: var(--green-soft); color: #2b8a3e; }
.adm-badge.is-disabled { border-color: #ffc9c9; background: var(--red-soft); color: #c92a2a; }
.adm-badge.is-pending { border-color: #ffe066; background: #fff9db; color: #8a6100; }
.adm-badge.is-role-admin { border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand-strong); }

.adm-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: 1rem;
    color: var(--ink-muted);
    font-weight: 700;
}

.adm-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.adm-section-title { margin: 1.75rem 0 1rem; font-size: 1.15rem; font-weight: 900; color: var(--ink-strong); }
.adm-exams { margin-top: 1.25rem; }

.adm-temp {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    margin-top: .75rem;
}
.adm-temp p { flex-basis: 100%; }
.adm-temp-password {
    padding: .3rem .7rem;
    border-radius: 10px;
    background: var(--surface);
    border: 2px solid var(--line-strong);
    color: var(--ink-strong);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .06em;
    user-select: all;
}

/* Cambio de contraseña: el formulario no se estira a todo el ancho (es un formulario, no una página de datos). */
.account-form { max-width: 520px; }

/* PWA: botón «Instalar app» (solo visible cuando el navegador lo ofrece). */
.side-install { width: 100%; background: none; text-align: left; margin-top: auto; }
.side-install[hidden], .sheet-link[hidden] { display: none; }

@media (max-width: 640px) {
    .adm-filters { grid-template-columns: 1fr 1fr; }
    .adm-filters [data-q] { grid-column: 1 / -1; }
    .adm-table th, .adm-table td { padding: .6rem .75rem; }

    /* Lista de alumnos en el móvil: cada fila es una tarjeta (nombre y email arriba; nivel, actividad y estado debajo). */
    .adm-users thead { display: none; }
    .adm-users tr { display: grid; grid-template-columns: auto 1fr; gap: .45rem .75rem; align-items: center; padding: .9rem 1rem; border-bottom: 2px solid var(--line); }
    .adm-users tbody tr:last-child { border-bottom: 0; }
    .adm-users td { display: block; padding: 0; border: 0; background: transparent; box-shadow: none; }
    .adm-users td:nth-child(1), .adm-users td:nth-child(5), .adm-users td:nth-child(6) { grid-column: 1 / -1; }
    .adm-users td:nth-child(3), .adm-users td:nth-child(4) { display: none; }
    .adm-users .adm-activity { display: inline; margin-right: .35rem; }
    .adm-users td:nth-child(5) .adm-user-email { display: inline; }
}

/* ---------------------------------------------------------------- Grabaciones (modo administrador) */

.adm-filters-4 { grid-template-columns: minmax(0, 1fr) 180px 220px 240px; }
.rec-stats { margin-bottom: 1.25rem; }
.rec-stats .course-progress { margin-top: .5rem; width: 100%; }
.rec-row-actions { white-space: nowrap; }
.rec-row-actions .btn + .btn, .rec-row-actions .btn + a, .rec-row-actions a + .btn { margin-left: .35rem; }

.rec-filters { gap: .5rem; }
.rec-filters .form-select { width: auto; min-width: 170px; }
.rec-progress { margin: 0 0 .75rem; color: var(--ink-muted); font-weight: 700; }
.rec-card { text-align: center; padding: 2rem 1.5rem; border-width: 2px; transition: border-color .2s; }
.rec-card.is-recording { border-color: var(--red-bg); box-shadow: 0 0 0 4px var(--red-soft); }
.rec-context { margin: 0 0 1rem; font-size: .85rem; font-weight: 800; letter-spacing: .03em; color: var(--brand-strong); }
.rec-text { margin: 0; font-size: clamp(1.4rem, 3.2vw, 2rem); font-weight: 900; line-height: 1.3; color: var(--ink-strong); }
.rec-translation { margin: .6rem 0 0; color: var(--ink-muted); font-size: 1.05rem; }
.rec-timer { margin: 1rem 0 0; font-weight: 900; color: var(--red); font-variant-numeric: tabular-nums; }
.rec-player { display: block; width: 100%; max-width: 420px; margin: 1.25rem auto 0; }
.rec-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1.5rem; }
.rec-keys { margin: 1rem 0 0; text-align: center; font-size: .82rem; color: var(--ink-muted); }
.rec-done .rec-text { font-size: 2.5rem; }

@media (max-width: 900px) {
    .adm-filters-4 { grid-template-columns: 1fr 1fr; }
    .adm-filters-4 [data-q] { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- Unificación de tarjetas y cifras
   Todas las páginas usan la misma tarjeta (borde de 2px con relieve inferior, como cursos y logros) y las mismas
   cifras (etiqueta en versalitas, valor grande), sea panel, progreso, estadísticas de vocabulario o administración. */

.dash-card,
.stat-tile {
    box-shadow: 0 4px 0 var(--line);
}

.stat-tile {
    border: 2px solid var(--line);
    border-radius: 16px;
    padding: .8rem .95rem;
    background: var(--surface);
}

.stat-label {
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #8a8a8a;
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--ink-strong);
}

.stat-sub {
    font-size: .78rem;
    font-weight: 700;
    color: var(--ink-muted);
}

/* ---------------------------------------------------------------- Completar eligiendo (opciones y banco de palabras) */

/* Hueco que se rellena al tocar una opción: mismo aspecto que el campo de escribir. */
.blank-slot {
    display: inline-block;
    min-width: 5.5rem;
    margin: 0 .35rem;
    padding: .1rem .6rem;
    border-bottom: 3px solid var(--line-strong);
    color: var(--ink-muted);
    font-weight: 900;
    text-align: center;
}
.blank-slot.is-filled { border-color: var(--brand); color: var(--brand-strong); }

.choice-bank { justify-content: center; margin-top: 1rem; }
.choice-chip.is-selected { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }

.answer-area { display: grid; gap: .5rem; }
.answer-mode { display: block; margin: .6rem auto 0; color: var(--ink-muted); font-weight: 800; }
.answer-mode:hover { color: var(--brand-strong); }

/* ---------------------------------------------------------------- Paso «Aprende» (antes de los ejercicios) */

.learn-card { text-align: center; }
.learn-card .exercise-meta { color: var(--green); }
.learn-en { margin: 1.25rem 0 .35rem; font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 900; line-height: 1.2; color: var(--ink-strong); }
.learn-es { margin: 0 0 1.25rem; font-size: 1.2rem; font-weight: 700; color: var(--ink-muted); }
.learn-card .audio-controls { justify-content: center; }
.is-learn .player-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; }
.learn-count { font-weight: 900; color: var(--ink-muted); }
.learn-skip { padding: 0; font-weight: 800; }

/* Aviso: el navegador no tiene voz en inglés (no se lee con acento español). */
.voice-missing { position: relative; padding-right: 2.75rem; margin-bottom: 1.25rem; }
.voice-missing .btn-close { position: absolute; top: .9rem; right: .9rem; }

/* Recomendación de navegador (Chrome o Edge) */
.auth-browser { margin: 1rem auto 0; max-width: 420px; text-align: center; font-size: .85rem; font-weight: 700; color: var(--ink-muted); }
.browser-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1.25rem; }
.browser-notice > span { flex: 1 1 320px; }

/* «En esta lección»: qué se va a aprender, antes de las tarjetas de palabras */
.learn-intro { text-align: left; }
.learn-intro .exercise-meta { color: var(--brand-strong); }
.learn-points { display: grid; gap: .75rem; margin: 1.25rem 0 0; padding: 0; list-style: none; }
.learn-points li { position: relative; padding: .85rem 1rem .85rem 2.6rem; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 1.05rem; line-height: 1.45; color: var(--ink-strong); }
.learn-points li::before { content: "💡"; position: absolute; left: .85rem; top: .85rem; }

/* Páginas públicas: portada, privacidad y condiciones (mismo ancho completo y espaciado que la app) */
.public-body { background: var(--canvas); min-height: 100vh; display: flex; flex-direction: column; }
.public-header { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; padding: .85rem 2.5rem; background: var(--surface); border-bottom: 2px solid var(--line); }
.public-brand { text-decoration: none; color: var(--ink-strong); }
.public-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.public-link { font-weight: 800; color: var(--ink-muted); text-decoration: none; }
.public-link:hover { color: var(--brand); }
.public-main { flex: 1; width: 100%; padding: 2rem 2.5rem 4rem; }
.public-footer { padding: 1.5rem 2.5rem 2rem; border-top: 2px solid var(--line); background: var(--surface); color: var(--ink-muted); font-size: .9rem; }
.public-footer a { font-weight: 800; }
.public-notice { margin-bottom: 1.5rem; }

/* Portada (lp-): franjas a todo el ancho con el mismo margen lateral que el resto de páginas */
.public-main { --lp-gutter: 2.5rem; }
.lp-hero, .lp-final { margin-left: calc(-1 * var(--lp-gutter)); margin-right: calc(-1 * var(--lp-gutter)); padding-left: var(--lp-gutter); padding-right: var(--lp-gutter); }
.lp-hero {
    margin-top: -2rem; padding-top: 3.5rem; padding-bottom: 5.5rem;
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 3rem; align-items: center;
    background:
        radial-gradient(circle at 88% 18%, rgba(88, 204, 2, .16) 0, transparent 38%),
        linear-gradient(180deg, var(--brand-soft) 0%, #f3f9ff 70%, var(--canvas) 100%);
}
.lp-pill { display: inline-block; margin: 0 0 1.1rem; padding: .4rem .9rem; border: 2px solid var(--brand-line); border-radius: 999px; background: var(--surface); font-size: .85rem; font-weight: 800; color: var(--brand-strong); }
.lp-title { position: relative; z-index: 0; margin: 0 0 1.1rem; font-size: clamp(2.4rem, 5.6vw, 4.2rem); font-weight: 900; line-height: 1.04; letter-spacing: -.025em; color: var(--ink-strong); }
.lp-mark { position: relative; white-space: nowrap; color: var(--brand); }
.lp-mark::after { content: ""; position: absolute; left: 0; right: 0; bottom: .02em; height: .2em; border-radius: 99px; background: var(--gold); opacity: .55; z-index: -1; }
.lp-lead { max-width: 54ch; margin: 0 0 1.75rem; font-size: clamp(1.05rem, 1.6vw, 1.22rem); line-height: 1.55; color: var(--ink); }
.lp-cta { display: flex; flex-wrap: wrap; gap: .85rem; margin-bottom: 1.4rem; }
.lp-cta .btn-outline-primary { background: var(--surface); }
.lp-checks { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin: 0; padding: 0; list-style: none; font-weight: 800; color: var(--ink-muted); }
.lp-checks li::before { content: "✓"; display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; margin-right: .4rem; border-radius: 50%; background: var(--green-bg); color: #fff; font-size: .8rem; }

/* Maqueta del móvil con un ejercicio */
.lp-phone-wrap { position: relative; justify-self: center; padding: 1.5rem 2.5rem; }
.lp-phone { width: min(340px, 100%); padding: 1.1rem 1.1rem 1.25rem; border: 10px solid var(--ink-strong); border-radius: 40px; background: var(--surface); box-shadow: 0 30px 60px -20px rgba(24, 100, 171, .45); transform: rotate(2deg); }
.lp-phone-top { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.1rem; }
.lp-x { color: #b0b0b0; font-weight: 900; }
.lp-bar { flex: 1; height: 14px; border-radius: 99px; background: var(--line); overflow: hidden; }
.lp-bar span { display: block; width: 62%; height: 100%; border-radius: 99px; background: var(--green-bg); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .08); }
.lp-phone-kicker { margin: 0 0 .75rem; font-size: 1.1rem; font-weight: 900; color: var(--ink-strong); }
.lp-source { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; font-weight: 800; color: var(--ink-strong); }
.lp-speaker { display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--brand); color: #fff; box-shadow: 0 3px 0 var(--brand-shadow); }
.lp-speaker .icon { width: 22px; height: 22px; color: #fff; }
.lp-answer { display: flex; flex-wrap: wrap; gap: .4rem; min-height: 3.2rem; padding: .35rem 0 .7rem; border-bottom: 2px solid var(--line); margin-bottom: 1rem; }
.lp-bank { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin-bottom: 1.1rem; }
.lp-tile { display: inline-block; padding: .4rem .75rem; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 12px; background: var(--surface); font-weight: 800; color: var(--ink-strong); }
.lp-tile.is-used { background: var(--line); border-color: var(--line); color: transparent; }
.lp-feedback { display: grid; gap: .1rem; padding: .8rem 1rem; border-radius: 14px; background: var(--green-soft); color: var(--green); font-weight: 700; }
.lp-feedback strong { font-size: 1.05rem; font-weight: 900; }
.lp-float { position: absolute; z-index: 1; display: inline-flex; align-items: center; gap: .35rem; padding: .55rem .9rem; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); font-weight: 900; color: var(--ink-strong); box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .25); }
.lp-float .icon { width: 20px; height: 20px; }
.lp-float-streak { top: .25rem; left: 0; transform: rotate(-5deg); }
.lp-float-streak .icon { color: var(--orange); }
.lp-float-xp { bottom: .5rem; right: 0; transform: rotate(4deg); }
.lp-float-xp .icon { color: var(--gold); }

/* Cifras (montadas sobre el final de la franja de arriba) */
.lp-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: -3.25rem 0 1rem; border: 2px solid var(--line); border-bottom-width: 5px; border-radius: var(--radius-lg); background: var(--surface); }
.lp-stat { display: grid; justify-items: center; gap: .1rem; padding: 1.4rem .75rem; text-align: center; }
.lp-stat + .lp-stat { border-left: 2px solid var(--line); }
.lp-stat strong { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 900; line-height: 1; color: var(--brand); }
.lp-stat span { font-size: .8rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }

.lp-section { padding: 3.5rem 0 1rem; }
.lp-kicker { margin: 0 0 .35rem; font-size: .8rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--green); }
.lp-h2 { margin: 0 0 1.5rem; font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 900; letter-spacing: -.02em; color: var(--ink-strong); }
.lp-sub { max-width: 70ch; margin: -.75rem 0 1.75rem; font-size: 1.08rem; color: var(--ink-muted); }
.lp-h3 { margin: 0 0 .35rem; font-size: 1.15rem; font-weight: 900; color: var(--ink-strong); }

/* Cómo funciona */
.lp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.lp-step { --c: var(--brand); --s: var(--brand-shadow); padding: 1.75rem 1.5rem; border: 2px solid var(--line); border-bottom-width: 5px; border-radius: var(--radius-lg); background: var(--surface); }
.lp-step p { margin: 0; line-height: 1.55; }
.lp-step-2 { --c: var(--green-bg); --s: var(--green-shadow); }
.lp-step-3 { --c: var(--orange); --s: #d97f00; }
.lp-step-icon { position: relative; display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 1.1rem; border-radius: 20px; background: var(--c); color: #fff; box-shadow: 0 5px 0 var(--s); }
.lp-step-icon .icon { width: 32px; height: 32px; color: #fff; stroke-width: 2.4; }
.lp-step-num { position: absolute; top: -10px; right: -10px; display: grid; place-items: center; width: 28px; height: 28px; border: 3px solid var(--surface); border-radius: 50%; background: var(--ink-strong); color: #fff; font-size: .8rem; font-weight: 900; }

/* Niveles: tarjetas con el color de su grupo (Básico, Intermedio, Avanzado, PRO) */
.lp-path { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.lp-level { --c: var(--green-bg); --s: var(--green-shadow); --soft: var(--green-soft); --t: var(--green); display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem; border: 2px solid var(--line); border-bottom-width: 5px; border-radius: var(--radius-lg); background: var(--surface); }
.lp-level.tier-intermediate { --c: var(--brand); --s: var(--brand-shadow); --soft: var(--brand-soft); --t: var(--brand-strong); }
.lp-level.tier-advanced { --c: var(--purple); --s: #7b3fc4; --soft: var(--purple-soft); --t: #7b3fc4; }
.lp-level.tier-pro { --c: var(--gold); --s: var(--gold-shadow); --soft: #fff6d6; --t: #a87900; }
.lp-node { display: grid; place-items: center; flex: none; min-width: 64px; height: 64px; padding: 0 .5rem; border-radius: 20px; background: var(--c); color: #fff; font-size: 1.3rem; font-weight: 900; box-shadow: 0 5px 0 var(--s); }
.lp-level:first-child .lp-node { font-size: .9rem; }
.lp-level-body p { margin: 0; font-size: .95rem; line-height: 1.5; }
.lp-level-body .lp-tier { display: inline-block; margin-bottom: .35rem; padding: .1rem .55rem; border-radius: 99px; background: var(--soft); color: var(--t); font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }

/* Qué incluye */
.lp-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.lp-feature { --c: var(--brand); --soft: var(--brand-soft); display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem; border: 2px solid var(--line); border-bottom-width: 5px; border-radius: var(--radius-lg); background: var(--surface); }
.lp-feature p { margin: 0; color: var(--ink-muted); }
.lp-feature-icon { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 16px; background: var(--soft); color: var(--c); }
.lp-feature-icon .icon { width: 28px; height: 28px; color: var(--c); }
.lp-feature-lessons { --c: var(--green); --soft: var(--green-soft); }
.lp-feature-dialogues { --c: #7b3fc4; --soft: var(--purple-soft); }
.lp-feature-speaking { --c: var(--red); --soft: var(--red-soft); }
.lp-feature-vocabulary { --c: #d97f00; --soft: #fff1dc; }
.lp-feature-progress { --c: #0c8599; --soft: #e3fafc; }

/* Gratis y hecho con cariño */
.lp-free { display: flex; gap: 2rem; align-items: center; margin: 3.5rem 0 0; padding: 2.25rem 2.5rem; border: 2px solid #ffd8a8; border-bottom-width: 5px; border-radius: var(--radius-lg); background: linear-gradient(135deg, #fff9db 0%, #fff4e6 100%); }
.lp-free .lp-h2 { margin-bottom: .6rem; }
.lp-free p { max-width: 70ch; margin-bottom: .75rem; font-size: 1.08rem; }
.lp-heart { display: grid; place-items: center; flex: none; width: 96px; height: 96px; border-radius: 50%; background: var(--red-bg); color: #fff; font-size: 3rem; line-height: 1; box-shadow: 0 6px 0 var(--red-shadow); }
.lp-free .lp-signature { margin: 1rem 0 0; font-weight: 900; color: var(--ink-strong); }

/* Llamada final */
.lp-final { margin-top: 3.5rem; margin-bottom: -4rem; padding-top: 3.5rem; padding-bottom: 3.5rem; background: var(--brand); color: #fff; text-align: center; }
.lp-final-title { margin: 0 0 .5rem; font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 900; color: #fff; }
.lp-final p { margin: 0 0 1.5rem; font-size: 1.15rem; color: rgba(255, 255, 255, .9); }
.lp-final-btn { --btn-shadow: rgba(0, 0, 0, .18); --bs-btn-bg: #fff; --bs-btn-border-color: #fff; --bs-btn-color: var(--brand-strong); --bs-btn-hover-bg: #f1f8ff; --bs-btn-hover-border-color: #f1f8ff; --bs-btn-hover-color: var(--brand-strong); --bs-btn-active-bg: #fff; --bs-btn-active-border-color: #fff; --bs-btn-active-color: var(--brand-strong); }
.lp-final .lp-browser { margin: 1.5rem 0 0; font-size: .85rem; font-weight: 700; color: rgba(255, 255, 255, .8); }

@media (max-width: 1099.98px) {
    .lp-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899.98px) {
    .lp-hero { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 2.25rem; }
    .lp-steps { grid-template-columns: 1fr; }
    .lp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lp-stat:nth-child(3) { border-left: 0; }
    .lp-stat:nth-child(n+3) { border-top: 2px solid var(--line); }
}
@media (max-width: 640px) {
    .public-main { --lp-gutter: 1rem; }
    .lp-features, .lp-path { grid-template-columns: 1fr; }
    .lp-free { flex-direction: column; align-items: flex-start; padding: 1.5rem 1.25rem; }
    .lp-heart { width: 72px; height: 72px; font-size: 2.2rem; }
    .lp-phone-wrap { padding: 1.25rem .5rem; }
    .lp-float-streak { left: -.25rem; }
    .lp-float-xp { right: -.25rem; }
    .lp-cta .btn { flex: 1 1 100%; }
}

.legal { padding: 2rem 2.5rem; }
.legal h2 { font-size: 1.2rem; font-weight: 900; color: var(--ink-strong); margin: 1.75rem 0 .6rem; }
.legal p, .legal ul { max-width: 80ch; }
.legal li { margin-bottom: .4rem; }

.auth-legal, .account-legal { margin: .75rem 0 0; font-size: .85rem; font-weight: 700; color: var(--ink-muted); }
.auth-legal { text-align: center; }
.account-delete { margin-top: 1.5rem; border-color: var(--red-soft); }

@media (max-width: 640px) {
    .public-header, .public-main, .public-footer { padding-left: 1rem; padding-right: 1rem; }
    .public-link { display: none; }
    .legal { padding: 1.25rem 1rem; }
}
