/* traineristqb · estilos
   Grises cálidos, naranja de marca y amarillo de atención.
   Cada color tiene un solo trabajo:
     naranja  → marca, acción principal, progreso
     amarillo → lo que pide atención (repaso pendiente, días sin uso, marcadas)
     verde    → correcto        rojo → incorrecto (y nada más) */

:root {
  --bg: #F4F3F1; --surface: #FFFFFF; --surface-2: #F7F6F4; --sunken: #ECEAE6;
  --ink: #1C1B19; --ink-2: #45423D; --muted: #6B675F; --line: #E6E3DE; --line-strong: #D3CFC8;
  --graphite: #1F1F22; --graphite-2: #2B2B2F; --on-graphite: #EDEBE7; --on-graphite-muted: #A19D96;
  --brand: #F2620F; --brand-hover: #E0560A; --brand-soft: #FDEBDD; --brand-ink: #C2410C; --on-brand: #1C1B19;
  --amber: #F5B41A; --amber-soft: #FDF3D6; --amber-ink: #8A5F00;
  --ok: #1F9D55; --ok-soft: #E3F4EA; --ok-ink: #17804A;
  --bad: #D93B2B; --bad-soft: #FBE6E3; --bad-ink: #B8321F;
  --c1: #F2620F; --c2: #F58A3C; --c3: #F5B41A; --c4: #C2410C; --c5: #8C877F; --c6: #45423D;
  --sombra: 0 1px 2px rgba(28, 27, 25, .05), 0 6px 20px rgba(28, 27, 25, .05);
  --sombra-alta: 0 18px 48px rgba(28, 27, 25, .22);
  --r: 14px; --r-sm: 10px;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #141416; --surface: #1E1E21; --surface-2: #232327; --sunken: #2A2A2E;
  --ink: #EDEBE7; --ink-2: #CFCBC4; --muted: #9C978F; --line: #2F2F33; --line-strong: #3E3E43;
  --graphite: #0E0E10; --graphite-2: #1A1A1D; --on-graphite: #EDEBE7; --on-graphite-muted: #8F8A83;
  --brand: #FF7A1A; --brand-hover: #FF8E3D; --brand-soft: #3A2416; --brand-ink: #FF9A52; --on-brand: #141416;
  --amber: #FFC93C; --amber-soft: #3A3016; --amber-ink: #FFD56A;
  --ok: #3CC77A; --ok-soft: #16301F; --ok-ink: #5BD592;
  --bad: #FF5A47; --bad-soft: #3A1C18; --bad-ink: #FF7B6B;
  --c1: #FF7A1A; --c2: #FF9A52; --c3: #FFC93C; --c4: #E2622A; --c5: #9C978F; --c6: #CFCBC4;
  --sombra: 0 1px 2px rgba(0, 0, 0, .3); --sombra-alta: 0 18px 48px rgba(0, 0, 0, .55);
  color-scheme: dark;
} }

*, *::before, *::after { box-sizing: border-box }
html, body { margin: 0 }
body { min-height: 100dvh; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px;
  line-height: 1.55; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01" }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.15 }
button { font: inherit; cursor: pointer; color: inherit }
a { color: var(--brand-ink); text-underline-offset: 2px }
[hidden] { display: none !important }
.mono { font-family: var(--f-mono) }
svg.i { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px }

/* ============ armazón: lateral (escritorio), barra superior y navegación inferior (celular) ============ */
.shell { min-height: 100dvh }
.lateral { display: none }
.principal { min-width: 0 }
.contenido { max-width: 46rem; margin: 0 auto; padding: 1.25rem 1rem 7.5rem }

.topbar { position: sticky; top: 0; z-index: 20; background: var(--graphite); color: var(--on-graphite);
  display: flex; align-items: center; gap: .6rem; padding: .65rem 1rem; min-height: 3.5rem }
.brand { display: inline-flex; align-items: center; gap: .55rem; background: none; border: 0; padding: 0;
  color: inherit; font-weight: 700; font-size: 1.02rem; letter-spacing: -.02em; text-decoration: none }
.brand img { width: 26px; height: 26px; border-radius: 7px }
.topbar .spacer { flex: 1 }
.progreso { display: flex; align-items: center; gap: .65rem; flex: 1; min-width: 0; max-width: 20rem; font-size: .8rem;
  font-weight: 600; color: var(--on-graphite-muted); white-space: nowrap }
.progreso .barra { flex: 1; height: 6px; border-radius: 99px; background: var(--graphite-2); overflow: hidden }
.progreso .barra i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .2s }
.clock { font-family: var(--f-mono); font-weight: 600; font-size: .92rem; font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem; border-radius: 99px;
  background: var(--graphite-2); color: var(--on-graphite) }
.clock .i { width: 16px; height: 16px; flex-basis: 16px }
.clock.low { background: var(--bad); color: #fff }
.tbtn { display: inline-flex; align-items: center; gap: .35rem; background: transparent; color: var(--on-graphite);
  border: 1px solid var(--graphite-2); border-radius: 99px; padding: .35rem .8rem; font-size: .85rem; font-weight: 500 }
.tbtn:hover { border-color: var(--on-graphite-muted) }
.tbtn .i { width: 16px; height: 16px; flex-basis: 16px }
.avatar { width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 0; background: var(--brand); color: var(--on-brand);
  font-weight: 700; font-size: .8rem; display: grid; place-items: center; padding: 0; letter-spacing: 0 }
.red { font-size: .72rem; font-weight: 600; color: var(--graphite); background: var(--amber); padding: .2rem .55rem;
  border-radius: 99px; white-space: nowrap }

.navinf { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)) }
.navitem { display: flex; flex-direction: column; align-items: center; gap: .15rem; background: none; border: 0;
  color: var(--muted); font-size: .7rem; font-weight: 600; padding: .35rem 0; border-radius: var(--r-sm); position: relative }
.navitem[aria-current="page"] { color: var(--brand-ink) }
.navitem[aria-current="page"] .i { stroke-width: 2.2 }
.navitem .punto { position: absolute; top: .2rem; left: calc(50% + .45rem); min-width: 1.05rem; height: 1.05rem; padding: 0 .25rem;
  border-radius: 99px; background: var(--amber); color: var(--graphite); font-size: .62rem; font-weight: 700; display: grid; place-items: center }

@media (min-width: 900px) {
  .shell[data-modo="app"] { display: grid; grid-template-columns: 15rem 1fr }
  .shell[data-modo="app"] .lateral { display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; height: 100dvh;
    background: var(--graphite); color: var(--on-graphite); padding: 1.25rem .85rem }
  .shell[data-modo="app"] .topbar { background: var(--bg); color: var(--ink); border-bottom: 1px solid var(--line) }
  .shell[data-modo="app"] .topbar .brand { display: none }
  .shell[data-modo="app"] .contenido { padding: 2rem 2rem 4rem; max-width: 60rem }
  .navinf { display: none !important }
  .lateral .brand { padding: .25rem .5rem; font-size: 1.1rem }
  .lateral nav { display: flex; flex-direction: column; gap: .2rem }
  .lateral .navitem { flex-direction: row; justify-content: flex-start; gap: .75rem; font-size: .92rem; font-weight: 500;
    color: var(--on-graphite-muted); padding: .6rem .75rem }
  .lateral .navitem:hover { background: var(--graphite-2); color: var(--on-graphite) }
  .lateral .navitem[aria-current="page"] { background: var(--graphite-2); color: var(--on-graphite) }
  .lateral .navitem[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: .55rem; bottom: .55rem; width: 3px;
    border-radius: 3px; background: var(--brand) }
  .lateral .navitem .punto { position: static; margin-left: auto }
  .lateral .pie-lateral { margin-top: auto; font-size: .75rem; color: var(--on-graphite-muted); padding: 0 .5rem; line-height: 1.5 }
  .lateral .pie-lateral a { color: var(--on-graphite-muted) }
  .shell[data-modo="foco"] .contenido { padding-top: 2rem }
}

/* ============ piezas comunes ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sombra) }
.pad { padding: 1.15rem 1.15rem 1.25rem }
.sec { font-size: 1.05rem; font-weight: 700; margin: 2rem 0 .8rem; display: flex; align-items: baseline; gap: .6rem }
.sec small { font-size: .82rem; font-weight: 500; color: var(--muted) }
.titulo-vista { font-size: clamp(1.6rem, 5vw, 2rem); font-weight: 750; margin: .25rem 0 .35rem }
.bajada { color: var(--muted); margin: 0 0 1.25rem; max-width: 36rem }
.note { font-size: .86rem; color: var(--muted); line-height: 1.5; margin: 1rem 0 0 }
.empty { color: var(--muted); font-size: .9rem; margin: 0 }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; background: var(--brand); color: var(--on-brand);
  border: 1px solid var(--brand); border-radius: var(--r-sm); padding: .72rem 1.15rem; font-size: .95rem; font-weight: 650;
  text-decoration: none; transition: background .12s, border-color .12s, transform .06s }
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover) }
.btn:active { transform: translateY(1px) }
.btn .i { width: 18px; height: 18px; flex-basis: 18px }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); font-weight: 550 }
.btn.ghost:hover { border-color: var(--ink-2) }
.btn.oscuro { background: var(--graphite); border-color: var(--graphite); color: var(--on-graphite) }
.btn.peligro { background: var(--surface); color: var(--bad-ink); border-color: var(--bad) }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none }
.btnrow { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.1rem }

.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 650; padding: .2rem .6rem;
  border-radius: 99px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; vertical-align: .1em }
.badge.due, .badge.atencion { background: var(--amber); color: var(--graphite) }
.badge.zero { background: var(--sunken); color: var(--muted) }
.badge.lvl4 { background: var(--graphite); color: var(--on-graphite) }
.badge.marca { background: var(--brand-soft); color: var(--brand-ink) }
.badge.ok { background: var(--ok-soft); color: var(--ok-ink) }
.badge.mal { background: var(--bad-soft); color: var(--bad-ink) }

.meter { height: .55rem; background: var(--sunken); border-radius: 99px; overflow: hidden }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: 99px }

.pills { display: flex; flex-wrap: wrap; gap: .4rem }
.pill { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-2); border-radius: 99px;
  padding: .38rem .85rem; font-size: .85rem; font-weight: 500 }
.pill:hover { border-color: var(--ink-2) }
.pill[aria-pressed="true"] { background: var(--graphite); border-color: var(--graphite); color: var(--on-graphite) }
.frow { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem }
.frow > span { font-size: .78rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em }
.frow .hint { font-size: .86rem; color: var(--muted); margin: 0 }

/* ============ carga ============ */
.cargando { min-height: 60dvh; display: grid; place-items: center; text-align: center; color: var(--muted) }
.cargando .giro { width: 30px; height: 30px; border: 3px solid var(--sunken); border-top-color: var(--brand);
  border-radius: 50%; margin: 0 auto .9rem; animation: giro .8s linear infinite }
@keyframes giro { to { transform: rotate(360deg) } }

/* ============ bienvenida ============ */
.shell[data-modo="afuera"] .topbar { display: none }
.shell[data-modo="afuera"] .contenido { max-width: 64rem; padding: 0 0 3rem }
.bienvenida { display: grid; gap: 0 }
.portada { background: var(--graphite); color: var(--on-graphite); padding: 1.6rem 1.25rem 2.2rem; position: relative; overflow: hidden }
.portada::after { content: ""; position: absolute; right: -4rem; bottom: -5rem; width: 16rem; height: 16rem; border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 98, 15, .35), transparent 70%); pointer-events: none }
.portada .brand { font-size: 1.15rem; margin-bottom: 2.4rem }
.portada .eyebrow { display: inline-block; font-size: .75rem; font-weight: 650; color: var(--graphite); background: var(--amber);
  padding: .2rem .65rem; border-radius: 99px; margin-bottom: 1rem }
.portada h1 { font-size: clamp(2.1rem, 9vw, 3.4rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.02; max-width: 15ch }
.portada h1 em { font-style: normal; color: var(--brand) }
.portada p { color: var(--on-graphite-muted); margin: 1rem 0 0; max-width: 30rem; font-size: 1.02rem }
.panel-ingreso { padding: 1.5rem 1.25rem 0 }
.puntos { list-style: none; margin: 0 0 1.6rem; padding: 0; display: grid; gap: .75rem }
.puntos li { display: grid; grid-template-columns: 2.4rem 1fr; gap: .8rem; align-items: start; font-size: .95rem; color: var(--ink-2) }
.puntos li .ico { width: 2.4rem; height: 2.4rem; border-radius: var(--r-sm); background: var(--brand-soft); color: var(--brand-ink);
  display: grid; place-items: center }
.puntos li strong { color: var(--ink) }
.acciones-ingreso { display: flex; flex-direction: column; gap: .65rem; max-width: 26rem }
.btn.ingreso { background: var(--surface); color: var(--ink); border-color: var(--line-strong); font-weight: 600 }
.btn.ingreso:hover { border-color: var(--ink-2) }
.btn.ingreso svg { width: 18px; height: 18px; flex: 0 0 18px }
.separador { display: flex; align-items: center; gap: .7rem; color: var(--muted); font-size: .78rem; font-weight: 600; margin: .35rem 0 }
.separador::before, .separador::after { content: ""; flex: 1; border-top: 1px solid var(--line) }
.letrachica { font-size: .82rem; color: var(--muted); line-height: 1.55; margin: 1.4rem 0 0; max-width: 34rem }
.aviso { background: var(--amber-soft); color: var(--ink); border-left: 3px solid var(--amber); border-radius: var(--r-sm);
  padding: .75rem .9rem; font-size: .88rem; margin: 1rem 0 0 }
@media (min-width: 900px) {
  .bienvenida { grid-template-columns: 1.1fr 1fr; min-height: 100dvh; align-items: stretch }
  .portada { padding: 2.5rem 3rem; display: flex; flex-direction: column; justify-content: center }
  .portada .brand { position: absolute; top: 2rem; left: 3rem }
  .panel-ingreso { padding: 3rem; display: flex; flex-direction: column; justify-content: center }
}

/* ============ inicio ============ */
.saludo { display: grid; gap: 1rem; padding: 1.3rem 1.25rem; margin-bottom: 1rem; position: relative; overflow: hidden }
.saludo h1 { font-size: clamp(1.55rem, 5vw, 2rem); font-weight: 750 }
.saludo p { color: var(--muted); margin: .3rem 0 0; font-size: .92rem }
.saludo .acciones { display: flex; gap: .6rem; flex-wrap: wrap }
@media (min-width: 700px) { .saludo { grid-template-columns: 1fr auto; align-items: center } }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr) } }
.stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1rem;
  display: flex; flex-direction: column-reverse; gap: .1rem; box-shadow: var(--sombra) }
.stats .lbl { font-size: .78rem; font-weight: 550; color: var(--muted) }
.stats .val small { font-size: .9rem; color: var(--muted); font-weight: 600 }
.stats .val { font-size: 1.75rem; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1 }

.modos { display: grid; gap: .75rem }
@media (min-width: 640px) { .modos { grid-template-columns: repeat(2, 1fr) } }
.modo { display: grid; grid-template-columns: 2.6rem 1fr; gap: .9rem; text-align: left; align-items: start; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; box-shadow: var(--sombra);
  transition: border-color .12s, transform .12s }
.modo:hover { border-color: var(--brand); transform: translateY(-1px) }
.modo .ico { width: 2.6rem; height: 2.6rem; border-radius: var(--r-sm); background: var(--sunken); color: var(--ink-2);
  display: grid; place-items: center }
.modo.destacado { background: var(--graphite); border-color: var(--graphite); color: var(--on-graphite) }
.modo.destacado .ico { background: var(--brand); color: var(--on-brand) }
.modo.destacado p { color: var(--on-graphite-muted) }
.modo h3 { font-size: 1rem; font-weight: 650; display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: .2rem }
.modo p { margin: 0; font-size: .86rem; color: var(--muted); line-height: 1.45 }
@media (min-width: 640px) { .modo.destacado { grid-column: 1 / -1 } }

.caps { display: grid; gap: .75rem }
@media (min-width: 640px) { .caps { grid-template-columns: repeat(2, 1fr) } }
.cap { display: grid; grid-template-columns: 2.6rem 1fr auto; gap: .9rem; align-items: center; text-align: left; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .95rem 1rem; box-shadow: var(--sombra) }
.cap:hover { border-color: var(--brand) }
.cap .num { width: 2.6rem; height: 2.6rem; border-radius: var(--r-sm); display: grid; place-items: center; font-weight: 750;
  background: var(--brand-soft); color: var(--brand-ink) }
.cap h3 { font-size: .95rem; font-weight: 650; margin-bottom: .45rem }
.cap .meter { height: .4rem }
.cap .meta { display: flex; justify-content: space-between; gap: .5rem; font-size: .75rem; color: var(--muted); margin-top: .35rem }
.cap .chev { color: var(--muted) }

/* ============ aviso de uso (franja) ============ */
.franja { display: flex; gap: .7rem; align-items: flex-start; font-size: .9rem; line-height: 1.45; margin: 0 0 1rem;
  padding: .85rem 1rem; border-radius: var(--r); background: var(--amber-soft); border: 1px solid var(--amber) }
.franja .i { color: var(--amber-ink); margin-top: .1rem }
.franja.alerta { background: var(--amber); border-color: var(--amber); color: var(--graphite) }
.franja.alerta .i, .franja.alerta a { color: var(--graphite) }
.franja button { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; padding: 0 .2rem; font-size: 1.2rem; line-height: 1 }

/* ============ examen ============ */
.qbox { padding: 1.25rem 1.15rem 1.35rem }
.qmeta { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .95rem }
.qmeta span { font-size: .72rem; font-weight: 650; padding: .2rem .6rem; border-radius: 99px; background: var(--sunken); color: var(--ink-2) }
.qmeta .k { background: var(--brand-soft); color: var(--brand-ink) }
.qmeta .dif3 { background: var(--graphite); color: var(--on-graphite) }
.qmeta .dif4 { background: var(--graphite); color: var(--amber) }
.escenario { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .85rem .95rem;
  font-size: .9rem; line-height: 1.6; white-space: pre-wrap; margin: 0 0 1rem; overflow-x: auto; color: var(--ink-2) }
.escenario.code { font-family: var(--f-mono); font-size: .78rem; white-space: pre; line-height: 1.5 }
.stem { font-size: 1.08rem; line-height: 1.5; margin: 0 0 1.1rem; font-weight: 650; letter-spacing: -.01em }
.opts { display: flex; flex-direction: column; gap: .55rem }
.opt { display: flex; gap: .8rem; align-items: flex-start; text-align: left; width: 100%; background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: .8rem .9rem; font-size: .95rem; line-height: 1.45;
  transition: border-color .12s, background .12s }
.opt:hover { border-color: var(--line-strong) }
.opt .letter { flex: 0 0 1.6rem; height: 1.6rem; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center;
  font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-top: -.05rem }
.opt[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft) }
.opt[aria-pressed="true"] .letter { background: var(--brand); border-color: var(--brand); color: var(--on-brand) }
.opt[data-st="right"] { border-color: var(--ok); background: var(--ok-soft) }
.opt[data-st="right"] .letter { background: var(--ok); border-color: var(--ok); color: #fff }
.opt[data-st="wrong"] { border-color: var(--bad); background: var(--bad-soft) }
.opt[data-st="wrong"] .letter { background: var(--bad); border-color: var(--bad); color: #fff }
.opt[data-st="dim"] { opacity: .55 }
.opt[disabled] { cursor: default }

.veredicto { display: flex; gap: .8rem; align-items: center; margin-top: 1.2rem; padding: .9rem 1rem; border-radius: var(--r-sm) }
.veredicto .sello { width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: 0 0 2.4rem }
.veredicto.bien { background: var(--ok-soft) } .veredicto.bien .sello { background: var(--ok) } .veredicto.bien b { color: var(--ok-ink) }
.veredicto.mal { background: var(--bad-soft) } .veredicto.mal .sello { background: var(--bad) } .veredicto.mal b { color: var(--bad-ink) }
.veredicto b { display: block; font-size: 1.05rem }
.veredicto span { font-size: .85rem; color: var(--ink-2) }
.why { margin-top: 1rem; display: flex; flex-direction: column; gap: .7rem; font-size: .9rem; line-height: 1.55 }
.why .row { display: grid; grid-template-columns: 1.6rem 1fr; gap: .7rem }
.why .row b { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-size: .75rem;
  text-transform: uppercase; background: var(--sunken); color: var(--ink-2) }
.why .row.ok b { background: var(--ok); color: #fff }
.trap { display: inline-block; font-size: .7rem; font-weight: 700; color: var(--amber-ink); background: var(--amber-soft);
  padding: .1rem .5rem; border-radius: 99px; margin-right: .4rem; white-space: nowrap }
.ref { font-size: .78rem; color: var(--muted); margin: .3rem 0 0; padding-top: .7rem; border-top: 1px solid var(--line) }
.srsnote { font-size: .8rem; color: var(--muted); margin: .4rem 0 0 }

.navbox { margin-top: .9rem; padding: 1rem 1.1rem 1.15rem }
.navbox h2 { font-size: .9rem; font-weight: 650 }
.jumpgrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: .8rem }
@media (min-width: 520px) { .jumpgrid { grid-template-columns: repeat(auto-fill, 2.6rem); gap: 7px } }
.qjump { aspect-ratio: 1; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 8px;
  font-size: .78rem; font-weight: 600; display: grid; place-items: center; padding: 0; position: relative; font-variant-numeric: tabular-nums }
.qjump[data-done="1"] { background: var(--sunken); color: var(--ink); border-color: var(--line-strong) }
.qjump[data-flag="1"]::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--amber) }
.qjump[aria-current="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand) }
.entregar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line) }
.entregar .pend { font-size: .82rem; color: var(--muted) }

.bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
  padding: .65rem 1rem calc(.65rem + env(safe-area-inset-bottom)); display: flex; justify-content: center }
.bottombar .inner { width: 100%; max-width: 46rem; display: flex; gap: .5rem; align-items: center }
.bottombar .pos { font-size: .82rem; font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums }
.bottombar .spacer { flex: 1 }
.bottombar .btn { padding: .6rem .9rem; font-size: .88rem }
@media (max-width: 420px) { .bottombar .btn { padding: .6rem .7rem } .bottombar .txt-opc { display: none } }

/* ============ resultado y revisión ============ */
.resultado { padding: 1.4rem 1.25rem }
.resultado .eyebrow { font-size: .82rem; font-weight: 600; color: var(--muted) }
.score { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: .4rem }
.score .big { font-size: 3.4rem; font-weight: 800; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums }
.score .big small { font-size: 1.4rem; color: var(--muted); font-weight: 600; letter-spacing: -.02em }
.verdict { font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; padding: .3rem .7rem; border-radius: 99px }
.verdict.si { background: var(--ok-soft); color: var(--ok-ink) }
.verdict.no { background: var(--bad-soft); color: var(--bad-ink) }
.resultado .meter { margin: 1.2rem 0 .35rem; height: .7rem; position: relative; overflow: visible }
.resultado .meter.si i { background: var(--ok) } .resultado .meter.no i { background: var(--bad) }
.cutline { position: relative; height: 1.1rem; font-size: .72rem; color: var(--muted) }
.cutline .txt { position: absolute; left: 65%; transform: translateX(-50%); white-space: nowrap }
.cutmark { position: absolute; top: -1.55rem; left: 65%; width: 2px; height: .95rem; background: var(--ink); border-radius: 2px }

.bars { display: flex; flex-direction: column; gap: .65rem }
.bar { display: grid; grid-template-columns: 9.5rem 1fr 3.2rem; gap: .7rem; align-items: center; font-size: .86rem }
@media (max-width: 480px) { .bar { grid-template-columns: 7.8rem 1fr 2.9rem; font-size: .8rem } }
.bar .track { height: .5rem; background: var(--sunken); border-radius: 99px; overflow: hidden }
.bar .track i { display: block; height: 100%; border-radius: 99px }
.bar .n { font-size: .8rem; font-weight: 600; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums }
.bar .lbl { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.diag { display: flex; flex-direction: column; gap: .8rem }
.diag .d { display: grid; grid-template-columns: 2rem 1fr; gap: .7rem; align-items: start }
.diag .cnt { height: 2rem; border-radius: 8px; background: var(--amber); color: var(--graphite); font-weight: 750; display: grid; place-items: center }
.diag b { display: block; font-size: .92rem }
.diag p { margin: .1rem 0 0; font-size: .85rem; color: var(--muted); line-height: 1.45 }
.revitem { padding: 1.1rem 1.1rem 1.2rem; margin-bottom: .8rem; border-left: 4px solid var(--line-strong) }
.revitem.bad { border-left-color: var(--bad) }
.revitem.good { border-left-color: var(--ok) }
.demo-cta { background: var(--graphite); color: var(--on-graphite); border-radius: var(--r); padding: 1.2rem 1.15rem; margin-top: 1rem }
.demo-cta h3 { font-size: 1.3rem; font-weight: 750; margin: 0 0 .35rem }
.demo-cta h3 em { font-style: normal; color: var(--brand) }
.demo-cta p { margin: 0 0 1rem; font-size: .92rem; color: var(--on-graphite-muted) }

/* ============ repaso ============ */
.repaso-hero { display: grid; gap: 1rem; padding: 1.3rem 1.25rem }
@media (min-width: 640px) { .repaso-hero { grid-template-columns: auto 1fr; align-items: center; gap: 1.5rem } }
.repaso-num { width: 6.5rem; height: 6.5rem; border-radius: 50%; display: grid; place-items: center; text-align: center;
  background: var(--amber); color: var(--graphite) }
.repaso-num.cero { background: var(--sunken); color: var(--muted) }
.repaso-num b { display: block; font-size: 2.2rem; font-weight: 800; line-height: 1; letter-spacing: -.03em }
.repaso-num span { font-size: .7rem; font-weight: 650 }
.lista { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden }
.lista .fila { padding: .75rem 1rem; display: flex; gap: .8rem; align-items: baseline; font-size: .9rem; border-top: 1px solid var(--line) }
.lista .fila:first-child { border-top: 0 }
.lista .fila .n { font-weight: 700; margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap }
.lista .fila .f { font-size: .78rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums }

/* ============ perfil ============ */
.perfil-cab { display: flex; gap: 1rem; align-items: center; margin: .25rem 0 1.4rem }
.perfil-cab .avatar { width: 3.4rem; height: 3.4rem; font-size: 1.2rem }
.perfil-cab h2 { font-size: 1.6rem; font-weight: 750 }
.perfil-cab p { margin: .15rem 0 0; color: var(--muted); font-size: .86rem; word-break: break-word }
.uso { padding: 1.1rem 1.15rem }
.uso .titulo { font-weight: 650; margin: 0 0 .35rem; font-size: .9rem; color: var(--muted) }
.uso .dias { font-size: 2.6rem; font-weight: 800; letter-spacing: -.04em; line-height: 1 }
.uso .dias small { font-size: .95rem; color: var(--muted); font-weight: 600; letter-spacing: 0 }
.uso .meter { margin: .9rem 0 .8rem; height: .5rem }
.uso .meter i { background: var(--ok) }
.uso.alerta .meter i { background: var(--amber) }
.uso.peligro .meter i { background: var(--bad) }
.uso.alerta { border-color: var(--amber) }
.uso.peligro { border-color: var(--bad) }
.uso p { margin: 0; font-size: .9rem; line-height: 1.55; color: var(--ink-2) }
.campo { display: flex; gap: .5rem; flex-wrap: wrap }
.campo input { flex: 1; min-width: 10rem; font: inherit; padding: .65rem .8rem; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink) }
.campo input:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand) }

/* ============ administración ============ */
.tabla { width: 100%; border-collapse: collapse; font-size: .86rem; background: var(--surface) }
.tabla th, .tabla td { border-bottom: 1px solid var(--line); padding: .6rem .7rem; text-align: left; vertical-align: top }
.tabla th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; background: var(--surface-2) }
.tabla td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600 }
.tabla .enun { color: var(--muted); font-size: .8rem; margin-top: .15rem }

/* ============ diálogo y avisos ============ */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(20, 20, 22, .55); display: flex; align-items: center;
  justify-content: center; padding: 1.25rem; backdrop-filter: blur(2px) }
.dialog { background: var(--surface); border-radius: var(--r); max-width: 24rem; width: 100%; padding: 1.3rem 1.25rem 1.2rem;
  display: flex; flex-direction: column; gap: 1.1rem; box-shadow: var(--sombra-alta) }
.dialog p { margin: 0; font-size: .97rem; line-height: 1.5 }
.dialog .acciones { display: flex; gap: .55rem; justify-content: flex-end; flex-wrap: wrap }
.dialog .btn { padding: .6rem 1rem; font-size: .9rem }
.toast { position: fixed; left: 50%; bottom: 5.5rem; transform: translateX(-50%); z-index: 60; background: var(--graphite); color: var(--on-graphite);
  padding: .7rem .95rem; border-radius: var(--r-sm); font-size: .88rem; max-width: calc(100% - 2rem); box-shadow: var(--sombra-alta);
  display: flex; gap: .9rem; align-items: center }
.toast button { background: var(--brand); color: var(--on-brand); border: 0; border-radius: 8px; padding: .3rem .7rem; font-size: .82rem; font-weight: 650 }
.toast.version { bottom: auto; top: 4.4rem }
.pie { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); display: flex; gap: 1rem; flex-wrap: wrap }
.pie a { color: var(--muted) }
.privacidad > p { font-size: .97rem; line-height: 1.65; margin: 0 0 1rem; color: var(--ink-2) }
.privacidad .card { margin-bottom: 1rem }
@media (min-width: 900px) { .shell[data-modo="app"] .pie { display: none } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important } }
/* En el examen la barra superior le deja lugar al progreso: en el celular queda solo el ícono. */
@media (max-width: 899px) { .shell[data-modo="foco"] .topbar .brand { font-size: 0; gap: 0 } }
