/* ============================================================ Tokens */
:root {
  --navy: #0a2540;
  --navy-2: #123a63;
  --sea: #0f7c9a;
  --sun: #ffb703;
  --coral: #ff6b4a;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #edf2f8;
  --text: #0f2236;
  --muted: #5b6f84;
  --line: #d9e3ee;
  --primary: #0f7c9a;
  --primary-ink: #ffffff;
  --primary-soft: #e1f2f7;
  --ok: #138a4d;
  --ok-soft: #e2f6ea;
  --ko: #d23f3f;
  --ko-soft: #fde9e7;
  --warn-soft: #fff4d6;
  --warn-ink: #7a5300;
  --shadow: 0 1px 2px rgba(10, 37, 64, .06), 0 8px 24px rgba(10, 37, 64, .08);
  --r: 18px;
  --c-pnb: #16a3a0; --c-per: #1f6fd1; --c-py: #7a4fd6; --c-cy: #d2543a;
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1724; --surface: #142334; --surface-2: #1b2d41; --text: #e8eef5; --muted: #9fb2c6; --line: #2a3e54;
    --primary: #3fb5d4; --primary-ink: #04121c; --primary-soft: #16364a;
    --ok: #43c486; --ok-soft: #133526; --ko: #f07171; --ko-soft: #3c2022; --warn-soft: #3a2f12; --warn-ink: #f4d27a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1724; --surface: #142334; --surface-2: #1b2d41; --text: #e8eef5; --muted: #9fb2c6; --line: #2a3e54;
  --primary: #3fb5d4; --primary-ink: #04121c; --primary-soft: #16364a;
  --ok: #43c486; --ok-soft: #133526; --ko: #f07171; --ko-soft: #3c2022; --warn-soft: #3a2f12; --warn-ink: #f4d27a;
  color-scheme: dark;
}

/* ============================================================ Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 500 17px/1.55 var(--font); -webkit-tap-highlight-color: transparent; }
a { color: var(--primary); font-weight: 700; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; font-weight: 900; margin: .2em 0 .35em; }
h2 { font-size: 1.3rem; font-weight: 800; margin: 1.6em 0 .6em; }
h3 { font-size: 1.08rem; font-weight: 800; }
svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-size: .92rem; font-weight: 600; }
.lead { color: var(--muted); font-size: 1.05rem; }
.centro { text-align: center; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 99; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

/* ============================================================ Cabecera */
.topbar { background: var(--navy); color: #fff; position: relative; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 900; font-size: 1.12rem; white-space: nowrap; }
.brand svg { width: 30px; height: 30px; stroke-width: 5; color: #fff; }
.brand svg circle { fill: var(--sun); }
.topnav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.topnav a { color: #cfe0f2; text-decoration: none; font-weight: 800; font-size: .9rem; padding: 6px 10px; border-radius: 999px; }
.topnav a:hover { background: var(--navy-2); color: #fff; }
@media (max-width: 520px) { .topnav { display: none; } }

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 8px; padding-bottom: 56px; }
main { min-width: 0; max-width: 780px; width: 100%; margin: 0 auto; outline: none; }
.sidebar { display: none; }
@media (min-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; }
  main { margin: 0; }
  .sidebar { display: block; }
  .ad-side { position: sticky; top: 16px; }
}

/* ============================================================ Publicidad (hueco reservado, discreta) */
.ad { display: flex; align-items: center; justify-content: center; background: var(--surface-2); border-radius: 14px; color: var(--muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; overflow: hidden; }
.ad:has(ins) { background: transparent; }
.ad ins { width: 100%; }
.ad-top-wrap { padding-top: 12px; }
.ad-banner { min-height: 90px; max-width: 728px; margin: 0 auto; }
/* En el móvil no hay banner arriba: el contenido es lo primero que se ve */
@media (max-width: 759px) { .ad-top-wrap { display: none; } }
.ad-inline { min-height: 250px; margin: 28px 0; }
.ad-side { min-height: 600px; }
/* En examen y práctica: nada de anuncios ni distracciones */
body.modo-app .ad-top-wrap, body.modo-app .footer, body.modo-app .topnav, body.modo-app .sidebar { display: none; }

/* ============================================================ Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 10px 20px; border: 0; border-radius: 14px;
  background: var(--primary); color: var(--primary-ink); font: 800 1rem var(--font);
  text-decoration: none; cursor: pointer; transition: transform .08s, filter .15s; box-shadow: 0 3px 0 rgba(10,37,64,.18);
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.btn-sec { background: var(--surface); color: var(--primary); box-shadow: inset 0 0 0 2px var(--line); }
.btn-big { width: 100%; min-height: 58px; font-size: 1.1rem; margin: 14px 0 4px; }
.btn-link { background: none; border: 0; color: var(--muted); font: 700 .92rem var(--font); text-decoration: underline; cursor: pointer; padding: 10px 0 0; }
.btn-ico { width: 46px; height: 46px; border-radius: 14px; border: 0; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; cursor: pointer; text-decoration: none; }
.btn-ico svg { width: 22px; height: 22px; stroke-width: 2.8; }
.chev { margin-left: auto; color: var(--muted); font-size: 1.6rem; font-weight: 400; line-height: 1; }

/* ============================================================ Portada */
.hero { position: relative; margin: 0 -16px; padding: 30px 20px 64px; background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 60%, var(--sea) 130%); color: #fff; overflow: hidden; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 46px; background: var(--bg);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 46' preserveAspectRatio='none'%3E%3Cpath d='M0 26C150 4 300 4 450 22s300 22 450 4 300-18 300-18V46H0z'/%3E%3C/svg%3E") center/100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 46' preserveAspectRatio='none'%3E%3Cpath d='M0 26C150 4 300 4 450 22s300 22 450 4 300-18 300-18V46H0z'/%3E%3C/svg%3E") center/100% 100%; }
.hero h1 { font-size: clamp(1.75rem, 6.5vw, 2.6rem); max-width: 16em; }
.hero p { font-size: 1.08rem; color: #cfe0f2; max-width: 34em; margin: 0; }
.subraya { background: linear-gradient(transparent 62%, rgba(255,183,3,.55) 62%); }
@media (min-width: 780px) { .hero { margin: 0; border-radius: 0 0 var(--r) var(--r); padding: 44px 36px 72px; } }
.paso { display: flex; align-items: center; gap: 10px; margin-top: 1.2em; }
.paso span { width: 32px; height: 32px; border-radius: 50%; background: var(--sun); color: var(--navy); display: grid; place-items: center; font-size: 1rem; font-weight: 900; flex: none; }

.titulos { display: grid; gap: 12px; }
@media (min-width: 640px) { .titulos { grid-template-columns: 1fr 1fr; } }
.titulo-card { --c: var(--c-per); display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--text); border-left: 6px solid var(--c); transition: transform .12s; }
.titulo-card:hover { transform: translateY(-2px); }
.s-pnb { --c: var(--c-pnb); } .s-per { --c: var(--c-per); } .s-py { --c: var(--c-py); } .s-cy { --c: var(--c-cy); }
.ico-tit { width: 58px; height: 58px; border-radius: 16px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); display: grid; place-items: center; flex: none; }
.ico-tit svg { width: 38px; height: 38px; stroke-width: 0; }
.ico-tit svg [stroke] { stroke-width: 3; }
.tc-txt { display: flex; flex-direction: column; min-width: 0; }
.tc-txt .sigla { font-weight: 900; color: var(--c); font-size: .85rem; letter-spacing: .06em; }
.tc-txt strong { font-size: 1.06rem; font-weight: 800; line-height: 1.25; }
.tc-txt em { font-style: normal; color: var(--c); font-weight: 800; font-size: .9rem; }
.tc-txt small { color: var(--muted); font-size: .88rem; font-weight: 600; line-height: 1.35; }
.tc-txt .cifras { color: var(--text); margin-top: 2px; }
.como { display: grid; gap: 12px; margin-top: 30px; }
@media (min-width: 640px) { .como { grid-template-columns: repeat(3, 1fr); } }
.como div { background: var(--surface); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.como h3 { margin: .5em 0 .2em; }
.como p { margin: 0; color: var(--muted); font-size: .95rem; }
.ico { width: 46px; height: 46px; border-radius: 14px; background: var(--primary-soft); display: grid; place-items: center; flex: none; font-size: 1.4rem; }

/* ============================================================ Página de título */
.migas { display: flex; flex-wrap: wrap; gap: 6px; font-size: .86rem; color: var(--muted); margin: 14px 0 6px; font-weight: 700; }
.migas a { color: var(--muted); font-weight: 700; }
.hero-tit { --c: var(--c-per); display: flex; gap: 16px; align-items: center; padding: 18px; margin: 6px 0 14px; border-radius: var(--r); background: linear-gradient(135deg, color-mix(in srgb, var(--c) 18%, var(--surface)), var(--surface)); box-shadow: var(--shadow); }
.hero-tit h1 { margin: 0; font-size: 1.55rem; }
.hero-tit p { margin: 4px 0 0; color: var(--muted); font-weight: 600; }
.kicker { text-transform: uppercase; letter-spacing: .07em; font-size: .76rem; font-weight: 900; color: var(--primary); margin: 0; }
.hero-mini { padding: 4px 0 6px; }
.hero-mini h1 { font-size: 1.6rem; }
.modos { display: grid; gap: 12px; }
.modo, .unidades a, .exlist a {
  display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 16px; text-decoration: none; color: var(--text); border: 2px solid transparent; transition: border-color .15s;
}
.modo:hover, .unidades a:hover, .exlist a:hover { border-color: var(--primary); }
.modo > span:nth-child(2) { display: flex; flex-direction: column; }
.modo strong { font-size: 1.1rem; font-weight: 900; }
.modo small, .u-txt small { color: var(--muted); font-size: .9rem; font-weight: 600; line-height: 1.4; }
.modo-fallos .ico { background: var(--warn-soft); }
.texto { background: var(--surface); border-radius: var(--r); padding: 6px 20px 14px; box-shadow: var(--shadow); margin: 18px 0; }
.texto li { margin: 8px 0; }
.info-box { background: var(--surface); border-radius: var(--r); padding: 4px 20px 14px; box-shadow: var(--shadow); margin-top: 24px; }
.reglas { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.reglas li { padding-left: 26px; position: relative; }
.reglas li::before { content: ""; position: absolute; left: 6px; top: .6em; width: 9px; height: 9px; border-radius: 50%; background: var(--sun); }
.faq details { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 800; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::after { content: "+"; color: var(--primary); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 0; padding: 0 16px 14px; color: var(--muted); }

/* ============================================================ Listados */
.tabs, .filtros { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.tab { border: 0; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); color: var(--text); padding: 9px 16px; border-radius: 999px; font: 800 .92rem var(--font); cursor: pointer; min-height: 44px; }
.tab.on { background: var(--navy); color: #fff; box-shadow: none; }
.tipo-ex h2 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.anio { margin-bottom: 10px; }
.anio summary { cursor: pointer; font-weight: 900; font-size: 1.1rem; padding: 10px 4px; }
.exlist, .unidades { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.exlist a { padding: 14px 16px; font-size: .97rem; font-weight: 700; }
.badge { font-size: .75rem; font-weight: 900; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-ko { background: var(--ko-soft); color: var(--ko); }
.b-bl, .b-an { background: var(--surface-2); color: var(--muted); }
.atajos { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 6px; }
.atajos .btn { flex: 1 1 220px; }
.num { width: 38px; height: 38px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 900; flex: none; }
.u-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.u-txt strong { font-weight: 800; }

/* ============================================================ Preguntas estáticas (SEO) */
.estatico { margin-top: 10px; }
.qstatic { background: var(--surface); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 12px; }
.opts-static { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.opts-static li { display: flex; gap: 10px; align-items: flex-start; }
.sol { margin-top: 10px; }
.sol summary { cursor: pointer; color: var(--primary); font-weight: 800; }
.sol p { margin: 8px 0 0; }

/* ============================================================ Tarjetas de pregunta */
.card, .qcard, .rcard { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.intro .tips { padding-left: 20px; color: var(--muted); font-weight: 600; }
.qmeta { margin: 0 0 8px; color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; }
.qnum { font-weight: 900; color: var(--text); font-size: 1.15rem; }
.qnum small { color: var(--muted); font-size: .85rem; }
.unidad { background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 800; }
.qtxt { font-size: 1.14rem; line-height: 1.45; margin: 4px 0 16px; font-weight: 800; }
.rcard .qtxt, .qstatic .qtxt { font-size: 1.04rem; }
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); color: var(--text); border: 2px solid var(--line); border-radius: 14px;
  padding: 13px 14px; font: 600 1rem/1.45 var(--font); cursor: pointer; min-height: 56px; transition: border-color .12s, background .12s, transform .08s;
}
button.opt:active:not(:disabled) { transform: scale(.99); }
@media (hover: hover) { button.opt:hover:not(:disabled) { border-color: var(--primary); } }
.letra { flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-weight: 900; font-size: .9rem; }
.otxt { flex: 1; padding-top: 3px; }
.opt.sel { border-color: var(--primary); background: var(--primary-soft); }
.opt.sel .letra { background: var(--primary); color: var(--primary-ink); }
.opt.bien { border-color: var(--ok); background: var(--ok-soft); }
.opt.bien .letra { background: var(--ok); color: #fff; }
.opt.mal { border-color: var(--ko); background: var(--ko-soft); }
.opt.mal .letra { background: var(--ko); color: #fff; }
.opt.apagada { opacity: .5; }
.opt:disabled { cursor: default; }
.tu { flex: none; align-self: center; font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.opt.bien .tu { color: var(--ok); } .opt.mal .tu { color: var(--ko); }
.aviso { background: var(--warn-soft); color: var(--warn-ink); padding: 10px 14px; border-radius: 12px; font-size: .92rem; font-weight: 700; margin: 0 0 14px; }
.aviso-anulada { margin-top: 12px; }
.anexo { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 14px; margin: 0 0 14px; border-radius: 12px; background: var(--primary-soft); color: var(--text); font-weight: 800; font-size: .95rem; text-decoration: none; border: 1.5px solid var(--primary); }
.anexo:hover { filter: brightness(.97); }
.tips .anexo { margin: 6px 0 0; }
.tips li.li-anexo { list-style: none; margin-left: -1.1em; }
.reportar { display: inline-block; margin-top: 12px; font-size: .85rem; font-weight: 700; color: var(--muted); text-decoration: none; }
.reportar:hover { color: var(--ko); text-decoration: underline; }
.tabla { width: 100%; border-collapse: collapse; font-size: .9rem; display: block; overflow-x: auto; }
.tabla th, .tabla td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tabla th { font-weight: 900; }
.nota { background: var(--primary-soft); padding: 10px 14px; border-radius: 12px; font-size: .92rem; margin: 12px 0 0; }

/* ============================================================ Modo app (examen y práctica) */
body.modo-app { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
body.modo-app .migas { display: none; }
.appbar {
  position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  background: var(--surface); margin: 0 -16px 14px; padding: 10px 16px 12px; box-shadow: var(--shadow);
}
@media (min-width: 780px) { .appbar { margin: 8px 0 16px; border-radius: var(--r); } }
.reloj-wrap { text-align: center; line-height: 1.1; }
.reloj { font-variant-numeric: tabular-nums; font-size: 1.65rem; font-weight: 900; }
.reloj.poco { color: var(--ko); animation: latido 1s ease-in-out infinite; }
@keyframes latido { 50% { opacity: .55; } }
.reloj-wrap small, .pr-tit small { display: block; color: var(--muted); font-size: .8rem; font-weight: 700; }
.btn-fin { min-height: 46px; padding: 8px 14px; background: var(--navy); }
.exprog { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.exprog span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sea), var(--sun)); transition: width .25s; }
.pr-tit { line-height: 1.15; }
.pr-tit strong { font-weight: 900; }
.pr-score { display: flex; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 3px; padding: 4px 10px; border-radius: 999px; font-weight: 900; font-variant-numeric: tabular-nums; font-size: .92rem; }
.pill svg { width: 15px; height: 15px; stroke-width: 3.2; }
.p-ok { background: var(--ok-soft); color: var(--ok); } .p-ko { background: var(--ko-soft); color: var(--ko); }

.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: 10px; align-items: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 -4px 20px rgba(10,37,64,.12);
}
.bottombar .btn { flex: 1; margin: 0; }
.bottombar .btn-sec:first-child { flex: 0 0 56px; padding: 0; }
.bottombar .btn-mapa { flex: 0 0 auto; padding: 0 14px; }
.bottombar .hint { margin: 0 auto; color: var(--muted); font-weight: 700; font-size: .95rem; padding: 14px 0; }
@media (min-width: 780px) { .bottombar { left: 50%; transform: translateX(-50%); max-width: 780px; bottom: 16px; border-radius: 20px; padding-bottom: 10px; } }

.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(6, 20, 36, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-in { background: var(--surface); width: 100%; max-width: 780px; max-height: 75vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); animation: sube .2s ease-out; }
@keyframes sube { from { transform: translateY(40px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h3 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; margin-top: 12px; }
.cel { height: 46px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font: 800 .95rem var(--font); cursor: pointer; display: grid; place-items: center; text-decoration: none; }
.cel.hecha { background: var(--primary-soft); border-color: var(--primary-soft); color: var(--primary); }
.cel.actual { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.c-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.c-ko { background: var(--ko); border-color: var(--ko); color: #fff; }
.c-bl { background: var(--surface-2); color: var(--muted); }
.c-an { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.leyenda { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.leyenda .cel { display: inline-block; width: 16px; height: 16px; border-radius: 5px; margin-left: 8px; }

.pausa-capa { position: fixed; inset: 0; z-index: 50; background: rgba(6, 20, 36, .6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: grid; place-items: center; padding: 16px; }
.pausa-capa .card { max-width: 420px; text-align: center; }

.feedback { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; padding: 12px 16px; border-radius: 14px; margin-top: 16px; animation: aparece .2s ease-out; }
@keyframes aparece { from { transform: translateY(6px); opacity: 0; } }
.f-ok { background: var(--ok-soft); color: var(--ok); } .f-ko { background: var(--ko-soft); color: var(--ko); }
.feedback strong { font-weight: 900; font-size: 1.05rem; }
.feedback span { color: var(--text); }

/* ============================================================ Resultados */
.veredicto { display: flex; gap: 18px; align-items: center; border-radius: var(--r); padding: 18px; margin-top: 10px; }
.veredicto h1 { margin: .1em 0 .2em; font-size: 1.5rem; }
.veredicto p { margin: 0; }
.v-ok { background: var(--ok-soft); } .v-ko { background: var(--ko-soft); }
.v-ok .kicker { color: var(--ok); } .v-ko .kicker { color: var(--ko); }
.anillo { --p: 0; --c: var(--ok); width: 104px; height: 104px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: radial-gradient(closest-side, var(--surface) 74%, transparent 75% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); }
.v-ko .anillo { --c: var(--ko); }
.anillo b { font-size: 1.6rem; font-weight: 900; }
.anillo small { font-size: .9rem; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.st { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 6px; text-align: center; }
.st b { display: block; font-size: 1.35rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.st span { color: var(--muted); font-size: .8rem; font-weight: 700; }
.st-ok b { color: var(--ok); } .st-ko b { color: var(--ko); }
.criterios { list-style: none; padding: 0; margin: 0; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.criterios li { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); font-weight: 700; }
.criterios li:first-child { border-top: 0; }
.criterios b { margin-left: auto; font-size: 1.1rem; }
.ci { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.ci svg { width: 15px; height: 15px; stroke-width: 3.4; }
.criterios .ok .ci { background: var(--ok); } .criterios .ko .ci { background: var(--ko); }
.criterios .ko b { color: var(--ko); }
.acciones { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.acciones .btn { flex: 1 1 180px; }
#rev { display: grid; gap: 12px; }
.rcard { border-left: 6px solid var(--line); }
.r-ok { border-left-color: var(--ok); } .r-ko { border-left-color: var(--ko); }
.rcard .badge { margin-left: auto; }
.fin-pr { text-align: center; margin-top: 16px; }
.fin-pr .anillo { margin: 4px auto 0; width: 120px; height: 120px; }
.fin-pr h1 { font-size: 1.45rem; }
.empty { text-align: center; padding: 30px 18px; margin-top: 16px; }

/* ============================================================ Pie */
.footer { background: var(--navy); color: #cfe0f2; padding: 28px 0 36px; font-size: .92rem; }
.footer a { color: #fff; display: block; margin: 4px 0; font-weight: 700; text-decoration: none; }
.footer strong { color: #fff; display: block; margin-bottom: 6px; }
.footer .muted { color: #9fb6cc; margin-top: 18px; }
.foot-cols { display: grid; gap: 20px; }
@media (min-width: 700px) { .foot-cols { grid-template-columns: 2fr 1.4fr 1fr; } }
.foot-cols p { margin: 0; }

@media (max-width: 520px) {
  body { font-size: 16.5px; }
  .card, .qcard, .rcard { padding: 16px; }
  .reloj { font-size: 1.5rem; }
  .stats .st b { font-size: 1.15rem; }
  .veredicto { padding: 14px; gap: 14px; }
  .anillo { width: 88px; height: 88px; }
  .anillo b { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Anexos de examen (tablas propias) */
.tabla-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 12px; }
.tabla.mareas { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabla.mareas th, .tabla.mareas td { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: top; }
.tabla.mareas tbody th b { display: block; font-size: 1.1rem; }
.tabla.mareas small { display: block; color: var(--muted); font-size: .72rem; font-weight: 700; }
.tabla.mareas td b { display: block; }
.tabla.mareas td span { display: block; font-weight: 700; }
.tabla.mareas td.pl small { color: var(--primary); }
.tabla.mareas td.bj small { color: var(--warn-ink); }
.tabla.presion { border-collapse: collapse; min-width: 220px; }
.tabla.presion td, .tabla.presion th { padding: 5px 14px; border-bottom: 1px solid var(--line); text-align: right; }
.calc-marea { display: grid; gap: 10px; background: var(--surface-2); padding: 14px; border-radius: 14px; margin: 0 0 12px; }
.calc-marea label { display: grid; gap: 4px; font-weight: 700; font-size: .9rem; }
.calc-marea input { font: inherit; font-size: 1rem; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); min-height: 44px; }
.calc-res { font-size: 1.15rem; }
html.embebido .topbar, html.embebido .ad-top-wrap, html.embebido .migas, html.embebido aside, html.embebido footer, html.embebido .ad { display: none !important; }
/* Hoja con el anexo dentro del examen */
.hoja-anexo { position: fixed; inset: 0; z-index: 90; background: rgba(10,37,64,.45); display: flex; align-items: flex-end; justify-content: center; }
.hoja-anexo > div { background: var(--surface); width: 100%; max-width: 820px; height: 92vh; height: 92dvh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; overflow: hidden; }
.hoja-anexo header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 800; }
.hoja-anexo iframe { flex: 1; border: 0; width: 100%; background: var(--bg); }

/* ============================================================ Ordenador: examen y práctica centrados, con panel de preguntas */
.expanel { display: none; }
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); font: 800 .8rem var(--font); text-align: center; }
@media (min-width: 1100px) {
  body.modo-app .layout { grid-template-columns: minmax(0, 1fr); }
  body.modo-app main { margin: 0 auto; }
  body.modo-app main.con-panel { max-width: 1120px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto auto 1fr; column-gap: 24px; align-items: start; }
  main.con-panel .appbar { grid-column: 1 / -1; grid-row: 1; }
  main.con-panel #exbody { grid-column: 1; grid-row: 2; }
  main.con-panel .bottombar { grid-column: 1; grid-row: 3; position: static; transform: none; max-width: none; margin-top: 14px; border-radius: 20px; padding: 10px 14px; }
  main.con-panel .btn-mapa { display: none; }
  main.con-panel .expanel { display: block; grid-column: 2; grid-row: 2 / span 2; position: sticky; top: 112px; background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
  .expanel h3 { margin: 0; }
  .expanel .atajos { margin: 12px 0 0; font-size: .85rem; color: var(--muted); line-height: 1.9; }
  body.modo-app:has(main.con-panel) { padding-bottom: 40px; }
}

/* ============================================================ Temas del examen y temas eliminatorios (marca discreta) */
.elim { display: inline-flex; align-items: center; gap: 4px; color: var(--coral); font-size: .74rem; font-weight: 800; white-space: nowrap; }
.elim::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.bloques { display: grid; gap: 12px; margin-top: 10px; }
.bloque .grid { margin-top: 6px; }
.bl-tit { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; font-weight: 800; font-size: .88rem; }
.bl-num { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: .75rem; font-weight: 900; }
.bl-nom { flex: 0 1 auto; }
.b-elim { border-left: 3px solid color-mix(in srgb, var(--coral) 55%, transparent); padding-left: 9px; }
.bl-res { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 900; }
.bl-res.bien { color: var(--ok); }
.bl-res.mal { color: var(--ko); }
.expanel .bloques { gap: 10px; }
.expanel .grid { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.expanel .cel { height: 38px; border-radius: 10px; font-size: .88rem; }
@media (min-width: 1100px) { main.con-panel .expanel { max-height: calc(100vh - 128px); overflow: auto; } }
.tema-tit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 28px 0 10px; font-size: 1.1rem; }
.tema-tit small { color: var(--muted); font-size: .8rem; font-weight: 700; }

/* Guardar mi progreso (clave) */
#progreso { display: grid; gap: 14px; margin-top: 14px; }
#progreso h2 { margin: 0 0 8px; font-size: 1.1rem; }
#progreso .card p:last-child { margin-bottom: 0; }
.resumen-local { margin: 0; color: var(--muted); }
.clave-card { text-align: center; }
.clave-eti { margin: 0; font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.clave-grande { margin: 6px 0 12px; font-size: clamp(1.5rem, 7vw, 2.1rem); font-weight: 900; letter-spacing: .06em; color: var(--primary); font-variant-numeric: tabular-nums; word-break: break-all; }
.clave-card .acciones { justify-content: center; }
.form-clave label { display: block; font-weight: 700; margin-bottom: 6px; }
.fila-clave { display: flex; gap: 8px; }
.fila-clave input { flex: 1; min-width: 0; font: inherit; font-size: 1.1rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--text); }
.fila-clave input:focus { outline: none; border-color: var(--primary); }
.fila-clave input::placeholder { color: var(--muted); opacity: .6; }
.btn-peligro { color: var(--ko); }
.invita-clave { margin: 14px 0 0; font-size: .9rem; }
.clave-card > p:last-child { text-align: left; }
