:root {
  --bg: #ffffff;
  --bg2: #f6f8fb;
  --panel: #ffffff;
  --panel2: #f1f4f9;
  --line: #e4e8ef;
  --line2: #cdd5e1;
  --text: #1a2336;
  --muted: #5d6a82;
  --faint: #8792a8;
  --navy: #222e46;
  --navy-2: #2d3b58;
  --tint: rgba(34, 46, 70, .07);
  --accent: #222e46;
  --accent-d: #222e46;
  --gold: #8a6a2c;
  --gold-bg: rgba(138, 106, 44, .11);
  --bad: #c0364a;
  --bad-bg: rgba(192, 54, 74, .09);
  --warn: #9a6a08;
  --warn-bg: rgba(200, 140, 20, .13);
  --ok: #1b7f61;
  --ok-bg: rgba(27, 127, 97, .10);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(26, 35, 54, .04), 0 6px 20px rgba(26, 35, 54, .05);
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Fraunces', 'Lora', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
body.noscroll { overflow: hidden; }
a { color: var(--navy); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; }
h1 { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 2rem; letter-spacing: -.015em; color: var(--navy); }
h2 { font-size: 1.05rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .6em; }
button, input, select, textarea { font: inherit; color: inherit; }
.pre { white-space: pre-wrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .82rem; }
.tiny { font-size: .74rem; }
.hide { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.gap-s { gap: 6px; }
.mt { margin-top: 14px; }
.mt-s { margin-top: 8px; }
.mb { margin-bottom: 14px; }
.center { text-align: center; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 700; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: var(--bg); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: block; padding: 6px 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.brand img { display: block; width: 100%; max-width: 196px; height: auto; }
.brand b { display: block; font-size: .95rem; line-height: 1.15; }
.brand span { font-size: .72rem; color: var(--muted); }
.navgroup { margin: 14px 0 4px 10px; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: .9rem; cursor: pointer; text-decoration: none; }
.nav a:hover { background: var(--panel2); color: var(--navy); text-decoration: none; }
.nav a.on { background: var(--navy); color: #fff; }
.nav svg, .ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pill { margin-left: auto; background: var(--bad); color: #fff; border-radius: 99px; font-size: .68rem; font-weight: 600; padding: 1px 7px; }
.pill.soft { background: var(--panel2); color: var(--muted); }
.nav a.on .pill { background: #fff; color: var(--navy); }
.who { margin-top: auto; padding: 14px 8px 4px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.who b { display: block; font-size: .85rem; line-height: 1.2; }
.who span { font-size: .72rem; color: var(--muted); }
.main { padding: 34px 40px 90px; max-width: 1280px; width: 100%; }
.topbar { display: none; }
.pagehead { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.pagehead p { color: var(--muted); margin: 4px 0 0; max-width: 62ch; }
.demo-bar { background: var(--gold-bg); border: 1px solid rgba(138, 106, 44, .3); color: var(--gold); border-radius: 10px; padding: 8px 12px; font-size: .8rem; margin-bottom: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.demo-bar button { background: none; border: 1px solid currentColor; color: inherit; border-radius: 7px; padding: 2px 9px; cursor: pointer; font-size: .76rem; }

/* ---------- Componentes ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line2); background: #fff; color: var(--navy); padding: 8px 15px; border-radius: 10px; cursor: pointer; font-weight: 500; font-size: .87rem; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--navy); background: var(--tint); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--navy-2); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.ghost:hover { color: var(--navy); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { background: var(--bad); filter: brightness(.94); }
.btn.sm { padding: 4px 10px; font-size: .78rem; border-radius: 8px; }
.btn .ico { width: 15px; height: 15px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.flat { padding: 0; overflow: hidden; }
.card h2 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card h2 small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat b { display: block; font-family: var(--serif); font-style: italic; font-size: 2.1rem; line-height: 1.1; font-weight: 600; color: var(--navy); }
.stat span { font-size: .78rem; color: var(--muted); }
.stat.bad b { color: var(--bad); } .stat.warn b { color: var(--warn); } .stat.ok b { color: var(--ok); }
.banner { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 18px 24px; display: flex; gap: 18px; align-items: center; margin-bottom: 16px; }
.banner big { font-family: var(--serif); font-style: italic; font-size: 2.9rem; font-weight: 600; line-height: 1; color: #fff; min-width: 1.4ch; text-align: center; }
.banner .muted { color: rgba(255, 255, 255, .72); }
.badge { display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.info { background: var(--tint); color: var(--navy); border-color: transparent; }
.badge.gold { background: var(--tint); color: var(--navy); border-color: transparent; }
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .66rem; font-weight: 600; color: #fff; border: 2px solid var(--panel); flex: none; }
.avs { display: inline-flex; } .avs .av + .av { margin-left: -8px; }
.av.lg { width: 38px; height: 38px; font-size: .85rem; }
.empty { text-align: center; color: var(--muted); padding: 34px 16px; background: var(--bg2); border: 1px dashed var(--line2); border-radius: var(--radius); }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 99px; padding: 5px 14px; cursor: pointer; font-size: .82rem; font-weight: 500; }
.tab:hover { color: var(--navy); border-color: var(--navy); }
.tab.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.tab .n { opacity: .7; margin-left: 4px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; font-size: .84rem; }

/* Formularios */
label { display: block; font-size: .78rem; color: var(--muted); font-weight: 500; margin: 0 0 4px; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=url], input[type=search], input[type=tel], input[type=number], select, textarea { width: 100%; background: #fff; border: 1px solid var(--line2); border-radius: 9px; padding: 9px 11px; outline: none; color: var(--text); }
input:focus, select:focus, textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(34, 46, 70, .12); }
textarea { resize: vertical; min-height: 84px; }
select option { background: #fff; }
input[type=checkbox], input[type=radio] { accent-color: var(--navy); width: 16px; height: 16px; }
.field { margin-bottom: 12px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { display: flex; gap: 7px; align-items: center; color: var(--text); font-size: .84rem; margin: 0; cursor: pointer; }
.hint { font-size: .76rem; color: var(--faint); margin-top: 4px; }
.err { color: var(--bad); font-size: .83rem; min-height: 1.2em; margin-top: 8px; }

/* Tablas y listas */
.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--bg2); }
.scroll-x { overflow-x: auto; }
.list { display: flex; flex-direction: column; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; border-left: 3px solid transparent; }
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--bg2); }
.item.bad { border-left-color: var(--bad); } .item.warn { border-left-color: var(--warn); } .item.ok { border-left-color: var(--ok); }
.item .num { color: var(--faint); font-size: .75rem; width: 34px; flex: none; }
.item .t { font-weight: 500; }
.item .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 3px; font-size: .76rem; color: var(--muted); }
.item.done .t { text-decoration: line-through; color: var(--muted); }
.group-h { padding: 9px 16px; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--bg2); display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.bar { height: 7px; background: var(--panel2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--navy); border-radius: 99px; }
.bar.ok i { background: var(--ok); } .bar.warn i { background: var(--warn); } .bar.bad i { background: var(--bad); }

/* Tarjetas de contenido */
.res { display: flex; flex-direction: column; gap: 8px; }
.res h3 { font-size: 1rem; }
.res > .badge { align-self: flex-start; }
.res { transition: border-color .15s, transform .15s; }
a.res:hover { border-color: var(--navy); transform: translateY(-1px); text-decoration: none; }
.res p { color: var(--muted); font-size: .85rem; margin: 0; }
.res .foot { margin-top: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 6px; }
.ann { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.ann:last-child { border-bottom: 0; }
.ann.pinned { background: var(--bg2); box-shadow: inset 3px 0 0 var(--navy); }
.ann h3 { font-size: 1.02rem; margin: 4px 0 6px; }
.reply { background: var(--panel2); border-radius: 10px; padding: 8px 12px; margin-top: 8px; font-size: .86rem; }
.quote { border-left: 3px solid var(--navy); padding: 4px 0 4px 14px; color: var(--muted); font-size: .9rem; }

/* Asistencia */
.att { display: inline-flex; gap: 4px; }
.att button { width: 34px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); color: var(--muted); cursor: pointer; font-weight: 600; font-size: .78rem; }
.att button.P.on { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.att button.T.on { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.att button.A.on { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.att button.E.on { background: var(--tint); color: var(--navy); border-color: var(--navy); }

/* Minutas / vista previa */
.paper { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); color: #1b2438; border-radius: 12px; padding: 24px 26px; font-size: .86rem; }
.paper h3 { font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--navy); margin-bottom: 4px; }
.paper h4 { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 14px 0 4px; }
.paper ul { margin: 0; padding-left: 18px; }

/* Gate / login */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 32px 24px; background: var(--bg); }
.gate-in { width: 100%; max-width: 880px; }
.gate-in.narrow { max-width: 480px; }
.gate-in.narrow .tabs { gap: 4px; }
.gate-in.narrow .tab { padding: 5px 11px; font-size: .8rem; }
.gate-head { text-align: center; margin-bottom: 34px; }
.gate-head img { display: block; width: min(420px, 80vw); height: auto; margin: 0 auto 18px; }
.gate-head h1 { display: none; }
.gate-head p { color: var(--muted); margin-top: 6px; }
.gate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gate .card { padding: 28px; }
.gate .card h2 { font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: var(--navy); }
.demo-box { margin-top: 18px; font-size: .8rem; }
.demo-box table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.demo-box td { padding: 4px 8px; border-bottom: 1px solid var(--line); }
.demo-box code { background: var(--panel2); padding: 1px 6px; border-radius: 5px; color: var(--navy); }

/* Modal y avisos */
.overlay { position: fixed; inset: 0; background: rgba(26, 35, 54, .45); backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 14px; overflow-y: auto; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; width: 100%; max-width: 560px; box-shadow: 0 30px 80px rgba(26, 35, 54, .25); }
.modal.wide { max-width: 760px; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal .x { background: none; border: 0; color: var(--muted); font-size: 1.6rem; cursor: pointer; line-height: 1; }
.mbody { padding: 18px 20px; }
.modal footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #fff; border: 1px solid var(--line2); border-left: 3px solid var(--navy); padding: 10px 14px; border-radius: 10px; box-shadow: 0 10px 30px rgba(26, 35, 54, .18); font-size: .86rem; transition: opacity .3s, transform .3s; max-width: 340px; }
.toast.bad { border-left-color: var(--bad); } .toast.ok { border-left-color: var(--ok); }
.toast.out { opacity: 0; transform: translateY(6px); }
.thread { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.msg { display: flex; gap: 10px; } .msg .b { background: var(--panel2); border-radius: 10px; padding: 8px 12px; flex: 1; font-size: .86rem; }
.video-frame { aspect-ratio: 16/9; width: 100%; border: 0; border-radius: 10px; background: #000; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 40; transform: translateX(-102%); transition: transform .22s; box-shadow: 0 0 60px rgba(26, 35, 54, .25); }
  body.menu .side { transform: none; }
  body.menu::after { content: ''; position: fixed; inset: 0; background: rgba(26, 35, 54, .4); z-index: 39; }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 10px 16px; }
  .topbar img { height: 26px; width: auto; display: block; }
  .topbar button { background: none; border: 1px solid var(--line); border-radius: 9px; color: var(--navy); width: 38px; height: 36px; cursor: pointer; display: grid; place-items: center; }
  .main { padding: 18px 16px 70px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .gate-grid { grid-template-columns: 1fr; }
  .fgrid { grid-template-columns: 1fr; }
  h1 { font-size: 1.4rem; }
  .banner big { font-size: 2.2rem; }
  .main { padding: 22px 16px 70px; }
  .overlay { padding: 2vh 8px; }
}
@media (max-width: 480px) {
  .g5 { grid-template-columns: 1fr 1fr; }
  .stat b { font-size: 1.5rem; }
}

/* ---------- Práctica (ejercicios interactivos) ---------- */
.ex { padding: 22px; max-width: 760px; }
.ex-mix { display: flex; align-items: center; justify-content: space-between; gap: 16px; text-decoration: none; color: inherit; border-color: var(--navy); background: var(--navy); color: #fff; }
.ex-mix:hover { background: var(--navy-2); text-decoration: none; }
.ex-mix .muted { color: rgba(255, 255, 255, .72); }
.ex-mix .badge { background: rgba(255, 255, 255, .14); color: #fff; }
.ex-mix .btn { background: #fff; color: var(--navy); border-color: #fff; }
.ex-mix h3 { margin: 6px 0 4px; }
.ex-top { display: flex; justify-content: space-between; gap: 10px; font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.ex-sc b { color: var(--text); }
.ex-timer { margin-top: 6px; }
.ex-timer i { transition: width .1s linear; }
.ex-q { font-size: 1.12rem; line-height: 1.4; margin: 14px 0 16px; font-weight: 600; }
.ex-opts { display: grid; gap: 9px; }
.ex-opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 11px 14px; cursor: pointer; font-size: .92rem; line-height: 1.4; transition: border-color .12s, background .12s; }
.ex-opt:hover:not(:disabled) { border-color: var(--navy); background: var(--bg2); }
.ex-opt .kb { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line2); display: grid; place-items: center; font-size: .72rem; color: var(--muted); margin-top: 1px; }
.ex-opt:disabled { cursor: default; color: var(--text); }
.ex-opt.ok { background: var(--ok-bg); border-color: var(--ok); }
.ex-opt.ok .kb { background: var(--ok); border-color: var(--ok); color: #fff; }
.ex-opt.bad { background: var(--bad-bg); border-color: var(--bad); }
.ex-opt.bad .kb { background: var(--bad); border-color: var(--bad); color: #fff; }
.ex-opt.dim { opacity: .5; }
.ex-fb { margin-top: 14px; padding: 11px 14px; border-radius: 11px; font-size: .88rem; border: 1px solid var(--line); background: var(--bg2); }
.ex-fb.ok { background: var(--ok-bg); border-color: transparent; }
.ex-fb.bad { background: var(--bad-bg); border-color: transparent; }
.ex-fb .small { margin-top: 4px; color: var(--muted); }
.ex-intro h2 { font-size: 1.2rem; margin-bottom: 6px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--text); cursor: pointer; margin: 12px 0 0; }
.chk input { width: 16px; height: 16px; accent-color: var(--navy); }
.ex-result { text-align: center; }
.ex-result h2 { font-size: 1.25rem; margin: 10px 0 4px; }
.ring { width: 104px; height: 104px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; border: 6px solid var(--line2); font-size: 1.5rem; }
.ring.ok { border-color: var(--ok); } .ring.warn { border-color: var(--warn); } .ring.bad { border-color: var(--bad); }
.ex-miss { display: grid; gap: 10px; text-align: left; }
.ex-m { background: var(--bg2); border: 1px solid var(--line); border-radius: 11px; padding: 11px 14px; font-size: .88rem; }
.ex-m .ok-t { color: var(--ok); margin: 3px 0; }
.ex-result > h3 { text-align: left; }
.center { text-align: center; justify-content: center; }
.row.center { display: flex; }

.ex-cloze { padding-left: 22px; margin: 14px 0; display: grid; gap: 16px; line-height: 2.2; font-size: .95rem; }
.ex-cloze li::marker { color: var(--faint); }
.blank { background: var(--panel2); border: 0; border-bottom: 2px solid var(--navy); border-radius: 6px 6px 0 0; padding: 2px 8px; margin: 0 3px; text-align: center; font-size: .92rem; min-width: 0; color: var(--text); }
.blank:focus { outline: none; background: var(--tint); }
.blank.ok { border-bottom-color: var(--ok); background: var(--ok-bg); }
.blank.bad { border-bottom-color: var(--bad); background: var(--bad-bg); }
.blank:disabled { opacity: 1; -webkit-text-fill-color: var(--text); }

.flash { perspective: 1200px; cursor: pointer; margin: 18px 0 10px; outline: none; }
.flash:focus-visible .flash-in { box-shadow: 0 0 0 2px var(--navy); }
.flash-in { display: grid; position: relative; transition: transform .45s; transform-style: preserve-3d; min-height: 190px; border-radius: 16px; }
.flash.flipped .flash-in { transform: rotateY(180deg); }
.face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 16px; border: 1px solid var(--line2); padding: 22px 26px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; background: #fff; box-shadow: var(--shadow); }
.face small { text-transform: uppercase; letter-spacing: .08em; font-size: .66rem; color: var(--faint); margin-bottom: 10px; }
.face p { font-size: 1.08rem; line-height: 1.45; margin: 0; }
.face.front p { font-weight: 600; font-size: 1.2rem; }
.face.back { transform: rotateY(180deg); background: var(--navy); border-color: var(--navy); color: #fff; }
.face.back small { color: rgba(255, 255, 255, .6); }

.mt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.mt-col { display: grid; gap: 9px; align-content: start; }
.mt-item { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; font-size: .86rem; line-height: 1.4; cursor: pointer; transition: border-color .12s, background .12s; }
.mt-item:hover:not(:disabled) { border-color: var(--navy); }
.mt-item.sel { border-color: var(--navy); background: var(--tint); }
.mt-item.done { border-color: var(--ok); background: var(--ok-bg); cursor: default; color: var(--text); }
.mt-item.wrong { border-color: var(--bad); background: var(--bad-bg); }
.mt-item:disabled { opacity: 1; }
@media (max-width: 600px) {
  .ex { padding: 16px; }
  .mt-grid { gap: 8px; }
  .mt-item { font-size: .8rem; padding: 10px; }
  .ex-mix { flex-direction: column; align-items: flex-start; }
  .ex-cloze { line-height: 2.4; }
}

/* Galería */
.gallery { columns: 4 220px; column-gap: 14px; }
.ph { break-inside: avoid; margin: 0 0 14px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line, #e6e8ee); background: #fff; cursor: pointer; }
.ph img { display: block; width: 100%; height: auto; transition: opacity .15s; }
.ph:hover img { opacity: .92; }
.ph figcaption { padding: 8px 10px; font-size: .82rem; color: var(--muted, #5a6478); }
.ph figcaption:empty { display: none; }
/* Temas de las tarjetas de video: texto que fluye, no etiqueta de una sola línea */
.theme { font-size: .8rem; color: var(--muted, #5a6478); line-height: 1.35; margin: 2px 0 0; }
