:root {
    --m2-ink: #10233d;
    --m2-muted: #607089;
    --m2-blue: #1458d6;
    --m2-cyan: #0b9eae;
    --m2-amber: #e5a100;
    --m2-paper: #ffffff;
    --m2-soft: #f4f7fb;
    --m2-line: #d8e0ea;
    --m2-navy: #07182d;
    --m2-good: #087f5b;
    --m2-warn: #9a5b00;
}

/* Tarjeta de acceso dentro de la Unidad 1 */
.acceso-menta02 {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    margin-top: 22px;
    padding: 26px 28px;
    overflow: hidden;
    color: #f8fbff;
    background:
        radial-gradient(circle at 91% 15%, rgba(72, 224, 211, .18), transparent 24%),
        linear-gradient(118deg, #102b4c 0%, #17365f 54%, #272450 100%);
    border: 1px solid rgba(60, 212, 219, .55);
    border-radius: 20px;
    box-shadow: 0 18px 42px rgba(2, 13, 29, .2);
}

.acceso-menta02::after {
    content: "";
    position: absolute;
    z-index: -1;
    right: -45px;
    bottom: -95px;
    width: 230px;
    height: 230px;
    border: 26px solid rgba(255,255,255,.04);
    border-radius: 50%;
}

.acceso-menta02__icono {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    color: #63eadf;
    background: rgba(5, 173, 184, .13);
    border: 1px solid rgba(49, 218, 221, .6);
    border-radius: 18px;
    font-size: 2rem;
    font-weight: 900;
}

.acceso-menta02 small {
    display: block;
    margin-bottom: 5px;
    color: #5de9df;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .12em;
}

.acceso-menta02 h3 {
    margin: 0 0 7px;
    color: #fff;
    font-size: clamp(1.35rem, 2.3vw, 1.85rem);
    line-height: 1.12;
}

.acceso-menta02 p {
    max-width: 730px;
    margin: 0;
    color: #cedcf0;
    font-size: .98rem;
    line-height: 1.55;
}

#abrirMenta02IA {
    position: relative;
    min-width: 205px;
    min-height: 58px;
    padding: 14px 24px;
    overflow: hidden;
    color: #07233c;
    background: linear-gradient(105deg, #ffd342 0%, #f5bb2c 48%, #58e2d8 100%);
    border: 0;
    border-radius: 15px;
    box-shadow: 0 13px 28px rgba(2, 12, 28, .32), inset 0 1px rgba(255,255,255,.6);
    font-family: inherit;
    font-size: .98rem;
    font-weight: 950;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

#abrirMenta02IA::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.5) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform .55s ease;
}

#abrirMenta02IA:hover {
    transform: translateY(-3px);
    filter: saturate(1.08);
    box-shadow: 0 17px 34px rgba(2, 12, 28, .4), 0 0 0 4px rgba(82, 226, 216, .12);
}

#abrirMenta02IA:hover::before { transform: translateX(120%); }
#abrirMenta02IA:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
#abrirMenta02IA:active { transform: translateY(0); }

body.m2-sin-scroll { overflow: hidden !important; }

.m2-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    overflow: auto;
    background: #e8eef5;
    color: var(--m2-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.m2-overlay.abierto { display: block; }
.m2-overlay * { box-sizing: border-box; }
.m2-app { min-height: 100vh; }

.m2-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px max(28px, calc((100vw - 1420px) / 2));
    color: #fff;
    background: var(--m2-navy);
    border-bottom: 3px solid #1eb5c8;
}

.m2-header h1 { margin: 2px 0 0; font-size: clamp(1.25rem, 2vw, 1.7rem); line-height: 1.15; }
.m2-header p { margin: 4px 0 0; color: #b7c8db; font-size: .88rem; }
.m2-marca { color: #55d5e3; font-size: .7rem; font-weight: 900; letter-spacing: .14em; }
.m2-header-tools { display: flex; align-items: center; gap: 14px; }
.m2-tiempo { min-width: 72px; padding: 8px 12px; text-align: center; font: 800 .9rem ui-monospace, SFMono-Regular, Menlo, monospace; background: #102c4d; border: 1px solid #315373; border-radius: 8px; }
.m2-cerrar { width: 42px; height: 42px; border: 1px solid #35516f; border-radius: 8px; color: #fff; background: transparent; font-size: 1.65rem; cursor: pointer; }
.m2-cerrar:hover { background: #173555; }

.m2-progreso { position: sticky; top: 93px; z-index: 21; height: 4px; background: #cdd7e2; }
.m2-progreso span { display: block; height: 100%; background: linear-gradient(90deg, var(--m2-blue), var(--m2-cyan)); transition: width .3s ease; }

.m2-registro {
    width: min(1180px, calc(100% - 40px));
    margin: 52px auto;
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    border-radius: 18px;
    overflow: hidden;
    background: var(--m2-paper);
    box-shadow: 0 22px 70px rgba(12, 34, 58, .16);
}

.m2-portada { padding: clamp(34px, 6vw, 72px); color: #fff; background: linear-gradient(145deg, #0b2946, #102f59 62%, #12496a); }
.m2-kicker { display: inline-block; margin-bottom: 18px; color: #46d8df; font-size: .72rem; font-weight: 900; letter-spacing: .13em; }
.m2-portada h2 { max-width: 650px; margin: 0 0 20px; font-size: clamp(2.15rem, 4.4vw, 4.25rem); line-height: .98; letter-spacing: -.05em; }
.m2-portada > p { max-width: 670px; margin: 0; color: #ccd9e8; font-size: 1.04rem; line-height: 1.7; }
.m2-metodo { display: grid; grid-template-columns: auto auto 1fr auto auto 1fr auto auto; align-items: center; gap: 9px; margin: 42px 0; }
.m2-metodo b { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #59cad7; border-radius: 50%; color: #66e3e9; font-size: .72rem; }
.m2-metodo span { font-weight: 800; font-size: .83rem; }
.m2-metodo i { height: 1px; background: #41627e; }
.m2-portada aside { padding: 18px 20px; border-left: 3px solid #f2bb34; background: rgba(255,255,255,.07); color: #dce8f3; line-height: 1.55; }

.m2-form-registro { padding: clamp(30px, 4vw, 54px); align-self: center; }
.m2-form-registro h3 { margin: 0 0 28px; font-size: 1.45rem; }
.m2-form-registro label, .m2-campo { display: grid; gap: 8px; margin-bottom: 18px; }
.m2-form-registro label span, .m2-campo > span { color: #2d415a; font-size: .87rem; font-weight: 800; line-height: 1.45; }
.m2-form-registro input, .m2-form-registro select, .m2-campo input, .m2-campo select, .m2-campo textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    color: var(--m2-ink);
    background: #fff;
    border: 1px solid #bac7d6;
    border-radius: 8px;
    outline: none;
    font: inherit;
}
.m2-campo textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
.m2-form-registro input:focus, .m2-form-registro select:focus, .m2-campo input:focus, .m2-campo select:focus, .m2-campo textarea:focus { border-color: var(--m2-blue); box-shadow: 0 0 0 3px rgba(20, 88, 214, .12); }
.m2-dos, .m2-comparacion { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.m2-primario, .m2-secundario {
    min-height: 46px;
    padding: 11px 19px;
    border-radius: 8px;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 850;
    cursor: pointer;
}
.m2-primario { color: #fff; background: var(--m2-blue); border: 1px solid var(--m2-blue); box-shadow: 0 7px 18px rgba(20, 88, 214, .2); }
.m2-primario:hover { background: #0d49b7; }
.m2-secundario { color: #30445c; background: #fff; border: 1px solid #b9c6d4; }
.m2-secundario:hover { background: #f2f5f8; }
.m2-form-registro .m2-primario { width: 100%; margin-top: 4px; }

.m2-workspace { width: min(1420px, calc(100% - 40px)); margin: 32px auto 70px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.m2-indice { position: sticky; top: 125px; padding: 10px; background: #f7f9fc; border: 1px solid #d2dbe5; border-radius: 12px; }
.m2-indice div { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; padding: 12px 10px; color: #79889a; border-left: 3px solid transparent; }
.m2-indice div + div { border-top: 1px solid #e2e8ef; }
.m2-indice b { display: grid; place-items: center; width: 32px; height: 32px; color: #587087; background: #e8edf3; border-radius: 6px; font-size: .72rem; }
.m2-indice span { font-size: .77rem; font-weight: 750; line-height: 1.25; }
.m2-indice span small { display: block; margin-top: 3px; color: #8190a1; font-size: .66rem; font-weight: 700; }
.m2-indice .actual { color: var(--m2-ink); border-left-color: var(--m2-blue); background: #edf4ff; }
.m2-indice .actual b { color: #fff; background: var(--m2-blue); }
.m2-indice .terminada { color: #477263; }
.m2-indice .terminada b { color: #fff; background: var(--m2-good); }

.m2-leccion { overflow: hidden; background: var(--m2-paper); border: 1px solid #d2dbe5; border-radius: 14px; box-shadow: 0 12px 35px rgba(25, 45, 70, .07); }
.m2-titulo-bloque { padding: clamp(28px, 4vw, 50px); color: #fff; background: linear-gradient(110deg, #0c2949, #153b65); }
.m2-titulo-bloque > span { color: #5adddf; font-size: .69rem; font-weight: 900; letter-spacing: .14em; }
.m2-bloque-meta { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.m2-bloque-meta span { color: #5adddf; font-size: .69rem; font-weight: 900; letter-spacing: .14em; }
.m2-bloque-meta strong { padding: 6px 9px; color: #0a2947; background: #64e3dd; border-radius: 5px; font-size: .67rem; letter-spacing: .08em; }
.m2-titulo-bloque h2 { margin: 9px 0 8px; font-size: clamp(1.8rem, 4vw, 3.2rem); line-height: 1; letter-spacing: -.035em; }
.m2-titulo-bloque p { max-width: 770px; margin: 0; color: #c6d5e4; line-height: 1.55; }

.m2-panel-teoria, .m2-panel-ejemplo, .m2-panel-cuaderno, .m2-panel-check { padding: clamp(25px, 4vw, 46px); }
.m2-panel-teoria { display: grid; grid-template-columns: 210px 1fr; gap: 30px; background: #fff; }
.m2-panel-teoria h3, .m2-panel-ejemplo h3, .m2-panel-cuaderno h3, .m2-panel-check h3 { margin: 0; font-size: 1.1rem; }
.m2-panel-teoria p { margin: 0; max-width: 850px; color: #33475e; font-size: 1.05rem; line-height: 1.7; }

.m2-panel-ejemplo { background: #edf4fb; border-top: 1px solid #dce5ee; border-bottom: 1px solid #dce5ee; }
.m2-panel-ejemplo h3 { margin-bottom: 18px; color: #194b80; }
.m2-panel-ejemplo p { display: grid; grid-template-columns: 36px 1fr; gap: 13px; align-items: start; max-width: 980px; margin: 8px 0; color: #2f455d; line-height: 1.55; }
.m2-panel-ejemplo p b { padding-top: 2px; color: #177a94; font: 800 .72rem ui-monospace, monospace; }

.m2-panel-cuaderno { position: relative; padding-left: clamp(62px, 8vw, 100px); background-color: #fffdf7; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 34px, #d9e4ee 35px); }
.m2-panel-cuaderno::before { content: ""; position: absolute; left: 48px; top: 0; bottom: 0; width: 2px; background: #e79b9b; }
.m2-cuaderno-cab { margin-bottom: 20px; }
.m2-cuaderno-cab span, .m2-check-cab > span { display: block; margin-bottom: 6px; color: #9a6500; font-size: .68rem; font-weight: 950; letter-spacing: .13em; }
.m2-panel-cuaderno ol { max-width: 980px; margin: 0; padding-left: 23px; }
.m2-panel-cuaderno li { min-height: 35px; padding: 3px 0 8px 8px; color: #293f56; line-height: 1.5; }
.m2-producto { display: grid; gap: 4px; max-width: 850px; margin-top: 22px; padding: 15px 17px; background: rgba(255,255,255,.82); border: 1px solid #ddc77e; border-left: 5px solid var(--m2-amber); border-radius: 7px; }
.m2-producto b { color: #7c5100; font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; }
.m2-producto span { color: #243c55; font-weight: 750; line-height: 1.45; }

.m2-panel-check { background: #f7f9fc; border-top: 4px solid var(--m2-blue); }
.m2-check-cab { margin-bottom: 24px; }
.m2-check-cab > span { color: var(--m2-blue); }
.m2-check-cab h3 { font-size: 1.35rem; }
.m2-check-cab p, .m2-instruccion { margin: 7px 0 0; color: var(--m2-muted); }
.m2-controles { max-width: 920px; }
.m2-campo small { justify-self: end; color: #6c7c8f; }
.m2-campo input:disabled, .m2-campo select:disabled, .m2-campo textarea:disabled { color: #526071; background: #eef1f5; }
.m2-acciones { display: flex; justify-content: space-between; gap: 12px; margin-top: 25px; padding-top: 20px; border-top: 1px solid #d8e0e9; }
.m2-error { min-height: 1.2em; margin: 6px 0; color: #b42318; font-size: .84rem; font-weight: 750; }

.m2-ruta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.m2-etapa { min-height: 80px; display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 10px; padding: 12px; color: var(--m2-ink); text-align: left; background: #fff; border: 1px solid #bfcbd8; border-radius: 8px; cursor: pointer; }
.m2-etapa b { display: grid; place-items: center; width: 30px; height: 30px; color: #fff; background: #6c7d91; border-radius: 5px; }
.m2-etapa span { font-weight: 800; }
.m2-etapa:hover { border-color: var(--m2-blue); }
.m2-etapa.seleccionada { border-color: var(--m2-blue); box-shadow: 0 0 0 3px rgba(20, 88, 214, .13); background: #edf4ff; }
.m2-etapa.seleccionada b { background: var(--m2-blue); }

.m2-timeline { display: grid; gap: 8px; margin: 4px 0 24px; padding: 18px; background: #0c2743; border-radius: 9px; }
.m2-barra { display: flex; align-items: center; min-height: 33px; padding: 6px 12px; color: #fff; background: linear-gradient(90deg, #1779ba, #1aa5ad); border-radius: 5px; font-size: .8rem; font-weight: 850; }
.m2-barra.b4 { width: 80%; }
.m2-barra.b3 { width: 60%; }
.m2-barra.b2 { width: 40%; }
.m2-dep { padding-top: 9px; color: #c9d9e8; border-top: 1px dashed #54718b; font-size: .8rem; }

.m2-feedback { margin-top: 20px; overflow: hidden; background: #fff; border: 1px solid #c9d4df; border-radius: 9px; }
.m2-feedback > div { display: flex; align-items: center; gap: 12px; padding: 14px 17px; color: #fff; background: #795a19; }
.m2-feedback.bien > div { background: var(--m2-good); }
.m2-feedback strong { font-size: 1.35rem; }
.m2-feedback > div span { font-weight: 800; }
.m2-feedback p { margin: 0; padding: 16px 18px 10px; color: #31465c; line-height: 1.6; }
.m2-feedback .m2-nota { padding: 9px 18px 16px; color: #725019; font-size: .84rem; }

.m2-guardando { min-height: calc(100vh - 100px); display: grid; place-content: center; justify-items: center; text-align: center; }
.m2-loader { width: 52px; height: 52px; border: 5px solid #cbd7e5; border-top-color: var(--m2-blue); border-radius: 50%; animation: m2giro .8s linear infinite; }
@keyframes m2giro { to { transform: rotate(360deg); } }
.m2-guardando h2 { margin: 20px 0 4px; }
.m2-guardando p { color: var(--m2-muted); }

.m2-resultado { width: min(1000px, calc(100% - 40px)); margin: 52px auto; display: grid; grid-template-columns: .9fr 1.1fr; overflow: hidden; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(15, 40, 65, .15); }
.m2-resultado-principal { padding: clamp(32px, 5vw, 60px); color: #fff; background: linear-gradient(145deg, #0a2745, #11466b); }
.m2-resultado-principal h2 { margin: 0; font-size: clamp(5rem, 11vw, 8.5rem); line-height: .9; letter-spacing: -.08em; }
.m2-resultado-principal h2 small { font-size: .25em; letter-spacing: 0; }
.m2-resultado-principal > p { color: #c9d9e7; font-weight: 750; }
.m2-resultado-principal .m2-duracion-final { margin-top: -4px; color: #8ee8e3; font-size: .82rem; font-weight: 700; }
.m2-evidencia { display: grid; gap: 6px; margin-top: 36px; padding: 17px; background: rgba(255,255,255,.08); border: 1px solid #416784; border-radius: 9px; }
.m2-evidencia span { color: #9fb5c9; font-size: .75rem; }
.m2-evidencia strong { font: 900 1.25rem ui-monospace, monospace; letter-spacing: .08em; }
.m2-evidencia button { justify-self: start; padding: 5px 9px; color: #fff; background: #1b6685; border: 0; border-radius: 4px; cursor: pointer; }
.m2-estado { padding: 12px; border-radius: 7px; font-size: .78rem; line-height: 1.45; }
.m2-estado.ok { color: #c7f5df; background: rgba(10,130,88,.2); }
.m2-estado.local { color: #ffe0a3; background: rgba(173,104,0,.22); }
.m2-entrega { padding: clamp(32px, 5vw, 60px); }
.m2-entrega h3 { margin: 0 0 20px; font-size: 1.55rem; }
.m2-entrega ol { padding-left: 22px; color: #3c5066; line-height: 1.75; }
.m2-acciones-finales { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

@media (max-width: 900px) {
    .acceso-menta02 { grid-template-columns: 62px 1fr; }
    .acceso-menta02__icono { width: 62px; height: 62px; }
    #abrirMenta02IA { grid-column: 1 / -1; width: 100%; }
    .m2-progreso { top: 90px; }
    .m2-registro, .m2-resultado { grid-template-columns: 1fr; }
    .m2-workspace { grid-template-columns: 1fr; }
    .m2-indice { position: static; display: grid; grid-template-columns: repeat(6, 1fr); overflow: auto; }
    .m2-indice div { display: block; min-width: 48px; padding: 7px; border: 0 !important; }
    .m2-indice span { display: none; }
    .m2-panel-teoria { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 620px) {
    .acceso-menta02 { grid-template-columns: 1fr; padding: 22px 18px; }
    .acceso-menta02__icono { width: 52px; height: 52px; border-radius: 13px; }
    #abrirMenta02IA { min-width: 0; }
    .m2-header { padding: 13px 15px; }
    .m2-header p { display: none; }
    .m2-progreso { top: 73px; }
    .m2-registro, .m2-workspace, .m2-resultado { width: calc(100% - 20px); margin-top: 15px; }
    .m2-portada, .m2-form-registro { padding: 28px 22px; }
    .m2-portada h2 { font-size: 2.4rem; }
    .m2-metodo { grid-template-columns: auto 1fr; }
    .m2-metodo i { display: none; }
    .m2-dos, .m2-comparacion, .m2-ruta { grid-template-columns: 1fr; }
    .m2-titulo-bloque, .m2-panel-teoria, .m2-panel-ejemplo, .m2-panel-check { padding: 25px 20px; }
    .m2-panel-cuaderno { padding: 26px 20px 26px 50px; }
    .m2-panel-cuaderno::before { left: 33px; }
    .m2-acciones { flex-direction: column-reverse; }
    .m2-acciones button { width: 100%; }
}

@media print {
    body > *:not(#menta02Overlay) { display: none !important; }
    .m2-overlay { position: static; display: block !important; background: #fff; }
    .m2-header, .m2-cerrar, .m2-acciones-finales { display: none !important; }
    .m2-resultado { width: 100%; margin: 0; box-shadow: none; border: 1px solid #bbb; }
}

.unidad-ia-bloque > .acceso-menta02 {
    grid-column: 1 / -1 !important;
    width: 100% !important;
}
