/* Área de alumnos · estilo «Acuarela» (elegido en el taller del 2026-11-04): lavanda y
   azul cielo, tarjetas de cristal, esquinas redondas, botones píldora, Cormorant Garamond
   en títulos y preguntas. Sigue al modo del teléfono salvo que se elija otro con el botón
   redondo (data-theme en <html>, guardado en localStorage «ewp-theme»). */
:root {
  --bg: #EEF0FC;
  --surface: rgba(255, 255, 255, .82);
  --surface-2: #E3E7FA;
  --solid: #ffffff;
  --text: #16204A;
  --muted: #4E5781;
  --line: rgba(30, 49, 117, .10);
  --line-2: rgba(30, 49, 117, .18);
  --accent: #1E3175;
  --accent-soft: #E3E7FA;
  --on-accent: #fff;
  --coral: #E0542C;
  --gold: #A97B2E;
  --ok: #2f7d4f;
  --ko: #b8402f;
  --ok-soft: color-mix(in srgb, var(--ok) 12%, var(--solid));
  --ko-soft: color-mix(in srgb, var(--ko) 10%, var(--solid));
  --disc: transparent;
  --sky: #9CC6EC;
  --lavender: #C9CDF3;
  --fx: 1;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px -18px rgba(30, 49, 117, .45);
  --font: "Lato", "Helvetica Neue", Arial, sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1838;
    --surface: rgba(30, 43, 90, .72);
    --surface-2: #24336A;
    --solid: #16224A;
    --text: #EEF0FC;
    --muted: #A9B1DA;
    --line: rgba(232, 234, 251, .12);
    --line-2: rgba(232, 234, 251, .2);
    --accent: #9CC6EC;
    --accent-soft: #24336A;
    --on-accent: #0E1838;
    --coral: #F07250;
    --gold: #C9A464;
    --ok: #7fd3a0;
    --ko: #f08a76;
    --disc: #EEF0FC;
    --fx: .35;
    --shadow: 0 10px 30px -18px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1838;
  --surface: rgba(30, 43, 90, .72);
  --surface-2: #24336A;
  --solid: #16224A;
  --text: #EEF0FC;
  --muted: #A9B1DA;
  --line: rgba(232, 234, 251, .12);
  --line-2: rgba(232, 234, 251, .2);
  --accent: #9CC6EC;
  --accent-soft: #24336A;
  --on-accent: #0E1838;
  --coral: #F07250;
  --gold: #C9A464;
  --ok: #7fd3a0;
  --ko: #f08a76;
  --disc: #EEF0FC;
  --fx: .35;
  --shadow: 0 10px 30px -18px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
/* Tres manchas de acuarela fijas: cielo arriba a la derecha y abajo, lavanda a la izquierda */
.bgfx {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--fx);
  background:
    radial-gradient(60% 40% at 90% 0%, color-mix(in srgb, var(--sky) 70%, transparent), transparent 70%),
    radial-gradient(50% 35% at 0% 30%, color-mix(in srgb, var(--lavender) 80%, transparent), transparent 70%),
    radial-gradient(60% 40% at 100% 80%, color-mix(in srgb, var(--sky) 45%, transparent), transparent 70%);
}
#app { max-width: 720px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 16px 28px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
h1 { font-family: var(--serif); font-size: 32px; font-weight: 600; line-height: 1.1; letter-spacing: .005em; text-wrap: balance; }
h2 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .18em; color: var(--muted); margin: 30px 0 12px; }
h3 { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.15; }
p { text-wrap: pretty; }
/* Punto coral al final de los títulos */
.dot { display: inline-block; width: .16em; height: .16em; border-radius: 50%; background: var(--coral); margin-left: .05em; vertical-align: baseline; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.mt { margin-top: 14px; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.rule { height: 1px; margin: 26px 0 0; background: linear-gradient(90deg, var(--gold), transparent); opacity: .7; }

/* Entrada escalonada de cada vista */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
#app > * { animation: rise .5s var(--ease) both; }
#app > *:nth-child(2) { animation-delay: .05s; }
#app > *:nth-child(3) { animation-delay: .1s; }
#app > *:nth-child(4) { animation-delay: .15s; }
#app > *:nth-child(5) { animation-delay: .2s; }
#app > *:nth-child(n+6) { animation-delay: .25s; }
body.running #app > * { animation: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Cabecera */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; min-height: 40px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 40px; height: 40px; border-radius: 50%; background: var(--disc); display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; }
.logo img { width: 36px; height: auto; }
.brand-name { font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.05; letter-spacing: .01em; }
.brand-sub { white-space: nowrap; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.top-r { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.sync { white-space: nowrap; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.sync-name { font-weight: 700; color: var(--text); max-width: 12ch; overflow: hidden; text-overflow: ellipsis; }
.sync .dot-s { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.sync .dot-s.on { background: var(--ok); }
.sync .dot-s.off { background: var(--gold); }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; color: var(--muted); padding: 8px 10px 8px 4px; border-radius: 10px; transition: color .15s; }
.back:hover { color: var(--text); }
.theme-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--muted); transition: color .15s, transform .12s var(--ease); }
.theme-btn:hover { color: var(--text); }
.theme-btn:active { transform: scale(.94); }
.theme-btn svg { width: 18px; height: 18px; }

/* Tarjetas de cristal */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.card + .card { margin-top: 12px; }

/* Aviso de caducidad */
.m-expiry { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: var(--text); border-left: 3px solid var(--coral); padding: 10px 14px; background: var(--surface); border-radius: 0 12px 12px 0; margin-bottom: 14px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.m-expiry b { font-weight: 700; }
.m-expiry a { margin-left: auto; font-weight: 700; color: var(--coral); white-space: nowrap; }

/* Repaso del día: la rosa de los vientos de María con el número en el punto coral */
.hero { display: flex; align-items: center; gap: 16px; }
.rose { position: relative; flex: 0 0 auto; width: 104px; height: 104px; border-radius: 50%; background: var(--disc); display: grid; place-items: center; }
.rose img { width: 104px; height: auto; opacity: .9; animation: needle 9s ease-in-out infinite; }
.rose b { position: absolute; bottom: -6px; right: -6px; min-width: 44px; height: 44px; border-radius: 99px; display: grid; place-items: center; background: var(--coral); color: #fff; font: 600 18px var(--mono); font-variant-numeric: tabular-nums; box-shadow: 0 6px 14px -6px rgba(224, 84, 44, .7); padding: 0 8px; }
@keyframes needle { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.hero-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.hero h3 { font-size: 23px; }
.hero .small { color: var(--muted); }

/* Inicio: bloques Practicar y Simulacro */
.block-h { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 4px; }
.block-h h2 { margin: 0; font-family: var(--serif); font-size: 23px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text); }
.explain { font-size: 14px; line-height: 1.55; color: var(--muted); margin-bottom: 12px; max-width: 62ch; }
.rows { padding: 0; overflow: hidden; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line); transition: background .15s; }
.lrow:first-child { border-top: 0; }
.lrow:hover { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.lrow:active { background: var(--surface-2); }
.lrow .t { flex: 1; min-width: 0; }
.lrow .t b { display: block; font-size: 15px; font-weight: 700; }
.lrow .t span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.lrow .k { display: flex; gap: 14px; text-align: right; }
.lrow .k b { display: block; font-family: var(--mono); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.lrow .k small { font-size: 10.5px; color: var(--muted); }
.lrow .go { color: var(--muted); font-size: 22px; line-height: 1; }

/* Antes del simulacro: puntuación y consejo del −0,33 */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; overflow: hidden; }
.facts div { padding: 12px 8px; text-align: center; }
.facts div + div { border-left: 1px solid var(--line); }
.facts b { display: block; font-family: var(--mono); font-size: 20px; font-weight: 600; }
.facts span { font-size: 12px; color: var(--muted); }
.tip { display: flex; gap: 12px; align-items: flex-start; border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.tip .tip-ico { flex: 0 0 auto; color: var(--gold); margin-top: 1px; }
.tip p { font-size: 14px; line-height: 1.6; color: var(--muted); max-width: 62ch; }
.tip b { font-weight: 700; color: var(--text); }

/* Cifras en fila (Progreso) */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.kpi { padding: 10px 12px; }
.kpi + .kpi { border-left: 1px dashed var(--line-2); }
.kpi .v { font-family: var(--mono); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi .l { font-size: 11.5px; color: var(--muted); line-height: 1.3; margin-top: 2px; }

/* Botones píldora */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 700; font-size: 14.5px; letter-spacing: .02em; text-align: center; transition: background .15s, border-color .15s, transform .12s var(--ease), filter .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 8px 20px -12px var(--accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.1); }
.btn.wa { background: #25D366; border-color: #25D366; color: #073b1d; }
.btn.wa:hover:not(:disabled) { background: #25D366; filter: brightness(1.05); }
.btn.wa svg { width: 18px; height: 18px; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 14px; font-size: 13.5px; }
.btn:disabled { opacity: .4; cursor: default; box-shadow: none; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btns .btn { flex: 1; }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.link { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Chips y formularios */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; transition: background .15s, border-color .15s, color .15s, transform .12s; }
.chip:active { transform: scale(.97); }
.chip .muted { font-family: var(--mono); font-size: 12px; margin-left: 2px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip.on .muted { color: inherit; opacity: .75; }
.field + .field { margin-top: 18px; }
.field > label { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border-radius: 99px; padding: 4px; gap: 2px; max-width: 100%; }
.seg button { padding: 7px 14px; border-radius: 99px; font-size: 14px; color: var(--muted); transition: background .18s, color .18s, box-shadow .18s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--solid); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 2px 8px -4px rgba(0, 0, 0, .2); font-weight: 700; }
.lede { color: var(--muted); margin-top: 8px; max-width: 60ch; font-size: 15px; }
.input, .search, .note-txt, .modal textarea { font: inherit; color: var(--text); background: var(--solid); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 13px; width: 100%; font-size: 16px; }
.input { min-height: 48px; }
.input:focus, .search:focus, .note-txt:focus, .modal textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); line-height: 1.5; cursor: pointer; }
.check input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); }
.check a { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.err { color: var(--ko); font-size: 13.5px; font-weight: 700; }
.err:empty { display: none; }

/* Pantallas centradas: entrada, invitación, caducado */
.gate { max-width: 400px; margin: 0 auto; }
.gate-top { display: flex; justify-content: flex-end; }
.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 4vh; }
.center .logo { width: 76px; height: 76px; }
.center .logo img { width: 70px; }
.center p { color: var(--muted); max-width: 34ch; }
.gate form { margin-top: 22px; display: flex; flex-direction: column; gap: 16px; }
.gate .field + .field { margin-top: 0; }
.footnote { font-size: 12.5px; color: var(--muted); text-align: center; }
.forgot { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.forgot p { font-size: 14px; color: var(--muted); }
.textbtn { font-size: 13.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 8px; }

/* Sesión en curso */
.runbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.qx { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--muted); background: var(--surface); }
.runbar .count { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
.runbar .count b { color: var(--text); font-weight: 600; }
.runbar .score, .timer { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13.5px; padding: 4px 11px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.timer.low { color: var(--ko); border-color: var(--ko); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .55; } }
.progress { height: 3px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: var(--coral); transition: width .45s var(--ease); }
.qcard { padding: 20px 18px 18px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; margin-bottom: 4px; }
.tag { font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
:root[data-theme="dark"] .tag { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag { color: var(--accent); } }
.tag.doubt { color: var(--ko); }
.qid { font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.qtext { font-family: var(--serif); font-size: 24px; line-height: 1.25; font-weight: 600; margin: 8px 0 16px; white-space: pre-line; text-wrap: pretty; overflow-wrap: anywhere; }
.opt { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 12px; margin-bottom: 9px; border-radius: var(--radius-sm); border: 1.5px solid var(--line-2); background: var(--solid); font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; transition: border-color .25s, background .25s, opacity .25s, transform .12s var(--ease); }
.opt:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.opt:active:not(:disabled) { transform: scale(.99); }
.opt .k { flex: 0 0 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-family: var(--mono); font-weight: 500; font-size: 12px; color: var(--muted); transition: background .25s, color .25s, border-color .25s; }
.opt.sel { border-color: var(--accent); }
.opt.sel .k { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.opt.correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.correct .k { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--ko); background: var(--ko-soft); }
.opt.wrong .k { background: var(--ko); border-color: var(--ko); color: #fff; }
.opt:disabled { cursor: default; color: var(--text); }
.opt.dim { opacity: .5; }
.exp { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 14.5px; line-height: 1.6; color: var(--muted); animation: fade-in .3s ease both; }
.exp b { color: var(--text); }
.exp .res { display: block; font-family: var(--serif); font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.exp .res.ok { color: var(--ok); }
.exp .res.ko { color: var(--ko); }
.report { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--muted); padding: 6px 12px 6px 10px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface); }
.report:hover { color: var(--text); }
.report svg { width: 14px; height: 14px; }
.runfoot { display: flex; gap: 8px; margin-top: 16px; }
.runfoot .btn { flex: 1; }
details > summary.small { padding: 8px 2px; }
.sheet { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-top: 10px; }
.sheet button { aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; transition: background .15s; }
.sheet button.ans { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.sheet button.cur { outline: 2px solid var(--coral); outline-offset: 1px; }
@media (max-width: 420px) { .sheet { grid-template-columns: repeat(8, 1fr); } }
.kbd-hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: 16px; }
.kbd-hint kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }
@media (hover: none) { .kbd-hint { display: none; } }

/* Resultados */
.result-hero { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; padding: 22px; }
.gauge { position: relative; width: 132px; height: 132px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .track { stroke: var(--surface-2); }
.gauge .val { transition: stroke-dashoffset 1s var(--ease); }
.gauge .num { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge .num b { font-family: var(--mono); font-size: 30px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.gauge .num span { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 4px; }
.verdict { font-family: var(--serif); font-size: 23px; font-weight: 600; line-height: 1.2; }
.result-hero .of { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.pill { font-family: var(--mono); font-size: 12px; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.ko { background: var(--ko-soft); color: var(--ko); }
@media (max-width: 440px) {
  .result-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .result-hero .pills { justify-content: center; }
}
.ok-t { color: var(--ok); } .ko-t { color: var(--ko); }

/* Barras y listas */
.bar-row { display: grid; grid-template-columns: minmax(110px, 40%) 1fr 52px; gap: 12px; align-items: center; padding: 8px 0; font-size: 14px; }
.bar-row + .bar-row { border-top: 1px dashed var(--line-2); }
.bar-row .muted.small { font-family: var(--mono); font-size: 11.5px; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transform-origin: left; animation: grow .7s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
.bar-row .pct { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; }
@media (max-width: 520px) {
  .bar-row { grid-template-columns: 1fr auto; grid-template-areas: "label pct" "bar bar"; row-gap: 7px; }
  .bar-row > :nth-child(1) { grid-area: label; }
  .bar-row > .bar { grid-area: bar; }
  .bar-row > .pct { grid-area: pct; }
}
.list-item { padding: 13px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; padding-top: 2px; }
.list-item:last-child { padding-bottom: 2px; }
.list-item .q { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.list-item .a { font-size: 14px; margin-top: 6px; padding-left: 18px; }
.list-item .exp { margin-left: 18px; }
details summary { cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details[open] summary .chev { transform: rotate(90deg); }
.chev { display: inline-block; width: 12px; transition: transform .2s var(--ease); color: var(--muted); }
.hist-wrap { overflow-x: auto; }
table.hist { width: 100%; border-collapse: collapse; font-size: 13px; font-family: var(--mono); font-variant-numeric: tabular-nums; margin-top: 8px; }
table.hist td, table.hist th { padding: 9px 4px; border-top: 1px solid var(--line); text-align: left; }
table.hist th { color: var(--muted); font-weight: 500; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; border-top: 0; }
.chart { width: 100%; height: 150px; display: block; margin-top: 8px; }
.empty { text-align: center; padding: 36px 10px; color: var(--muted); }
.empty .ico { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }

/* Barra de pestañas */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); width: min(440px, calc(100% - 24px)); display: flex; padding: 6px; gap: 2px; background: var(--surface); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); border: 1px solid var(--line); border-radius: 99px; box-shadow: 0 12px 32px -12px rgba(14, 24, 56, .35); z-index: 10; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; font-size: 11px; font-weight: 700; color: var(--muted); position: relative; border-radius: 99px; transition: color .18s, background .18s; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a:hover { color: var(--text); }
.tabbar a.on { color: var(--coral); }
:root[data-theme="dark"] .tabbar a.on { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabbar a.on { color: var(--accent); } }
.badge-count { position: absolute; top: 2px; left: calc(50% + 7px); background: var(--coral); color: #fff; font-family: var(--mono); font-size: 10px; font-weight: 600; border-radius: 99px; padding: 0 5px; min-width: 17px; line-height: 17px; text-align: center; }
.badge-count:empty { display: none; }
body.running .tabbar, body.bare .tabbar { display: none; }
body.running, body.bare { padding-bottom: 24px; }

.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translate(-50%, 10px) scale(.98); display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100% - 32px)); width: max-content; background: var(--solid); color: var(--text); border: 1px solid var(--line-2); padding: 10px 18px 10px 10px; border-radius: 99px; font-size: 14.5px; font-weight: 700; line-height: 1.35; box-shadow: 0 16px 36px -14px rgba(14, 24, 56, .45); z-index: 30; opacity: 0; transition: opacity .2s, transform .3s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
body.running .toast, body.bare .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }
.toast-ico { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.toast-ico svg { width: 15px; height: 15px; }
.toast[data-kind="ok"] .toast-ico { background: var(--ok-soft); color: var(--ok); }
.toast[data-kind="warn"] .toast-ico, .toast[data-kind="time"] .toast-ico { background: color-mix(in srgb, var(--coral) 16%, var(--solid)); color: var(--coral); }

/* Explicaciones por opción y apuntes */
.exp .why { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.exp .why b { color: var(--ko); }
.exp .why b.warn-t { color: var(--gold); }
.saved { margin-top: 10px; padding: 9px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 13.5px; }
.others { margin-top: 10px; }
.others summary { padding: 4px 0; }
.others .other { font-size: 14px; line-height: 1.55; padding: 7px 0 0 18px; color: var(--muted); }
.others .other b { font-weight: 700; color: var(--text); }
mark { background: color-mix(in srgb, var(--coral) 16%, transparent); color: inherit; padding: 0 4px; border-radius: 5px; font-weight: 700; }
.note-txt { display: block; margin: 12px 0 0 18px; width: calc(100% - 18px); min-height: 64px; resize: vertical; line-height: 1.5; }
.note-meta { padding-left: 18px; margin-top: 3px; font-family: var(--mono); font-size: 11.5px; }
.note-h { display: flex; justify-content: space-between; align-items: baseline; }
.note .btns { padding-left: 18px; }

/* Modales (sustituyen a confirm()) */
.modal { margin: auto; width: min(400px, calc(100% - 32px)); padding: 26px 22px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--solid); color: var(--text); box-shadow: 0 30px 70px -20px rgba(5, 8, 20, .55); text-align: center; animation: modal-in .24s var(--ease) both; }
.modal::backdrop { background: rgba(14, 24, 56, .42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade-in .2s ease both; }
.modal.out { animation: modal-out .14s ease-in both; }
.modal.out::backdrop { animation: fade-out .14s ease-in both; }
.modal-ico { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.modal-ico svg { width: 22px; height: 22px; }
.modal.danger .modal-ico { background: var(--ko-soft); color: var(--ko); }
.modal h3 { font-size: 24px; line-height: 1.2; text-wrap: balance; }
.modal p { margin-top: 8px; color: var(--muted); font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.modal textarea { margin-top: 14px; min-height: 110px; resize: vertical; line-height: 1.5; text-align: left; }
.modal .count-chars { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; margin-top: 4px; }
.modal-btns { display: flex; gap: 10px; margin-top: 20px; }
.modal-btns .btn { flex: 1; }
.btn.danger { background: var(--ko); border-color: var(--ko); color: #fff; }
.btn.danger:hover:not(:disabled) { background: var(--ko); filter: brightness(1.08); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(6px) scale(.97); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@media (max-width: 480px) {
  .modal { margin: auto auto calc(16px + env(safe-area-inset-bottom)); }
  .modal-btns { flex-direction: column-reverse; }
}

/* ===================== Panel de María (panel.js) ===================== */
.pad { padding: 14px 16px; }
/* «Esta semana» */
.week-list { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; }
.week-list li { padding-left: 14px; position: relative; }
.week-list li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--coral); }
/* Lista de alumnos con píldora de estado */
.stu { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); transition: background .15s; }
.stu:first-child { border-top: 0; }
a.stu:hover { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
a.stu:active { background: var(--surface-2); }
.stu .av { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.stu .t { flex: 1; min-width: 0; }
.stu .t b { display: block; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stu .t span { font-size: 12px; color: var(--muted); }
.stu .go { color: var(--muted); font-size: 22px; line-height: 1; }
.stu .inv-del { flex: 0 0 auto; min-width: 36px; padding: 6px 10px; color: var(--muted); }
.stu .inv-del:hover { color: var(--ko); }
.pill-st { flex: 0 0 auto; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; border-radius: 99px; padding: 4px 9px; white-space: nowrap; vertical-align: middle; }
.st-ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.st-soon { background: color-mix(in srgb, var(--coral) 16%, transparent); color: var(--coral); }
.st-off { background: var(--surface-2); color: var(--muted); }
.st-inv { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
/* Enlace de invitación o de contraseña */
.link-url { display: block; margin: 4px 0 6px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; user-select: all; }
.linkbox .btns { margin-top: 10px; }
#reset-out .linkbox { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
/* Ficha del alumno */
.stu-head h1 { overflow-wrap: anywhere; }
.stu-head p { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.kpis.k4 { grid-template-columns: repeat(4, 1fr); margin: 0; }
.kpi .v.small-v { font-size: 16px; line-height: 1.5; }
@media (max-width: 520px) {
  .kpis.k4 { grid-template-columns: repeat(2, 1fr); }
  .kpis.k4 .kpi:nth-child(3) { border-left: 0; }
  .kpis.k4 .kpi:nth-child(n+3) { border-top: 1px dashed var(--line-2); }
}
.bar.ko > i { background: var(--coral); }
.qline { font-weight: 400 !important; font-size: 14.5px !important; overflow-wrap: anywhere; }
.danger-zone { margin-top: 26px; padding-top: 16px; border-top: 1px dashed var(--line-2); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.btn.danger-line { color: var(--ko); border-color: color-mix(in srgb, var(--ko) 45%, var(--line)); }
/* Banco: resultados y editor */
.bq { display: block; padding: 12px 16px; border-top: 1px solid var(--line); transition: background .15s; }
.bq:first-child { border-top: 0; }
.bq:hover { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.bq b { display: block; font-weight: 400; font-size: 14.5px; line-height: 1.45; margin-top: 3px; overflow-wrap: anywhere; }
.bq .tagline { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-left: 8px; }
.bq .mod, .corr { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--coral); margin-left: 8px; }
.bq .rep-n { color: var(--gold); }
.qhead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 4px 0 12px; }
.qhead .corr { margin-left: auto; padding: 3px 9px; border-radius: 99px; background: color-mix(in srgb, var(--coral) 14%, transparent); }
.qhead .qid { font-size: 13px; color: var(--gold); }
.card .qtext { margin: 4px 0 16px; }
.eos { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.eo { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 12px; border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); background: var(--solid); font-size: 15px; line-height: 1.4; transition: border-color .15s, background .15s; }
.eo:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.eo .r { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); transition: border-color .15s, background .15s; }
.eo .eo-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.eo .eo-t b { color: var(--muted); font-weight: 500; font-size: 12px; margin-right: 4px; }
.eo.on { border-color: var(--ok); background: var(--ok-soft); }
.eo.on .r { border-color: var(--ok); background: radial-gradient(var(--ok) 45%, transparent 50%); }
.eo .was { flex: 0 0 auto; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.exp-edit { min-height: 110px; resize: vertical; line-height: 1.5; font-size: 15px; }
.warn-card { border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); }
.warn-card h3 { margin: 2px 0 4px; }
.warn-t { color: var(--gold); }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.cmp > div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; overflow-wrap: anywhere; }
@media (max-width: 480px) { .cmp { grid-template-columns: 1fr; } }
.rep { padding: 12px 16px; border-top: 1px solid var(--line); }
.rep:first-child { border-top: 0; }
.rep p { font-size: 14.5px; line-height: 1.5; margin-bottom: 8px; overflow-wrap: anywhere; }
.hist { font-size: 13px; color: var(--muted); line-height: 1.5; border-left: 2px solid var(--gold); padding-left: 12px; }
.hist-list { list-style: none; }
.hist-item { font-size: 14px; line-height: 1.5; border-left: 2px solid var(--gold); padding: 2px 0 2px 12px; overflow-wrap: anywhere; }
.hist-item + .hist-item { margin-top: 14px; }
.hist-meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.hist-meta .now { color: var(--ok); font-weight: 600; }
.hist-exp { font-size: 13px; color: var(--muted); margin-top: 2px; }
.hist-item .textbtn { padding: 6px 0 0; font-weight: 700; color: var(--accent); }
