/* Simulacro PNE — estilos */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f0f3fa;
  --text: #16203d;
  --muted: #5b6585;
  --border: #dfe4f0;
  --primary: #2449d8;
  --primary-hover: #1c3ab3;
  --primary-soft: #e7ecff;
  --ok: #138a4a;
  --ok-soft: #e3f6eb;
  --bad: #c62f3b;
  --bad-soft: #fde8ea;
  --warn: #a96200;
  --warn-soft: #fff3dc;
  --flag: #e48a00;
  --shadow: 0 1px 2px rgba(22, 32, 61, 0.06), 0 4px 16px rgba(22, 32, 61, 0.06);
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Lexend", var(--font);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1424;
    --surface: #171e33;
    --surface-2: #1e2741;
    --text: #e7ebf7;
    --muted: #9aa5c4;
    --border: #2a3452;
    --primary: #6d8cff;
    --primary-hover: #8aa3ff;
    --primary-soft: #222f5a;
    --ok: #45c97f;
    --ok-soft: #173826;
    --bad: #ff6b76;
    --bad-soft: #3d1c22;
    --warn: #ffb547;
    --warn-soft: #3a2c12;
    --flag: #ffb547;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.25; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.75rem; }
button { font: inherit; color: inherit; }
kbd {
  font: 600 0.8em var(--font);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0 0.35em;
}

.container { max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; }
.container.narrow { max-width: 780px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 0.35rem;
}
.section-title { margin: 32px 0 14px; }
.page-title { margin-top: 4px; }

/* ---------- botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.6rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, opacity 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.875rem; }
.btn-lg { padding: 0.8rem 1.4rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn:focus-visible, .option:focus-visible, .tile:focus-visible, .review-row:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent);
  outline-offset: 2px;
}

.link-back {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
  font-weight: 500;
}
.link-back:hover { color: var(--text); }

/* ---------- barra superior ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 0.95rem;
}
.exam-status { display: flex; align-items: center; gap: 10px; }
.exam-progress-label { font-weight: 600; font-size: 0.9rem; color: var(--muted); }
.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  white-space: nowrap;
}
.timer.is-low { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.timer.is-critical { background: var(--bad-soft); color: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.6; } }

.progress { height: 4px; background: var(--border); }
.progress span { display: block; height: 100%; background: var(--primary); transition: width 0.3s; }

/* ---------- inicio ---------- */

.hero { padding: 24px 0 8px; max-width: 680px; }
.lead { font-size: 1.1rem; color: var(--muted); }

.resume {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
  border-left: 4px solid var(--primary);
}
.resume h2 { margin-bottom: 0.2rem; }
.resume p { margin: 0; }
.resume-actions { display: flex; gap: 8px; }

.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.exam-card { display: flex; flex-direction: column; gap: 6px; }
.exam-card h3 { margin: 4px 0 0; }
.exam-card-top { display: flex; justify-content: space-between; align-items: center; }
.exam-year { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--primary); }
.exam-meta { font-weight: 600; font-size: 0.9rem; margin: 4px 0 8px; }
.exam-card-bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  white-space: nowrap;
}
.badge-level { background: var(--primary-soft); color: var(--primary); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }

.soon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.soon { color: var(--muted); font-weight: 600; text-align: center; border-style: dashed; box-shadow: none; }

.table-wrap { padding: 0; overflow-x: auto; }
.history { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.history th, .history td { padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.history th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.history tr:last-child td { border-bottom: 0; }
.history .num { text-align: right; font-variant-numeric: tabular-nums; }

.site-footer { max-width: 1080px; margin: 0 auto; padding: 0 16px 40px; color: var(--muted); font-size: 0.8rem; }

/* ---------- preparación ---------- */

.notice { border-radius: 10px; padding: 12px 16px; margin: 16px 0; font-size: 0.93rem; }
.notice-warn { background: var(--warn-soft); color: var(--warn); }

.setup { margin-top: 20px; display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.field input {
  font: inherit;
  font-weight: 400;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.field input:focus { outline: 3px solid var(--primary-soft); border-color: var(--primary); }

.modes { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.modes legend { font-weight: 600; margin-bottom: 8px; }
.mode {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.mode:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.mode input { margin-top: 4px; accent-color: var(--primary); width: 18px; height: 18px; flex: none; }
.mode-body { display: flex; flex-direction: column; gap: 2px; }
.mode-body span { color: var(--muted); font-size: 0.93rem; }
.mode-body strong .badge { margin-left: 6px; vertical-align: 1px; }

.rules h2 { font-size: 1rem; }
.rules ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 6px; color: var(--muted); }
.rules strong { color: var(--text); }

/* ---------- pregunta ---------- */

.exam { padding-top: 20px; }
.question { padding: 24px; }
.skill {
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 12px;
}
.skill span { font-weight: 600; }
.q-intro { font-weight: 600; }
.q-num { color: var(--primary); }
.passage {
  margin: 0 0 1rem;
  padding: 14px 18px;
  border-left: 4px solid var(--primary);
  background: var(--surface-2);
  border-radius: 0 10px 10px 0;
  font-size: 1.04rem;
  line-height: 1.65;
}
.passage p:last-of-type { margin-bottom: 0.4rem; }
.stem { font-weight: 600; font-size: 1.06rem; margin-bottom: 1rem; }

.source { font-size: 0.82rem; color: var(--muted); text-align: right; margin-top: -0.5rem; }
.passage + .source { margin-top: -0.6rem; }
.q-figure { margin: 0 0 1rem; text-align: center; }
.q-figure img, .option-text img, .answer-options img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  background: #fff; /* las figuras del MEP tienen fondo blanco: se ven bien también en modo oscuro */
}
.q-figure img { cursor: zoom-in; padding: 6px; }
.option-text img { display: block; padding: 4px; }
.option-text { min-width: 0; }
.q-table-wrap { overflow-x: auto; margin: 0 0 1rem; }
.q-table { border-collapse: collapse; margin: 0 auto; font-size: 0.95rem; }
.q-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: center; }
.q-table tr:first-child td { background: var(--surface-2); font-weight: 600; }
.q-list { margin: 0 0 1rem; padding-left: 1.4rem; display: grid; gap: 4px; }
.question u, .answer-body u { text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--primary); }
.question p.q-intro:empty { display: none; }

.subject-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.subject-nav a {
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.subject-nav a:hover { border-color: var(--primary); color: var(--primary); }
.subject { scroll-margin-top: 70px; }
.subject-nav a.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.teacher-list { display: grid; gap: 16px; margin-top: 20px; }
.teacher-item { scroll-margin-top: 70px; }
.teacher-item .answer-options { margin-top: 8px; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 16, 34, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: calc(100vh - 90px); background: #fff; border-radius: 8px; padding: 8px; }
.lightbox .btn { color: #fff; border-color: rgba(255, 255, 255, 0.4); }

.options { display: grid; gap: 10px; }
.option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  line-height: 1.5;
}
.option:hover:not(:disabled) { border-color: var(--primary); }
.option:disabled { cursor: default; }
.option-letter {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: -2px;
}
.option.is-selected { border-color: var(--primary); background: var(--primary-soft); }
.option.is-selected .option-letter { background: var(--primary); border-color: var(--primary); color: #fff; }
.option.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.option.is-correct .option-letter { background: var(--ok); border-color: var(--ok); color: #fff; }
.option.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.option.is-wrong .option-letter { background: var(--bad); border-color: var(--bad); color: #fff; }

.feedback { margin-top: 14px; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.feedback-ok { background: var(--ok-soft); color: var(--ok); }
.feedback-bad { background: var(--bad-soft); color: var(--bad); }
.feedback span { color: var(--text); font-size: 0.9rem; }

.exam-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.exam-actions .btn-primary { margin-left: auto; }
.btn-flag { background: transparent; border-color: var(--border); color: var(--muted); }
.btn-flag:hover { border-color: var(--flag); color: var(--flag); }
.btn-flag.is-on { background: var(--warn-soft); border-color: var(--flag); color: var(--warn); }
.hint { text-align: right; color: var(--muted); font-size: 0.82rem; margin-top: 10px; }

/* ---------- revisión ---------- */

.review-head { margin-bottom: 16px; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.stat {
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 8px 14px;
  min-width: 96px;
}
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.stat-value.ok { color: var(--ok); }
.stat-value.bad { color: var(--bad); }
.stat-label { font-size: 0.78rem; color: var(--muted); }

.flagged { margin-bottom: 16px; border-left: 4px solid var(--flag); }
.review-list { display: grid; gap: 6px; }
.review-row {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--surface-2);
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}
.review-row:hover { background: var(--primary-soft); }
.review-n { font-weight: 700; min-width: 2ch; }
.review-stem { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.review-a { font-weight: 700; color: var(--primary); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 4px; border: 1.5px solid var(--border); background: var(--surface); display: inline-block; }
.dot-answered { background: var(--primary); border-color: var(--primary); }
.dot-flagged { border-color: var(--flag); border-width: 2.5px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 6px 0;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  line-height: 1.2;
}
.tile:hover { border-color: var(--primary); }
.tile-n { font-size: 0.75rem; color: var(--muted); }
.tile-a { font-weight: 700; }
.tile.is-answered { background: var(--primary-soft); border-color: transparent; }
.tile.is-answered .tile-a { color: var(--primary); }
.tile.is-flagged { border-color: var(--flag); border-width: 2.5px; }

.submit-bar { display: flex; justify-content: flex-end; margin-top: 20px; }

/* ---------- resultados ---------- */

.score { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; padding: 28px; }
.score h1 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); }
.score-text { flex: 1; min-width: 260px; }
.ring {
  --p: 0;
  flex: none;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-2) 0);
  display: grid;
  place-items: center;
}
.ring-inner {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-value { font-family: var(--font-display); font-weight: 700; font-size: 2.3rem; line-height: 1; }
.ring-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.results-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; align-items: start; margin-top: 20px; }
.results-grid > section > .section-title { margin-top: 0; }
.topics { display: grid; gap: 14px; margin-top: 12px; }
.topic-row-head { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; margin-bottom: 4px; }
.topic-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.topic-score.is-weak { color: var(--bad); }
.topic-score.is-good { color: var(--ok); }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; min-width: 4px; }
.bar .is-weak { background: var(--bad); }
.bar .is-good { background: var(--ok); }

.study { margin-bottom: 14px; }
.study-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.study ul { padding-left: 1.2rem; margin: 0 0 0.75rem; display: grid; gap: 4px; }
.missed { font-size: 0.88rem; color: var(--muted); margin: 0; }
.missed a {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  padding: 1px 6px;
  margin: 2px 2px 0 0;
  border-radius: 6px;
  background: var(--bad-soft);
  color: var(--bad);
  font-weight: 700;
  text-decoration: none;
}

.answers { margin-top: 12px; }
.answers-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tabs { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.tabs button {
  border: 0;
  background: transparent;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}
.tabs button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.answer-list { display: grid; gap: 8px; }
.answer-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; scroll-margin-top: 80px; }
.answer-item summary {
  display: grid;
  grid-template-columns: auto auto 1fr;
  grid-template-areas: "icon n stem" ". . letters";
  column-gap: 10px;
  align-items: baseline;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.answer-item summary::-webkit-details-marker { display: none; }
.answer-icon { grid-area: icon; font-weight: 700; }
.answer-n { grid-area: n; font-weight: 700; }
.answer-stem { grid-area: stem; min-width: 0; }
.answer-letters { grid-area: letters; font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.answer-ok .answer-icon { color: var(--ok); }
.answer-bad .answer-icon, .answer-blank .answer-icon { color: var(--bad); }
.answer-body { padding: 4px 18px 18px; border-top: 1px solid var(--border); }
.answer-body .eyebrow { margin-top: 12px; }
.answer-options { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.answer-options li { padding: 8px 12px; border-radius: 8px; background: var(--surface-2); overflow-x: auto;
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 8px; }
.answer-options li > span { flex: 1 1 200px; min-width: 0; }
.answer-options li em { font-style: normal; font-weight: 600; font-size: 0.85rem; }
.answer-options li.is-correct { background: var(--ok-soft); }
.answer-options li.is-correct em { color: var(--ok); }
.answer-options li.is-wrong { background: var(--bad-soft); }
.answer-options li.is-wrong em { color: var(--bad); }

.results-actions { display: flex; justify-content: center; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

/* ---------- diálogo y avisos ---------- */

.modal {
  border: 0;
  border-radius: var(--radius);
  padding: 24px;
  width: min(440px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.modal::backdrop { background: rgba(10, 16, 34, 0.5); }
.modal p { color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100vw - 32px);
  background: var(--text);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: toast-in 0.2s ease-out;
}
.toast-warn { background: var(--warn); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .results-grid { grid-template-columns: 1fr; }
}

/* En pantallas táctiles no se muestran los atajos de teclado. */
@media (hover: none) and (pointer: coarse) {
  .only-keyboard { display: none; }
}

@media (max-width: 560px) {
  /* Durante el examen la barra necesita espacio para el tiempo: solo queda el logo. */
  .topbar-inner:has(.exam-status) .brand-name { display: none; }
  .exam-progress-label { font-size: 0.82rem; }
  .question { padding: 18px 16px; }
  .passage { padding: 12px 14px; font-size: 1rem; }
  .exam-actions .btn { flex: 1 1 100%; }
  .exam-actions > span { display: none; }
  .hint { text-align: center; }
  .score { padding: 20px; justify-content: center; text-align: center; }
  .score .stats { display: grid; grid-template-columns: 1fr 1fr; }
  .resume-actions { width: 100%; }
  .resume-actions .btn { flex: 1; }
  .submit-bar .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- impresión ---------- */

@media print {
  :root { --bg: #fff; --surface: #fff; --shadow: none; }
  body { background: #fff; color: #000; font-size: 12px; }
  .topbar, .no-print, .site-footer, #toast { display: none !important; }
  .card, .answer-item { break-inside: avoid; box-shadow: none; }
  .results-grid { grid-template-columns: 1fr; }
  .ring { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .bar span, .badge, .answer-options li { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
