:root {
  --bg: #F4F6F8;
  --surface: #FFFFFF;
  --surface-2: #EEF1F4;
  --surface-3: #E3E8ED;
  --text: #0E1A22;
  --muted: #5A6772;
  --border: #DFE4E9;
  --ink: #0B1B24;
  --ink-2: #13293A;
  --accent: #FFB81C;
  --accent-ink: #1A1300;
  --accent-soft: #FFF2D1;
  --primary: #0F6E66;
  --primary-ink: #FFFFFF;
  --primary-soft: #DDF1EE;
  --ok: #138A4B;
  --ok-soft: #DDF5E7;
  --bad: #C8322B;
  --bad-soft: #FDE4E2;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(11, 27, 36, .05), 0 8px 24px -8px rgba(11, 27, 36, .12);
  --shadow-lg: 0 20px 48px -16px rgba(11, 27, 36, .28);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A1218;
    --surface: #111C24;
    --surface-2: #17242E;
    --surface-3: #1F2F3B;
    --text: #E8EEF2;
    --muted: #93A3AE;
    --border: #22323E;
    --ink: #08131A;
    --ink-2: #102330;
    --accent-soft: #3A2D0A;
    --primary: #3CC6B5;
    --primary-ink: #04221E;
    --primary-soft: #11332F;
    --ok: #4ADE80;
    --ok-soft: #10301D;
    --bad: #F87171;
    --bad-soft: #3A1717;
    --shadow: none;
    --shadow-lg: 0 20px 48px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-tap-highlight-color: transparent; }

body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); }
svg { flex: none; }
button { font: inherit; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  height: 60px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.02em;
}
.brand b { font-weight: 800; color: var(--primary); }
.topnav { display: none; align-items: center; gap: 4px; margin-left: auto; }
.topnav a:not(.btn) {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.topnav a:not(.btn):hover { background: var(--surface-2); color: var(--text); }
.topnav a.active:not(.btn) { color: var(--text); background: var(--surface-2); }
.chip-cat {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: color-mix(in srgb, var(--accent) 50%, var(--text));
}

/* ---------- Bottom tab bar (móvil) ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
}
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--primary); }
.tabbar .tab-main svg {
  width: 44px; height: 44px; padding: 10px; margin-top: -20px;
  border-radius: 16px; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 8px 20px -6px rgba(255, 184, 28, .7);
}
body.focus .tabbar, body.focus .footer { display: none; }

/* ---------- Layout ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px 16px 110px;
  outline: none;
}
.view { animation: rise .35s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.08; letter-spacing: -.035em; margin: 0 0 12px; font-weight: 800; }
h2 { font-size: 22px; margin: 36px 0 14px; letter-spacing: -.02em; font-weight: 800; }
h3 { font-size: 16px; margin: 0 0 4px; font-weight: 700; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pad { padding: 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s var(--ease), background-color .15s, box-shadow .2s, border-color .15s;
}
.btn:hover { border-color: var(--surface-3); background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000); border-color: transparent; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -10px rgba(255, 184, 28, .9); }
.btn-accent:hover { background: #FFC542; border-color: #FFC542; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 28px 22px;
  background: radial-gradient(120% 120% at 100% 0%, #1B4A5A 0%, var(--ink-2) 45%, var(--ink) 100%);
  color: #F3F7F9;
  display: grid;
  gap: 24px;
  box-shadow: var(--shadow-lg);
}
.hero::before {
  /* líneas de carretera */
  content: "";
  position: absolute;
  right: -40px; top: -20px; bottom: -20px;
  width: 220px;
  background:
    repeating-linear-gradient(180deg, var(--accent) 0 26px, transparent 26px 50px) center / 6px 100% no-repeat,
    linear-gradient(90deg, transparent 0 8px, rgba(255,255,255,.06) 8px calc(100% - 8px), transparent 0);
  transform: rotate(14deg);
  opacity: .5;
  pointer-events: none;
}
.hero > * { position: relative; }
.hero h1 { color: #fff; max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: #B9C8D1; max-width: 46ch; font-size: 16px; }
.hero .eyebrow { color: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero .btn:not(.btn-accent) { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #fff; }
.hero .btn:not(.btn-accent):hover { background: rgba(255,255,255,.14); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 20px; font-size: 14px; color: #B9C8D1; }
.facts span { display: inline-flex; align-items: center; gap: 6px; }
.facts b { color: #fff; }

.readiness {
  align-self: center;
  justify-self: center;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 18px 22px;
  border-radius: 22px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  min-width: 220px;
}
.readiness small { color: #B9C8D1; font-size: 13px; }

/* ---------- Ring ---------- */
.ring { position: relative; display: grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-3); }
.hero .ring .track { stroke: rgba(255,255,255,.12); }
.ring .val { transition: stroke-dashoffset .9s var(--ease); }
.ring .ring-label { position: absolute; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.ring .ring-label b { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.ring .ring-label span { font-size: 12px; color: var(--muted); font-weight: 600; }
.hero .ring .ring-label span { color: #B9C8D1; }

/* ---------- Mode cards ---------- */
.modes { display: grid; gap: 12px; }
.mode {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  text-decoration: none;
  color: var(--text);
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.mode:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.mode .ico {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
}
.mode .ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mode .ico.y { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 60%, var(--text)); }
.mode .ico.r { background: var(--bad-soft); color: var(--bad); }
.mode .ico.b { background: #E1EAFB; color: #1F4FA0; }
@media (prefers-color-scheme: dark) { .mode .ico.b { background: #172A4A; color: #8FB1F0; } }
.mode p { margin: 0; color: var(--muted); font-size: 14px; }
.mode .go { margin-left: auto; color: var(--muted); transition: transform .2s var(--ease); }
.mode:hover .go { transform: translateX(4px); color: var(--text); }
.mode .go svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.mode .count { margin-left: auto; font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--bad-soft); color: var(--bad); }

/* ---------- Stats / chart ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { padding: 16px; }
.stat b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat span { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.chart { padding: 18px 18px 12px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.bars { position: relative; height: 140px; display: flex; align-items: flex-end; gap: 6px; padding-top: 8px; }
.bars .bar {
  flex: 1;
  min-width: 0;
  max-width: 36px;
  border-radius: 8px 8px 4px 4px;
  background: var(--bad);
  opacity: .85;
  transform-origin: bottom;
  animation: grow .7s var(--ease) both;
  position: relative;
}
.bars .bar.pass { background: var(--ok); }
.bars .bar:hover { opacity: 1; }
.bars .bar:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
}
@keyframes grow { from { transform: scaleY(0); } }
.bars .goal { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--muted); opacity: .6; pointer-events: none; }
.bars .goal span { position: absolute; right: 0; top: -20px; font-size: 11px; font-weight: 700; color: var(--muted); }

.steps { display: grid; gap: 12px; counter-reset: s; }
.step { padding: 18px; display: flex; gap: 14px; }
.step::before {
  counter-increment: s;
  content: counter(s);
  flex: none;
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 11px;
  background: var(--ink);
  color: var(--accent);
  font-weight: 800;
}
@media (prefers-color-scheme: dark) { .step::before { background: var(--surface-3); } }
.step p { margin: 0; font-size: 14px; color: var(--muted); }

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.notice svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; margin-top: 1px; }

/* ---------- Exam / practice layout ---------- */
.exam { display: grid; gap: 16px; align-items: start; }
.exam-bar {
  position: sticky;
  top: 60px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  background: var(--bg);
}
.exam-bar .title { font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
}
.timer-pill svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.timer-pill.low { background: var(--bad); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .75; } }

.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 60%, var(--accent))); transition: width .4s var(--ease); }

.qcard { padding: 22px; }
.qcard.enter { animation: slide .3s var(--ease) both; }
@keyframes slide { from { opacity: 0; transform: translateX(14px); } }
.q-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 700; color: var(--muted); }
.q-meta .pill { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); }
.q-text { font-size: clamp(18px, 2.4vw, 22px); line-height: 1.35; font-weight: 700; letter-spacing: -.015em; margin: 12px 0 18px; }
.q-figure {
  display: grid;
  place-items: center;
  margin: 0 0 18px;
  padding: 18px;
  border-radius: 16px;
  background: var(--surface-2);
  background-image: radial-gradient(var(--surface-3) 1px, transparent 1px);
  background-size: 14px 14px;
}
.q-figure img { display: block; width: auto; max-width: 100%; height: 190px; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(11,27,36,.18)); cursor: zoom-in; transition: transform .25s var(--ease); }
.q-figure img.wide { height: auto; max-height: 230px; width: 100%; max-width: 460px; }
.q-figure.zoom img { transform: scale(1.45); cursor: zoom-out; }

.options { display: grid; gap: 10px; }
.option {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, transform .12s var(--ease);
}
.option:hover:not(:disabled) { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: color-mix(in srgb, var(--primary-soft) 40%, var(--surface)); }
.option:active:not(:disabled) { transform: scale(.99); }
.option .letter {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  font-weight: 800;
  font-size: 15px;
  text-transform: uppercase;
  transition: background-color .15s, color .15s;
}
.option .mark { margin-left: auto; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.option.selected { border-color: var(--primary); background: var(--primary-soft); }
.option.selected .letter { background: var(--primary); color: var(--primary-ink); }
.option.correct { border-color: var(--ok); background: var(--ok-soft); color: var(--text); }
.option.correct .letter { background: var(--ok); color: #fff; }
.option.correct .mark { color: var(--ok); }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); animation: shake .35s ease; }
.option.wrong .letter { background: var(--bad); color: #fff; }
.option.wrong .mark { color: var(--bad); }
.option.dim { opacity: .55; }
.option:disabled { cursor: default; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.kbd { display: none; }

.feedback { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 16px; border-radius: 14px; font-weight: 700; animation: rise .3s var(--ease) both; }
.feedback svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.feedback.ok { background: var(--ok-soft); color: var(--ok); }
.feedback.ko { background: var(--bad-soft); color: var(--bad); }

.nav-row { display: flex; gap: 10px; margin-top: 18px; }
.nav-row .btn { flex: 1; }

/* Panel lateral */
.side { display: grid; gap: 14px; }
.side .card { padding: 18px; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.side-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--surface-2); border: 1px solid var(--border); }
.legend i.a { background: var(--primary); border-color: var(--primary); }
.legend i.ok { background: var(--ok); border-color: var(--ok); }
.legend i.ko { background: var(--bad); border-color: var(--bad); }

.grid-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.grid-nav button {
  aspect-ratio: 1;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s var(--ease), background-color .15s;
}
.grid-nav button:hover { transform: translateY(-1px); border-color: var(--muted); }
.grid-nav button.answered { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.grid-nav button.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.grid-nav button.ko { background: var(--bad); border-color: var(--bad); color: #fff; }
.grid-nav button.current { outline: 3px solid var(--accent); outline-offset: 2px; }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.mini-stats div { padding: 10px 4px; border-radius: 12px; background: var(--surface-2); }
.mini-stats b { display: block; font-size: 20px; font-weight: 800; }
.mini-stats span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.shortcut-hint { display: none; font-size: 12px; color: var(--muted); margin: 0; }
.shortcut-hint kbd { font: inherit; font-weight: 700; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); }

/* ---------- Result ---------- */
.result { display: grid; gap: 22px; padding: 28px 22px; text-align: center; justify-items: center; overflow: hidden; position: relative; }
.result.pass { background: linear-gradient(180deg, var(--ok-soft), var(--surface) 70%); }
.result.fail { background: linear-gradient(180deg, var(--bad-soft), var(--surface) 70%); }
.result h1 { margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 14px; }
.badge.pass { background: var(--ok); color: #fff; }
.badge.fail { background: var(--bad); color: #fff; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 440px; }
.result-stats div { padding: 12px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.result-stats b { display: block; font-size: 22px; font-weight: 800; }
.result-stats span { font-size: 12px; color: var(--muted); font-weight: 600; }
.result .actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.tabs { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface-2); }
.tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.review { display: grid; gap: 10px; margin-top: 14px; }
.review-item { padding: 16px 18px; border-left: 4px solid var(--ok); }
.review-item.ko { border-left-color: var(--bad); }
.review-item .q { font-weight: 700; margin: 6px 0 8px; }
.review-item img { display: block; height: 110px; max-width: 100%; margin: 0 0 10px; }
.review-item .ans { display: flex; gap: 8px; font-size: 14px; margin: 4px 0 0; }
.review-item .ans.ok { color: var(--ok); }
.review-item .ans.ko { color: var(--bad); }

/* ---------- Study blocks ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head p { margin: 0; max-width: 56ch; }
.blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.block { display: flex; align-items: center; gap: 14px; padding: 16px; text-decoration: none; color: var(--text); transition: transform .2s var(--ease), box-shadow .2s; }
.block:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.block .ring .ring-label b { font-size: 14px; }
.block h3 { margin: 0; }
.block span { font-size: 13px; color: var(--muted); font-weight: 600; }

.signs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 20px; }
.sign-tile { display: grid; place-items: center; gap: 6px; padding: 12px; text-decoration: none; color: var(--text); font-size: 12px; font-weight: 700; transition: transform .2s var(--ease); cursor: pointer; border: 1px solid var(--border); }
.sign-tile:hover { transform: translateY(-3px) rotate(-1deg); }
.sign-tile img { width: 100%; height: 84px; object-fit: contain; }
.sign-tile.ok { border-color: var(--ok); }
.sign-tile.ko { border-color: var(--bad); }

/* ---------- Legal ---------- */
.legal { max-width: 760px; }
.legal h2 { font-size: 19px; margin-top: 28px; }
.legal p, .legal li { font-size: 15px; color: color-mix(in srgb, var(--text) 85%, var(--muted)); }

.empty { text-align: center; padding: 40px 20px; display: grid; justify-items: center; gap: 6px; }
.empty .big { font-size: 48px; }

/* ---------- Footer & toast ---------- */
.footer { border-top: 1px solid var(--border); padding: 24px 16px 100px; text-align: center; }
.disclaimer { max-width: 680px; margin: 0 auto 10px; font-size: 13px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; font-size: 14px; font-weight: 600; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 50;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  transition: opacity .25s, transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall 1.8s ease-in forwards; }
@keyframes fall { to { transform: translateY(520px) rotate(540deg); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .modes { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 40px; }
}

@media (min-width: 900px) {
  main { padding: 32px 24px 48px; }
  .topnav { display: flex; }
  .chip-cat { margin-left: 8px; }
  .tabbar { display: none; }
  .footer { padding-bottom: 28px; }
  .toast { bottom: 32px; }
  .hero { grid-template-columns: 1fr auto; padding: 48px 52px; align-items: center; }
  .home-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
  .home-grid h2 { margin-top: 36px; }

  /* Examen: pregunta a la izquierda, panel a la derecha */
  .exam { grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; }
  .exam-bar { grid-column: 1 / -1; }
  .side { position: sticky; top: 132px; }
  .qcard { padding: 30px; }
  .kbd { display: inline; margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
  .option .mark + .kbd { margin-left: 8px; }
  .shortcut-hint { display: block; }
}

/* ---------- Premium ---------- */
.chip-plan {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  background: linear-gradient(135deg, #FFD36B, var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 6px 16px -8px rgba(255, 184, 28, .9);
  white-space: nowrap;
}
.chip-plan.on { background: var(--ink); color: var(--accent); box-shadow: none; }
@media (prefers-color-scheme: dark) { .chip-plan.on { background: var(--surface-3); } }
.lock-tag {
  margin-left: 5px;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: color-mix(in srgb, var(--accent) 45%, var(--text));
  vertical-align: 1px;
}
.tabbar a { position: relative; }
.tab-lock {
  position: absolute;
  top: 0;
  right: calc(50% - 22px);
  font-style: normal;
  font-size: 8px;
  font-weight: 800;
  padding: 1px 3px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-ink);
}
body.premium [data-solo-gratis] { display: none !important; }
.badge-pro {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 800; letter-spacing: .03em;
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
}
.mode .badge-pro { position: absolute; top: 12px; right: 12px; }

/* Anuncios */
.ad {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 90px;
  margin: 24px 0;
  border-radius: 14px;
  border: 1px dashed var(--surface-3);
  background: var(--surface);
  overflow: hidden;
}
.ad-label { position: absolute; top: 6px; left: 10px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ad-house { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 22px 18px 16px; text-decoration: none; color: var(--text); }
.ad-house b { display: block; font-size: 15px; }
.ad-house span { font-size: 13px; color: var(--muted); }
.ad-house .btn { flex: none; }
.ad-lateral { margin: 0; min-height: 250px; }
.ad-lateral .ad-house { flex-direction: column; text-align: center; justify-content: center; }
.ad-desktop { display: none; }
@media (min-width: 900px) { .ad-desktop { display: grid; } }

/* Plan gratis: aviso de estudio diario */
.cupo {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 14px 16px; margin-bottom: 16px; border-radius: 14px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  font-size: 14px;
}
.block.locked { opacity: .55; }
.block.locked:hover { transform: none; box-shadow: var(--shadow); }
.block .lock { margin-left: auto; font-size: 18px; }

/* Bloqueo y página premium */
.paywall { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 40px 22px; max-width: 620px; margin: 0 auto; }
.paywall .lock-ico { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 22px; background: var(--accent-soft); font-size: 34px; }
.paywall ul { text-align: left; }

.pricing { display: grid; gap: 20px; align-items: start; }
.price-card { padding: 28px 24px; position: relative; overflow: hidden; }
.price-card.featured { border: 2px solid var(--accent); }
.price-tag { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.price-tag b { font-size: 52px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.price-tag s { font-size: 22px; color: var(--muted); font-weight: 700; }
.price-tag .etq { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.price-terms { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.price-terms strong { color: var(--text); }
.checks { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.checks li::before { content: "✓"; flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--ok-soft); color: var(--ok); font-weight: 800; font-size: 13px; }
.checks li.no::before { content: "–"; background: var(--surface-2); color: var(--muted); }
.checks li.no { color: var(--muted); }

.compare { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare th, .compare td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: center; }
.compare th:first-child, .compare td:first-child { text-align: left; }
.compare thead th { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.compare .si { color: var(--ok); font-weight: 800; }
.compare .no { color: var(--muted); }

.buy-steps { display: grid; gap: 12px; counter-reset: b; }
.buy-step { display: flex; gap: 14px; align-items: flex-start; padding: 16px; }
.buy-step::before {
  counter-increment: b; content: counter(b);
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-weight: 800;
}
.buy-step h3 { margin-bottom: 4px; }
.buy-step p { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.yape-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.yape-num { font-size: 22px; font-weight: 800; letter-spacing: .02em; padding: 6px 14px; border-radius: 12px; background: #F3E8FF; color: #6B21A8; }
@media (prefers-color-scheme: dark) { .yape-num { background: #2E1A47; color: #D8B4FE; } }
.btn-wa { background: #25D366; border-color: #25D366; color: #06321A; }
.btn-wa:hover { background: #1EBE5B; border-color: #1EBE5B; }

.code-form { display: flex; gap: 10px; flex-wrap: wrap; }
.code-form input {
  flex: 1; min-width: 200px; min-height: 52px; padding: 0 16px;
  border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 18px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.code-form input:focus { outline: none; border-color: var(--primary); }
.form-msg { margin-top: 10px; font-size: 14px; font-weight: 600; min-height: 20px; }
.form-msg.ko { color: var(--bad); }
.form-msg.ok { color: var(--ok); }

.active-plan { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 24px; background: linear-gradient(135deg, var(--ink-2), var(--ink)); color: #fff; border: 0; }
.active-plan p { margin: 0; color: #B9C8D1; }
.active-plan h2 { margin: 0 0 4px; color: #fff; }

@media (min-width: 900px) {
  .pricing { grid-template-columns: 1.1fr 1fr; }
}

@media (min-width: 900px) { .chip-plan { margin-left: 8px; } }

/* ---------- Libro de Reclamaciones ---------- */
.libro-link {
  display: inline-flex; align-items: center; gap: 10px; margin: 4px auto 16px;
  padding: 10px 16px; border-radius: 14px; border: 2px solid var(--text);
  color: var(--text); text-decoration: none; text-align: left; background: var(--surface);
}
.libro-link svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.libro-link b { display: block; font-size: 14px; }
.libro-link small { display: block; font-size: 12px; color: var(--muted); }
.libro-ico { font-size: 56px; line-height: 1; }
.libro-prov { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.libro-prov span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.libro-prov b { font-size: 15px; word-break: break-word; }
.tipos { display: grid; gap: 12px; margin-bottom: 16px; }
.libro-form h2 { font-size: 18px; margin: 8px 0 14px; }
.libro-form h2:not(:first-child) { margin-top: 28px; }
.libro-form .field { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 12px; }
.libro-form input:not([type=checkbox]):not([type=radio]), .libro-form select, .libro-form textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px;
  border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; font-weight: 500;
}
.libro-form textarea { resize: vertical; }
.libro-form input:focus, .libro-form select:focus, .libro-form textarea:focus { outline: none; border-color: var(--primary); }
.grid2 { display: grid; gap: 0 14px; }
.grid2.tight { grid-template-columns: 1fr 1.3fr; gap: 0 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 6px 0 12px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.segmented { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface-2); margin-bottom: 14px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 8px 18px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { outline: 3px solid var(--accent); }
.hoja { padding: 22px; }
.hoja-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px; padding-bottom: 12px; border-bottom: 2px solid var(--text); }
.hoja-head b { display: block; font-size: 18px; letter-spacing: .02em; }
.hoja-head span { font-weight: 800; color: var(--bad); }
.hoja-tabla { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.hoja-tabla th, .hoja-tabla td { text-align: left; vertical-align: top; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.hoja-tabla th { width: 34%; color: var(--muted); font-weight: 600; }
.hoja-tabla td { white-space: pre-wrap; word-break: break-word; }
.hoja-tabla tr.sec td { padding-top: 16px; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); }
@media (min-width: 700px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid2 .full { grid-column: 1 / -1; }
  .tipos { grid-template-columns: 1fr 1fr; }
}
@media print {
  .topbar, .tabbar, .footer, .toast, .hero-actions, .card.pad:not(.hoja) { display: none !important; }
  body, .card { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  main { padding: 0 !important; }
}

/* Logo */
.brand { gap: 11px; font-size: 19px; letter-spacing: -.035em; }
.brand-mark { border-radius: 9px; box-shadow: 0 4px 12px -4px rgba(11, 27, 36, .45); transition: transform .25s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.04); }

/* El foco programático del contenido principal no debe mostrar borde */
main:focus, main:focus-visible { outline: none; }

/* Aviso de cookies */
.cookies {
  position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto; padding: 14px 16px;
  display: grid; gap: 10px; box-shadow: var(--shadow-lg); animation: rise .3s var(--ease) both;
}
.cookies p { margin: 0; font-size: 14px; }
.cookies-acciones { display: flex; gap: 8px; justify-content: flex-end; }
.link-btn { border: 0; background: none; padding: 0; color: var(--primary); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
@media (min-width: 900px) { .cookies { bottom: 20px; left: auto; right: 20px; } }

/* Contraste del botón dentro del espacio publicitario */
.ad-house .btn, .ad-house span.btn { color: var(--accent-ink); }
/* Imágenes con dimensiones declaradas: mantener proporción */
.q-figure img, .sign-tile img, .review-item img { height: auto; }
.q-figure img { height: 190px; }
.q-figure img.wide { height: auto; }
.sign-tile img { height: 84px; }
.review-item img { height: 110px; width: auto; }

/* Campo trampa anti-spam (invisible para personas) */
.trampa { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
