/* ==========================================================================
   Zona de Riesgo Academy — Sistema de diseño
   Tokens en :root, modo oscuro con [data-theme="dark"]. Mobile-first.
   ========================================================================== */
:root {
  /* Manual de identidad Zona de Riesgo: amarillo #FBBA07 (C0 M30 Y94 K0) y negro #000000; grises de apoyo #A7A5A5 y #E8E8E8.
     --brand rellena; --brand-ink es el tono del amarillo apto para texto sobre blanco (contraste AA). */
  --brand: #fbba07; --brand-600: #e5a800; --brand-50: #fff6d9; --brand-ink: #8a6400; --on-brand: #000000; --ink: #000000; --grey: #a7a5a5; --grey-light: #e8e8e8;
  --blue: #1d6fb8; --blue-50: #e8f1fa;
  --warn: #b77700; --warn-bg: #fff4d6; --danger: #c0392b; --danger-bg: #fdecea; --ok: #1e8449; --ok-bg: #e6f4ea;
  --bg: #f4f4f2; --surface: #ffffff; --surface-2: #f2f1ec; --border: #e0dfda;
  --text: #0a0a0a; --muted: #5b5a55; --shadow: 0 1px 2px rgba(16,40,32,.06), 0 4px 16px rgba(16,40,32,.06);
  --radius: 14px; --radius-sm: 8px; --sidebar: 268px;
  --font-head: Impact, "Anton", "Arial Narrow Bold", sans-serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --brand: #fbba07; --brand-600: #ffcc3d; --brand-50: #2a2208; --brand-ink: #fbba07; --on-brand: #000000; --ink: #000000; --grey: #a7a5a5; --grey-light: #2a2a27;
  --blue: #6aaee8; --blue-50: #142636;
  --warn: #f2c14e; --warn-bg: #3a2f10; --danger: #ff7b6e; --danger-bg: #3d1a17; --ok: #5ed38a; --ok-bg: #133222;
  --bg: #000000; --surface: #121211; --surface-2: #1d1d1b; --border: #2a2a27;
  --text: #f2f1ec; --muted: #a7a5a5; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--on-brand); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---------- Botones y formularios ---------- */
.btn { display: inline-flex; align-items: center; gap: .45rem; justify-content: center; border: 1px solid transparent; background: var(--brand); color: var(--on-brand); padding: .6rem 1rem; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; min-height: 40px; transition: background .15s, transform .05s; }
.btn.dark { background: var(--ink); color: var(--brand); } .btn.dark:hover { background: #1d1d1b; }
.btn:hover { background: var(--brand-600); } .btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ai { background: linear-gradient(135deg, #6c4ee0, #1d6fb8); color: #fff; }
.btn.sm { padding: .35rem .7rem; min-height: 32px; font-size: .85rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { background: transparent; border: 1px solid transparent; color: var(--text); border-radius: 10px; width: 40px; height: 40px; display: inline-grid; place-items: center; cursor: pointer; font-size: 1.15rem; position: relative; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .75rem; min-height: 42px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.field { margin-bottom: .9rem; }
.row { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .row.cols-2 { grid-template-columns: 1fr 1fr; } .row.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: auto; min-height: auto; }

/* ---------- Tarjetas y layout ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem; }
.card + .card { margin-top: 1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid.kpis { grid-template-columns: repeat(2, 1fr); }
.grid.courses { grid-template-columns: 1fr; }
.grid.two { grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid.kpis { grid-template-columns: repeat(4, 1fr); } .grid.courses { grid-template-columns: repeat(2, 1fr); } .grid.two { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .grid.courses { grid-template-columns: repeat(3, 1fr); } .grid.main-side { grid-template-columns: 2fr 1fr; } }
.page { padding: 1rem; max-width: 1240px; margin: 0 auto; }
@media (min-width: 720px) { .page { padding: 1.5rem; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head p { margin: 0; }
.stack > * + * { margin-top: 1rem; }

/* KPI */
.kpi { display: flex; gap: .8rem; align-items: center; }
.kpi .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--brand-50); flex: none; }
.kpi .val { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.kpi .lbl { font-size: .8rem; color: var(--muted); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.badge.info { background: var(--blue-50); color: var(--blue); border-color: transparent; }
.badge.brand { background: var(--brand-50); color: var(--brand-ink); border-color: transparent; }

/* ---------- Progreso ---------- */
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .5s; }
.ring { --p: 0; --size: 120px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--surface-2) 0); flex: none; }
.ring::before { content: ""; grid-area: 1/1; width: calc(var(--size) - 22px); height: calc(var(--size) - 22px); border-radius: 50%; background: var(--surface); }
.ring > div { grid-area: 1/1; text-align: center; z-index: 1; }
.ring strong { font-size: 1.5rem; display: block; line-height: 1; }
.ring.sm { --size: 64px; } .ring.sm strong { font-size: 1rem; } .ring.sm::before { width: calc(var(--size) - 12px); height: calc(var(--size) - 12px); }

/* ---------- Tarjeta de curso ---------- */
.course-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; transition: transform .15s, box-shadow .15s; }
.course-card:hover { transform: translateY(-2px); }
.course-cover { height: 96px; display: flex; align-items: flex-end; justify-content: space-between; padding: .75rem 1rem; color: #fff; font-size: 2.2rem; position: relative; }
.course-cover .badge { background: rgba(255,255,255,.92); color: #13201c; border: 0; font-size: .72rem; }
.course-body { padding: 1rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.course-body h3 { margin: 0; }
.course-meta { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .8rem; color: var(--muted); }
.course-foot { margin-top: auto; display: flex; gap: .5rem; align-items: center; justify-content: space-between; }

/* ---------- Navbar estudiante ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: .5rem; padding: .5rem 1rem; min-height: 60px; }
.logo { display: flex; align-items: center; gap: .5rem; font-weight: 800; color: var(--text); text-decoration: none; font-size: 1rem; white-space: nowrap; }
.logo .mark { width: 36px; height: 36px; border-radius: 9px; background: var(--ink); display: grid; place-items: center; color: var(--brand); font-size: .95rem; font-weight: 900; letter-spacing: -.04em; border: 2px solid var(--brand); }
.logo small { display: block; font-weight: 500; color: var(--muted); font-size: .7rem; }
.nav-links { display: none; gap: .25rem; margin-left: 1rem; }
.nav-links a { color: var(--muted); text-decoration: none; padding: .45rem .75rem; border-radius: 8px; font-weight: 600; font-size: .92rem; }
.nav-links a:hover { background: var(--surface-2); color: var(--text); }
.nav-links a.active { color: var(--brand-ink); background: var(--brand-50); }
.spacer { flex: 1; }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(4, 1fr); }
.bottom-nav a { text-align: center; padding: .45rem 0 .55rem; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 600; }
.bottom-nav a span { display: block; font-size: 1.2rem; }
.bottom-nav a.active { color: var(--brand-ink); }
.student-main { padding-bottom: 70px; }
@media (min-width: 820px) { .nav-links { display: flex; } .bottom-nav { display: none; } .student-main { padding-bottom: 0; } }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; font-weight: 800; font-size: .85rem; flex: none; }
.dot { position: absolute; top: 6px; right: 6px; min-width: 17px; height: 17px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .65rem; font-weight: 800; display: grid; place-items: center; padding: 0 3px; }

/* ---------- Layout admin con sidebar colapsable ---------- */
.admin-shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--border); padding: .75rem; transform: translateX(-100%); transition: transform .2s, width .2s; z-index: 40; display: flex; flex-direction: column; gap: .25rem; overflow-y: auto; }
.sidebar.open { transform: none; box-shadow: var(--shadow); }
.sidebar .logo { padding: .5rem; margin-bottom: .5rem; }
.side-link { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.side-link .i { font-size: 1.1rem; width: 1.4rem; text-align: center; flex: none; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link.active { background: var(--brand-50); color: var(--brand-ink); }
.side-sep { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .8rem .7rem .3rem; }
.admin-top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .5rem; padding: .5rem 1rem; min-height: 60px; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; display: none; }
.scrim.show { display: block; }
@media (min-width: 1000px) {
  .sidebar { transform: none; }
  .admin-shell { grid-template-columns: var(--sidebar) 1fr; }
  .admin-shell.collapsed { grid-template-columns: 72px 1fr; }
  .admin-shell.collapsed .sidebar { width: 72px; }
  .admin-shell.collapsed .side-link .t, .admin-shell.collapsed .side-sep, .admin-shell.collapsed .logo-text { display: none; }
  .admin-shell.collapsed .side-link { justify-content: center; }
  .admin-content { grid-column: 2; }
  .scrim { display: none !important; }
}

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; flex: 1; max-width: 320px; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8,20,16,.55); display: grid; place-items: center; z-index: 60; padding: 1rem; animation: fade .15s; }
.modal { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); border: 1px solid var(--border); }
.modal.lg { max-width: 960px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 1.2rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.2rem; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
@keyframes fade { from { opacity: 0; } }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 1rem; bottom: 80px; z-index: 80; display: flex; flex-direction: column; gap: .5rem; }
@media (min-width: 820px) { .toasts { bottom: 1rem; } }
.toast { background: var(--text); color: var(--bg); padding: .7rem 1rem; border-radius: 10px; box-shadow: var(--shadow); max-width: 340px; animation: fade .2s; font-weight: 500; }
.toast.error { background: var(--danger); color: #fff; } .toast.success { background: var(--ok); color: #fff; }

/* ---------- Notificaciones / alertas ---------- */
.dropdown { position: absolute; right: 0; top: 48px; width: min(360px, 92vw); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.18); z-index: 50; max-height: 70vh; overflow: auto; }
.notif { display: flex; gap: .7rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.notif.unread { background: var(--brand-50); }
.notif .n-ico { font-size: 1.15rem; }
.notif p { margin: 0; font-size: .85rem; color: var(--muted); }
.alert { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .85rem; border-radius: 10px; border-left: 4px solid var(--blue); background: var(--blue-50); }
.alert.warn { border-color: var(--warn); background: var(--warn-bg); }
.alert.danger { border-color: var(--danger); background: var(--danger-bg); }
.alert.ok { border-color: var(--ok); background: var(--ok-bg); }
.alert + .alert { margin-top: .5rem; }
.alert .t { font-weight: 700; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-hero { display: none; background: #000; color: #fff; position: relative; overflow: hidden; padding: 3rem; flex-direction: column; justify-content: space-between; }
.auth-hero h1 { font-size: 2.2rem; }
.auth-hero ul { padding-left: 1.1rem; } .auth-hero li { margin-bottom: .4rem; }
.auth-form { display: grid; place-items: center; padding: 1.5rem 1rem; }
.auth-form .card { width: 100%; max-width: 420px; padding: 1.6rem; }
.tabs { display: flex; gap: .25rem; background: var(--surface-2); padding: .25rem; border-radius: 10px; margin-bottom: 1.2rem; border: 1px solid var(--border); }
.tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: .55rem; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.demo-users button { width: 100%; justify-content: space-between; margin-bottom: .4rem; }
@media (min-width: 960px) { .auth-wrap { grid-template-columns: 1.1fr 1fr; } .auth-hero { display: flex; } }

/* ---------- Reproductor ---------- */
.player { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .player { grid-template-columns: 300px 1fr; } }
.outline { padding: .5rem; position: relative; }
@media (min-width: 1000px) { .outline { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; } }
.outline h4 { font-size: .8rem; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; margin: .8rem .5rem .3rem; }
.outline button { display: flex; width: 100%; gap: .55rem; align-items: center; text-align: left; background: transparent; border: 0; color: var(--text); padding: .5rem; border-radius: 8px; cursor: pointer; font: inherit; font-size: .9rem; }
.outline button:hover { background: var(--surface-2); }
.outline button.active { background: var(--brand-50); color: var(--brand-ink); font-weight: 700; }
.outline .st { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: .7rem; flex: none; }
.outline .st.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.video-box { aspect-ratio: 16/9; border-radius: var(--radius-sm); background: linear-gradient(135deg, #10302a, #183a5c); color: #fff; display: grid; place-items: center; text-align: center; overflow: hidden; position: relative; }
.video-box iframe, .video-box video { width: 100%; height: 100%; border: 0; }
.video-box .play { width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,.18); border: 2px solid #fff; color: #fff; font-size: 1.8rem; cursor: pointer; }
.video-progress { position: absolute; left: 0; bottom: 0; height: 5px; background: var(--brand); transition: width .25s linear; }
.slide { min-height: 260px; display: flex; flex-direction: column; justify-content: center; padding: 2rem; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--brand-50), var(--blue-50)); border: 1px solid var(--border); }
.slide h2 { font-size: 1.5rem; }
.doc-box { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 1.25rem; background: var(--surface-2); }
.lesson-content h2 { font-size: 1.1rem; margin-top: 1rem; }
.lesson-content ul { padding-left: 1.2rem; }
.timer { font-variant-numeric: tabular-nums; }

/* Quiz */
.q { padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .8rem; }
.q legend { font-weight: 700; padding: 0; margin-bottom: .5rem; }
.q fieldset { border: 0; padding: 0; margin: 0; }
.opt { display: flex; gap: .6rem; align-items: center; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px; margin-bottom: .4rem; cursor: pointer; font-weight: 500; }
.opt:hover { background: var(--surface-2); }
.opt input { width: auto; min-height: auto; accent-color: var(--brand); }
.opt.correct { border-color: var(--ok); background: var(--ok-bg); }
.opt.wrong { border-color: var(--danger); background: var(--danger-bg); }
.feedback { font-size: .88rem; margin-top: .4rem; padding: .5rem .7rem; border-radius: 8px; }

/* Foro */
.post { display: flex; gap: .7rem; padding: .8rem 0; border-bottom: 1px solid var(--border); }
.post .reply { margin-left: 2.5rem; }
.post-body { flex: 1; }
.post-meta { font-size: .8rem; color: var(--muted); }

/* Gamificación */
.streak { display: flex; align-items: center; gap: .8rem; }
.streak .flame { font-size: 2.2rem; }
.days { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin-top: .6rem; }
.days span { aspect-ratio: 1; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }
.days span.on { background: var(--brand); border-color: var(--brand); }
.achievements { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .6rem; }
.ach { text-align: center; padding: .6rem .3rem; border-radius: 10px; border: 1px solid var(--border); font-size: .74rem; }
.ach .e { font-size: 1.6rem; display: block; }
.ach.off { opacity: .4; filter: grayscale(1); }

/* IA */
.ai-panel { border: 1px solid color-mix(in srgb, #6c4ee0 35%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, #6c4ee0 7%, var(--surface)), var(--surface)); }
.ai-result .module { border: 1px solid var(--border); border-radius: 10px; padding: .75rem; margin-bottom: .6rem; background: var(--surface); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: .3rem .7rem; font: inherit; font-size: .82rem; cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand-ink); }
.spinner { width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Editor de cursos */
.editor-module { border: 1px solid var(--border); border-radius: 10px; padding: .8rem; margin-bottom: .8rem; background: var(--surface-2); }
.editor-lesson { border: 1px solid var(--border); border-radius: 8px; padding: .7rem; margin: .5rem 0; background: var(--surface); }
.inline { display: flex; gap: .5rem; align-items: center; }
.inline > input, .inline > select { flex: 1; }

/* Certificado (vista previa en pantalla) */
.cert-preview { position: relative; aspect-ratio: 1.414; background: #fff; color: #111; border: 1px solid #d9d9d9; border-radius: 4px; overflow: hidden; container-type: inline-size; text-align: center; box-shadow: var(--shadow, 0 2px 10px rgba(0,0,0,.08)); }
.cert-preview .cert-logo { position: absolute; left: 1.6cqw; top: 1.6cqw; width: 18cqw; height: auto; }
.cert-preview .cert-wm { position: absolute; left: 50%; top: 24%; width: 50cqw; height: auto; transform: translateX(-50%); }
.cert-preview .cert-qr { position: absolute; right: 3cqw; top: 3cqw; display: flex; flex-direction: row-reverse; gap: 1cqw; align-items: center; text-align: right; font-size: 1.25cqw; line-height: 1.35; color: #555; }
.cert-preview .cert-qr span { width: 7cqw; height: 7cqw; display: block; }
.cert-preview .cert-qr strong { font-size: 1.5cqw; color: #111; }
.cert-preview .cert-body { position: absolute; inset: 17% 0 auto; padding: 0 12cqw; }
.cert-preview .ct { font-family: Georgia, 'Times New Roman', serif; font-size: 4.3cqw; font-weight: 400; color: #1a1a1a; }
.cert-preview .cl { margin-top: 7cqw; font-size: 1.85cqw; font-weight: 700; }
.cert-preview .cn { margin-top: 1.6cqw; font-family: Georgia, 'Times New Roman', serif; font-size: 5.8cqw; line-height: 1.1; font-weight: 400; color: #0a0a0a; overflow-wrap: anywhere; }
.cert-preview .cx { margin: 2cqw auto 0; max-width: 45cqw; font-size: 1.55cqw; line-height: 1.5; color: #222; }
.cert-preview .cert-signs { position: absolute; left: 0; right: 0; bottom: 6.2%; display: flex; justify-content: space-around; padding: 0 12cqw; }
.cert-preview .cs { width: 27cqw; border-top: .25cqw solid var(--cert, #17494d); padding-top: .9cqw; display: flex; flex-direction: column; gap: .25cqw; }
.cert-preview .cs strong { font-size: 1.6cqw; letter-spacing: .02em; }
.cert-preview .cs em { font-size: 1.25cqw; color: #333; }
.cert-preview .cert-band { position: absolute; left: 0; right: 0; bottom: 0; height: 4%; background: #000; }
.cert-preview .cert-band i { position: absolute; left: 50%; top: 0; bottom: 0; width: 9cqw; transform: translateX(-50%) skewX(-40deg); background: repeating-linear-gradient(90deg, #fbba07 0 1.8cqw, #000 1.8cqw 3cqw); }

.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty .e { font-size: 2.4rem; display: block; margin-bottom: .4rem; }
.chart-box { position: relative; height: 260px; }
.hide-sm { display: none; } @media (min-width: 720px) { .hide-sm { display: initial; } }
.loading { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }
[hidden] { display: none !important; }
.grid > .card + .card { margin-top: 0; }

/* ---------- Identidad Zona de Riesgo ---------- */
.hazard { height: 6px; background: repeating-linear-gradient(-45deg, var(--brand) 0 14px, #000 14px 28px); }
.auth-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: repeating-linear-gradient(-45deg, #fbba07 0 22px, #000 22px 44px); }
.auth-hero h1 span { color: #fbba07; }
.auth-hero .pill { display: inline-block; border: 1px solid #fbba07; color: #fbba07; border-radius: 999px; padding: .2rem .8rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em; margin-bottom: 1rem; }
.auth-hero a { color: #fbba07; }
.sidebar { border-top: 6px solid transparent; border-image: repeating-linear-gradient(-45deg, var(--brand) 0 14px, #000 14px 28px) 6; }
.wa { display: inline-flex; align-items: center; gap: .4rem; background: #25d366; color: #fff; border-radius: 999px; padding: .45rem .9rem; font-weight: 700; text-decoration: none; font-size: .85rem; }

/* Tipografía de marca (manual: IMPACT para titulares) */
h1, .kpi .val, .ring strong, .display { font-family: var(--font-head); font-weight: 400; letter-spacing: .01em; }
h1 { font-size: 1.85rem; text-transform: uppercase; }
.kpi .val { font-size: 1.6rem; }
.auth-hero h1 { font-size: 2.6rem; line-height: 1.1; }
/* Logo oficial: versión negra en tema claro, amarilla en tema oscuro (variantes permitidas por el manual) */
.logo { --lh: 34px; }
.brand-logo { display: block; height: var(--lh); width: auto; flex: none; }
.brand-logo.on-dark, [data-theme="dark"] .brand-logo.on-light { display: none; }
[data-theme="dark"] .brand-logo.on-dark { display: block; }
.brand-iso { display: none; height: 34px; width: auto; }
/* Sello ACADEMY (3.5): cuatro estilos, se elige en brand.js (ACADEMY_STYLE) */
.academy-tag { display: inline-flex; align-items: center; gap: .4rem; align-self: center; line-height: 1; white-space: nowrap; --ac: 1.25rem; }
.academy-tag b { font-family: Anton, Impact, sans-serif; font-weight: 400; font-size: var(--ac); letter-spacing: .12em; }
.academy-tag .ac-cap { width: calc(var(--ac) * .95); height: calc(var(--ac) * .95); display: block; }
.academy-tag.sm { --ac: .95rem; } .academy-tag.lg { --ac: 2.1rem; }
/* 1 sello */
.ac-sello { gap: .45rem; padding: .24rem .85rem .34rem .24rem; background: #000; border-radius: 999px 10px 10px 999px; background-image: repeating-linear-gradient(135deg, #FBBA07 0 6px, #000 6px 12px); background-size: 100% 3px; background-repeat: no-repeat; background-position: bottom; }
.ac-sello .ac-ic { width: calc(var(--ac) * 1.5); height: calc(var(--ac) * 1.5); border-radius: 50%; background: #FBBA07; color: #000; display: grid; place-items: center; box-shadow: inset 0 0 0 2px #000; }
.ac-sello b { color: #FBBA07; }
[data-theme="dark"] .ac-sello { box-shadow: inset 0 0 0 1px rgba(251,186,7,.55); }
/* 2 cinta */
.ac-cinta { background: #FBBA07; color: #000; padding: calc(var(--ac) * .28) calc(var(--ac) * .95); clip-path: polygon(calc(var(--ac) * .5) 0, 100% 0, calc(100% - var(--ac) * .5) 100%, 0 100%); }
.ac-cinta b { letter-spacing: .14em; }
/* 3 placa */
.ac-placa { padding: 4px; border-radius: 6px; background: repeating-linear-gradient(135deg, #FBBA07 0 7px, #000 7px 14px); }
.ac-placa .ac-ic { display: none; }
.ac-placa b { display: block; background: #fff; color: #000; padding: calc(var(--ac) * .12) calc(var(--ac) * .65); border-radius: 3px; letter-spacing: .16em; }
[data-theme="dark"] .ac-placa b, .auth-hero .ac-placa b { background: #000; color: #FBBA07; }
/* 4 minimal */
/* Las letras de ACADEMY miden lo mismo que las de ZONA DE RIESGO: 54/114 de la altura del logo (--lh),
   y se suben un poco para quedar alineadas con ellas (el logo tiene el subtítulo debajo). */
.ac-minimal { padding-left: calc(var(--lh) * .3); border-left: 3px solid #FBBA07; height: var(--lh); gap: .45rem; flex: none; }
.ac-minimal .ac-ic, .ac-minimal .ac-word { transform: translateY(calc(var(--lh) * -.158)); }
.ac-minimal .ac-ic { color: #FBBA07; } .ac-minimal .ac-cap { width: calc(var(--lh) * .56); height: calc(var(--lh) * .56); }
.ac-minimal .ac-word { height: calc(var(--lh) * .474); width: auto; display: block; color: #000; }
.auth-hero .hero-brand { display: flex; align-items: flex-end; gap: 1rem; margin-bottom: 1.4rem; }
/* ACADEMY a la derecha, a la altura de «DE RIESGO» del logo vertical */
.auth-hero .ac-minimal { height: auto; padding: .3rem 0 .3rem .8rem; margin-bottom: 7px; align-self: flex-end; }
.auth-hero .ac-minimal .ac-ic, .auth-hero .ac-minimal .ac-word { transform: none; }
.auth-hero .ac-minimal .ac-word { height: 29px; } .auth-hero .ac-minimal .ac-cap { width: 34px; height: 34px; }
[data-theme="dark"] .ac-minimal .ac-word { color: #FBBA07; }
.auth-hero .ac-minimal .ac-word { color: #fff; }
@media (max-width: 480px) { .topbar .brand-logo { height: 24px; } .topbar .academy-tag b, .topbar .academy-tag .ac-word { display: none; } .topbar .academy-tag { padding: .3rem .45rem; } }
.sidebar .logo { --lh: 19px; gap: .4rem; }
.logo.in-card { --lh: 24px; flex-wrap: nowrap; }
.sidebar .ac-minimal .ac-ic, .logo.in-card .ac-minimal .ac-ic { display: none; }
@media (min-width: 1000px) {
  .admin-shell.collapsed .sidebar .brand-logo, .admin-shell.collapsed .academy-tag { display: none !important; }
  .admin-shell.collapsed .brand-iso { display: block; }
}
.auth-hero .hero-logo { width: 230px; height: auto; }

/* ---------- Versión 2 ---------- */
.quiz-timer { position: sticky; top: 70px; z-index: 5; display: inline-flex; align-items: center; gap: .4rem; background: var(--ink); color: var(--brand); font-family: var(--font-head); font-size: 1.3rem; padding: .3rem .9rem; border-radius: 10px; margin-bottom: .8rem; font-variant-numeric: tabular-nums; }
.quiz-timer.low { background: var(--danger); color: #fff; }
.stars { display: flex; gap: .2rem; margin: .4rem 0 .6rem; }
.stars button { background: none; border: 0; font-size: 1.9rem; line-height: 1; cursor: pointer; color: var(--grey); padding: 0 .1rem; }
.stars button.on { color: var(--brand); }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem; border-radius: 8px; font-size: .9rem; }
.rank li.me { background: var(--brand-50); font-weight: 700; }
.rank .pos { width: 1.6rem; text-align: center; font-weight: 800; }
@media (min-width: 720px) { td.hide-sm, th.hide-sm { display: table-cell; } }

/* ---------- Portada pública ---------- */
.lp-wrap { max-width: 1160px; margin: 0 auto; padding: 0 1.1rem; }
.lp-hero { background: #000; color: #fff; padding: 3.2rem 0 3rem; position: relative; overflow: hidden; }
.lp-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: repeating-linear-gradient(-45deg, #fbba07 0 22px, #000 22px 44px); }
.lp-hero h1 { font-size: clamp(2.1rem, 6vw, 3.8rem); line-height: 1.05; max-width: 18ch; margin-bottom: 1rem; }
.lp-hero h1 span { color: #fbba07; }
.lp-hero .pill { display: inline-block; border: 1px solid #fbba07; color: #fbba07; border-radius: 999px; padding: .25rem .9rem; font-size: .75rem; font-weight: 700; letter-spacing: .08em; margin-bottom: 1.1rem; }
.lp-lead { font-size: 1.1rem; max-width: 62ch; opacity: .88; margin-bottom: 1.5rem; }
.btn.lp-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.btn.lp-ghost:hover { background: rgba(255,255,255,.12); }
.lp-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 2.2rem 0 1rem; max-width: 760px; }
.lp-stats strong { display: block; font-family: var(--font-head); font-weight: 400; font-size: 2rem; color: #fbba07; line-height: 1.1; }
.lp-stats span { font-size: .85rem; opacity: .8; }
@media (min-width: 720px) { .lp-stats { grid-template-columns: repeat(4, 1fr); } }
.lp-section { padding: 3rem 0; scroll-margin-top: 70px; }
.lp-section.alt { background: var(--surface); border-block: 1px solid var(--border); }
.lp-h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); text-transform: uppercase; margin-bottom: .4rem; }
.lp-two { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 860px) { .lp-two { grid-template-columns: 1.3fr 1fr; } }
.lp-cert { text-align: center; padding: 1.5rem; border: 6px solid var(--ink); }
.lp-qr { font-size: 3.5rem; line-height: 1; margin-top: .6rem; }
.lp-steps { grid-template-columns: 1fr; margin-top: 1.2rem; }
@media (min-width: 720px) { .lp-steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .lp-steps { grid-template-columns: repeat(4, 1fr); } }
.lp-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--ink); color: var(--brand); font-family: var(--font-head); font-size: 1.3rem; margin-bottom: .7rem; }
[data-theme="dark"] .lp-n { background: var(--brand); color: #000; }
.lp-cta { margin-top: 2rem; background: var(--brand); color: #000; border-radius: var(--radius); padding: 1.4rem 1.5rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.lp-footer { background: #000; color: #f2f1ec; padding: 2.2rem 0; }
.lp-footer a { color: #fbba07; }
.lp-footer p { margin: 0 0 .3rem; }
.chip.on { background: var(--ink); color: var(--brand); border-color: var(--ink); }
[data-theme="dark"] .chip.on { background: var(--brand); color: #000; border-color: var(--brand); }
.btn { white-space: nowrap; }

/* ---------- Unidades y actividades interactivas ---------- */
.outline .unit-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0; }
.outline .unit-p { font-size: .72rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: .05rem .45rem; letter-spacing: 0; }
.outline .unit-p.done { background: #1e8449; border-color: #1e8449; color: #fff; }
.outline .unit-t { font-weight: 700; font-size: .92rem; margin: .1rem .5rem .3rem; }
.outline button:disabled { opacity: .5; cursor: not-allowed; }
.outline button.is-act { background: color-mix(in srgb, var(--brand) 9%, transparent); }
.outline button.is-act.active { background: var(--brand-50); }
.unit-acc { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .9rem; margin: .5rem 0; background: var(--surface-2); }
.unit-acc summary { cursor: pointer; }
.unit-acc ul { margin: .5rem 0 0; }
.html-box { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.html-box iframe { display: block; width: 100%; height: min(72vh, 640px); border: 0; background: #fff; }
.game { border: 2px solid var(--brand); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.game-head { display: flex; align-items: center; gap: .6rem; padding: .6rem .9rem; background: #000; color: #fbba07; flex-wrap: wrap; }
.game-head .badge { background: #fbba07; color: #000; border-color: #fbba07; }
.game-head .btn.ghost { color: #fff; }
.game-body { padding: 1rem; }
.game #gMsg { padding: 0 1rem; }
.game #gMsg .alert { margin-bottom: 1rem; }
.game-win { animation: pop .35s ease; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.ws-wrap { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 760px) { .ws-wrap { grid-template-columns: minmax(0, 520px) 1fr; } }
.ws-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 2px; touch-action: none; user-select: none; max-width: 520px; }
.ws-cell { aspect-ratio: 1; min-width: 0; padding: 0; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); color: var(--text); font: 700 clamp(.7rem, 2.6vw, 1.05rem)/1 Inter, system-ui, sans-serif; cursor: pointer; }
.ws-cell.sel { background: #fbba07; color: #000; border-color: #000; }
.ws-cell.found { background: #1e8449; color: #fff; border-color: #1e8449; }
.ws-cell.bad { background: var(--danger); color: #fff; animation: shake .3s; }
.ws-words { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.ws-words li { border: 1px solid var(--border); border-radius: 99px; padding: .2rem .7rem; font-weight: 700; font-size: .85rem; }
.ws-words li.done { text-decoration: line-through; background: #1e8449; color: #fff; border-color: #1e8449; }
.mt-cols { display: grid; grid-template-columns: 1fr 1.4fr; gap: .8rem; }
.mt-col { display: flex; flex-direction: column; gap: .5rem; }
.mt-item { text-align: left; padding: .6rem .7rem; border: 2px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .92rem; cursor: pointer; min-height: 44px; }
.mt-item.sel { border-color: #000; background: #fbba07; color: #000; }
.mt-item.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 18%, transparent); cursor: default; opacity: 1; }
.mt-item.bad { border-color: var(--danger); animation: shake .3s; }
.tf-card { text-align: center; padding: 1rem; max-width: 640px; margin: 0 auto; }
.tf-q { font-size: 1.15rem; font-weight: 700; }
.od-list { list-style: none; padding: 0; margin: 0 0 .8rem; display: flex; flex-direction: column; gap: .4rem; }
.od-item { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border: 2px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.od-item.ok { border-color: var(--ok); }
.od-item.bad { border-color: var(--danger); }
.od-n { width: 26px; height: 26px; border-radius: 50%; background: #000; color: #fbba07; display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.hm { text-align: center; }
.hm-word { display: flex; justify-content: center; flex-wrap: wrap; gap: .35rem; margin: 1rem 0; }
.hm-word span { width: 2rem; height: 2.5rem; border-bottom: 3px solid var(--text); display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; }
.hm-word span.miss { color: var(--danger); }
.hm-keys { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; max-width: 560px; margin: 0 auto; }
.hm-key { width: 2.3rem; height: 2.5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font: 700 1rem Inter, system-ui, sans-serif; cursor: pointer; }
.hm-key.hit { background: #1e8449; color: #fff; }
.hm-key.miss { background: var(--danger); color: #fff; opacity: .6; }
.mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .5rem; }
.mm-card { position: relative; min-height: 92px; border: 2px solid #000; border-radius: 10px; background: #000; color: #fbba07; font: inherit; cursor: pointer; padding: .4rem; }
.mm-card .mm-front { display: none; font-size: .82rem; font-weight: 600; }
.mm-card .mm-back { font-size: 1.8rem; font-weight: 800; }
.mm-card.open, .mm-card.ok { background: var(--surface); color: var(--text); }
.mm-card.open .mm-front, .mm-card.ok .mm-front { display: block; }
.mm-card.open .mm-back, .mm-card.ok .mm-back { display: none; }
.mm-card.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, transparent); cursor: default; }
.editor-module .unit-tools { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.editor-lesson.act { border-left: 4px solid var(--brand); }

/* ---------- Recursos: enlaces incrustados, archivos, video narrado, tareas y selector ---------- */
.embed-box { aspect-ratio: 16/9; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.embed-box iframe, .embed-box video { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.file-card { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); flex-wrap: wrap; }
.file-ico { font-size: 1.8rem; }
.task-box { border: 2px dashed var(--brand); border-radius: var(--radius-sm); padding: 1rem; margin-top: 1rem; background: var(--surface); }
.nv { border-radius: var(--radius-sm); overflow: hidden; background: #000; color: #fff; border: 2px solid #000; container-type: inline-size; }
.nv-stage { aspect-ratio: 16/9; padding: calc(10px + 3.5cqw) 5cqw 3cqw; display: flex; flex-direction: column; background: linear-gradient(135deg, #000 0%, #1c1c1c 60%, #3a2c00 100%); position: relative; overflow: auto; }
.nv-stage::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: repeating-linear-gradient(-45deg, #fbba07 0 14px, #000 14px 28px); }
.nv-stage > :first-child { margin-top: auto; }
.nv-stage > :last-child { margin-bottom: auto; }
.nv-stage .nv-n { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: #fbba07; margin-bottom: .4rem; }
.nv-stage h3 { font-family: Impact, Anton, sans-serif; font-weight: 400; font-size: clamp(1.2rem, 5cqw, 2.4rem); line-height: 1.1; color: #fbba07; margin: 0 0 .5rem; letter-spacing: .02em; text-transform: uppercase; }
.nv-stage .lesson-content { color: #fff; font-size: clamp(.8rem, 2.3cqw, 1.2rem); line-height: 1.4; }
.nv-stage .lesson-content p, .nv-stage .lesson-content ul { margin: 0 0 .5em; }
.nv-stage .lesson-content h2 { color: #fbba07; font-size: 1.1em; }
/* Video narrado con personajes animados (3.6) */
.nv.anim-on .nv-sub { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); padding: 0; min-height: 0; }   /* el texto ya va en el globo o el recuadro */
.nv-stage.is-anim { padding: 0; overflow: hidden; display: block; }
.nv-stage.is-anim::before { z-index: 3; }
.nv-anim { position: absolute; inset: 0; overflow: hidden; }
.nv-bg { position: absolute; inset: 0; width: 100%; height: 100%; animation: nvPan 26s ease-in-out infinite alternate; }
@keyframes nvPan { from { transform: scale(1.04) translateX(-1%); } to { transform: scale(1.08) translateX(1%); } }
.nv-cast { position: absolute; left: 3%; right: 3%; bottom: 0; display: flex; justify-content: center; align-items: flex-end; gap: 1%; height: calc(62% * min(1, 5.5 / var(--n))); }
.nv-char:nth-child(even) { z-index: 1; }
.nv-char { position: relative; height: 100%; flex: 0 1 calc(94% / max(var(--n), 3)); min-width: 0; display: flex; justify-content: center; align-items: flex-end; transition: filter .3s, scale .3s, opacity .3s; animation: nvIn .6s cubic-bezier(.2, .9, .3, 1.3) both; animation-delay: var(--d); transform-origin: bottom center; }
.nv-char .av { height: 100%; width: auto; max-width: none; flex: none; overflow: visible; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25)); animation: nvIdle 3.4s ease-in-out infinite; animation-delay: calc(var(--d) * 4); transform-origin: bottom center; }
.nv-char .av-eyes { transform-box: fill-box; transform-origin: center; animation: nvBlink 4.2s infinite; animation-delay: calc(var(--d) * 9); }
.nv-char .av-mouth-open { opacity: 0; }
.nv-char.talking { scale: 1.1; z-index: 2; }
.nv-char.talking .av { animation: nvTalk .5s ease-in-out infinite; }
.nv-char.talking .av-mouth-open { animation: nvMouth .26s steps(2) infinite; }
.nv-char.talking .av-mouth { animation: nvMouth .26s steps(2) infinite reverse; }
.nv-char.dim { filter: saturate(.55) brightness(.82); scale: .94; }
.nv-name { position: absolute; bottom: 4%; left: 50%; transform: translateX(-50%); background: #000; color: #fbba07; font-weight: 800; font-size: clamp(.55rem, 1.6cqw, .85rem); padding: .15em .6em; border-radius: 999px; white-space: nowrap; letter-spacing: .02em; }
.nv-char.talking .nv-name { background: #fbba07; color: #000; }
@keyframes nvIn { from { opacity: 0; transform: translateY(40%); } to { opacity: 1; transform: none; } }
@keyframes nvIdle { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-1.2%) rotate(.6deg); } }
@keyframes nvTalk { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-3%) rotate(1deg); } }
@keyframes nvBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes nvMouth { 0% { opacity: 0; } 100% { opacity: 1; } }
.nv-bubble { position: absolute; top: 6%; transform: translateX(-50%); width: min(62%, 560px); background: #fff; color: #111; border: 3px solid #000; border-radius: 18px; padding: .6em .9em; font-size: clamp(.72rem, 2.1cqw, 1.15rem); line-height: 1.35; box-shadow: 0 8px 0 rgba(0, 0, 0, .18); animation: nvPop .28s cubic-bezier(.2, .9, .3, 1.4); z-index: 4; }
.nv-bubble b { display: block; font-size: .78em; color: #b07d00; text-transform: uppercase; letter-spacing: .06em; }
.nv-bubble::after { content: ''; position: absolute; bottom: -16px; left: calc(50% + var(--tail, 0px)); transform: translateX(-50%); border: 14px solid transparent; border-top-color: #000; border-bottom: 0; }
.nv-caption { position: absolute; top: 7%; left: 50%; transform: translateX(-50%); width: min(80%, 760px); background: rgba(0, 0, 0, .78); color: #fff; border-left: 6px solid #fbba07; border-radius: 10px; padding: .6em 1em; font-size: clamp(.72rem, 2.1cqw, 1.15rem); line-height: 1.4; animation: nvFade .35s ease; z-index: 4; }
@keyframes nvPop { from { opacity: 0; transform: translateX(-50%) scale(.8); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes nvFade { from { opacity: 0; transform: translateX(-50%) translateY(-6px); } to { opacity: 1; transform: translateX(-50%); } }
.nv-titlecard { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: linear-gradient(180deg, rgba(0, 0, 0, .78), rgba(0, 0, 0, .35)); opacity: 0; pointer-events: none; transition: opacity .5s; z-index: 5; padding: 0 6%; }
.nv-titlecard span { color: #fbba07; font-size: clamp(.6rem, 1.6cqw, .85rem); letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.nv-titlecard h3 { font-family: Impact, Anton, sans-serif; font-weight: 400; color: #fff; font-size: clamp(1.4rem, 6.5cqw, 3.4rem); line-height: 1.05; margin: .2em 0 0; text-transform: uppercase; text-shadow: 0 4px 0 #000; }
.nv-anim.titling .nv-titlecard { opacity: 1; }
.nv-anim.titling .nv-titlecard h3 { animation: nvPop2 .6s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes nvPop2 { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
.nv-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; margin-top: .6rem; }
.nv-person { display: flex; gap: .6rem; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: .4rem .6rem; background: var(--surface-2); }
.nv-person .av { width: 56px; height: 67px; flex: none; }
.nv-person .av-mouth-open { opacity: 0; }
.nv-person span { display: block; line-height: 1.3; }
/* Pantalla completa del video narrado */
.nv:fullscreen, .nv.nv-full { display: flex; flex-direction: column; width: 100vw; height: 100vh; border: 0; border-radius: 0; background: #000; }
.nv.nv-full { position: fixed; inset: 0; z-index: 9999; height: 100dvh; }
.nv:fullscreen .nv-stage, .nv.nv-full .nv-stage { flex: 1; aspect-ratio: auto; min-height: 0; }
.nv:fullscreen .nv-bubble, .nv.nv-full .nv-bubble, .nv:fullscreen .nv-caption, .nv.nv-full .nv-caption { font-size: clamp(.9rem, 2.2vmin + .4rem, 1.7rem); }
body.nv-lock { overflow: hidden; }
.nv-tip { display: block; margin-top: .2rem; color: var(--text); }
.nv-voice { display: block; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .nv-bg, .nv-char, .nv-char .av, .nv-char .av-eyes, .nv-bubble, .nv-caption { animation: none !important; } }
.nv-stage .lesson-content strong { color: #fbba07; }
.nv-sub { min-height: 2.6rem; padding: .5rem 1rem; background: #111; color: #fff; text-align: center; font-size: .95rem; display: grid; place-items: center; }
.nv-bar { display: flex; gap: 3px; padding: 0 .6rem; background: #111; }
.nv-bar button { flex: 1; height: 14px; padding: 5px 0; border: 0; background: transparent; cursor: pointer; }
.nv-bar button span { display: block; height: 4px; border-radius: 4px; background: #444; }
.nv-bar button.done span { background: #fbba07; }
.nv-bar button.cur span { background: #fff; }
.nv-ctrl { display: flex; align-items: center; gap: .4rem; padding: .4rem .6rem .6rem; background: #111; }
.nv-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #262626; color: #fff; font-size: 1rem; cursor: pointer; }
.nv-btn:hover:not(:disabled) { background: #fbba07; color: #000; }
.nv-btn:disabled { opacity: .4; cursor: default; }
#nvPlay { background: #fbba07; color: #000; width: 46px; height: 46px; font-size: 1.1rem; }
.nv-count { font-size: .85rem; color: #ccc; margin-left: .4rem; }
.nv-rate { width: auto; min-height: 36px; padding: .2rem .5rem; background: #262626; color: #fff; border-color: #444; }
.chooser { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: .8rem; margin-top: .6rem; }
.chooser-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .5rem; }
.chooser-item { display: flex; flex-direction: column; align-items: center; gap: .25rem; text-align: center; padding: .7rem .4rem; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.chooser-item:hover, .chooser-item:focus-visible { background: var(--brand-50); border-color: var(--brand); }
.chooser-item .ci { font-size: 1.7rem; line-height: 1; }
.chooser-item .cn { font-weight: 700; font-size: .88rem; }
.chooser-item .cd { font-size: .72rem; color: var(--muted); line-height: 1.25; }
.nv-count { white-space: nowrap; }
@container (max-width: 560px) { .nv-stage { aspect-ratio: auto; min-height: 56cqw; } .nv-sub { font-size: .85rem; } }

/* ==========================================================================
   v2.3 — Información general, cartelera, encuesta, editor por pestañas y juegos dinámicos
   ========================================================================== */
/* ---------- Índice del curso por grupos ---------- */
.outline h4.grp-h { color: var(--text); border-top: 1px solid var(--border); padding-top: .7rem; font-size: .76rem; }
.outline h4.grp-h:first-child { border-top: 0; padding-top: 0; margin-top: .2rem; }
.outline button .badge.danger { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }

/* ---------- Información general ---------- */
.hub-hero { display: flex; gap: 1rem; align-items: center; padding: 1.1rem; border-radius: 12px; margin-bottom: 1rem; color: #fff; background: linear-gradient(135deg, var(--c), #000 140%); position: relative; overflow: hidden; }
.hub-hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 8px; background: repeating-linear-gradient(-45deg, #fbba07 0 12px, #000 12px 24px); }
.hub-hero h2 { color: #fff; font-family: var(--font-head); letter-spacing: .02em; font-size: 1.5rem; margin: 0 0 .3rem; }
.hub-ico { font-size: 2.8rem; background: rgba(255,255,255,.15); width: 72px; height: 72px; border-radius: 16px; display: grid; place-items: center; flex: none; }
.hub-mini { margin-bottom: 1rem; }
.checks { list-style: none; padding: 0; display: grid; gap: .4rem; }
.checks li { padding-left: 1.7rem; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--brand); color: #000; font-weight: 800; font-size: .75rem; display: grid; place-items: center; }
.roadmap { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.roadmap li { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.roadmap li div { display: flex; flex-direction: column; min-width: 0; }
.roadmap li small { color: var(--muted); }
.roadmap li.done { border-color: var(--ok); }
.rm-n { width: 32px; height: 32px; border-radius: 50%; background: #000; color: #fbba07; display: grid; place-items: center; font-weight: 800; flex: none; }
.roadmap li.done .rm-n { background: var(--ok); color: #fff; }
.teacher { display: flex; gap: 1.1rem; align-items: flex-start; flex-wrap: wrap; }
.teacher-photo { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; background: #000; color: #fbba07; display: grid; place-items: center; font: 800 2.4rem var(--font-head); flex: none; border: 4px solid var(--brand); }
.teacher-photo img { width: 100%; height: 100%; object-fit: cover; }
.teacher-body { flex: 1; min-width: 220px; }
.teacher-body h3 { font-size: 1.25rem; margin: 0; }
.teacher-title { color: var(--brand-ink); font-weight: 700; margin: .1rem 0 .6rem; }
.teacher-contact { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .6rem; }
.teacher.compact { padding: .8rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); align-items: center; }
.teacher.compact .teacher-photo { width: 64px; height: 64px; font-size: 1.3rem; border-width: 3px; }
.teacher.compact .teacher-title { margin-bottom: 0; }
.books { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.book { display: flex; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); transition: transform .15s, box-shadow .15s; }
.book:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.book-spine { width: 54px; flex: none; display: grid; place-items: center; font-size: 1.5rem; background: #000; }
.book-spine.t-norma { background: #fbba07; } .book-spine.t-guia { background: #1e8449; } .book-spine.t-articulo { background: #1f618d; } .book-spine.t-web { background: #6c3483; }
.book-body { padding: .7rem .8rem; min-width: 0; }
.book-body h4 { margin: .35rem 0 .15rem; font-size: .95rem; }
.book-body p { margin: 0 0 .3rem; }
.book-body { display: flex; flex-direction: column; align-items: flex-start; flex: 1; }
.book-link { margin-top: auto; align-self: flex-start; max-width: 100%; white-space: normal; text-align: left; }
.steps { display: grid; gap: .6rem; }
.step { display: flex; gap: .8rem; align-items: flex-start; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.step > span { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #000; font-weight: 800; display: grid; place-items: center; flex: none; }
.step p { margin: .1rem 0 0; }

/* ---------- Cartelera ---------- */
.board { display: grid; gap: .8rem; }
.note { position: relative; padding: .9rem 1rem; border: 1px solid var(--border); border-left: 6px solid var(--grey); border-radius: 10px; background: var(--surface); }
.note.pinned { border-left-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, var(--surface)); }
.note.is-new { animation: pop .4s ease; box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 40%, transparent); }
.note-head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .3rem; }
.note h3 { margin: .2rem 0 .3rem; }

/* ---------- Encuesta ---------- */
.sv-progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.sv-progress span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .3s; }
.sv-q { border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1rem; margin: 0 0 .8rem; transition: border-color .2s; }
.sv-q legend { font-weight: 700; padding: 0 .3rem; display: flex; gap: .5rem; align-items: center; }
.sv-q.missing { border-color: var(--danger); animation: shake .3s; }
.sv-n { width: 26px; height: 26px; border-radius: 50%; background: #000; color: #fbba07; display: grid; place-items: center; font-size: .8rem; flex: none; }
.req { color: var(--danger); }
.sv-stars { display: flex; align-items: center; gap: .2rem; }
.sv-stars button { font-size: 2.2rem; line-height: 1; background: none; border: 0; color: var(--grey); cursor: pointer; padding: .1rem; transition: transform .15s, color .15s; }
.sv-stars button.on { color: var(--brand); text-shadow: 0 0 1px #000; }
.sv-stars button:hover { transform: scale(1.2) rotate(-8deg); }
.sv-lbl { margin-left: .6rem; font-weight: 700; color: var(--brand-ink); }
.sv-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.sv-scale button { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .5rem .2rem; border: 2px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; transition: transform .15s, border-color .15s; }
.sv-scale button span { font-size: 1.7rem; filter: grayscale(.8); transition: filter .15s; }
.sv-scale button small { font-size: .7rem; text-align: center; line-height: 1.15; color: var(--muted); }
.sv-scale button:hover { transform: translateY(-2px); }
.sv-scale button.on { border-color: #000; background: var(--brand); color: #000; }
.sv-scale button.on span { filter: none; animation: pop .3s; } .sv-scale button.on small { color: #000; font-weight: 700; }
.sv-nps { display: grid; grid-template-columns: repeat(11, 1fr); gap: .25rem; margin-bottom: .3rem; }
.sv-nps button { aspect-ratio: 1; min-width: 0; border: 2px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font: 700 .9rem var(--font); cursor: pointer; }
.sv-nps button.on.lo { background: var(--danger); color: #fff; border-color: var(--danger); }
.sv-nps button.on.mid { background: var(--brand); color: #000; border-color: #000; }
.sv-nps button.on.hi { background: var(--ok); color: #fff; border-color: var(--ok); }
.survey-lock, .survey-thanks { text-align: center; padding: 1.5rem 1rem; }
.survey-lock > span, .survey-thanks > span { font-size: 3rem; display: block; }
.survey-thanks > span { animation: pop .5s; }
.sv-steps { list-style: none; display: flex; justify-content: center; gap: .6rem; flex-wrap: wrap; padding: 0; margin: 0 0 1rem; }
.sv-steps li { display: flex; gap: .35rem; align-items: center; padding: .3rem .7rem; border-radius: 99px; background: var(--surface-2); font-size: .85rem; }
.sv-steps li.ok { background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.survey-cta { display: flex; gap: .8rem; align-items: center; padding: .9rem 1rem; border-radius: 12px; margin-bottom: 1rem; background: #000; color: #fff; text-decoration: none; border: 2px solid var(--brand); transition: transform .15s; }
.survey-cta:hover { transform: translateY(-2px); }
.survey-cta > span { font-size: 2rem; animation: pulse 1.6s infinite; }
.survey-cta div { flex: 1; display: flex; flex-direction: column; }
.survey-cta strong { color: var(--brand); } .survey-cta b { font-size: 1.4rem; color: var(--brand); }
.kpi:has(.k-v) { flex-direction: column; align-items: flex-start; gap: .15rem; }
.k-l { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.k-v { font-size: 1.9rem; font-weight: 800; line-height: 1.1; } .k-v small { font-size: .9rem; color: var(--muted); }
.k-v.ok { color: var(--ok); } .k-v.warn { color: var(--warn); } .k-v.danger { color: var(--danger); }
.sq { padding: .6rem 0; border-bottom: 1px solid var(--border); } .sq:last-child { border: 0; }
.dist { display: grid; gap: .2rem; margin-top: .4rem; }
.dist-r { display: grid; grid-template-columns: 120px 1fr 30px; gap: .5rem; align-items: center; font-size: .78rem; }
.dist-r .dl { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dist-r .db { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.dist-r .db i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.dist-r .db i.lo { background: var(--danger); } .dist-r .db i.hi { background: var(--ok); }
.dist-r .dn { text-align: right; font-weight: 700; }
.quote { margin: 0 0 .6rem; padding: .5rem .8rem; border-left: 4px solid var(--brand); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: .9rem; }
.quote footer { font-size: .75rem; color: var(--muted); margin-top: .2rem; }

/* ---------- Interruptores ---------- */
.switch { display: flex; gap: .7rem; align-items: center; padding: .55rem 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .sw { width: 44px; height: 24px; border-radius: 99px; background: var(--grey); position: relative; flex: none; transition: background .2s; }
.switch .sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .sw { background: var(--ok); }
.switch input:checked + .sw::after { transform: translateX(20px); }
.switch input:focus-visible + .sw { outline: 3px solid var(--blue); outline-offset: 2px; }
.switch span:last-child { display: flex; flex-direction: column; }
.switch small { color: var(--muted); font-size: .8rem; }

/* ---------- Editor de cursos ---------- */
.editor-page { max-width: 1200px; }
.ed-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; margin: -.25rem 0 .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); flex-wrap: wrap; }
.ed-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 1.4rem; flex: none; }
.ed-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ed-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unsaved { color: var(--warn); font-weight: 700; }
.ed-tabs { display: flex; gap: .3rem; overflow-x: auto; margin-bottom: 1rem; border-bottom: 2px solid var(--border); scrollbar-width: thin; }
.ed-tabs button { display: flex; align-items: center; gap: .4rem; white-space: nowrap; padding: .65rem .9rem; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; background: none; color: var(--muted); font: 600 .92rem var(--font); cursor: pointer; }
.ed-tabs button .n { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: .75rem; }
.ed-tabs button small { background: var(--surface-2); border-radius: 99px; padding: 0 .45rem; font-size: .72rem; }
.ed-tabs button.on { color: var(--text); border-bottom-color: var(--brand); }
.ed-tabs button.on .n { background: #000; color: #fbba07; }
.ed-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 960px) { .ed-grid { grid-template-columns: 1.5fr 1fr; } }
.obj-row { margin-bottom: .4rem; }
.obj-n { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #000; display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.pick-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: .3rem; }
.pick-icons button { font-size: 1.3rem; aspect-ratio: 1; border: 2px solid var(--border); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.pick-icons button.on { border-color: #000; background: var(--brand); }
.pick-colors { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-bottom: .8rem; }
.pick-colors button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.pick-colors button.on { box-shadow: 0 0 0 3px var(--brand); }
.pick-colors input[type=color] { width: 40px; height: 34px; padding: 2px; }
.ed-cover { height: 110px; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; padding: 0 1rem; font-size: 2.6rem; }
.book-row { border: 1px solid var(--border); border-radius: 10px; padding: .7rem; margin-bottom: .6rem; background: var(--surface-2); }
.ed-units { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .ed-units { grid-template-columns: 250px 1fr; align-items: start; } .unit-list { position: sticky; top: 90px; } }
.unit-list { display: flex; flex-direction: column; gap: .4rem; }
@media (max-width: 899px) { .unit-list { flex-direction: row; overflow-x: auto; } .unit-list button { min-width: 170px; } .unit-list p { display: none; } }
.unit-list button { display: flex; gap: .6rem; align-items: center; text-align: left; padding: .6rem; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; transition: border-color .15s, transform .15s; }
.unit-list button:hover { border-color: var(--brand); }
.unit-list button.on { border-color: #000; background: var(--brand-50); }
.unit-list button.drop-unit { border-style: dashed; border-color: var(--ok); transform: scale(1.03); background: var(--ok-bg); }
.u-n { width: 32px; height: 32px; border-radius: 10px; background: #000; color: #fbba07; display: grid; place-items: center; font: 800 1rem var(--font-head); flex: none; }
.u-t { display: flex; flex-direction: column; min-width: 0; } .u-t small { color: var(--muted); font-size: .75rem; }
.u-t strong { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.les-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .8rem; }
.les { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); transition: box-shadow .15s, opacity .15s; }
.les.act { border-left: 5px solid var(--brand); }
.les.open { box-shadow: var(--shadow); border-color: var(--brand); }
.les.dragging { opacity: .4; }
.les.drop-before { box-shadow: 0 -4px 0 var(--ok); }
.les-h { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; flex-wrap: wrap; }
.grip { cursor: grab; color: var(--muted); font-size: 1.2rem; padding: 0 .2rem; user-select: none; }
.les-ic { font-size: 1.3rem; }
.les-title { flex: 1; min-width: 160px; display: flex; flex-direction: column; align-items: flex-start; text-align: left; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; padding: .2rem; }
.les-title small { color: var(--muted); font-size: .78rem; }
.warn-t { color: var(--danger); font-weight: 700; }
.les-tools { display: flex; gap: .15rem; align-items: center; }
.les-tools select { width: auto; min-height: 32px; padding: .2rem .4rem; font-size: .8rem; }
.les-b { padding: .2rem .9rem .9rem; border-top: 1px dashed var(--border); animation: fade .2s; }
textarea.mono { font-family: ui-monospace, monospace; font-size: .85rem; }
.chooser.always { margin-top: 0; background: var(--surface-2); border-style: dashed; }
.game-pick { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0; }
.game-pick button { display: flex; gap: .3rem; align-items: center; padding: .35rem .6rem; border: 2px solid var(--border); border-radius: 99px; background: var(--surface-2); color: var(--text); font: 600 .82rem var(--font); cursor: pointer; }
.game-pick button.on { border-color: #000; background: var(--brand); color: #000; }
.q-card { border: 1px solid var(--border); border-radius: 12px; padding: .8rem; margin-bottom: .6rem; background: var(--surface); }
.q-opt { display: flex; align-items: center; gap: .5rem; margin-top: .35rem; padding: .2rem .4rem; border-radius: 8px; font-weight: 400; }
.q-opt input[type=radio] { width: auto; min-height: auto; flex: none; accent-color: var(--ok); }
.q-opt.right { background: var(--ok-bg); }
.q-l { width: 24px; height: 24px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.q-opt.right .q-l { background: var(--ok); color: #fff; }

/* ---------- Efectos ---------- */
.fx-float { position: fixed; z-index: 9999; transform: translate(-50%, 0); pointer-events: none; font: 800 1.05rem var(--font); white-space: nowrap; padding: .15rem .55rem; border-radius: 99px; animation: floatUp .9s ease-out forwards; }
.fx-float.good { background: var(--ok); color: #fff; } .fx-float.bad { background: var(--danger); color: #fff; }
@keyframes floatUp { from { opacity: 0; transform: translate(-50%, 0) scale(.7); } 20% { opacity: 1; transform: translate(-50%, -14px) scale(1.1); } to { opacity: 0; transform: translate(-50%, -60px) scale(1); } }

/* ---------- Juegos dinámicos ---------- */
.game { box-shadow: 0 6px 0 #000; }
.game-head strong { font-family: var(--font-head); letter-spacing: .03em; font-weight: 400; font-size: 1.1rem; }
.hud { display: flex; gap: .4rem; align-items: center; }
.hud-i { background: rgba(251,186,7,.15); color: #fbba07; border-radius: 99px; padding: .15rem .6rem; font-size: .85rem; }
.hud-i b { color: #fff; font-variant-numeric: tabular-nums; }
.hud-i.combo { background: #c0392b; color: #fff; animation: pop .3s; }
.game-prog { height: 6px; background: #222; }
.game-prog span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, #fbba07 0 10px, #e5a800 10px 20px); transition: width .4s; }
.game-intro { text-align: center; padding: 1.2rem .5rem; animation: pop .35s; }
.gi-ico { font-size: 3.6rem; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }
.game-intro h3 { font-family: var(--font-head); font-weight: 400; font-size: 1.6rem; letter-spacing: .03em; }
.game-intro p { max-width: 520px; margin-left: auto; margin-right: auto; }
.gi-rules { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-bottom: 1rem; }
.gi-rules span { background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: .2rem .7rem; font-size: .82rem; }
.btn.lg { font-size: 1.15rem; padding: .85rem 2rem; box-shadow: 0 4px 0 #000; transition: transform .1s, box-shadow .1s; }
.btn.lg:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.game-end { text-align: center; padding: .4rem 0 1rem; animation: pop .4s; }
.ge-stars { display: flex; justify-content: center; gap: .3rem; }
.ge-stars span { font-size: 3rem; color: var(--border); transform: scale(0); animation: starIn .45s var(--d) forwards cubic-bezier(.3,1.7,.5,1); }
.ge-stars span.on { color: var(--brand); text-shadow: 0 2px 0 #000; }
@keyframes starIn { to { transform: scale(1); } }
.ge-pts { font-size: 1.1rem; margin: .2rem 0; } .ge-pts b { font: 400 2rem var(--font-head); }
.ge-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem .9rem; color: var(--muted); margin-bottom: .8rem; }
.game-end .game-win { text-align: left; }
/* Sopa de letras */
.ws-cell { transition: transform .1s, background .2s; animation: cellIn .4s calc(var(--i) * 15ms) both; }
@keyframes cellIn { from { transform: scale(.4); opacity: 0; } }
.ws-cell:hover { transform: scale(1.08); }
.ws-cell.found { background: var(--wc, #1e8449); border-color: var(--wc, #1e8449); animation: found .4s calc(var(--k, 0) * 50ms) both; }
@keyframes found { 50% { transform: scale(1.3); } }
.ws-cell.hint { animation: hintPulse .5s 4 alternate; background: var(--brand); color: #000; }
@keyframes hintPulse { to { transform: scale(1.25); box-shadow: 0 0 0 4px var(--brand); } }
.ws-words li { transition: background .2s; }
.ws-words li.done { background: var(--wc, #1e8449); border-color: var(--wc, #1e8449); animation: pop .3s; }
/* Emparejar */
.mt-h { font-size: .75rem; text-transform: uppercase; font-weight: 800; color: var(--muted); letter-spacing: .05em; }
.mt-item { display: flex; gap: .5rem; align-items: center; touch-action: none; transition: transform .12s, border-color .15s, background .15s; animation: pop .3s both; }
.mt-item:hover:not(.ok) { transform: translateX(3px); border-color: var(--brand); }
.mt-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px dashed var(--border); flex: none; display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: #fff; }
.mt-item.sel .mt-dot { border-color: #000; background: #000; }
.mt-item.ok { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 15%, transparent); }
.mt-item.ok .mt-dot { background: var(--pc); border: 0; }
.mt-item.mt-over { border-color: var(--ok); border-style: dashed; transform: scale(1.03); }
.mt-ghost { position: fixed; z-index: 9998; pointer-events: none; transform: translate(-50%, -50%) rotate(-3deg); box-shadow: 0 10px 30px rgba(0,0,0,.3); background: #fbba07; color: #000; border-color: #000; opacity: .95; }
/* Verdadero o falso */
.tf-stage { position: relative; max-width: 560px; margin: 0 auto; }
.tf-stack span { position: absolute; inset: 0; border-radius: 16px; background: var(--surface-2); border: 2px solid var(--border); transform: translateY(calc(var(--k) * 8px)) scale(calc(1 - var(--k) * .04)); z-index: 0; }
.tf-card { position: relative; z-index: 1; background: var(--surface); border: 2px solid #000; border-radius: 16px; padding: 1.4rem 1rem 1rem; box-shadow: 0 4px 0 #000; touch-action: pan-y; user-select: none; transition: transform .25s, border-color .2s, background .2s; }
.tf-card.enter { animation: cardIn .35s cubic-bezier(.3,1.4,.5,1); }
@keyframes cardIn { from { transform: translateY(30px) scale(.9); opacity: 0; } }
.tf-card.lean-r { border-color: var(--ok); } .tf-card.lean-l { border-color: var(--danger); }
.tf-card.right { border-color: var(--ok); background: var(--ok-bg); } .tf-card.wrong { border-color: var(--danger); background: var(--danger-bg); animation: shake .3s; }
.tf-card.done { text-align: center; }
.tf-n { font-size: .75rem; text-transform: uppercase; font-weight: 800; color: var(--muted); letter-spacing: .05em; }
.tf-clock { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.tf-clock span { display: block; height: 100%; width: 100%; background: var(--ok); transition: width .1s linear; }
.tf-clock span.low { background: var(--danger); }
.tf-btns { display: flex; justify-content: center; gap: .8rem; margin-top: 1.1rem; }
.tf-btns .btn { min-width: 140px; font-size: 1rem; box-shadow: 0 4px 0 #000; }
.tf-btns .tf-v { background: var(--ok); color: #fff; } .tf-btns .tf-f { background: var(--danger); color: #fff; }
.tf-btns kbd { font: 700 .7rem var(--font); background: rgba(255,255,255,.25); border-radius: 4px; padding: 0 .3rem; }
.tf-fb { margin-top: .8rem; text-align: left; animation: pop .3s; }
#tfNext { margin-top: .4rem; }
/* Ordenar */
.od-item { cursor: grab; touch-action: none; user-select: none; transition: transform .15s, border-color .15s, background .15s; }
.od-item:hover { border-color: var(--brand); }
.od-item.dragging { cursor: grabbing; background: var(--brand-50); border-color: #000; transform: scale(1.02); box-shadow: var(--shadow); }
.od-t { flex: 1; }
.od-grip { color: var(--muted); font-style: normal; font-size: 1.1rem; }
.od-item.bad { animation: shake .3s; }
.od-list.solved .od-item { animation: found .4s calc(var(--k) * 80ms) both; background: var(--ok-bg); }
/* Ahorcado */
.hm-top { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.hm-top > div { flex: 1; min-width: 240px; }
.hm-gauge { width: 190px; color: var(--text); flex: none; }
.hm-hint { background: var(--surface-2); border-radius: 10px; padding: .5rem .7rem; }
.hm-word span.pop { animation: found .35s; color: var(--ok); }
.hm-word.won span { animation: found .4s calc(var(--k) * 60ms) both; color: var(--ok); border-color: var(--ok); }
.hm-key { transition: transform .1s; box-shadow: 0 2px 0 var(--border); }
.hm-key:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--brand); }
/* Memoria 3D */
.mm-card { perspective: 800px; background: none; border: 0; padding: 0; min-height: 100px; animation: pop .3s calc(var(--k) * 30ms) both; }
.mm-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .45s; }
.mm-card.open .mm-in, .mm-card.ok .mm-in { transform: rotateY(180deg); }
.mm-card .mm-back, .mm-card .mm-front { display: grid !important; place-items: center; position: absolute; inset: 0; border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; padding: .4rem; }
.mm-card .mm-back { background: repeating-linear-gradient(-45deg, #fbba07 0 10px, #000 10px 20px); color: transparent; border: 2px solid #000; }
.mm-card .mm-back::after { content: "?"; position: absolute; width: 42px; height: 42px; border-radius: 50%; background: #000; color: #fbba07; display: grid; place-items: center; font: 800 1.4rem var(--font); }
.mm-card .mm-front { transform: rotateY(180deg); background: var(--surface); color: var(--text); border: 2px solid #000; font-size: .82rem; font-weight: 600; }
.mm-card .mm-front.b { background: var(--brand-50); }
.mm-card.ok .mm-front { border-color: var(--ok); background: var(--ok-bg); }
.mm-card.no .mm-front { border-color: var(--danger); animation: shake .3s .35s; }
.mm-card:hover:not(.open):not(.ok) .mm-in { transform: rotateY(12deg); }
@media (prefers-reduced-motion: reduce) { .game *, .fx-float, .ge-stars span { animation: none !important; transition: none !important; } .ge-stars span { transform: none; } }
.sv-scale button { min-width: 0; } .sv-scale button small { overflow-wrap: anywhere; hyphens: auto; }
.sv-q { min-width: 0; } .sv-field { min-width: 0; }
@media (max-width: 480px) { .sv-scale { gap: .25rem; } .sv-scale button { padding: .4rem .1rem; } .sv-scale button span { font-size: 1.4rem; } .sv-scale button small { font-size: .6rem; } .sv-nps { gap: .15rem; } .sv-nps button { font-size: .75rem; border-width: 1px; } .sv-stars button { font-size: 1.9rem; } }
.editor-page { min-width: 0; width: 100%; max-width: min(1200px, 100%); }
.ed-body, .ed-units > *, .ed-grid > * { min-width: 0; }
@media (max-width: 600px) { .ed-bar { gap: .4rem; padding: .5rem; } .ed-bar .btn { padding: .45rem .7rem; } .les-tools select { max-width: 92px; } }
.admin-content { min-width: 0; }
.player > * { min-width: 0; }
.tf-btns .btn { min-width: 0; flex: 1; max-width: 200px; }

/* ==========================================================================
   v2.4 — Presentaciones (archivo, enlace o código) y juegos con imágenes
   ========================================================================== */
.deck-box { position: relative; aspect-ratio: 16 / 9; background: #111; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.deck-box.is-pdf { aspect-ratio: auto; height: min(78vh, 620px); background: var(--surface-2); }
.deck-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.deck-box:fullscreen { aspect-ratio: auto; height: 100vh; border-radius: 0; }
.deck-ways { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: .5rem; }
.dw { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem; border: 1px dashed var(--border); border-radius: 12px; background: var(--surface-2); min-width: 0; }
.dw > div { min-width: 0; flex: 1; } .dw p { margin: .1rem 0 .4rem; }
.dw-n { width: 26px; height: 26px; border-radius: 50%; background: #000; color: #fbba07; display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.game-media { display: flex; gap: .7rem; align-items: flex-start; margin-top: .6rem; padding: .6rem; border-radius: 10px; background: var(--surface-2); }
.gm-cover { width: 76px; height: 76px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--border); display: grid; place-items: center; font-size: 1.8rem; overflow: hidden; flex: none; }
.gm-cover img { width: 100%; height: 100%; object-fit: cover; }
.picto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.picto-grid button { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .5rem; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: 600 .75rem var(--font); cursor: pointer; }
.picto-grid button:hover, .picto-grid button:focus-visible { border-color: var(--brand); background: var(--brand-50); }
.picto-grid img { width: 60px; height: 60px; }
/* Imágenes dentro de los juegos */
.g-img { display: block; max-width: 100%; object-fit: contain; pointer-events: none; user-select: none; }
.gi-cover { max-width: min(320px, 80%); max-height: 180px; border-radius: 14px; object-fit: cover; box-shadow: 0 4px 0 #000; animation: bob 2.4s ease-in-out infinite; }
.mt-item .g-img { width: 52px; height: 52px; flex: none; }
.mm-front.has-img { flex-direction: column; gap: .2rem; display: flex !important; align-items: center; justify-content: center; }
.mm-front .g-img { max-height: 64px; width: auto; }
.mm-card:has(.has-img) { min-height: 120px; }
.tf-img { max-height: 140px; margin: .5rem auto 0; }
.od-t .g-img.sm { width: 36px; height: 36px; display: inline-block; vertical-align: middle; margin-right: .4rem; }
.od-t .g-t { vertical-align: middle; }
.hm-hint { display: flex; gap: .6rem; align-items: center; } .hm-hint .g-img { width: 64px; height: 64px; flex: none; }
/* Clasificar */
.cl-tray { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; min-height: 54px; padding: .6rem; border: 2px dashed var(--border); border-radius: 14px; margin-bottom: 1rem; }
.cl-item { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .5rem .8rem; border: 2px solid #000; border-radius: 12px; background: var(--surface); color: var(--text); font: 600 .9rem var(--font); cursor: grab; touch-action: none; box-shadow: 0 3px 0 #000; transition: transform .12s; animation: pop .3s both; }
.cl-item.has-img { width: 112px; } .cl-item .g-img { width: 64px; height: 64px; }
.cl-item:hover:not(.ok) { transform: translateY(-2px) rotate(-1deg); }
.cl-item.sel { background: #fbba07; color: #000; transform: scale(1.06); }
.cl-item.bad { animation: shake .3s; border-color: var(--danger); }
.cl-item.ok { cursor: default; box-shadow: none; border-color: transparent; background: rgba(255,255,255,.85); color: #000; padding: .25rem .5rem; font-size: .8rem; }
.cl-item.ok.has-img { width: 84px; } .cl-item.ok .g-img { width: 44px; height: 44px; }
.cl-ghost { position: fixed; z-index: 9998; pointer-events: none; transform: translate(-50%, -50%) rotate(-4deg); box-shadow: 0 12px 30px rgba(0,0,0,.35); background: #fbba07; }
.cl-bins { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.cl-bin { border-radius: 14px; background: color-mix(in srgb, var(--gc) 14%, var(--surface)); border: 3px solid var(--gc); min-height: 150px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.cl-bin:hover, .cl-bin.cl-over { transform: translateY(-3px); box-shadow: 0 6px 0 var(--gc); }
.cl-bin.bad { animation: shake .3s; }
.cl-h { display: flex; align-items: center; gap: .4rem; background: var(--gc); color: #fff; padding: .45rem .7rem; font-weight: 800; border-radius: 10px 10px 0 0; }
.cl-h .g-t { flex: 1; } .cl-h .g-img { width: 30px; height: 30px; }
.cl-c { background: rgba(255,255,255,.25); border-radius: 99px; padding: 0 .5rem; font-size: .8rem; }
.cl-in { display: flex; flex-wrap: wrap; gap: .35rem; padding: .5rem; }
/* Completar la frase y trivia */
.fb-card, .tv-card { position: relative; max-width: 640px; margin: 0 auto; background: var(--surface); border: 2px solid #000; border-radius: 16px; padding: 1.2rem 1rem 1rem; box-shadow: 0 4px 0 #000; text-align: center; }
.fb-card.enter, .tv-card.enter { animation: cardIn .35s cubic-bezier(.3,1.4,.5,1); }
.fb-img, .tv-img { max-height: 150px; margin: .4rem auto .2rem; }
.fb-s { font-size: 1.2rem; font-weight: 700; line-height: 1.8; margin: .4rem 0 0; }
.fb-gap { display: inline-block; min-width: 120px; padding: 0 .6rem; margin: 0 .2rem; border-bottom: 4px dashed var(--brand); color: var(--muted); }
.fb-gap.ok { border: 0; background: var(--ok); color: #fff; border-radius: 8px; animation: found .4s; }
.fb-gap.no { border: 0; background: var(--danger); color: #fff; border-radius: 8px; animation: shake .3s; }
.fb-opts, .tv-opts { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); max-width: 640px; margin: 1rem auto 0; }
.fb-opt, .tv-opt { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border: 2px solid #000; border-radius: 12px; background: var(--surface); color: var(--text); font: 700 .95rem var(--font); cursor: pointer; box-shadow: 0 3px 0 #000; text-align: left; transition: transform .1s, background .15s; }
.fb-opt { justify-content: center; }
.fb-opt:hover:not(:disabled), .tv-opt:hover:not(:disabled) { transform: translateY(-2px); background: var(--brand-50); }
.fb-opt.ok, .tv-opt.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.fb-opt.no, .tv-opt.no { background: var(--danger); color: #fff; border-color: var(--danger); animation: shake .3s; }
.tv-opt b { width: 28px; height: 28px; border-radius: 8px; background: #000; color: #fbba07; display: grid; place-items: center; flex: none; }
.tv-opt.has-img { flex-direction: column; } .tv-opt .g-img { width: 80px; height: 80px; }
.tv-opt.gone { opacity: .25; transform: scale(.95); }
.tv-q { font-size: 1.15rem; font-weight: 800; margin: .3rem 0 .6rem; }
.tv-secs { position: absolute; top: .6rem; right: .8rem; font: 400 1.4rem var(--font-head); color: var(--muted); }
#tvNext, #fbNext { margin-top: .6rem; }
#fbFb { text-align: center; }
/* Ruleta */
.rl { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: .5rem 0; }
.rl-wrap { position: relative; width: min(300px, 80vw); }
.rl-svg { width: 100%; display: block; filter: drop-shadow(0 6px 0 #000); }
.rl-pointer { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 2rem; color: #c0392b; z-index: 2; text-shadow: 0 2px 0 #000; }

/* ===================== v2.5: lecturas enriquecidas, respuestas escritas ===================== */
.lesson-content h3 { font-size: 1rem; margin: .9rem 0 .3rem; }
.lesson-content ol { padding-left: 1.4rem; }
.lesson-content a { color: var(--brand-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.md-callout { background: var(--brand-50); border-left: 5px solid var(--brand); border-radius: 10px; padding: .75rem 1rem; margin: .8rem 0; }
.md-callout > p:first-of-type { margin-top: .2rem; }
.md-callout p:last-child, .md-callout ul:last-child { margin-bottom: 0; }
.md-tag { display: inline-block; background: #000; color: var(--brand); font-size: .72rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: .15rem .55rem; border-radius: 6px; margin-bottom: .2rem; }
.md-table { margin: .8rem 0; border: 1px solid var(--border); border-radius: 10px; }
.md-table table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.md-table th { background: #000; color: var(--brand); text-align: left; padding: .5rem .7rem; }
.md-table td { padding: .5rem .7rem; border-top: 1px solid var(--border); vertical-align: top; }
.md-table tr:nth-child(even) td { background: var(--surface-2); }
.tt-area { width: 100%; min-height: 220px; resize: vertical; font: inherit; line-height: 1.5; }
.tt-foot { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: .5rem; }
.tt-ok { color: #1e7a3c; font-weight: 600; }
.tt-bad { color: var(--danger, #c0392b); font-weight: 600; }
.tt-sent { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: .8rem 1rem; margin: .6rem 0 .3rem; line-height: 1.55; overflow-wrap: anywhere; }

/* ===================== v2.6: imágenes de las unidades ===================== */
.unit-banner { margin: 0 0 1rem; border-radius: 14px; overflow: hidden; position: relative; background: #111; border: 2px solid #000; }
.unit-banner img { display: block; width: 100%; aspect-ratio: 1200 / 420; object-fit: cover; }
.unit-banner figcaption { padding: .75rem 1rem .9rem; background: #000; color: #fff; display: flex; flex-direction: column; gap: .1rem; border-top: 3px solid var(--brand); }
.unit-banner figcaption span { color: var(--brand); font-family: Anton, Impact, sans-serif; letter-spacing: .05em; text-transform: uppercase; font-size: .9rem; }
.unit-banner figcaption strong { font-size: clamp(1rem, 2.4vw, 1.35rem); line-height: 1.2; }
.unit-banner figcaption small { opacity: .85; font-size: .85rem; }
.outline .unit-thumb { display: block; width: calc(100% - 1rem); margin: .8rem .5rem .3rem; aspect-ratio: 1200 / 420; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.acc-thumb { width: 96px; aspect-ratio: 1200 / 420; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-right: .6rem; }
.roadmap li.has-img { flex-wrap: wrap; position: relative; }
.roadmap li.has-img .rm-n { position: absolute; top: .35rem; right: .35rem; box-shadow: 0 0 0 3px var(--surface-2); }
.roadmap .rm-img { width: 100%; aspect-ratio: 1200 / 420; object-fit: cover; border-radius: 8px; margin-bottom: .2rem; }
.unit-art { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; padding: .8rem; border: 1px dashed var(--border); border-radius: 12px; background: var(--surface-2); margin: .2rem 0 .8rem; }
.unit-art > img, .unit-art-empty { width: 240px; max-width: 100%; aspect-ratio: 1200 / 420; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.unit-art > div { flex: 1; min-width: 220px; }
.unit-art-empty { display: grid; place-items: center; align-content: center; background: var(--surface); color: var(--muted); font-size: 1.4rem; }
.unit-art-empty span { font-size: .8rem; }
.art-h { font-size: .95rem; margin: .8rem 0 .4rem; }
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .5rem; }
.art-grid button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: none; cursor: pointer; }
.art-grid button:hover, .art-grid button:focus-visible { border-color: var(--brand); }
.art-grid img { display: block; width: 100%; aspect-ratio: 1200 / 420; object-fit: cover; }
.modal.wide { max-width: 900px; }
.md-fig { margin: 1rem 0; }
.md-img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); display: inline-block; vertical-align: middle; }
.md-fig .md-img { display: block; margin: 0 auto; }
.md-fig figcaption { text-align: center; font-size: .85rem; color: var(--muted); margin-top: .35rem; }

/* Ilustraciones de sección (curso de Equidad): ancho completo, sin pie de foto */
.md-illus { margin: .4rem 0 1rem; }
.md-illus .md-img { width: 100%; max-width: 620px; aspect-ratio: 1200 / 300; object-fit: cover; border: 2px solid #000; border-radius: 12px; }

/* Fotos junto a los párrafos (alt "Foto: ..."): flotan a la derecha y el texto las rodea */
.md-photo { float: right; width: 40%; max-width: 340px; margin: .3rem 0 .8rem 1.2rem; }
.md-photo .md-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 2px solid #000; }
.md-photo figcaption { text-align: left; font-size: .75rem; }
.lesson-content h2, .lesson-content h3, .md-callout, .md-table { clear: both; }
@media (max-width: 640px) { .md-photo { float: none; width: 100%; max-width: none; margin: .8rem 0; } }

/* ---------- Carrusel de ideas (lecciones tipo "carousel") ---------- */
.car { position: relative; }
.car-bar { height: 6px; background: var(--grey-light); border-radius: 99px; overflow: hidden; margin-bottom: .8rem; }
.car-bar span { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .35s ease; }
.car-viewport { overflow: hidden; border-radius: var(--radius); transition: height .35s ease; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
.car-viewport:active { cursor: grabbing; }
.car-track { display: flex; align-items: flex-start; transition: transform .45s cubic-bezier(.22,.8,.3,1); will-change: transform; }
.car-track.dragging { transition: none; }
.car-slide { flex: 0 0 100%; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: grid; min-height: 340px; outline: none; }
.car-slide img { -webkit-user-drag: none; pointer-events: none; }
.car-body { padding: 1.4rem 1.6rem 1.6rem; align-self: center; }
.car-body h2 { font-family: var(--font-head); font-weight: 400; letter-spacing: .01em; font-size: clamp(1.45rem, 3.4vw, 2rem); line-height: 1.1; margin: 0 0 .35rem; }
.car-body .car-kicker { display: inline-block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-ink); background: var(--brand-50); border-radius: 99px; padding: .2rem .7rem; margin: 0 0 .9rem; }
.car-body p { font-size: 1.02rem; }
.car-body > ul:not(.car-cards) { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.car-body > ul:not(.car-cards) li { position: relative; padding: .55rem .8rem .55rem 2.3rem; background: var(--surface-2); border-radius: 10px; font-size: 1rem; }
.car-body > ul:not(.car-cards) li::before { content: "✓"; position: absolute; left: .7rem; top: .5rem; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--brand); color: #000; font-size: .72rem; font-weight: 800; display: grid; place-items: center; }
/* Foto lateral */
.car-slide.has-photo { grid-template-columns: minmax(0, 42%) minmax(0, 1fr); }
.car-slide.has-photo .car-media { margin: 0; position: relative; background: #000; height: 100%; min-height: 340px; }
.car-slide.has-photo .car-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; border-radius: 0; max-width: none; aspect-ratio: auto; }
.car-slide.has-photo .car-media figcaption { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 1.6rem .8rem .55rem; font-size: .72rem; text-align: left; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.78)); }
/* Ilustración como franja superior */
.car-slide.has-banner .car-media { margin: 0; border-bottom: 3px solid #000; background: var(--brand-50); }
.car-slide.has-banner .car-media img { display: block; width: 100%; max-width: none; aspect-ratio: 1200 / 300; object-fit: cover; border: 0; border-radius: 0; }
.car-slide.has-banner .car-body { align-self: start; }
/* Viñetas con encabezado: tarjetas */
.car-cards { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .7rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .car-cards.n2 { grid-template-columns: 1fr 1fr; } .car-cards.n3 { grid-template-columns: repeat(3, 1fr); } .car-cards.n4 { grid-template-columns: 1fr 1fr; } }
.car-cards li { background: var(--surface-2); border: 1px solid var(--border); border-top: 5px solid var(--brand); border-radius: 12px; padding: .8rem .9rem; font-size: .95rem; line-height: 1.45; }
.car-cards li > strong:first-child { display: block; font-size: 1.02rem; margin-bottom: .25rem; }
.car-cards li em { display: block; margin-top: .5rem; padding-top: .45rem; border-top: 1px dashed var(--border); color: var(--muted); font-size: .88rem; }
/* Lista numerada: pasos */
.car-steps { list-style: none; counter-reset: paso; padding: 0; margin: .4rem 0 0; display: grid; gap: .6rem; }
.car-steps li { counter-increment: paso; position: relative; padding: .6rem .8rem .6rem 3.1rem; background: var(--surface-2); border-radius: 12px; min-height: 2.8rem; }
.car-steps li::before { content: counter(paso); position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); width: 1.8rem; height: 1.8rem; border-radius: 50%; background: #000; color: var(--brand); font-family: var(--font-head); font-size: 1.05rem; display: grid; place-items: center; }
.car-body .md-callout { margin: 1rem 0 0; font-size: 1rem; }
/* Portada y cierre */
.car-slide.is-first .car-body h2 { font-size: clamp(1.7rem, 4.2vw, 2.4rem); }
.car-slide.is-first .car-steps li { padding-top: .45rem; padding-bottom: .45rem; min-height: 0; }
.car-slide.is-first .car-steps li::before { background: var(--brand); color: #000; width: 1.5rem; height: 1.5rem; font-size: .9rem; }
@media (min-width: 760px) { .car-slide.is-first .car-steps { grid-template-columns: 1fr 1fr; } }
.car-slide.is-last { background: #000; color: #fff; border-color: #000; background-image: repeating-linear-gradient(135deg, var(--brand) 0 14px, #000 14px 28px); background-size: 100% 10px; background-repeat: no-repeat; background-position: bottom; }
.car-slide.is-last .car-body { text-align: center; max-width: 680px; margin: 0 auto; padding: 2.4rem 1.6rem 2.8rem; }
.car-slide.is-last .car-body h2 { color: var(--brand); }
.car-slide.is-last .car-kicker { background: #1d1d1b; color: var(--brand); }
.car-slide.is-last .md-callout { background: transparent; border: 0; padding: 0; font-family: var(--font-head); font-size: clamp(1.5rem, 3.6vw, 2.1rem); line-height: 1.15; color: #fff; }
.car-slide.is-last .md-callout .md-tag { display: block; font-family: var(--font); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin-bottom: .5rem; }
.car-slide.is-last p { color: #e8e8e8; }
/* Navegación */
.car-nav { display: flex; align-items: center; justify-content: center; gap: .8rem; margin-top: .8rem; }
.car-arrow { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #000; background: var(--brand); color: #000; font-size: 1.6rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0 0 3px; }
.car-arrow:hover:not([disabled]) { background: var(--brand-600); }
.car-arrow[disabled] { opacity: .3; cursor: default; background: var(--surface-2); border-color: var(--border); color: var(--muted); }
[data-theme="dark"] .car-arrow:not([disabled]) { border-color: var(--brand); }
.car-arrow.pulse { animation: car-pulse 1.6s ease-in-out infinite; }
@keyframes car-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 60%, transparent); } 50% { box-shadow: 0 0 0 9px transparent; } }
.car-dots { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }
.car-dots button { width: 11px; height: 11px; padding: 0; border-radius: 99px; border: 2px solid var(--grey); background: transparent; cursor: pointer; transition: width .25s, background .25s; }
.car-dots button.seen { background: var(--grey); }
.car-dots button[aria-selected="true"] { width: 30px; background: var(--brand); border-color: var(--brand); }
.car-count { text-align: center; margin: .45rem 0 0; }
@media (prefers-reduced-motion: reduce) { .car-track, .car-viewport, .car-bar span { transition: none; } .car-arrow.pulse { animation: none; } }
@media (max-width: 640px) {
  .car-slide { min-height: 0; }
  .car-slide.has-photo { grid-template-columns: 1fr; }
  .car-slide.has-photo .car-media { min-height: 0; height: auto; aspect-ratio: 16 / 10; }
  .car-body { padding: 1.1rem 1.05rem 1.3rem; }
}
.car-slide.is-last .md-callout p { font-size: inherit; color: #fff; margin: 0 0 1rem; }

/* ---------- Documentos PDF de solo lectura (lecciones tipo "docs") ---------- */
.docv-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .7rem; }
.docv-tabs button { display: inline-flex; align-items: center; gap: .45rem; text-align: left; font: inherit; font-size: .88rem; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .5rem .75rem; cursor: pointer; flex: 1 1 220px; max-width: 100%; }
.docv-tabs button:hover { background: var(--surface-2); }
.docv-tabs button.on { background: var(--brand-50); border-color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand); }
.docv { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.docv-bar { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; padding: .55rem .8rem; background: #000; color: #fff; border-bottom: 3px solid var(--brand); }
.docv-bar .docv-title { font-size: .92rem; color: var(--brand); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 200px; }
.docv-bar .spacer { display: none; }
.docv-bar .muted, .docv-bar .docv-zoom { color: #e8e8e8; }
.docv-bar .btn.secondary { background: #1d1d1b; color: #fff; border-color: #3a3a37; min-width: 34px; }
.docv-scroll { height: min(75vh, 900px); overflow: auto; padding: 12px; -webkit-user-select: none; user-select: none; }
.docv:fullscreen .docv-scroll { height: calc(100vh - 100px); }
.docv-pages { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.docv-pages canvas { display: block; max-width: none; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.18); border-radius: 2px; pointer-events: none; }
.docv-note { margin: 0; padding: .45rem .8rem; border-top: 1px solid var(--border); background: var(--surface); }
@media print { .docv, .docv-tabs { display: none !important; } }
@media (max-width: 640px) { .docv-scroll { height: 70vh; padding: 6px; } .docv-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .3rem; scroll-snap-type: x mandatory; } .docv-tabs button { flex: 0 0 80%; font-size: .82rem; padding: .45rem .6rem; scroll-snap-align: start; } }

/* ---------- Editor de unidades y contenido (versión 3.2) ---------- */
.u-t strong { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.unit-sum { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; padding-bottom: .9rem; border-bottom: 1px solid var(--border); margin-bottom: .9rem; }
.unit-sum > img, .unit-sum-empty { width: 150px; aspect-ratio: 1200 / 420; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex: none; }
.unit-sum-empty { display: grid; place-items: center; background: var(--surface-2); font-size: 1.3rem; }
.unit-sum-t { flex: 1; min-width: 200px; } .unit-sum-t h3 { margin: 0; font-size: 1.15rem; } .unit-sum-t p { margin: .15rem 0 0; }
.unit-info { background: var(--surface-2); border-radius: 12px; padding: .9rem; margin: -.2rem 0 1rem; }
.unit-info .unit-art { background: var(--surface); margin-bottom: 0; }
.les-head { display: flex; align-items: flex-end; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.les-head h3 { margin: 0; } .les-head p { margin: .1rem 0 0; }
.les-legend { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; color: var(--muted); }
.kind { display: inline-block; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; border-radius: 99px; padding: .08rem .5rem; margin-right: .4rem; vertical-align: 1px; }
.kind.k-res { background: var(--blue-50); color: var(--blue); }
.kind.k-act { background: var(--brand); color: #000; }
.les-legend .kind + .kind, .les-legend .kind:not(:first-child) { margin-left: .6rem; }
.les-n { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font-size: .78rem; font-weight: 800; color: var(--muted); flex: none; }
.les.act .les-n { background: var(--brand-50); border-color: var(--brand); color: var(--brand-ink); }
.les-title small { display: block; margin-top: .15rem; }
.les-edit { flex: none; }
.les-menu-w { position: relative; flex: none; }
.les-more { font-size: 1.2rem; line-height: 1; min-width: 36px; }
.les-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 250px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: .35rem; display: flex; flex-direction: column; animation: fade .12s; }
.les-menu button { text-align: left; background: none; border: 0; border-radius: 8px; padding: .5rem .6rem; font: inherit; font-size: .88rem; color: var(--text); cursor: pointer; }
.les-menu button:hover:not([disabled]) { background: var(--surface-2); }
.les-menu button[disabled] { opacity: .4; cursor: default; }
.les-menu .danger-t { color: var(--danger); }
.les-menu-sep { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .45rem .6rem .15rem; border-top: 1px solid var(--border); margin-top: .25rem; }
.les-menu-sep:empty { padding: 0; }
.les-sec { display: flex; align-items: center; gap: .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 1rem 0 .55rem; }
.les-sec span { width: 22px; height: 22px; border-radius: 50%; background: #000; color: var(--brand); display: grid; place-items: center; font: 800 .75rem var(--font); }
.les-sec::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.les-basic { display: grid; gap: 0 .8rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .les-basic { grid-template-columns: minmax(0, 1fr) 280px; } }
.type-help { margin: -.3rem 0 0; }
.les-foot { margin-top: .9rem; padding-top: .7rem; border-top: 1px dashed var(--border); }
.add-big { width: 100%; padding: .9rem; border: 2px dashed var(--brand); border-radius: 12px; background: var(--brand-50); color: var(--text); font: 700 .95rem var(--font); cursor: pointer; }
.add-big:hover { background: color-mix(in srgb, var(--brand) 25%, var(--surface)); }
.add-big[aria-expanded="true"] { border-style: solid; background: var(--surface-2); border-color: var(--border); }
.chooser-panel { border: 1px solid var(--border); border-radius: 12px; padding: .9rem; margin-top: .6rem; background: var(--surface); animation: fade .15s; }
.ch-group + .ch-group { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.ch-group h4 { margin: 0; font-size: .95rem; } .ch-group > p { margin: .1rem 0 .5rem; }
.ch-group:last-of-type .chooser-item { background: var(--brand-50); }
/* Editor del carrusel tarjeta por tarjeta */
.card-ed { border: 1px solid var(--border); border-radius: 12px; margin-bottom: .6rem; background: var(--surface-2); overflow: hidden; }
.card-ed-h { display: flex; align-items: center; gap: .35rem; padding: .4rem .6rem; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-ed-h strong { font-size: .88rem; }
.card-ed-n { width: 22px; height: 22px; border-radius: 6px; background: var(--brand); color: #000; display: grid; place-items: center; font: 800 .75rem var(--font); }
.card-ed-b { display: grid; gap: .6rem; padding: .6rem; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .card-ed-b { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.card-ed-b textarea { min-height: 190px; height: 100%; font-size: .8rem; }
.card-ed-prev { min-width: 0; overflow: hidden; border-radius: 10px; }
.car-mini .car-slide { zoom: .56; min-height: 0; }
.car-mini .car-slide.has-photo .car-media { min-height: 300px; }
.cards-help { margin-top: .5rem; } .cards-help summary { cursor: pointer; font-weight: 600; font-size: .85rem; } .cards-help ul { margin: .4rem 0 0; padding-left: 1.2rem; }
@media (max-width: 600px) { .les-h { gap: .35rem; } .les-title { min-width: 0; flex-basis: calc(100% - 90px); } .les-edit { margin-left: auto; } .les-menu { min-width: 220px; } }
@media (max-width: 600px) { .les-ic { display: none; } .grip { display: none; } }

/* ---------- Restricción de acceso por requisitos (versión 3.3) ---------- */
.req-ed { border: 1px dashed var(--border); border-radius: 12px; padding: .7rem .8rem; margin-top: .7rem; background: var(--surface-2); }
.req-ed.on { border-style: solid; border-color: var(--brand); background: var(--brand-50); }
.req-ed-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; margin-bottom: .45rem; }
.req-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.req-chip { display: inline-flex; align-items: center; gap: .35rem; background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: .25rem .3rem .25rem .7rem; font-size: .85rem; font-weight: 600; }
.req-chip small { color: var(--muted); font-weight: 400; }
.req-chip button { border: 0; background: var(--surface-2); color: var(--text); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: .75rem; }
.req-chip button:hover { background: var(--danger-bg); color: var(--danger); }
.req-ed select { max-width: 460px; }
.req-t { color: var(--brand-ink); font-weight: 700; }
.req-box { display: flex; gap: 1rem; align-items: flex-start; padding: 1.2rem; border: 2px solid var(--brand); border-radius: var(--radius); background: var(--brand-50); }
.req-ic { font-size: 2rem; line-height: 1; }
.req-box ul { margin: .5rem 0 .9rem; padding-left: 1.1rem; } .req-box li { margin: .2rem 0; } .req-box a { font-weight: 600; }
.course-nav button.req-lock span:nth-child(2), button.req-lock > span:nth-child(2) { opacity: .65; }

/* 3.4: repaso «Para recordar» en la última tarjeta del carrusel (fondo negro) */
.car-slide.is-last .car-steps { text-align: left; margin-top: .6rem; }
.car-slide.is-last .car-steps li { background: #1d1d1b; color: #f2f2f2; border: 1px solid #333; font-size: .95rem; line-height: 1.4; }
.car-slide.is-last .car-steps li strong { color: var(--brand); }
.car-slide.is-last .car-steps li::before { background: var(--brand); color: #000; }
.car-slide.is-last .md-callout { font-size: clamp(1.25rem, 3vw, 1.7rem); }
.video-watch { margin: .5rem 0 0; }
.nv:fullscreen .nv-name, .nv.nv-full .nv-name { font-size: clamp(.8rem, 1.6vmin, 1.1rem); }

/* ================================================================ 3.7 · Dashboard */
.dash-hero { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; background: linear-gradient(120deg, var(--brand-50), var(--surface) 70%); border-left: 6px solid var(--brand); }
.dash-hero h1 { margin: .1rem 0 .3rem; }
.dash-date { margin: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.dash-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.dash-alerts { display: grid; gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 720px) { .dash-alerts { grid-template-columns: 1fr 1fr; } }
.dash-alerts .alert { text-decoration: none; color: inherit; margin: 0; }
.dash-alerts .alert:hover { filter: brightness(.98); }
.kpi-link { text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.kpi-link:hover, .kpi-link:focus-visible { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.kpi-link.good .ico { background: var(--ok-bg); } .kpi-link.good .val { color: var(--ok); }
.kpi-link.bad .ico { background: var(--danger-bg); } .kpi-link.bad .val { color: var(--danger); }
.dash-courses td { vertical-align: middle; }
.dash-course { display: flex; gap: .6rem; align-items: center; text-decoration: none; color: inherit; }
.dash-course > span:first-child { font-size: 1.4rem; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-50); flex: none; }
.dash-course > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.dash-course:hover strong { text-decoration: underline; }
.dash-num { display: inline-block; min-width: 2.2em; text-align: center; font-weight: 800; font-size: 1.1rem; background: var(--brand); color: var(--on-brand); border-radius: 999px; padding: .1rem .55rem; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.dash-list li:last-child { border-bottom: 0; }
.dash-list li > div { flex: 1; min-width: 0; }
.dash-medal { font-size: 1.3rem; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-50); flex: none; }

/* ================================================================ 3.7 · Empresas */
.co-grid { display: grid; gap: .8rem; grid-template-columns: 1fr; margin-top: .8rem; }
@media (min-width: 720px) { .co-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .co-grid { grid-template-columns: repeat(3, 1fr); } }
.co-card { display: block; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: inherit; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.co-card:hover, .co-card:focus-visible { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.co-top { display: flex; gap: .7rem; align-items: center; margin-bottom: .6rem; }
.co-top strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-logo { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; font-weight: 800; letter-spacing: .02em; background: var(--brand); color: var(--on-brand); }
.co-logo.lg { width: 60px; height: 60px; font-size: 1.3rem; border-radius: 16px; }
.co-stats { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.co-stats b { color: var(--text); font-size: 1rem; }
.co-courses { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .6rem; }
.co-courses .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-pick { max-height: 280px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .3rem; }
.co-pick label { display: flex; gap: .55rem; align-items: center; font-weight: 400; padding: .4rem .5rem; margin: 0; border-radius: 6px; cursor: pointer; }
.co-pick label:hover { background: var(--surface-2); }
.co-pick input[type=checkbox] { width: auto; min-height: 0; }

/* ================================================================ 3.7 · Inscritos por curso */
.enr-count { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .6rem 0 .2rem; padding: .55rem .7rem; border-radius: var(--radius-sm); background: var(--brand-50); text-decoration: none; color: inherit; border: 1px solid transparent; }
.enr-count:hover { border-color: var(--brand); }
.enr-total { font-size: .9rem; }
.enr-total b { font-size: 1.25rem; font-weight: 800; margin-right: .15rem; }
.enr-split { display: flex; gap: .6rem; font-size: .8rem; color: var(--muted); }

/* ================================================================ 3.7 · Edición de certificados */
.cert-edit { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .cert-edit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } .cert-edit > div:last-child { position: sticky; top: 0; } }
.cert-fs { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .9rem .3rem; margin: 0 0 .8rem; }
.cert-fs legend { font-weight: 700; font-size: .85rem; padding: 0 .35rem; color: var(--brand-ink); }
.cert-fs .field .small { display: block; margin-top: .2rem; }
#coCourses .check, #pl .check { display: block; padding: .3rem .2rem; line-height: 1.4; }
#coCourses .check input, #pl .check input { margin-right: .4rem; vertical-align: -2px; }

/* ---------- 3.8: menú de unidades desplegable ---------- */
.outline .unit-nav { border-bottom: 1px solid var(--border); }
.outline .unit-nav:last-child { border-bottom: 0; }
.outline .unit-nav > summary { list-style: none; cursor: pointer; padding: .15rem 0 .1rem; border-radius: 8px; }
.outline .unit-nav > summary::-webkit-details-marker { display: none; }
.outline .unit-nav > summary::marker { content: ''; }
.outline .unit-nav > summary:hover { background: var(--surface-2); }
.outline .unit-nav > summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
.outline .unit-nav .unit-t { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.outline .unit-caret { flex: none; width: .55rem; height: .55rem; margin-top: .3rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; opacity: .7; }
.outline .unit-nav[open] .unit-caret { transform: rotate(225deg); margin-top: .5rem; }
.outline .unit-lessons { display: flex; flex-direction: column; padding-bottom: .4rem; }
@media (prefers-reduced-motion: reduce) { .outline .unit-caret { transition: none; } }

/* ---------- 3.8: paquetes SCORM ---------- */
.scorm-box iframe { height: min(78vh, 720px); }
.scorm-up { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .4rem 0; }

/* ---------- 3.8: reporte de avance por empresa ---------- */
.co-report .card-head { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-start; justify-content: space-between; margin-bottom: .6rem; }
.co-report .card-head h2 { margin: 0; font-size: 1.15rem; }
.rep-wrap { max-height: 70vh; overflow: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.rep-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: .85rem; }
.rep-table th, .rep-table td { padding: .5rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; background: var(--surface); }
.rep-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: .75rem; }
.rep-table tfoot td { background: var(--surface-2); position: sticky; bottom: 0; z-index: 1; }
.rep-table .rep-sticky { position: sticky; left: 0; z-index: 1; min-width: 180px; max-width: 240px; box-shadow: 1px 0 0 var(--border); }
.rep-table thead .rep-sticky { z-index: 3; }
.rep-table tfoot .rep-sticky { z-index: 2; }
.rep-ch { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 150px; white-space: normal; }
.rep-cell { display: grid; gap: .15rem; min-width: 110px; }
.rep-cell small { color: var(--muted); font-size: .7rem; line-height: 1.2; }
.rep-bar { display: block; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.rep-bar i { display: block; height: 100%; background: var(--muted); border-radius: 99px; }
.rep-cell.ok strong, .rep-avg.ok { color: var(--ok); } .rep-cell.ok .rep-bar i { background: var(--ok); }
.rep-cell.mid strong, .rep-avg.mid { color: var(--brand-ink); } .rep-cell.mid .rep-bar i { background: var(--brand); }
.rep-cell.low strong, .rep-avg.low { color: var(--warn); } .rep-cell.low .rep-bar i { background: var(--warn); }
.rep-cell.zero strong, .rep-avg.zero { color: var(--muted); }
.rep-avg { font-weight: 800; font-size: 1rem; }

/* ---------- 3.8: pantalla de Usuarios ---------- */
.u-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 640px) { .u-stats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .u-stats { grid-template-columns: repeat(5, 1fr); } }
.u-stat { display: flex; gap: .7rem; align-items: center; text-align: left; padding: .8rem .9rem; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, transform .15s; min-width: 0; }
.u-stat:hover { border-color: var(--brand); transform: translateY(-1px); }
.u-stat:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.u-stat.on { border-color: var(--ink); background: var(--brand-50); }
.u-stat.warn { border-color: var(--warn); background: var(--warn-bg); }
.u-stat b { display: block; font-size: 1.4rem; line-height: 1.1; }
.u-stat small { display: block; color: var(--muted); font-size: .75rem; line-height: 1.2; }
.u-ic { font-size: 1.5rem; flex: none; }
.u-tabs { display: flex; gap: .3rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin: -.2rem 0 .8rem; padding-bottom: 0; scrollbar-width: thin; }
.u-tabs button { flex: none; border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: .55rem .8rem; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.u-tabs button:hover { color: var(--text); }
.u-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--brand); }
.u-n { display: inline-block; width: auto; height: auto; min-width: 1.5rem; padding: .05rem .4rem; margin-left: .25rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: .72rem; line-height: 1.4; font-weight: 700; text-align: center; vertical-align: middle; }
.u-tabs button[aria-selected="true"] .u-n { background: var(--brand); color: #000; }
.u-tools { display: grid; grid-template-columns: 1fr; gap: .5rem; }
.u-tools input, .u-tools select { width: 100%; min-width: 0; max-width: none; }
@media (min-width: 720px) { .u-tools { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.u-head, .u-row { display: grid; gap: .8rem; align-items: center; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1.3fr) minmax(0, .9fr) 7.5rem 13rem; }
.u-head { padding: .5rem .7rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--border); }
.u-list { display: flex; flex-direction: column; }
.u-row { padding: .7rem; border-bottom: 1px solid var(--border); }
.u-row:hover { background: var(--surface-2); }
.u-row.is-pend { background: var(--warn-bg); }
.u-row.is-off { opacity: .65; }
.u-who { display: flex; gap: .7rem; align-items: center; min-width: 0; }
.u-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: .2rem; }
.u-org > div { overflow: hidden; text-overflow: ellipsis; }
.u-prog .progress { margin: .25rem 0; }
.u-lbl { display: none; }
.u-act { display: flex; gap: .3rem; justify-content: flex-end; flex-wrap: wrap; }
.badge.sm { font-size: .66rem; padding: .05rem .45rem; }
.avatar.role-admin { background: var(--danger-bg); color: var(--danger); }
.avatar.role-instructor { background: var(--brand-50); color: var(--brand-ink); }
@media (max-width: 1000px) {
  .u-head { display: none; }
  .u-row { grid-template-columns: 1fr auto; grid-template-areas: "who st" "org org" "prog prog" "last act"; gap: .5rem .8rem; padding: .9rem .7rem; }
  .u-who { grid-area: who; } .u-st { grid-area: st; align-self: start; } .u-org { grid-area: org; padding-left: calc(36px + .7rem); }
  .u-prog { grid-area: prog; padding-left: calc(36px + .7rem); } .u-prog:has(.u-none) { display: none; }
  .u-last { grid-area: last; align-self: center; } .u-act { grid-area: act; }
  .u-lbl { display: inline; color: var(--muted); }
}
@media (max-width: 480px) {
  .u-row { grid-template-areas: "who st" "org org" "prog prog" "last last" "act act"; }
  .u-org, .u-prog { padding-left: 0; }
  .u-act { justify-content: flex-start; }
}

/* ---------- 3.8: ajustes para celulares ---------- */
.grid > *, .row > * { min-width: 0; }
.chart-box canvas { max-width: 100%; }
.page-head > * { min-width: 0; }
@media (max-width: 520px) {
  .toolbar input, .toolbar select { min-width: 0; max-width: none; flex: 1 1 100%; }
  .topbar-inner { gap: .2rem; padding: .5rem .6rem; }
  .topbar .logo { min-width: 0; flex: 0 1 auto; overflow: hidden; display: flex; align-items: center; }
  .topbar .icon-btn { width: 36px; height: 36px; }
  .topbar .avatar { width: 30px; height: 30px; font-size: .75rem; }
}

/* ---------- 3.9: introducción de la portada de acceso ---------- */
.auth-hero .hero-intro { opacity: .9; font-size: 1.02rem; line-height: 1.55; max-width: 62ch; margin: 0 0 .8rem; }
.auth-hero .hero-intro strong { color: #fbba07; }
.auth-intro-sm { background: var(--brand-50); border-left: 4px solid var(--brand); border-radius: 10px; padding: .7rem .9rem; margin: 0 0 1rem; font-size: .9rem; line-height: 1.45; }
.auth-intro-sm p { margin: 0 0 .35rem; } .auth-intro-sm p:last-child { margin: 0; }
@media (min-width: 960px) { .auth-intro-sm { display: none; } }

/* ---------- 3.9: portada de acceso con imagen ---------- */
.auth-hero.auth-hero-img { padding: 0; background: #0d0d0f; align-items: center; justify-content: center; }
.auth-hero.auth-hero-img::before, .auth-hero.auth-hero-img::after { display: none; }
.auth-hero-img img { display: block; width: 100%; height: 100vh; max-height: 100vh; object-fit: contain; position: sticky; top: 0; }

/* ---------- 3.9: nueva portada pública ---------- */
.lp-hero2 { padding: 3rem 0 3.6rem; background: radial-gradient(ellipse 70% 80% at 85% 40%, rgba(251,186,7,.20), transparent 60%), radial-gradient(ellipse 50% 60% at 10% 100%, rgba(251,186,7,.08), transparent 70%), #0b0b0c; }
.lp-hero-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 1000px) { .lp-hero-grid { grid-template-columns: 1.05fr 1fr; } }
.lp-hero2 h1 { font-size: clamp(2.2rem, 5.2vw, 4rem); max-width: 15ch; }
.lp-hero2 .pill { display: inline-flex; gap: .4rem; align-items: center; text-transform: uppercase; letter-spacing: .04em; background: rgba(251,186,7,.08); }
.lp-actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.lp-btn-main { padding: .85rem 1.3rem; font-size: 1.02rem; box-shadow: 0 8px 24px rgba(251,186,7,.25); }
.lp-btn-line { border-color: #fbba07 !important; padding: .85rem 1.2rem; }
.lp-link { color: #fff; font-weight: 700; text-decoration: none; padding: .6rem .4rem; border-bottom: 2px solid transparent; }
.lp-link:hover { border-bottom-color: #fbba07; }
.lp-stats2 { gap: 0; margin-top: 2.2rem; }
.lp-stats2 > div { padding: .2rem 1.1rem; border-left: 1px solid rgba(255,255,255,.18); }
.lp-stats2 > div:first-child { border-left: 0; padding-left: 0; }
@media (max-width: 719px) { .lp-stats2 { row-gap: 1rem; } .lp-stats2 > div:nth-child(3) { border-left: 0; padding-left: 0; } }
/* composición visual */
.lp-visual { position: relative; aspect-ratio: 1.12; max-width: 640px; width: 100%; margin: 0 auto; }
.lp-ph { position: absolute; object-fit: cover; border-radius: 16px; border: 2px solid rgba(251,186,7,.55); box-shadow: 0 18px 40px rgba(0,0,0,.55); }
.lp-ph-a { left: 0; top: 6%; width: 42%; height: 58%; }
.lp-ph-b { right: 0; top: 0; width: 46%; height: 44%; }
.lp-laptop { position: absolute; left: 14%; right: 6%; bottom: 6%; filter: drop-shadow(0 24px 40px rgba(0,0,0,.6)); }
.lp-screen { background: #1a1a1c; border: 10px solid #1a1a1c; border-bottom-width: 14px; border-radius: 14px 14px 4px 4px; overflow: hidden; box-shadow: 0 0 0 1px #3a3a3e inset; }
.lp-screen img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; border-radius: 3px; }
.lp-base { height: 14px; margin: 0 -7%; background: linear-gradient(#cfd0d4, #8d8f95); border-radius: 0 0 14px 14px; position: relative; }
.lp-base::after { content: ""; position: absolute; left: 42%; right: 42%; top: 0; height: 5px; background: #6d6f75; border-radius: 0 0 6px 6px; }
.lp-float { position: absolute; display: flex; gap: .6rem; align-items: center; background: rgba(18,18,20,.92); color: #fff; border: 1px solid rgba(251,186,7,.6); border-radius: 14px; padding: .6rem .8rem; box-shadow: 0 12px 30px rgba(0,0,0,.5); backdrop-filter: blur(6px); animation: lpFloat 6s ease-in-out infinite; }
.lp-float strong { display: block; font-size: .85rem; } .lp-float small { display: block; font-size: .7rem; opacity: .75; }
.lp-f-prog { left: -2%; bottom: 30%; }
.lp-f-play { right: -1%; top: 40%; animation-delay: -2s; }
.lp-f-cert { right: 4%; bottom: -2%; animation-delay: -4s; background: #fff8e1; color: #1b1b1b; border-color: #fbba07; }
.lp-ring { --p: 75; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#fbba07 calc(var(--p) * 1%), rgba(255,255,255,.15) 0); }
.lp-ring b { width: 36px; height: 36px; border-radius: 50%; background: #121214; display: grid; place-items: center; font-size: .72rem; }
.lp-play { width: 40px; height: 40px; border-radius: 50%; background: #fbba07; color: #000; display: grid; place-items: center; font-size: .9rem; }
.lp-medal { font-size: 1.8rem; }
@keyframes lpFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .lp-float { animation: none; } }
@media (max-width: 560px) { .lp-float { padding: .45rem .55rem; gap: .4rem; } .lp-float strong { font-size: .72rem; } .lp-float small { display: none; } .lp-ring { width: 36px; height: 36px; } .lp-ring b { width: 28px; height: 28px; font-size: .6rem; } .lp-play { width: 30px; height: 30px; } .lp-medal { font-size: 1.3rem; } .lp-screen { border-width: 6px; border-bottom-width: 9px; } }
/* por qué */
.lp-kicker { display: inline-block; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink); background: var(--brand-50); padding: .25rem .7rem; border-radius: 99px; margin-bottom: .6rem; }
.lp-why-head { max-width: 760px; margin-bottom: 1.6rem; }
.lp-feats { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .lp-feats { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .lp-feats { grid-template-columns: repeat(4, 1fr); } }
.lp-feat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.lp-feat:hover { transform: translateY(-3px); }
.lp-feat img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.lp-feat > div { padding: 1rem 1.1rem 1.2rem; position: relative; }
.lp-fi { position: absolute; top: -24px; left: 1rem; width: 44px; height: 44px; border-radius: 12px; background: #fbba07; display: grid; place-items: center; font-size: 1.3rem; box-shadow: 0 6px 14px rgba(0,0,0,.2); }
.lp-feat h3 { margin: 1.1rem 0 .3rem; font-size: 1.05rem; }
.lp-feat p { margin: 0; color: var(--muted); font-size: .92rem; }
/* empresas */
.lp-biz { background: #0b0b0c; color: #f2f1ec; }
.lp-biz .lp-kicker { background: rgba(251,186,7,.15); color: #fbba07; }
.lp-biz-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .lp-biz-grid { grid-template-columns: 1fr 1.15fr; } }
.lp-biz p { opacity: .85; }
.lp-checks { list-style: none; padding: 0; margin: 1rem 0 1.4rem; display: grid; gap: .55rem; }
.lp-checks li { padding-left: 1.8rem; position: relative; }
.lp-checks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 2px solid #fbba07; color: #fbba07; display: grid; place-items: center; font-size: .75rem; font-weight: 800; }
.sem { display: inline-block; padding: .05rem .5rem; border-radius: 99px; font-size: .78rem; margin: .1rem .1rem 0 0; color: #000; }
.sem.ok { background: #2ecc71; } .sem.mid { background: #fbba07; } .sem.bad { background: #e74c3c; color: #fff; }
.lp-shot { margin: 0; border-radius: 14px; overflow: hidden; border: 2px solid rgba(251,186,7,.5); box-shadow: 0 20px 50px rgba(0,0,0,.6); background: #fff; }
.lp-shot img { display: block; width: 100%; }
/* portada: barra superior oscura */
.lp-top { background: #0b0b0c; border-bottom-color: rgba(255,255,255,.1); color: #fff; }
.lp-top .brand-logo.on-light { display: none !important; } .lp-top .brand-logo.on-dark { display: block !important; }
.lp-top .academy-tag { color: #fff; }
.lp-top .nav-links a { color: #e9e8e2; white-space: nowrap; }
.lp-top .nav-links a:hover { color: #fbba07; background: rgba(255,255,255,.06); }
.lp-top .icon-btn { color: #fff; } .lp-top .icon-btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); }
.lp-top .btn.secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.lp-hero2 h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); max-width: 17ch; }
@media (max-width: 560px) { .lp-actions .btn { width: 100%; justify-content: center; } .lp-actions .lp-link { width: 100%; text-align: center; } .lp-hero2 { padding-top: 2rem; } }
@media (min-width: 820px) and (max-width: 1100px) { .lp-top .nav-links a { padding-inline: .45rem; font-size: .9rem; } }
.lp-top .ac-minimal .ac-word { color: #fff; }
@media (max-width: 1179px) { .lp-top .nav-links { display: none; } }
.lp-andra { border: 2px solid #fbba07; border-radius: 14px; padding: 1rem 1.2rem; background: var(--brand-50); font-size: 1.05rem; line-height: 1.55; margin: .6rem 0 1rem; }
.lp-checks-light li::before { color: var(--brand-ink); border-color: #fbba07; }
.lp-quote { font-style: italic; font-weight: 600; color: var(--brand-ink); font-size: 1.1rem; margin: .4rem 0 0; }
.lp-why-head { max-width: 900px; }
.auth-poster-sm { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto 1rem; border-radius: 14px; box-shadow: var(--shadow); }
@media (min-width: 960px) { .auth-poster-sm { display: none; } }
/* portada: catálogo de cursos */
.lp-underline { position: relative; padding-bottom: .5rem; margin-bottom: .7rem; }
.lp-underline::after { content: ""; position: absolute; left: 0; bottom: 0; width: 64px; height: 5px; border-radius: 3px; background: #fbba07; }
.lp-sub { max-width: 820px; }
.lp-chips { margin: 1.1rem 0 1.4rem; gap: .45rem; }
.lp-chips .chip { display: inline-flex; gap: .35rem; align-items: center; }
.lp-courses { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 680px) { .lp-courses { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .lp-courses { grid-template-columns: repeat(3, 1fr); } }
.lp-course { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,.06); transition: transform .2s, box-shadow .2s, border-color .2s; }
.lp-course:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,.12); border-color: #fbba07; }
.lp-cover { position: relative; aspect-ratio: 400 / 200; overflow: hidden; background: linear-gradient(135deg, color-mix(in srgb, var(--cc) 22%, #fff), color-mix(in srgb, var(--cc) 40%, #fff)); display: grid; place-items: center; }
.lp-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.lp-course:hover .lp-cover img { transform: scale(1.04); }
.lp-cover-ic { font-size: 3.6rem; }
.lp-cat { position: absolute; top: .7rem; right: .7rem; background: var(--cc); color: #fff; font-size: .72rem; font-weight: 700; padding: .25rem .65rem; border-radius: 99px; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.lp-cbody { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.lp-cbody h3 { margin: 0; font-size: 1.08rem; line-height: 1.3; }
.lp-cmeta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; font-size: .78rem; color: var(--muted); }
.lp-cbody p { margin: 0; font-size: .9rem; color: var(--muted); flex: 1; }
.lp-cfoot { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-top: .4rem; padding-top: .7rem; border-top: 1px dashed var(--border); }
.lp-certok { font-size: .75rem; font-weight: 700; color: var(--brand-ink); background: var(--brand-50); border-radius: 99px; padding: .3rem .7rem; }
[data-theme="dark"] .lp-cover { filter: brightness(.92); }
.lock-badge { background: var(--surface-2); color: var(--muted); }
.lock-alert { margin-top: 1rem; }
/* 3.9: imagen de portada editable por curso */
.course-cover.has-img, .ed-cover.has-img { position: relative; overflow: hidden; }
.course-cover.has-img img, .ed-cover.has-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.course-cover.has-img .badge, .ed-cover.has-img .badge { position: relative; z-index: 1; margin-left: auto; }
.course-cover.has-img { height: 130px; }
.ed-cover.has-img { height: 160px; }
.lp-hero2 .lp-lead + .lp-lead { margin-top: -.8rem; }
/* 3.9.1: menú con «Reporte Empresas» — más compacto en pantallas medianas para que no se salga */
@media (min-width: 1180px) and (max-width: 1499px) { .lp-top .nav-links { margin-left: .4rem; gap: 0; } .lp-top .nav-links a { padding-inline: .5rem; font-size: .88rem; } }
@media (max-width: 1299px) { .lp-top .nav-links { display: none; } }
/* 4.0: botón 🔑 restablecer contraseña: acciones de usuario en una sola fila */
.u-act .btn.ghost.sm { padding-inline: .4rem; }
@media (min-width: 1101px) { .u-head, .u-row { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1.3fr) minmax(0, .9fr) 7.5rem 14.5rem; } .u-act { flex-wrap: nowrap; } }
/* 5.0: páginas públicas (privacidad, recuperar contraseña) */
.pub-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.pub-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.pub-head .logo { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.pub-head .brand-logo { height: 30px; width: auto; } .pub-head .brand-iso { display: none; }
.pub-main { flex: 1; width: 100%; max-width: 480px; margin: 0 auto; padding: 2rem 16px; }
.pub-main.wide { max-width: 860px; }
.pub-card h1 { font-size: 1.6rem; margin-top: 0; }
.pub-foot { text-align: center; padding: 1rem 16px 1.4rem; }
.legal h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin-top: 0; }
.legal h2 { margin-top: 2rem; padding-top: .6rem; border-top: 3px solid #fbba07; }
.legal h3 { margin: 1.2rem 0 .3rem; font-size: 1.05rem; }
.legal p, .legal li { line-height: 1.6; } .legal li { margin: .25rem 0; }
.legal-toc { margin: .4rem 0 1rem; }
@media (max-width: 560px) { .pub-head .brand-logo { display: none !important; } .pub-head .brand-iso { display: block; height: 30px; width: auto; } .pub-head .logo { overflow: hidden; } }
