/* English Master v2 — Sistema de diseño + shell de navegación (css/v2-shell.css)
   Tema CLARO liquid-glass. Tokens únicos para toda la plataforma.
   REGLA: este archivo solo AÑADE estilos; no reescribe los selectores del
   motor (.v2-*) salvo la adaptación mínima al tema claro (sección 2). */

/* ============ 1. TOKENS ============ */
body.v2 {
  /* Azules del curso (intactos, de css/v2.css) */
  --em-blue: #4f7cff;
  --em-blue-deep: #1d5fd6;
  --em-blue-ink: #123f9e;
  --em-blue-soft: rgba(79, 124, 255, .12);

  /* Superficies claras */
  --em-bg0: #f4f8ff;
  --em-bg1: #e8f0fd;
  --em-glass: rgba(255, 255, 255, .66);
  --em-glass-strong: rgba(255, 255, 255, .88);
  --em-line: rgba(29, 95, 214, .14);
  --em-line-soft: rgba(29, 95, 214, .08);

  /* Texto */
  --em-ink: #15263f;
  --em-ink-soft: #33475f;
  --em-muted: #5d7194;

  /* Semánticos */
  --em-ok: #16a34a;
  --em-ok-soft: rgba(22, 163, 74, .12);
  --em-bad: #dc2626;
  --em-bad-soft: rgba(220, 38, 38, .10);
  --em-warn: #d97706;
  --em-warn-soft: rgba(217, 119, 6, .12);
  --em-purple: #7c3aed;
  --em-purple-soft: rgba(124, 58, 237, .12);

  /* Tipografías (las de la web: Inter UI + Fraunces display) */
  --em-font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --em-font-display: 'Fraunces', Georgia, 'Times New Roman', serif;

  --em-radius: 18px;
  --em-radius-sm: 12px;
  --em-shadow: 0 12px 34px rgba(29, 95, 214, .10);
  --em-shadow-sm: 0 4px 14px rgba(29, 95, 214, .08);
  --em-side-w: 268px;
}

/* ============ 2. ADAPTACIÓN AL TEMA CLARO (motor .v2-*) ============
   Solo remapea variables y toques mínimos para que la sesión, los
   ejercicios, el mapa y los exámenes se vean bien en claro. */
body.v2 {
  --v2-bg: var(--em-bg1);
  --v2-card: var(--em-glass);
  --v2-card2: var(--em-glass-strong);
  --v2-line: var(--em-line);
  --v2-txt: var(--em-ink);
  --v2-mut: var(--em-muted);
  --v2-acc: var(--em-blue);
  --v2-ok: var(--em-ok);
  --v2-bad: var(--em-bad);
  --v2-warn: var(--em-warn);
  font-family: var(--em-font-ui);
  color: var(--em-ink);
  background:
    radial-gradient(1100px 480px at 12% -4%, rgba(79, 124, 255, .14), transparent 60%),
    radial-gradient(900px 520px at 96% 8%, rgba(124, 180, 255, .16), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(79, 124, 255, .08), transparent 60%),
    linear-gradient(180deg, var(--em-bg0), var(--em-bg1));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
body.v2 .v2-card {
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: var(--em-shadow-sm);
}
body.v2 .v2-opt.sel, body.v2 .v2-chip.sel {
  background: rgba(79, 124, 255, .16);
  border-color: var(--em-blue);
}
body.v2 .v2-input { background: #fff; }
body.v2 .v2-meta { background: rgba(79, 124, 255, .08); }
body.v2 .v2-prog { background: rgba(29, 95, 214, .12); }
body.v2 .v2-toast {
  background: #fff;
  box-shadow: 0 12px 34px rgba(21, 38, 63, .18);
}
body.v2 .v2-clase, body.v2 .v2-dia, body.v2 .v2-ej,
body.v2 .v2-step, body.v2 .v2-audio, body.v2 .v2-check,
body.v2 .v2-err, body.v2 .v2-kpi .k, body.v2 .v2-flash,
body.v2 .v2-lectura, body.v2 .v2-read {
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
}
/* El topbar viejo del motor se oculta cuando el shell está montado
   (sigue en el DOM por compatibilidad: #v2-salir, .v2-nav). */
body.em-on .v2-topbar { display: none !important; }
body.em-on .wrap {
  max-width: 1180px;
  padding-left: 26px;
  padding-right: 26px;
}

/* ============ 3. LAYOUT DEL SHELL ============ */
#em-shell {
  display: grid;
  grid-template-columns: var(--em-side-w) minmax(0, 1fr);
  min-height: 100vh;
}
.em-side {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #1663d9 0%, #0d47a8 62%, #0a3580 100%);
  color: #fff;
  z-index: 60;
  box-shadow: 8px 0 30px rgba(13, 71, 168, .25);
}
.em-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 16px;
  color: #fff;
  text-decoration: none;
}
.em-brand img { width: 40px; height: 40px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
.em-brand b { display: block; font-size: 18px; letter-spacing: -.01em; line-height: 1.1; }
.em-brand span { display: block; font-size: 11.5px; opacity: .75; font-weight: 500; }
.em-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.3) transparent;
}
.em-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  color: rgba(255, 255, 255, .88);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  transition: background .18s ease, color .18s ease, transform .18s ease;
  position: relative;
}
.em-nav a svg { width: 20px; height: 20px; flex: none; opacity: .92; }
.em-nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; transform: translateX(2px); }
.em-nav a.on {
  background: rgba(255, 255, 255, .20);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 16px rgba(0,0,0,.18);
}
.em-nav a.on::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 4px;
  background: #fff;
}
.em-nav a .em-count {
  margin-left: auto;
  background: #ff5a5a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.em-side-foot { padding: 12px 14px 18px; border-top: 1px solid rgba(255,255,255,.16); display: grid; gap: 6px; }
.em-admin-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  border: 1px dashed rgba(255,255,255,.45);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: background .18s ease, transform .18s ease;
}
.em-admin-link:hover { background: rgba(255,255,255,.24); transform: translateY(-1px); }
.em-admin-link svg { width: 18px; height: 18px; }
.em-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: none;
  border: 0;
  color: rgba(255,255,255,.85);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background .18s ease;
}
.em-logout:hover { background: rgba(255,255,255,.10); color: #fff; }
.em-logout svg { width: 18px; height: 18px; }

.em-main { min-width: 0; display: flex; flex-direction: column; }
.em-top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 26px;
  background: rgba(244, 248, 255, .78);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--em-line-soft);
}
.em-burger {
  display: none;
  background: var(--em-glass-strong);
  border: 1px solid var(--em-line);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--em-ink);
}
.em-burger svg { width: 20px; height: 20px; }
.em-page-title {
  font-family: var(--em-font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.em-search { position: relative; margin-left: auto; width: min(340px, 32vw); }
.em-search input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border-radius: 999px;
  border: 1px solid var(--em-line);
  background: var(--em-glass-strong);
  font-family: inherit;
  font-size: 14px;
  color: var(--em-ink);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.em-search input:focus { border-color: var(--em-blue); box-shadow: 0 0 0 3px rgba(79,124,255,.18); }
.em-search > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--em-muted); }
.em-search-drop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--em-line);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(21, 38, 63, .16);
  overflow: hidden;
  z-index: 80;
}
.em-search-drop a {
  display: block;
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--em-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--em-line-soft);
}
.em-search-drop a:last-child { border-bottom: 0; }
.em-search-drop a:hover { background: var(--em-blue-soft); }
.em-search-drop small { color: var(--em-muted); display: block; font-size: 11.5px; }
.em-bell {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--em-line);
  background: var(--em-glass-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--em-ink-soft);
  transition: transform .18s ease, box-shadow .18s ease;
  text-decoration: none;
  flex: none;
}
.em-bell:hover { transform: translateY(-1px); box-shadow: var(--em-shadow-sm); }
.em-bell svg { width: 19px; height: 19px; }
.em-bell .n {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff5a5a;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  min-width: 19px;
  height: 19px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--em-bg0);
}
.em-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  text-decoration: none;
  color: inherit;
}
.em-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--em-blue), #7aa2ff);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(79, 124, 255, .35);
  border: 2px solid #fff;
  flex: none;
}
.em-user b { display: block; font-size: 14px; line-height: 1.2; }
.em-user span { display: block; font-size: 12px; color: var(--em-muted); }

.em-content { padding: 26px 0 60px; flex: 1; }
.em-foot {
  padding: 18px 26px 26px;
  color: var(--em-muted);
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
body.em-on .footer { border: 0; background: none; }

/* Overlay móvil */
.em-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 60, .45);
  backdrop-filter: blur(2px);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
body.em-side-open .em-scrim { opacity: 1; pointer-events: auto; }

/* ============ 4. COMPONENTES ============ */
.em-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--em-radius);
  padding: 30px 32px;
  margin: 0 0 22px;
  background: linear-gradient(120deg, rgba(255,255,255,.85), rgba(214,231,255,.75));
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: var(--em-shadow);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.em-hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(79,124,255,.28), transparent 65%);
  pointer-events: none;
}
.em-hero .kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--em-blue-deep);
  margin-bottom: 8px;
}
.em-hero h1 {
  font-family: var(--em-font-display);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  letter-spacing: -.015em;
  margin: 0 0 8px;
  color: var(--em-ink);
}
.em-hero h1 .hl { color: var(--em-blue-deep); }
.em-hero p { margin: 0; color: var(--em-ink-soft); font-size: 15.5px; max-width: 60ch; }

.em-grid { display: grid; gap: 16px; }
.em-grid.stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.em-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.em-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.em-grid.quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.em-card {
  background: var(--em-glass);
  border: 1px solid rgba(255, 255, 255, .85);
  outline: 1px solid var(--em-line-soft);
  border-radius: var(--em-radius);
  padding: 20px 22px;
  box-shadow: var(--em-shadow-sm);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  transition: transform .22s ease, box-shadow .22s ease;
  min-width: 0;
}
.em-card.hoverable:hover { transform: translateY(-3px); box-shadow: var(--em-shadow); }
.em-card h2 {
  font-family: var(--em-font-display);
  font-size: 19px;
  margin: 0 0 4px;
  letter-spacing: -.01em;
}
.em-card h3 { font-size: 15.5px; margin: 0 0 6px; }
.em-card .sub { font-size: 13px; color: var(--em-muted); margin: 0 0 12px; }
.em-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.em-card-head h2 { margin: 0; }
.em-link { font-size: 13px; font-weight: 700; color: var(--em-blue-deep); text-decoration: none; white-space: nowrap; }
.em-link:hover { text-decoration: underline; }

.em-stat { display: flex; gap: 14px; align-items: flex-start; }
.em-stat .ic {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.em-stat .ic svg { width: 24px; height: 24px; }
.em-stat .ic.blue { background: var(--em-blue-soft); color: var(--em-blue-deep); }
.em-stat .ic.green { background: var(--em-ok-soft); color: var(--em-ok); }
.em-stat .ic.purple { background: var(--em-purple-soft); color: var(--em-purple); }
.em-stat .ic.orange { background: var(--em-warn-soft); color: var(--em-warn); }
.em-stat .ic.red { background: var(--em-bad-soft); color: var(--em-bad); }
.em-stat .lb { display: block; font-size: 13px; color: var(--em-muted); font-weight: 500; }
.em-stat .vl { display: block; font-size: 27px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.em-stat .ft { display: block; font-size: 12.5px; font-weight: 600; }
.em-stat .ft.blue { color: var(--em-blue-deep); }
.em-stat .ft.green { color: var(--em-ok); }
.em-stat .ft.purple { color: var(--em-purple); }
.em-stat .ft.orange { color: var(--em-warn); }
.em-stat .ft.red { color: var(--em-bad); }

.em-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, #5d87ff, var(--em-blue));
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 11px 20px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(79, 124, 255, .32);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.em-btn:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 12px 26px rgba(79,124,255,.4); }
.em-btn:active { transform: translateY(0); }
.em-btn.ghost {
  background: var(--em-glass-strong);
  color: var(--em-blue-deep);
  border: 1px solid var(--em-line);
  box-shadow: none;
}
.em-btn.ghost:hover { box-shadow: var(--em-shadow-sm); }
.em-btn:disabled { opacity: .5; cursor: default; transform: none; }
.em-btn svg { width: 17px; height: 17px; }

.em-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.em-badge.ok { background: var(--em-ok-soft); color: var(--em-ok); }
.em-badge.info { background: var(--em-blue-soft); color: var(--em-blue-deep); }
.em-badge.warn { background: var(--em-warn-soft); color: var(--em-warn); }
.em-badge.mut { background: rgba(93, 113, 148, .12); color: var(--em-muted); }
.em-badge.bad { background: var(--em-bad-soft); color: var(--em-bad); }

.em-bar { height: 9px; border-radius: 6px; background: rgba(29, 95, 214, .12); overflow: hidden; }
.em-bar > i {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--em-blue), #7aa2ff);
  width: 0;
  transition: width .8s cubic-bezier(.2, .8, .25, 1);
}
.em-bar > i.green { background: linear-gradient(90deg, #16a34a, #4ade80); }

.em-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.em-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--em-muted);
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 1px solid var(--em-line);
}
.em-table td { padding: 10px; border-bottom: 1px solid var(--em-line-soft); vertical-align: middle; }
.em-table tr:last-child td { border-bottom: 0; }
.em-table tbody tr { transition: background .15s ease; }
.em-table tbody tr:hover { background: rgba(79, 124, 255, .05); }

.em-aviso { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--em-line-soft); align-items: flex-start; }
.em-aviso:last-child { border-bottom: 0; }
.em-aviso .ic {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: var(--em-blue-soft); color: var(--em-blue-deep);
  display: inline-flex; align-items: center; justify-content: center;
}
.em-aviso .ic svg { width: 20px; height: 20px; }
.em-aviso b { display: block; font-size: 14.5px; }
.em-aviso p { margin: 3px 0; font-size: 13.5px; color: var(--em-ink-soft); }
.em-aviso time { font-size: 12px; color: var(--em-blue-deep); font-weight: 600; }

.em-cal { width: 100%; border-collapse: collapse; font-size: 13px; text-align: center; }
.em-cal th { font-size: 11px; color: var(--em-muted); font-weight: 700; padding: 6px 2px; text-transform: uppercase; }
.em-cal td { padding: 3px 2px; }
.em-cal .d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  position: relative;
}
.em-cal .d.dim { color: #a9b7d0; }
.em-cal .d.today { background: var(--em-blue); color: #fff; font-weight: 800; }
.em-cal .d.hit::after {
  content: "";
  position: absolute;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--em-ok);
}
.em-cal .d.today.hit::after { background: #fff; }
.em-cal-title { font-family: var(--em-font-display); font-size: 16px; font-weight: 700; }
.em-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.em-cal-nav button {
  border: 1px solid var(--em-line);
  background: var(--em-glass-strong);
  border-radius: 9px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  color: var(--em-ink);
  font-size: 15px;
  line-height: 1;
}

.em-quick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: var(--em-radius-sm);
  background: var(--em-glass-strong);
  border: 1px solid var(--em-line-soft);
  text-decoration: none;
  color: var(--em-ink);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.em-quick:hover { transform: translateY(-3px); box-shadow: var(--em-shadow); }
.em-quick .ic {
  width: 46px; height: 46px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.em-quick .ic svg { width: 22px; height: 22px; }

.em-donut { display: flex; gap: 18px; align-items: center; }
.em-donut svg { flex: none; }
.em-legend { list-style: none; margin: 0; padding: 0; font-size: 13.5px; display: grid; gap: 6px; flex: 1; }
.em-legend li { display: flex; align-items: center; gap: 8px; }
.em-legend .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.em-legend b { margin-left: auto; }

.em-nivel-head { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 12px; flex-wrap: wrap; }
.em-nivel-head h2 { font-family: var(--em-font-display); font-size: 22px; margin: 0; letter-spacing: -.01em; }
.em-mod-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.em-mod { text-decoration: none; color: inherit; display: block; }
.em-mod .num {
  width: 52px; height: 52px; border-radius: 16px; flex: none;
  background: linear-gradient(135deg, var(--em-blue), #7aa2ff);
  color: #fff; font-weight: 800; font-size: 19px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(79, 124, 255, .3);
}
.em-mod.locked .num { background: linear-gradient(135deg, #9fb0c9, #7d90ad); box-shadow: none; }
.em-mod.done .num { background: linear-gradient(135deg, #16a34a, #4ade80); box-shadow: 0 8px 18px rgba(22,163,74,.3); }
.em-mod-top { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.em-mod-top b { display: block; font-size: 15.5px; line-height: 1.3; }
.em-mod-top small { color: var(--em-muted); font-size: 12.5px; font-weight: 600; }
.em-mod-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; font-weight: 700; }

.em-tool { display: flex; gap: 14px; align-items: flex-start; }
.em-tool .ic {
  width: 50px; height: 50px; border-radius: 15px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--em-blue-soft); color: var(--em-blue-deep);
}
.em-tool .ic svg { width: 24px; height: 24px; }
.em-tool.locked .ic { background: rgba(93,113,148,.12); color: var(--em-muted); }
.em-tool b { display: block; font-size: 15px; margin-bottom: 2px; }
.em-tool p { margin: 0 0 8px; font-size: 13px; color: var(--em-muted); }

.em-kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 14px; }
.em-kv dt { color: var(--em-muted); font-weight: 600; }
.em-kv dd { margin: 0; font-weight: 600; }

.em-pdf-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--em-line-soft);
  text-decoration: none;
  color: inherit;
  transition: background .15s ease;
  border-radius: 10px;
}
.em-pdf-row:hover { background: rgba(79, 124, 255, .06); }
.em-pdf-row:last-child { border-bottom: 0; }
.em-pdf-row .ic {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: var(--em-bad-soft); color: var(--em-bad);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px;
}
.em-pdf-row b { display: block; font-size: 14px; }
.em-pdf-row small { color: var(--em-muted); font-size: 12.5px; }
.em-pdf-row .go { margin-left: auto; color: var(--em-blue-deep); font-weight: 700; font-size: 13px; white-space: nowrap; }

.em-empty { text-align: center; padding: 34px 16px; color: var(--em-muted); font-size: 14px; }
.em-empty .big { font-size: 40px; display: block; margin-bottom: 10px; }

/* Skeleton / shimmer */
.em-skel {
  position: relative;
  overflow: hidden;
  background: rgba(29, 95, 214, .08);
  border-radius: 8px;
  min-height: 14px;
}
.em-skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.75) 50%, transparent 80%);
  animation: em-shimmer 1.4s infinite;
}
@keyframes em-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ============ 5. ANIMACIONES FLUIDAS ============ */
#v2-view.em-enter { animation: em-view-in .38s cubic-bezier(.2, .8, .25, 1); }
@keyframes em-view-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.em-side { transition: transform .3s cubic-bezier(.2, .8, .25, 1); }
.em-nav a { will-change: transform; }
.em-card.hoverable, .em-quick, .em-mod { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  #v2-view.em-enter { animation: none; }
}

/* ============ 6. RESPONSIVE ============ */
@media (max-width: 1180px) {
  .em-grid.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .em-mod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  #em-shell { grid-template-columns: minmax(0, 1fr); }
  .em-side {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: min(300px, 84vw);
    transform: translateX(-105%);
    height: 100dvh;
  }
  body.em-side-open .em-side { transform: translateX(0); }
  .em-burger { display: inline-flex; }
  .em-search { width: 100%; max-width: 260px; }
  .em-user .em-user-txt { display: none; }
}
@media (max-width: 760px) {
  .em-grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .em-grid.cols-2, .em-grid.cols-3, .em-mod-grid, .em-grid.quick { grid-template-columns: minmax(0, 1fr); }
  .em-top { padding: 10px 14px; gap: 10px; }
  .em-page-title { font-size: 18px; }
  .em-search { display: none; }
  body.em-on #v2-view.wrap { padding-left: 14px; padding-right: 14px; }
  .em-hero { padding: 22px 20px; }
  .em-kv { grid-template-columns: 1fr; gap: 2px; }
  .em-kv dt { margin-top: 8px; }
  .em-table { font-size: 13px; }
  .em-foot { padding: 14px; }
}

/* ===== Rediseño de vistas (tareas 1–3) ===== */

/* Regla global: los enlaces de navegación del sistema no llevan subrayado */
#em-shell a, #em-shell a:hover { text-decoration: none; }

/* Botón pequeño del sistema (para reemplazar enlaces de texto de navegación) */
.em-btn.sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }

/* Tarjetas resumen de la vista de clase */
.em-sum-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 4px 0; }
.em-sum-grid .vl small { font-size: 15px; font-weight: 600; color: var(--em-muted); }
.em-sum-sub { margin: 8px 0 0; font-size: 13px; color: var(--em-muted); }

/* Rejilla de días de la clase (tarjetas) */
.em-dia-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 14px; }
.em-dia {
  display: flex; flex-direction: column; gap: 8px; padding: 14px; min-height: 152px;
  background: var(--em-glass); border: 1px solid var(--em-line-soft);
  border-radius: var(--em-radius); color: inherit;
  transition: transform .18s ease, box-shadow .18s ease;
}
a.em-dia:hover { transform: translateY(-3px); box-shadow: var(--em-shadow); }
.em-dia-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.em-dia-num {
  font-size: 12.5px; font-weight: 800; color: var(--em-muted);
  background: rgba(93, 113, 148, .12); padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.em-dia-ic {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  background: rgba(93, 113, 148, .12); color: var(--em-muted);
}
.em-dia.done .em-dia-ic { background: var(--em-ok-soft); color: var(--em-ok); }
.em-dia.cur .em-dia-ic { background: var(--em-blue-soft); color: var(--em-blue-deep); }
.em-dia-t { font-size: 14px; line-height: 1.35; }
.em-dia-tm { font-size: 12.5px; color: var(--em-muted); font-weight: 600; margin-top: auto; }
.em-dia-st { font-size: 13px; font-weight: 800; }
.em-dia-st.ok { color: var(--em-ok); }
.em-dia-st.info { color: var(--em-blue-deep); }
.em-dia-st.mut { color: var(--em-muted); }
.em-dia.locked { opacity: .78; cursor: default; }
.em-dia.locked .em-dia-t { color: var(--em-muted); }

/* Buscador: resultados como filas del sistema */
.em-search-drop a { display: flex; align-items: center; gap: 10px; }
.em-search-drop a .sr { flex: 1; min-width: 0; }
.em-search-drop a .sr-go { color: var(--em-blue-deep); font-weight: 800; font-size: 17px; flex: none; }

/* Descargas: botón de apertura dentro de la fila */
.em-pdf-row .em-pdf-open { margin-left: auto; flex: none; }

@media (max-width: 1280px) {
  .em-dia-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .em-dia-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .em-sum-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ===== 7. INTERIORES DEL DÍA (ejercicios · juegos · tests · PDFs) =====
   Solo añadidos: el sistema existente (secciones 1–6) no se toca.
   Nota: el volteo 3D de flashcards lo cubre el CSS inyectado por
   ensureFlashCSS() en js/v2/sesion.js (perspective + preserve-3d +
   backface-visibility): está completo y no se duplica aquí. */

/* Tarjeta de ejercicio (pregunta): glass interior, anidable en em-card */
body.v2 .em-ej {
  padding: 16px 18px;
  margin: 12px 0;
  background: var(--em-glass);
  border: 1px solid var(--em-line-soft);
  border-radius: var(--em-radius-sm);
  box-shadow: var(--em-shadow-sm);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
}
body.v2 .em-ej .consigna { font-size: 16px; font-weight: 700; line-height: 1.5; color: var(--em-ink); margin-bottom: 10px; }
body.v2 .em-ej .consigna .em-badge { margin-left: 8px; vertical-align: middle; }

/* Opciones como botones del sistema (em-btn ghost, ancho completo) */
body.v2 .em-opt {
  display: flex; width: 100%; justify-content: flex-start; align-items: center;
  text-align: left; white-space: normal; gap: 8px;
  margin: 8px 0; padding: 12px 16px; font-size: 15px; font-weight: 600; line-height: 1.4;
}
body.v2 .em-opt.sel { border-color: var(--em-blue); background: var(--em-blue-soft); box-shadow: none; }
body.v2 .em-opt.ok { border-color: var(--em-ok); background: var(--em-ok-soft); color: var(--em-ink); box-shadow: none; }
body.v2 .em-opt.bad { border-color: var(--em-bad); background: var(--em-bad-soft); color: var(--em-ink); box-shadow: none; }

/* Chips (ordenar, encontrar-error, letras) como botones pequeños del sistema */
body.v2 .em-chip { margin: 4px; }
body.v2 .v2-chip.em-chip.sel { border-color: var(--em-blue); background: var(--em-blue-soft); box-shadow: none; }
body.v2 .v2-chip.em-chip.ok { border-color: var(--em-ok); background: var(--em-ok-soft); box-shadow: none; }
body.v2 .v2-chip.em-chip.bad { border-color: var(--em-bad); background: var(--em-bad-soft); box-shadow: none; }

/* Tarjeta de feedback/explicación */
body.v2 .em-fb {
  margin-top: 12px; padding: 14px 16px;
  border-radius: var(--em-radius-sm);
  background: var(--em-glass-strong);
  border: 1px solid var(--em-line-soft);
  box-shadow: var(--em-shadow-sm);
  font-size: 14.5px; line-height: 1.55;
}
body.v2 .em-fb.ok { border-color: var(--em-ok); background: linear-gradient(180deg, var(--em-ok-soft), rgba(255,255,255,.72)); }
body.v2 .em-fb.bad { border-color: var(--em-bad); background: linear-gradient(180deg, var(--em-bad-soft), rgba(255,255,255,.72)); }
body.v2 .em-fb .resp { font-weight: 800; margin-top: 8px; }

/* Tests: barra de progreso + pantalla de resultado con nota */
body.v2 .em-test-prog { margin: 12px 0 4px; }
body.v2 .em-test-prog .em-bar { margin-bottom: 8px; }
body.v2 .em-test-count { font-weight: 600; }
body.v2 .em-test-result {
  margin-top: 14px; padding: 26px 20px; text-align: center;
  border-radius: var(--em-radius);
  background: var(--em-glass);
  border: 1px solid var(--em-line-soft);
  box-shadow: var(--em-shadow-sm);
}
body.v2 .em-test-result h3 { font-family: var(--em-font-display); font-size: 22px; margin: 0 0 8px; }
body.v2 .em-test-grade { font-size: 54px; font-weight: 800; color: var(--em-blue-deep); letter-spacing: -.02em; line-height: 1; margin: 8px 0 4px; }
body.v2 .em-test-grade small { font-size: 24px; color: var(--em-muted); font-weight: 700; }
body.v2 .em-test-result.low .em-test-grade { color: var(--em-warn); }
body.v2 .em-test-result p { font-size: 15px; color: var(--em-ink-soft); }
body.v2 .em-test-result .v2-tip { text-align: left; margin: 12px 0; }
body.v2 .em-test-result .v2-btn { margin-top: 12px; }

/* Juegos: pantalla en tarjeta glass, marcador visible, resultado */
body.v2 .em-game { padding: 24px; margin: 14px 0; text-align: center; }
body.v2 .em-game h2 { font-family: var(--em-font-display); font-size: 24px; margin: 0 0 6px; }
body.v2 .em-game .v2-mut { margin: 0 0 14px; }
body.v2 .em-game .consigna { font-size: 17px; font-weight: 700; margin: 10px 0; }
body.v2 .v2-timer {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 64px; padding: 8px 18px; margin-bottom: 10px;
  border-radius: 999px; font-size: 26px; font-weight: 800; color: var(--em-warn);
  background: var(--em-warn-soft); border: 1px solid rgba(217,119,6,.3);
}
body.v2 .em-game-prog {
  display: inline-block; font-size: 13px; font-weight: 700; color: var(--em-muted);
  background: rgba(93,113,148,.12); border-radius: 999px; padding: 6px 14px; margin-bottom: 12px;
}
body.v2 .em-game-result {
  margin-top: 16px; padding: 22px 18px;
  border-radius: var(--em-radius-sm);
  background: var(--em-glass-strong);
  border: 1px solid var(--em-line-soft);
}
body.v2 .em-game-result h3 { font-family: var(--em-font-display); font-size: 21px; margin: 0 0 8px; }
body.v2 .em-game-result p { margin: 6px 0 0; font-size: 15px; }
body.v2 .em-game .v2-opts { text-align: left; }

/* Cartas del juego de memoria */
body.v2 .em-mem {
  display: inline-flex; align-items: center; justify-content: center;
  aspect-ratio: 1; margin: 0; padding: 8px;
  font-size: 16px; font-weight: 700;
  border-radius: var(--em-radius-sm);
}
body.v2 .em-mem.ok { border-color: var(--em-ok); background: var(--em-ok-soft); color: var(--em-ink); box-shadow: none; }

/* PDFs del día: filas del sistema en lista glass (igual que Descargas) */
body.v2 .em-pdf-list { display: grid; gap: 10px; margin: 14px 0; }
body.v2 .em-pdf-list .em-pdf-row {
  background: var(--em-glass);
  border: 1px solid var(--em-line-soft);
  border-radius: var(--em-radius-sm);
  padding: 14px 16px;
  box-shadow: var(--em-shadow-sm);
}
body.v2 .em-pdf-list .em-pdf-row:last-child { border-bottom: 1px solid var(--em-line-soft); }
