/* DELE A2 · Preparación — estilos (móvil primero) */

:root {
  --bg: #f6f2ea;
  --surface: #fffdf9;
  --surface-2: #efe9de;
  --ink: #1d2230;
  --ink-2: #3a4050;
  --muted: #6c7180;
  --line: #e2dbcd;
  --accent: #2f4ab8;
  --accent-ink: #ffffff;
  --accent-soft: #e4e8fa;
  --lect: #2f6fd1;
  --lect-soft: #e2ecfb;
  --aud: #7a4cc2;
  --aud-soft: #eee6fa;
  --esc: #c0650f;
  --esc-soft: #fbecdc;
  --ok: #1b8549;
  --ok-soft: #e0f2e7;
  --bad: #c23b2c;
  --bad-soft: #fbe4e0;
  --warn: #a8700e;
  --warn-soft: #fbf0d6;
  --hl: #ffe7a0;
  --shadow: 0 1px 2px rgba(40, 30, 10, .05), 0 6px 20px rgba(40, 30, 10, .06);
  --radius: 16px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs: 16px;
  --tabbar: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171c;
    --surface: #1e2128;
    --surface-2: #272b34;
    --ink: #ebe7df;
    --ink-2: #cfcabf;
    --muted: #9a9fab;
    --line: #323743;
    --accent: #8ea2ff;
    --accent-ink: #10142a;
    --accent-soft: #252c4a;
    --lect: #7fb0ff;
    --lect-soft: #1d2a40;
    --aud: #b89bff;
    --aud-soft: #2a2340;
    --esc: #f0a35c;
    --esc-soft: #3a2a1a;
    --ok: #5fd08f;
    --ok-soft: #173326;
    --bad: #ff8a7a;
    --bad-soft: #3d1f1b;
    --warn: #f1c25b;
    --warn-soft: #3a3019;
    --hl: #5a4a14;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
body.noscroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0 0 .6em; }
.loading { padding: 40px 16px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; color: var(--muted); }

.ico { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }

/* ---------- estructura ---------- */
.wrap { max-width: 680px; margin: 0 auto; padding: 16px 16px calc(var(--tabbar) + 40px + env(safe-area-inset-bottom)); }
.wrap.test { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

.bar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.bar-in { max-width: 680px; margin: 0 auto; display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 8px; }
.bar-title { flex: 1; min-width: 0; font-size: 1.05rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title small { display: block; font-size: .75rem; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.bar-title em { font-style: normal; color: var(--muted); font-weight: 500; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent;
  display: inline-grid; place-items: center; color: var(--ink); text-decoration: none; flex: none;
}
.icon-btn:active { background: var(--surface-2); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center; gap: 4px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600;
}
.tab .ico { width: 24px; height: 24px; }
.tab.on { color: var(--accent); }

/* ---------- inicio ---------- */
.hero { padding: calc(env(safe-area-inset-top) + 28px) 16px 8px; }
.hero-in { max-width: 680px; margin: 0 auto; position: relative; }
.kicker { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; margin-bottom: 4px; }
.hero h1 { font-family: var(--serif); font-size: 2.6rem; font-weight: 700; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hello { margin-top: 8px; font-size: 1.05rem; color: var(--ink-2); }
.streak { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 0; padding: 4px 10px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); font-weight: 650; font-size: .85rem; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin: 0 0 12px;
}
.link-card { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.link-card > div { flex: 1; }
.link-card small { display: block; color: var(--muted); }

.resume {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: linear-gradient(0deg, var(--accent-soft), var(--accent-soft)), var(--surface);
}
.resume .rc-ico { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.resume > div:nth-child(2) { flex: 1; min-width: 0; }
.resume small { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 700; }
.resume b { display: block; }
.resume span { font-size: .85rem; color: var(--muted); }

.pruebas { display: grid; gap: 12px; margin: 16px 0 20px; }
.pcard {
  --c: var(--accent); --cs: var(--accent-soft);
  display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.pcard::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--c); }
.pcard:active { transform: scale(.99); }
.p-lectura { --c: var(--lect); --cs: var(--lect-soft); }
.p-auditiva { --c: var(--aud); --cs: var(--aud-soft); }
.p-escritura { --c: var(--esc); --cs: var(--esc-soft); }
.pc-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--cs); color: var(--c); display: grid; place-items: center; flex: none; }
.pc-ico .ico { width: 26px; height: 26px; }
.pc-body { flex: 1; min-width: 0; }
.pc-body h2 { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; margin-bottom: 2px; }
.pc-body p { color: var(--muted); font-size: .88rem; margin-bottom: 10px; }
.pc-body small { color: var(--muted); font-size: .8rem; }

.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-bottom: 6px; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--accent)); transition: width .4s; }

.foot-note { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 20px; }

/* ---------- página de prueba ---------- */
.lead { color: var(--muted); margin: 4px 0 14px; }
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 650; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.hint { font-size: .85rem; color: var(--muted); margin: 8px 2px 0; min-height: 2.5em; }
.sec { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 26px 2px 10px; font-weight: 700; }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 14px; border: 0; background: transparent;
  border-bottom: 1px solid var(--line); text-align: left; min-height: 60px;
}
.row:last-child { border-bottom: 0; }
.row:active { background: var(--surface-2); }
.row-num { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; flex: none; color: var(--ink-2); }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; }
.row-main small { display: block; color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row > .ico { color: var(--muted); }
.badge { font-size: .8rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); flex: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }

.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.tc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 10px; }
.tc-head span { color: var(--ink-2); flex: 1; min-width: 60%; }
.tc-head small { color: var(--muted); font-size: .8rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-width: 44px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.chip.done { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.chip-rand { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip:active { transform: scale(.96); }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 650; text-decoration: none; color: var(--ink);
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.actions .btn { flex: 1; }

/* ---------- prueba en curso ---------- */
.test-bar .bar-title { font-size: 1rem; }
.timer { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; font-weight: 700; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); margin-right: 4px; }
.timer.low { background: var(--bad-soft); color: var(--bad); }
.mode-pill { font-size: .75rem; font-weight: 700; color: var(--ok); background: var(--ok-soft); border-radius: 99px; padding: 4px 10px; margin-right: 8px; }
.steps { max-width: 680px; margin: 0 auto; display: flex; gap: 6px; padding: 0 16px 10px; }
.step { flex: 1; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: .85rem; color: var(--muted); }
.step.full { background: var(--surface-2); color: var(--ink-2); }
.step.on { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.step.chk { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.step.chk.on { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }

.tarea-head { margin: 6px 0 16px; }
.tema { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; margin-bottom: 6px; }
.instr { color: var(--ink-2); font-size: .95rem; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.part-score { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; font-weight: 700; margin-top: 10px; }
.part-score.ok { background: var(--ok-soft); color: var(--ok); }
.part-score.bad { background: var(--warn-soft); color: var(--warn); }

.doc {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 8px;
  box-shadow: var(--shadow); margin-bottom: 14px; font-family: var(--serif); font-size: 1.08rem; line-height: 1.6;
}
.doc h4 { font-family: var(--sans); font-size: .95rem; font-weight: 700; margin-bottom: 8px; color: var(--ink); }
.doc.mini { font-size: 1rem; padding: 12px 14px 4px; margin-bottom: 10px; border-style: dashed; box-shadow: none; }
.doc.mini h4 { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.doc .letter { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-family: var(--sans); font-weight: 800; margin-right: 8px; font-size: .9rem; }

.tabs3 .tabs-h { display: flex; gap: 6px; margin-bottom: 10px; }
.sheet .tabs3 .tabs-h { position: sticky; top: -16px; background: var(--bg); padding: 8px 0; margin-top: -8px; z-index: 1; }
.tabs3 .tabs-h button { flex: 1; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; }
.tabs3 .tabs-h button.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.tab-p { display: none; }
.tab-p.on { display: block; }

.items { display: grid; gap: 14px; }
.item { background: color-mix(in srgb, var(--surface) 55%, transparent); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.item .q { margin: 0; }
.qs { display: grid; gap: 14px; }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.item .q { box-shadow: none; border: 0; padding: 4px 2px 2px; background: transparent; }
.q-text { font-weight: 600; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.num { flex: none; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: .82rem; font-weight: 800; display: inline-grid; place-items: center; }
.opts { display: grid; gap: 8px; }
.opt {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left;
  padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); min-height: 48px; line-height: 1.4;
}
.opt .let { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: var(--muted); }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.opt.sel .let { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .let { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .let { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt:disabled { cursor: default; color: var(--ink); }
.opt:not(:disabled):active { transform: scale(.99); }

.abc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opt-abc {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 4px; min-height: 58px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.opt-abc b { font-size: 1.1rem; }
.opt-abc small { font-size: .72rem; color: var(--muted); line-height: 1.2; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.opt-abc.sel { border-color: var(--accent); background: var(--accent-soft); }
.opt-abc.right { border-color: var(--ok); background: var(--ok-soft); }
.opt-abc.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt-abc:disabled { cursor: default; color: var(--ink); }

.grid10 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.opt-l { height: 46px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 800; font-size: 1rem; }
.opt-l.used { color: var(--muted); background: var(--surface-2); border-style: dashed; }
.opt-l.sel { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); border-style: solid; }
.opt-l.right { border-color: var(--ok); background: var(--ok); color: #fff; border-style: solid; }
.opt-l.wrong { border-color: var(--bad); background: var(--bad); color: #fff; border-style: solid; }
.opt-l:disabled { cursor: default; }
.sel-txt { margin: 10px 2px 0; font-size: .9rem; color: var(--accent); font-weight: 600; }

.enun-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-family: var(--sans); font-size: .95rem; }
.enun-list li { display: flex; gap: 10px; align-items: flex-start; }
.enun-list b { flex: none; width: 24px; height: 24px; border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; font-size: .8rem; }

.fb { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 12px; font-size: .92rem; line-height: 1.45; }
.fb .ico { margin-top: 2px; }
.fb.ok { background: var(--ok-soft); }
.fb.ok .ico, .fb.ok b { color: var(--ok); }
.fb.bad { background: var(--bad-soft); }
.fb.bad .ico, .fb.bad b { color: var(--bad); }

.test-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px max(16px, calc((100vw - 680px) / 2 + 16px)) calc(10px + env(safe-area-inset-bottom));
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.test-nav .btn { flex: 1; }
.test-nav .btn.primary { flex: 1.4; }

.fab {
  position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 26;
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border-radius: 99px;
  border: 0; background: var(--ink); color: var(--bg); font-weight: 700; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.fab[hidden] { display: none; }

/* ---------- reproductor ---------- */
.player {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  background: var(--aud-soft); margin-bottom: 8px;
}
.play-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--aud); color: #fff; display: grid; place-items: center; flex: none; }
.play-btn .ico { width: 22px; height: 22px; }
.play-btn:disabled { opacity: .4; }
.pl-main { flex: 1; min-width: 0; }
.pl-main b { display: block; font-size: .9rem; margin-bottom: 6px; }
.pl-bar { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--aud) 22%, transparent); overflow: hidden; }
.pl-bar span { display: block; height: 100%; width: 0; background: var(--aud); border-radius: inherit; transition: width .5s; }
.pl-count { font-size: .8rem; font-weight: 700; color: var(--aud); min-width: 30px; text-align: right; }
.player.playing .play-btn { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--aud) 25%, transparent); } }
.player-big { padding: 16px; margin-bottom: 16px; }
.player-big .play-btn { width: 60px; height: 60px; }

.transcript { margin: 0 0 10px; font-size: .9rem; }
.transcript summary { cursor: pointer; color: var(--aud); font-weight: 650; padding: 6px 2px; }
.tr { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 4px; font-family: var(--serif); font-size: 1rem; line-height: 1.55; }
.tr b { font-family: var(--sans); font-size: .85rem; }

.no-tts { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 12px; font-size: .9rem; margin-bottom: 14px; }

/* ---------- hoja y diálogos ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-bg { position: absolute; inset: 0; background: rgba(10, 10, 20, .45); animation: fade .2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 22px 22px 0 0; max-width: 720px; margin: 0 auto; animation: up .25s ease-out;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 18px; border-bottom: 1px solid var(--line); }
.sheet-body { overflow-y: auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.modal-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(10, 10, 20, .45); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 20px; padding: 20px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal h3 { font-size: 1.15rem; margin-bottom: 8px; }
.modal p { color: var(--ink-2); }
.modal-btns { display: grid; gap: 8px; margin-top: 16px; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: .92rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); animation: up .2s; max-width: calc(100vw - 32px);
}

/* ---------- resultados ---------- */
.score-card { display: flex; gap: 18px; align-items: center; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.score-card h2 { font-family: var(--serif); font-size: 1.6rem; margin: 2px 0 4px; }
.score-card p { margin: 0 0 2px; color: var(--ink-2); font-size: .92rem; }
.ring {
  --c: var(--ok); flex: none; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0);
}
.score-card.fail .ring { --c: var(--warn); }
.ring span { width: 78px; height: 78px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: 1.5rem; line-height: 1; }
.ring small { font-size: .8rem; color: var(--muted); font-weight: 700; display: block; }
.tbars { display: grid; gap: 10px; margin: 18px 2px; }
.tbar { display: grid; grid-template-columns: 70px 1fr 44px; gap: 10px; align-items: center; font-size: .9rem; }
.tbar .meter { margin: 0; }
.tbar b { text-align: right; }
.rev-part { margin-bottom: 28px; }
.rev-part > h4 { font-family: var(--serif); font-size: 1.15rem; margin: 0 0 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- escritura ---------- */
.mail { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 14px; box-shadow: var(--shadow); }
.mail-h { padding: 10px 14px; background: var(--surface-2); font-size: .85rem; color: var(--ink-2); display: grid; gap: 2px; }
.mail-b { padding: 14px 16px 6px; font-family: var(--serif); font-size: 1.05rem; line-height: 1.6; }
.chat { background: var(--surface-2); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.chat-from { font-size: .8rem; color: var(--muted); font-weight: 650; margin: 0 0 6px 4px; }
.bubble { background: var(--surface); border-radius: 4px 16px 16px 16px; padding: 10px 14px 4px; max-width: 92%; box-shadow: var(--shadow); line-height: 1.5; }
.foro .mail-h { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--esc); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }

.pautas h4, .frases-box h4 { font-size: .95rem; margin-bottom: 8px; }
.pautas ul, .frases { margin: 0; padding-left: 20px; }
.pautas li, .frases li { margin-bottom: 4px; }
details.card > summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; align-items: center; gap: 8px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "›"; margin-left: auto; font-size: 1.3rem; color: var(--muted); transition: transform .2s; }
details.card[open] > summary::after { transform: rotate(90deg); }
details.card[open] > summary { margin-bottom: 10px; }

.choose { display: grid; gap: 12px; }
.opt-card { text-align: left; width: 100%; border: 1.5px solid var(--line); }
.opt-card small { display: block; font-weight: 800; color: var(--esc); text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; }
.opt-card b { display: block; font-family: var(--serif); font-size: 1.15rem; margin: 2px 0 6px; }
.opt-card p { color: var(--ink-2); font-size: .92rem; }
.opt-card ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: .9rem; }

.editor { margin-top: 6px; }
.chars { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chars::-webkit-scrollbar { display: none; }
.chars button { flex: none; min-width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 1.1rem; font-weight: 600; }
.chars button:active { background: var(--surface-2); }
textarea#txt {
  width: 100%; min-height: 260px; resize: vertical; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface); padding: 14px; font-family: var(--serif); font-size: 1.08rem; line-height: 1.6;
  box-shadow: var(--shadow); outline: none;
}
textarea#txt:focus { border-color: var(--esc); }
.wc { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin: 8px 2px 0; font-size: .88rem; }
.wc-n { font-weight: 800; }
.wc-goal { color: var(--muted); }
.wc-bar { flex-basis: 100%; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; position: relative; }
.wc-bar span { display: block; height: 100%; background: var(--warn); width: 0; transition: width .2s; }
.wc.ok .wc-n { color: var(--ok); }
.wc.ok .wc-bar span { background: var(--ok); }
.wc.high .wc-n { color: var(--warn); }

.paper {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 6px; margin: 10px 0 12px;
  font-family: var(--serif); font-size: 1.05rem; line-height: 1.6; box-shadow: var(--shadow);
  border-left: 4px solid var(--esc);
}
.model-paper { box-shadow: none; }
.checks { display: grid; gap: 6px; margin: 0 0 12px; }
.chk { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 12px; font-size: .9rem; line-height: 1.4; }
.chk .ico { margin-top: 1px; }
.chk.ok { background: var(--ok-soft); }
.chk.ok .ico { color: var(--ok); }
.chk.warn { background: var(--warn-soft); }
.chk.warn .ico { color: var(--warn); }
.pauta { display: flex; gap: 10px; align-items: flex-start; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.pauta:last-child { border-bottom: 0; }
.pauta input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--ok); }
.rev-w { margin-bottom: 30px; }
.rev-w > h3 { font-family: var(--serif); font-size: 1.3rem; margin-top: 8px; }

/* ---------- progreso y ajustes ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.5rem; font-family: var(--serif); }
.stat small { color: var(--muted); font-size: .75rem; }
.tip { display: flex; gap: 10px; align-items: flex-start; background: var(--accent-soft); color: var(--ink); border-radius: 14px; padding: 12px 14px; margin: 12px 0; font-size: .92rem; }
.tip .ico { color: var(--accent); margin-top: 2px; }
.hist .row-num { font-size: .7rem; }
.hist .row-num.l { background: var(--lect-soft); color: var(--lect); }
.hist .row-num.a { background: var(--aud-soft); color: var(--aud); }
.hist .row-num.e { background: var(--esc-soft); color: var(--esc); }
.field { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field > span { font-weight: 650; }
.field small { color: var(--muted); }
.field input[type=text], .field input[type=date], .field select {
  width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px;
}
.field input[type=range] { width: 100%; accent-color: var(--accent); }
.prose h3 { font-family: var(--serif); font-size: 1.2rem; margin: 18px 0 8px; }
.prose ul { padding-left: 20px; margin: 0 0 10px; }
.prose li { margin-bottom: 6px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; margin-bottom: 10px; }
.prose td, .prose th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }

@media (min-width: 700px) {
  .pruebas { grid-template-columns: 1fr; }
  .hero h1 { font-size: 3rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- ayuda en ruso ---------- */
.ru-help {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 8px 14px; border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: .88rem;
}
.hero-help {
  position: absolute; top: 0; right: 0; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); color: var(--accent); font-weight: 700; font-size: .85rem; box-shadow: var(--shadow);
}
.help { font-size: 1rem; line-height: 1.55; }
.help .help-title { font-family: var(--serif); font-size: 1.35rem; margin: 2px 0 10px; }
.help h3 { font-size: 1rem; margin: 18px 0 6px; }
.help ul { padding-left: 20px; margin: 0 0 10px; }
.help li { margin-bottom: 6px; }
.help hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0 6px; }
.ru-quote { background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; }
.gloss { width: 100%; border-collapse: collapse; font-size: .92rem; }
.gloss td { padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; width: 50%; }
.gloss td:first-child { font-weight: 600; }
