/*
 * ALBA - Ajustes de ergonomía para iPad 10ª generación.
 * Vista vertical de referencia: 820 × 1180 CSS px (1640 × 2360 píxeles físicos).
 * Se mantienen las reglas originales de style.css y el diseño de escritorio/móvil.
 * No interviene en contenido, respuestas, progreso ni lógica del examen.
 */

/* Ajustes globales de lectura y controles táctiles. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: auto;
}
body { min-width: 0; }
button, select, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, select { max-width: 100%; }
button:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #0d9a99;
  outline-offset: 3px;
}
.question-card h2, .answer, .feedback, .review-card,
.quiz-meta, .qchips, .notes, .brand {
  overflow-wrap: break-word;
}
.answer > span:last-child, .review-card, .feedback { min-width: 0; }

.feedback div, .review-card details > p {
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.boe-link { min-height: 44px; display: flex; align-items: center; }
#refLabel { overflow-wrap: anywhere; }
#topicLabel { text-align: right; overflow-wrap: anywhere; min-width: 0; }
#poolInfo { line-height: 1.5; }
#reviewList summary { padding: 11px 0; min-height: 44px; }
#reviewList details[open] { padding-bottom: 8px; }
.welcome-screen {
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
footer, .app:not(.welcome-active) main {
  padding-bottom: max(26px, env(safe-area-inset-bottom));
}

/* iPad en vertical: orientación principal de uso, pantalla de 10,9". */
@media (min-width: 751px) and (max-width: 950px) and (orientation: portrait) {
  .app { max-width: 100%; }
  .masthead {
    padding: calc(15px + env(safe-area-inset-top)) 24px 15px;
    gap: 12px;
  }
  .brand-logo { flex: 0 0 54px; width: 54px; height: 54px; }
  .brand strong { font-size: 13px; letter-spacing: 1px; line-height: 1.3; }
  .brand small { font-size: 12px; line-height: 1.4; }
  .edition { font-size: 10px; letter-spacing: 1px; padding: 8px 12px; }
  main { padding: 0 20px max(32px, env(safe-area-inset-bottom)); }

  /* Portada: logo y botón visibles sin desplazamiento en un iPad normal. */
  .welcome-screen {
    min-height: 100vh;
    min-height: 100svh;
    padding: max(24px, env(safe-area-inset-top)) 28px max(28px, env(safe-area-inset-bottom));
  }
  .welcome-inner { width: min(100%, 760px); gap: clamp(20px, 3vh, 34px); }
  .academy-logo { width: min(45vw, 300px); max-height: 36svh; }
  .welcome-inner h1 {
    max-width: 740px;
    font-size: clamp(28px, 4vw, 34px);
    line-height: 1.29;
    letter-spacing: .45px;
    text-wrap: balance;
  }
  .welcome-cta {
    min-height: 58px;
    min-width: 224px;
    border-radius: 14px;
    font-size: 17px;
  }

  /* Inicio: jerarquía visual compacta sin disminuir legibilidad. */
  .hero:not(.welcome-screen) { padding: 25px 30px; min-height: 0; border-radius: 20px; }
  .hero h1 { font-size: clamp(34px, 4.6vw, 40px); line-height: 1.12; margin: 8px 0; }
  .hero p { font-size: 15px; line-height: 1.48; margin: 10px 0; max-width: 680px; }
  .hero-flags { gap: 12px; margin-top: 16px; font-size: 12px; line-height: 1.4; }
  .stats:not(.result-stats) {
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 12px;
    margin: 14px 0;
  }
  .stats:not(.result-stats) article { padding: 16px 19px; }
  .stats label { font-size: 13px; line-height: 1.4; }
  .stats b { font-size: 27px; }
  .panel { padding: 24px 27px; border-radius: 18px; margin-top: 14px; }
  .section-heading { margin-bottom: 16px; gap: 16px; }
  .section-heading h2 { font-size: 25px; }
  .section-heading small { font-size: 11px; }
  .theme-fields { gap: 13px; margin-bottom: 15px; padding-bottom: 15px; }
  .theme-fields label, .fields label { font-size: 14px; gap: 7px; }
  .theme-fields select, .fields select {
    width: 100%;
    min-height: 54px;
    font-size: 16px;
    padding-top: 12px;
    padding-bottom: 12px;
    line-height: 1.4;
    border-radius: 11px;
  }
  .fields { gap: 13px; }
  .fields > label:first-child { grid-column: 1 / -1; }
  .actions { gap: 15px; margin-top: 19px; }
  .primary, .secondary { min-height: 52px; font-size: 15px; border-radius: 11px; }
  .notes { margin: 20px 4px; gap: 20px; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .notes b { font-size: 15px; }
  .notes p { font-size: 14px; line-height: 1.55; }
  footer { font-size: 13px; gap: 10px; }
  .text-btn { min-height: 44px; font-size: 13px; }

  /* Test: navegación persistente durante preguntas con fundamentos largos. */
  .quiz-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 7px 12px 7px;
    margin: 6px -12px 8px;
    min-height: 59px;
    background: rgba(243,246,249,.96);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(16,42,73,.08);
    border-radius: 0 0 12px 12px;
  }
  .quiz-header .back { min-height: 47px; font-size: 16px; }
  .mode-tag { padding: 9px 14px; font-size: 13px; }
  .timer { font-size: 15px; }
  .quiz-meta {
    align-items: flex-start;
    margin: 14px 0 12px;
    font-size: 14px;
    line-height: 1.42;
  }
  .quiz-meta strong { max-width: 64%; }
  .progress { margin-bottom: 18px; height: 8px; }
  .question-card { max-width: 100%; padding: 25px 26px; border-radius: 19px; }
  .qchips { gap: 8px; font-size: 12px; line-height: 1.45; }
  .qchips span { max-width: 100%; }
  .question-card h2 {
    margin: 17px 0 21px;
    font-size: clamp(22px, 3.1vw, 26px);
    line-height: 1.43;
    letter-spacing: -.2px;
  }
  .answer-options { gap: 12px; }
  .answer {
    min-height: 65px;
    border-radius: 12px;
    padding: 16px 17px;
    gap: 16px;
    align-items: flex-start;
    font-size: 17px;
    line-height: 1.46;
  }
  .answer .letter {
    flex: 0 0 34px;
    height: 34px;
    font-size: 15px;
    border-radius: 9px;
  }
  .feedback {
    padding: 18px 20px;
    margin-top: 20px;
    font-size: 15px;
    line-height: 1.65;
    border-radius: 10px;
  }
  .feedback strong { font-size: 17px; }
  .feedback small { display: block; margin-top: 10px; font-size: 13px; }
  .boe-link { font-size: 14px; }
  .qfooter { gap: 15px; margin-top: 22px; }
  .qfooter button { min-height: 54px; font-size: 15px; }
  .question-help { font-size: 13px; line-height: 1.6; margin: 16px auto 28px; }

  /* Resultados: mostrar antes los datos más útiles y mejorar la revisión. */
  .result-hero {
    margin-top: 15px;
    padding: 27px 26px;
    border-radius: 20px;
  }
  .result-hero h1 { font-size: 30px; }
  .grade { font-size: 64px; line-height: 1.1; }
  .result-message { font-size: 15px; line-height: 1.45; }
  .result-stats { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 11px; margin-top: 14px; }
  .result-stats article { padding: 16px; }
  .review-card { padding: 18px 0; }
  .review-card h3 { font-size: 16px; line-height: 1.55; margin: 8px 0; }
  .review-card p { font-size: 14px; line-height: 1.65; }
  .review-card summary { font-size: 14px; }
  .review-card .ref { display: block; margin-top: 8px; font-size: 12px; }
}

/* iPad en horizontal: mismo diseño, más contenido por fila y controles táctiles. */
@media (min-width: 951px) and (max-width: 1250px) and (orientation: landscape) {
  .masthead { padding: 13px 25px; }
  .hero:not(.welcome-screen) { padding: 24px 30px; min-height: 0; }
  .hero h1 { font-size: 38px; }
  .hero p { font-size: 15px; max-width: 820px; }
  .hero-flags { margin-top: 13px; }
  .stats:not(.result-stats) article { padding: 14px 20px; }
  .panel { padding: 22px 27px; margin-top: 13px; }
  .theme-fields { gap: 15px; grid-template-columns: 1fr 1fr; margin-bottom: 16px; padding-bottom: 16px; }
  .theme-fields label { min-width: 0; }
  .fields { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
  .fields select, .theme-fields select { min-height: 53px; font-size: 16px; }
  .answer { min-height: 60px; font-size: 16px; padding: 15px 16px; }
  .question-card h2 { font-size: 24px; }
  .quiz-header { margin: 7px 0; }
  .result-hero { padding: 29px; }
  .notes p, .review-card p { font-size: 14px; }
  .review-card h3 { font-size: 16px; }
}

/* Para móvil o multitarea en pantalla dividida, evitar elementos estrechos. */
@media (max-width: 750px) {
  .hero h1 { overflow-wrap: anywhere; }
  .stats:not(.result-stats) article { min-width: 0; padding: 13px 12px; }
  .stats label { font-size: 11px; }
  .stats b { font-size: 24px; }
  .quiz-meta { align-items: flex-start; line-height: 1.5; }
  .quiz-meta strong { max-width: 55%; }
  .question-card h2 { overflow-wrap: anywhere; }
  .answer { min-height: 58px; font-size: 16px; }
  .qfooter button { min-height: 52px; }
  .review-card h3 { font-size: 15px; }
  .review-card p, .feedback { font-size: 14px; }
  .result-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .result-hero { margin-top: 16px; padding: 27px 18px; }
  .notes p { font-size: 13px; }
  .text-btn { min-height: 44px; }
}
@media (max-width: 390px) {
  .qfooter { gap: 9px; }
  .qfooter button { padding: 12px 9px; }
}
@media (max-height: 610px) and (orientation: landscape) {
  .academy-logo { max-height: 26svh; }
  .welcome-inner { gap: 10px; }
  .welcome-inner h1 { font-size: clamp(17px,2.4vw,25px); }
  .welcome-cta { min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ALBA v55: selector propio para Safari iPad, evita listas nativas fuera de pantalla. */
.theme-picker { min-width: 0; display: grid; gap: 8px; }
.theme-picker label { font-size: 13px; font-weight: 800; }
.legacy-theme-select { display: none !important; }
.theme-trigger {
  width: 100%;
  min-width: 0;
  min-height: 51px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px 10px 15px;
  border: 1px solid #cfdde5;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.theme-trigger[aria-expanded="true"] { border-color: var(--teal); box-shadow: 0 0 0 3px #0d7b7b18; }
#themeTriggerText { display: block; min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.select-chevron { flex-shrink: 0; font-size: 21px; line-height: 1; color: var(--muted); }
.theme-popup {
  position: fixed;
  z-index: 1000;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 7px;
  background: #fff;
  border: 1px solid #cadce4;
  border-radius: 14px;
  box-shadow: 0 18px 45px #102a492b;
  overflow: hidden;
}
.theme-search {
  width: 100%;
  flex: 0 0 auto;
  height: 45px;
  margin: 0 0 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit;
  font-size: 16px; /* evita zoom al enfocar el campo de búsqueda en Safari iOS */
  outline-color: var(--teal);
  color: var(--ink);
  background: #f5f8fa;
}
.theme-list {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.theme-choice {
  width: 100%;
  min-height: 46px;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid #e6ecf0;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  display: grid;
  grid-template-columns: 68px minmax(0,1fr) 17px;
  align-items: center;
  gap: 9px;
  padding: 10px 9px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}
.theme-choice:hover, .theme-choice:focus-visible { background: #eaf6f5; }
.theme-choice[aria-selected="true"] { background: #eaf6f5; color: #086c6b; }
.theme-choice-number { font-weight: 800; letter-spacing: .2px; white-space: nowrap; font-size: 12px; }
.theme-choice-name { display: block; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.theme-choice-check { opacity: 0; font-weight: 900; color: var(--teal); }
.theme-choice[aria-selected="true"] .theme-choice-check { opacity: 1; }

/* Acceso a estadísticas, sustituyendo el rótulo de edición de prueba. */
.progress-nav {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  border: 1px solid #bbd7de;
  color: #096b72;
  background: white;
  white-space: nowrap;
  cursor: pointer;
  min-height: 45px;
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 12px;
  letter-spacing: .7px;
  font-weight: 850;
}
.progress-nav:hover { background: #e8f4f3; }
.progress-nav span { font-size: 16px; }
@media (max-width: 750px) {
  .progress-nav { display: inline-flex; min-height: 44px; padding: 8px 9px; font-size: 11px; }
  .brand strong { font-size: 10px; }
  .brand small { font-size: 10px; }
}

/* Tamaños reducidos de enunciados, respuestas y referencias. */
.question-card h2 { font-size: clamp(19px,2.4vw,23px); line-height: 1.43; }
.answer { font-size: 15px; line-height: 1.46; }
.qchips { font-size: 11px; }
@media (min-width: 751px) and (max-width: 950px) and (orientation: portrait) {
  .theme-trigger { min-height: 51px; font-size: 13px; }
  .theme-choice { font-size: 12.5px; }
  .theme-choice-number { font-size: 11.5px; }
  .theme-fields label { font-size: 13px; }
  .question-card h2 { font-size: 20px; line-height: 1.43; margin: 15px 0 18px; }
  .answer { font-size: 14px; line-height: 1.5; padding: 13px 14px; min-height: 55px; }
  .answer-options { gap: 9px; }
  .answer .letter { flex-basis: 30px; height: 30px; font-size: 13px; }
  .question-card { padding: 22px 24px; }
  .feedback { font-size: 13px; }
  .qchips span { font-size: 11px; padding: 6px 9px; }
}
@media (max-width: 750px) {
  .theme-trigger { font-size: 13px; min-height: 49px; }
  .question-card h2 { font-size: 19px; }
  .answer { font-size: 14px; }
  .qchips { font-size: 10.5px; }
}
@media (max-width: 450px) {
  .brand { gap: 6px; }
  .brand-logo { width: 39px; height: 39px; flex-basis: 39px; }
  .progress-nav { font-size: 10px; padding: 7px 8px; letter-spacing: 0; }
}

/* Segunda página: resumen histórico y recomendaciones por tema. */
.dashboard-header {
  margin: 10px 0 18px;
  padding: 25px 28px;
  border-radius: 20px;
  color: white;
  background: linear-gradient(115deg,#102a49,#126c73);
}
.dashboard-header .dashboard-back { display: block; color: #fff; margin: 0 0 16px; padding: 7px 0; font-size: 14px; }
.dashboard-header .eyebrow { margin-bottom: 8px; }
.dashboard-header h1 { font-size: clamp(25px,3.3vw,33px); margin: 0 0 8px; line-height: 1.25; }
.dashboard-header p { margin: 0; font-size: 14px; color: #e3f0f3; line-height: 1.55; }
.dashboard-stats { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 14px 0; }
.dashboard-stats article { padding: 17px 18px; }
.dashboard-stats b { font-size: 28px; }
.dashboard-stats label { font-size: 12px; line-height: 1.4; }
.dashboard-priority, .dashboard-list-panel { margin-top: 15px; }
.dashboard-priority .section-heading, .dashboard-list-panel .section-heading { margin-bottom: 8px; }
.recommend-intro, .dashboard-legend { font-size: 13px; line-height: 1.55; color: var(--muted); }
.dashboard-legend { margin: 4px 0 17px; }
.recommend-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.recommend-choice {
  border: 1px solid #c8dce0;
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 49px;
  background: #f4fbfa;
  text-align: left;
  color: #0d555b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}
.recommend-choice:hover { border-color: #0d7b7b; background: #e5f6f3; }
.dashboard-themes { display: grid; gap: 13px; }
.theme-progress-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 17px 18px;
  background: #fff;
  min-width: 0;
}
.theme-progress-heading { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.theme-progress-title { min-width: 0; flex: 1; }
.theme-progress-number { display: block; font-size: 11px; font-weight: 900; color: var(--teal); letter-spacing: .8px; }
.theme-progress-title h3 { font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; margin: 3px 0 12px; }
.theme-progress-status {
  flex: 0 0 auto;
  border: 1px solid #d1dfe5;
  border-radius: 20px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
}
.status-urgent { background: #fff0ee; border-color: #f2c4c2; color: #9b3439; }
.status-review { background: #fff8e6; border-color: #e9d59b; color: #855e12; }
.status-good { background: #eaf7f1; border-color: #a3d0ba; color: #097450; }
.status-learning { background: #eef6fb; color: #345f79; }
.theme-progress-indicators { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin: 7px 0 12px; }
.theme-progress-metric { background: #f4f7f9; border-radius: 8px; padding: 9px 10px; min-width: 0; }
.theme-progress-metric small { color: var(--muted); display: block; line-height: 1.35; font-size: 11px; }
.theme-progress-metric strong { display: block; font-size: 17px; color: var(--ink); margin-top: 3px; overflow-wrap: anywhere; }
.theme-progress-track { background: #e1e9ee; border-radius: 12px; height: 6px; overflow: hidden; }
.theme-progress-fill { height: 100%; background: var(--teal); }
.theme-progress-footer { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 12px; }
.theme-progress-accuracy { font-size: 12px; line-height: 1.4; color: var(--muted); }
.theme-progress-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; justify-content: end; }
.small-primary, .small-secondary {
  border-radius: 9px;
  padding: 8px 12px;
  min-height: 42px;
  font-size: 12px;
  font-weight: 750;
  border: 1px solid #cbdfe3;
}
.small-primary { color: white; background: var(--teal); border-color: var(--teal); }
.small-secondary { color: var(--teal); background: white; }
.small-primary:hover { background: #0c6568; }
.small-secondary:hover { background: #eff7f6; }
@media (min-width: 751px) and (max-width: 950px) and (orientation: portrait) {
  .dashboard-header { padding: 24px 25px; }
  .dashboard-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .dashboard-stats article { padding: 13px 14px; }
  .dashboard-stats label { font-size: 11px; }
  .dashboard-stats b { font-size: 25px; }
  .theme-progress-title h3 { font-size: 14px; }
}
@media (max-width: 750px) {
  .dashboard-header { padding: 19px 18px; }
  .dashboard-header h1 { font-size: 25px; }
  .dashboard-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .dashboard-stats article { padding: 15px; }
  .dashboard-stats b { font-size: 26px; }
  .recommend-choices { grid-template-columns: 1fr; }
  .theme-progress-card { padding: 14px 12px; }
  .theme-progress-heading { flex-direction: column; }
  .theme-progress-title h3 { font-size: 14px; margin-bottom: 4px; }
  .theme-progress-status { margin-bottom: 4px; }
  .theme-progress-indicators { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .theme-progress-footer { flex-direction: column; align-items: stretch; }
  .theme-progress-actions { justify-content: start; }
}

/* Distribución simétrica de las cuatro cifras del progreso. */
.stats.dashboard-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
@media (min-width: 751px) and (max-width: 950px) and (orientation: portrait) {
  .stats.dashboard-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 750px) {
  .stats.dashboard-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
}


/* V57: Selector nativo compatible con Chrome y Safari, nombres cortos, título íntegro visible. */
.theme-native {min-width:0;width:100%;display:grid;gap:7px;font-size:13px;font-weight:750;color:var(--ink)}
.theme-native #theme {
  box-sizing:border-box;display:block;width:100%;max-width:100%;min-width:0;
  min-height:52px;border:1px solid #cbdbe3;border-radius:10px;
  padding:10px 31px 10px 12px;background:#fff;color:#1b364b;
  font-family:inherit;font-size:14px;line-height:1.35;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.theme-native #theme:focus-visible {outline:3px solid #15a49d;outline-offset:2px}
.theme-full-title {
 display:block;min-height:2.7em;color:#6e8491;font-size:11.5px;font-weight:550;
 line-height:1.35;overflow-wrap:anywhere;
}
.progress-nav {text-decoration:none}
footer .backup-status {color:#2d7d7a;font-size:12px;flex-basis:100%;line-height:1.5}
footer .backup-status:empty{display:none}
@media (min-width:751px) and (max-width:950px) and (orientation:portrait) {
 .theme-native #theme {font-size:13px;min-height:49px}
 .theme-full-title {font-size:11px}
}

/* ===== ALBA v58 · Portada y cronómetro personalizable ===== */
/* Portada con el escudo original de la Escuela Nacional de Policía. */
#welcome .welcome-inner {
  width:min(100%,930px);
  gap:clamp(12px,2.1vh,24px);
}
#welcome .academy-logo {
  width:min(69vw,435px);
  max-width:100%;
  height:auto;
  max-height:47svh;
  object-fit:contain;
  flex-shrink:1;
}
#welcome .welcome-inner h1 {
  font-size:clamp(29px,4.3vw,46px);
  max-width:910px;
  line-height:1.22;
  font-weight:850;
  letter-spacing:.55px;
  text-wrap:balance;
  margin:0;
}
#welcome .welcome-cta {
  min-width:216px;
  min-height:53px;
  padding:13px 31px;
  font-size:17px;
  letter-spacing:1.6px;
}
#welcome .welcome-offline {
  color:#ffe16c;
  font-size:clamp(11px,1.75vw,15px);
  font-weight:800;
  letter-spacing:.85px;
  line-height:1.4;
  margin:0;
  text-align:center;
  text-wrap:balance;
}

/* Compactar las letras de los valores y de los apartados, sin reducir el área táctil. */
#home .theme-fields label,
#home .fields label {
  font-size:12px;
}
#home .theme-fields select#topic,
#home .fields select#mode,
#home .fields select#level,
#home .fields select#count {
  box-sizing:border-box;
  min-width:0;
  width:100%;
  font-size:13px !important;
  line-height:1.4;
  font-weight:600;
  min-height:49px;
  padding-top:11px;
  padding-bottom:11px;
}
#home select#topic option,
#home select#mode option,
#home select#level option,
#home select#count option {
  font-size:13px;
}

/* Cuatro tarjetas en dos columnas: cronómetro justo debajo de Mejor nota. */
#home #stats.stats {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:12px;
}
#home #stats.stats article {
  min-width:0;
}
#home #stats .stat-timer {
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:8px;
  padding-top:15px;
  padding-bottom:15px;
}
#home #stats .stat-timer label {
  display:flex;
  align-items:center;
  gap:6px;
  margin:0;
  font-weight:800;
  font-size:12px;
  color:#1c485a;
}
.timer-symbol {
  color:#159b91;
  font-size:22px;
  line-height:1;
  vertical-align:middle;
}
#testDuration {
  box-sizing:border-box;
  width:100%;
  max-width:100%;
  min-width:0;
  min-height:43px;
  border:1px solid #cbdce4;
  border-radius:9px;
  padding:8px 9px;
  font:700 13px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;
  color:#173c50;
  background:#f8fcfd;
}
#testDuration:focus-visible{
  outline:3px solid #149d95;
  outline-offset:2px;
}
#home #stats .timer-description {
  display:block;
  margin:0;
  font-size:10.5px;
  font-weight:500;
  line-height:1.4;
  color:#667d8b;
}
#quiz #timer {font-variant-numeric:tabular-nums;}

/* Mantener el diseño dentro de la pantalla en iPad y teléfonos. */
@media (min-width:751px) and (max-width:950px) and (orientation:portrait) {
  #welcome .academy-logo {width:min(72vw,440px);max-height:44svh}
  #welcome .welcome-inner h1 {font-size:clamp(32px,4.9vw,43px)}
  #welcome .welcome-inner {gap:clamp(14px,2.2vh,24px)}
  #home #stats .stat-timer {padding:14px 17px}
}
@media (max-width:750px) {
  #welcome .academy-logo {width:min(77vw,350px);max-height:41svh}
  #welcome .welcome-inner h1 {font-size:clamp(22px,5.6vw,32px);line-height:1.27}
  #welcome .welcome-inner {gap:clamp(12px,2vh,19px)}
  #welcome .welcome-offline {font-size:11px;letter-spacing:.45px}
  #home #stats.stats {gap:9px}
  #home #stats.stats article {padding:13px 12px}
  #home #stats .stat-timer {gap:6px}
  #home #stats .stat-timer label {font-size:11px}
  #home #stats .timer-description {font-size:10px}
  #testDuration {min-height:41px;font-size:12px;padding:7px}
  #home .theme-fields select#topic,
  #home .fields select#mode,
  #home .fields select#level,
  #home .fields select#count {font-size:12px !important}
}
@media (max-height:650px) and (orientation:landscape) {
  #welcome .academy-logo {max-height:28svh;width:auto}
  #welcome .welcome-inner h1 {font-size:clamp(18px,3.2vw,27px)}
  #welcome .welcome-inner {gap:10px}
}

/* ALBA v68 · Bloques de estudio, notas individuales y notas compactas. */
#home .theme-fields .block-native { grid-column:1/-1; min-width:0; }
#home #subjectBlock {
 display:block; width:100%; max-width:100%; min-width:0; min-height:49px;
 border:1px solid #cbdce4; border-radius:9px; padding:10px 13px;
 color:#152b42; background:#f7fafc;
 font-size:13px; font-weight:800; line-height:1.4; text-overflow:ellipsis;
}
#home #subjectBlock option{font-size:13px;font-weight:650}
#home #stats .stat-block-bests{display:flex;flex-direction:column;gap:7px;justify-content:space-between}
#home #stats .block-best-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;min-width:0}
#home #stats .block-best-grid>div{min-width:0;text-align:center;padding:8px 1px;border:1px solid #dfe8ef;border-radius:8px;background:#f5f9fc}
#home #stats .block-best-grid small{display:block;font-size:9px;line-height:1.3;font-weight:800;color:#506c7e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#home #stats .block-best-grid b{display:block;margin-top:4px;font-size:clamp(13px,1.8vw,20px);font-variant-numeric:tabular-nums;letter-spacing:-.3px;color:#132d49}
#home #stats .block-best-hint{font-size:9px;line-height:1.32;font-weight:550;color:#61788a}
#home .notes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px;margin:13px 6px 11px;align-items:start}
#home .notes>div{min-width:0}
#home .notes b{font-size:12px;font-weight:850;line-height:1.25}
#home .notes p{margin:3px 0 0;font-size:11.5px;font-weight:700;line-height:1.35;color:#506375}
@media(min-width:751px) and (max-width:980px){
 #home .notes{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
 #home #stats .block-best-grid b{font-size:17px}
}
@media(max-width:750px){
 #home .notes{grid-template-columns:1fr;gap:8px;margin:12px 7px 10px}
 #home .notes p{font-size:11.5px;line-height:1.32;margin-top:2px}
 #home #subjectBlock{font-size:12px}
 #home #stats .stat-block-bests{padding:12px 7px!important;gap:6px}
 #home #stats .block-best-grid{gap:2px}
 #home #stats .block-best-grid>div{padding:6px 0}
 #home #stats .block-best-grid small{font-size:8px;letter-spacing:-.15px}
 #home #stats .block-best-grid b{font-size:14px}
 #home #stats .block-best-hint{font-size:8.3px}
}


/* ALBA v70: tarjetas azul marino, tipografía de alto contraste y navegación. */
#masthead a#openProgress.progress-nav {
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  min-height:45px;
  padding:12px 20px;
  border:1px solid #2967a6;
  border-radius:11px;
  background:linear-gradient(120deg,#12375f,#195289) !important;
  box-shadow:0 3px 10px #102a4920;
  color:#fff !important;
  font-size:12px;
  font-weight:900;
  letter-spacing:.7px;
  text-decoration:none;
}
#masthead a#openProgress.progress-nav:hover {
  background:linear-gradient(120deg,#164979,#226aab) !important;
}
#masthead a#openProgress.progress-nav:focus-visible {outline:3px solid #76c9fb;outline-offset:2px}
#home #stats.stats article {
  background:linear-gradient(125deg,#102a49 0%,#164669 72%,#176272 130%) !important;
  border:1px solid #276183 !important;
  box-shadow:0 4px 13px #0a29441e;
  color:#fff !important;
}
#home #stats.stats article > label,
#home #stats.stats article.stat-timer > label {
  display:block;
  margin:0 0 8px;
  color:#fff !important;
  font-size:clamp(10px,1.4vw,13px);
  font-weight:900 !important;
  letter-spacing:.35px;
  line-height:1.4;
  text-align:center;
  text-transform:uppercase;
}
#home #stats.stats article > b {
  display:block;
  width:100%;
  text-align:center;
  color:white !important;
  font-size:clamp(27px,3.1vw,38px);
  font-weight:900;
  line-height:1.3;
  letter-spacing:-.6px;
}
#home #stats #statMisses {
  background:#ae3344;
  color:#fff !important;
  width:min(94%,115px);
  margin:5px auto 0;
  padding:3px 10px;
  border-radius:10px;
  box-shadow:inset 0 1px 1px #ffffff32;
}
#home #stats .stat-block-bests > label {
  margin-bottom:2px;
}
#home #stats .block-best-grid {gap:5px}
#home #stats .block-best-grid > div {
  background:#ffffff14 !important;
  border:1px solid #ffffff35 !important;
  border-radius:9px;
  padding:8px 2px;
}
#home #stats .block-best-grid small {
  color:#fff !important;
  font-size:clamp(8px,.9vw,11px);
  font-weight:900;
  text-transform:uppercase;
}
#home #stats .block-best-grid b {
  color:#fff !important;
  font-size:clamp(14px,1.9vw,23px);
  font-weight:900;
}
#home #stats .block-best-hint {
  color:#ebf4ff !important;
  opacity:.85;
  font-weight:650;
  text-align:center;
}
#home #stats .stat-timer > label {
  display:flex !important;
  justify-content:center;
  align-items:center;
  gap:7px;
}
#home #stats .stat-timer .timer-symbol {color:#fff !important}
#home #stats .stat-timer .timer-description {
  color:#fff !important;
  font-weight:650;
  opacity:.94;
  line-height:1.45;
}
#home #stats .stat-timer select#testDuration {
  background-color:#fff;
  color:#102a49;
  font-weight:850;
  border-color:#93b5cc;
}
@media(max-width:750px) {
  #masthead a#openProgress.progress-nav {
    font-size:10px;
    min-height:42px;
    padding:10px 12px;
    letter-spacing:.35px;
  }
  #home #stats.stats article > label,
  #home #stats.stats article.stat-timer > label {
    font-size:10px;
    line-height:1.3;
  }
  #home #stats.stats article > b {font-size:30px}
  #home #stats .block-best-grid {gap:3px}
  #home #stats .block-best-grid > div {padding:6px 0}
  #home #stats .block-best-grid small {font-size:8px}
  #home #stats .block-best-grid b {font-size:13px}
  #home #stats .stat-timer .timer-description {font-size:9px}
}


/* ALBA v71: configuración del test en azul degradado. Solo pantalla de sesión. */
#home .panel.settings {
  color: #fff;
  background: linear-gradient(128deg, #102a49 0%, #164669 66%, #176272 130%) !important;
  border: 1px solid #24698e !important;
  box-shadow: 0 8px 22px rgba(10, 37, 64, .16);
}
#home .panel.settings .section-heading small {
  color: #ffe16c !important;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.15px;
}
#home .panel.settings .section-heading h2 {
  color: #fff !important;
  font-weight: 900;
}
#home .panel.settings .soft-pill {
  color: #fff !important;
  background: rgba(255,255,255,.13) !important;
  border-color: rgba(255,255,255,.38) !important;
  font-weight: 850;
}
#home .panel.settings .theme-fields {
  border-bottom-color: rgba(255,255,255,.23) !important;
}
#home .panel.settings .theme-fields > label,
#home .panel.settings .fields > label {
  color: #fff !important;
  font-size: 12px;
  font-weight: 900 !important;
  text-transform: uppercase;
  letter-spacing: .5px;
  line-height: 1.4;
}
#home .panel.settings .theme-full-title {
  color: #f1f7fc !important;
  font-weight: 800;
  text-transform: none;
  letter-spacing: normal;
}
#home .panel.settings select#subjectBlock,
#home .panel.settings select#theme,
#home .panel.settings select#topic,
#home .panel.settings select#mode,
#home .panel.settings select#level,
#home .panel.settings select#count {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  font-weight: 850 !important;
  text-transform: none !important;
  letter-spacing: 0;
  border: 1px solid rgba(153,209,245,.56) !important;
  border-radius: 11px;
  -webkit-appearance: none;
  appearance: none;
  padding: 12px 40px 12px 14px !important;
  background-color: #1e5481 !important;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1L6 6L11 1' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
    linear-gradient(112deg, #19446f 0%, #215985 60%, #256b94 100%) !important;
  background-repeat: no-repeat, no-repeat !important;
  background-position: right 15px center, center !important;
  background-size: 12px 8px, 100% 100% !important;
  box-shadow: inset 0 1px rgba(255,255,255,.09);
}
#home .panel.settings select:focus-visible {
  outline: 3px solid #ffe16c !important;
  outline-offset: 3px;
}
#home .panel.settings select:disabled { opacity: .7; }
#home .panel.settings select option {
  color: #102a49 !important;
  -webkit-text-fill-color: #102a49;
  background: #f1f6fb !important;
  font-weight: 750;
  text-transform: none;
}
#home .panel.settings #poolInfo {
  color: #fff !important;
  font-size: 12px;
  font-weight: 900 !important;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: .3px;
}
#home .panel.settings button#start {
  color: #fff !important;
  background: #176bcc !important;
  border: 1px solid #60a1ef !important;
  border-radius: 11px;
  box-shadow: 0 3px 11px rgba(3,19,44,.25);
  font-size: 14px;
  font-weight: 900 !important;
}
#home .panel.settings button#start:hover:not(:disabled) {
  background: #2681ec !important;
}
#home .panel.settings button#start:focus-visible {
  outline: 3px solid #ffe16c !important;
  outline-offset: 3px;
}
#home .panel.settings button#start:disabled { opacity: .5; }
@media (max-width: 750px) {
  #home .panel.settings .theme-fields > label,
  #home .panel.settings .fields > label { font-size: 11px; }
  #home .panel.settings #poolInfo { font-size: 11px; }
  #home .panel.settings select#subjectBlock,
  #home .panel.settings select#theme,
  #home .panel.settings select#topic,
  #home .panel.settings select#mode,
  #home .panel.settings select#level,
  #home .panel.settings select#count { font-size: 12px !important; }
}


/* ALBA iPad 10 (2360x1640 physical pixels): portrait 820x1180 CSS px. */
:root {-webkit-text-size-adjust:100%;text-size-adjust:100%}
@supports (padding: max(0px)) {
 .masthead{padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right))}
 .app main{padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
}
html,body,.app,.screen,.question-card,.settings,.fields,.theme-fields{min-width:0;max-width:100%}
img{height:auto}
select,input,textarea{font-size:max(16px,1rem)}
button,select,.answer,summary{touch-action:manipulation}
.answer,.question-card h2,.hero,.stats article,.review-card{overflow-wrap:anywhere}
#refLabel{word-break:break-word}
@media(min-width:751px) and (max-width:950px) and (orientation:portrait){
  .masthead,.stats,.theme-fields,.fields{min-width:0}
  .app main{width:100%}
  .answer{font-size:17px;min-height:64px}
}
@media(min-width:951px) and (max-width:1250px) and (orientation:landscape){
  .app main{max-width:1180px;margin-inline:auto}
  .question-card{max-width:100%}
}
