/* Interfaz propia de cada examen (js/exam-hub.js). Usa --accent del examen: cada uno conserva su identidad. */
.xh-host { margin: 0 0 var(--sp-4, 16px); }
.xh { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.xh-card { background: var(--surface); border: 2px solid color-mix(in srgb, var(--accent) 18%, var(--border)); border-radius: 20px; padding: 16px; min-width: 0; }
.xh-card h3 { margin: 0; font: 800 1rem var(--font-display); }
.xh-card small { color: var(--ink-2); }
.xh-ic { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.xh-target-h, .xh-map-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.xh-map-h > div { display: grid; gap: 2px; }
@media (min-width: 900px) {
  .xh-score, .xh-budget, .xh-generic { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
  .xh-bands, .xh-papers { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
  .xh-pass { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
  .xh-pass .xh-rule { grid-column: 1; }
  .xh-pass .xh-secs { grid-column: 2; grid-row: 1 / span 2; }
}

/* objetivo */
.xh-stepper { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 4px 0 10px; }
.xh-step { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--accent); background: var(--surface); color: var(--accent); font: 800 1.4rem/1 var(--font-display); cursor: pointer; }
.xh-step:active { transform: scale(.94); }
.xh-big { font: 900 2.6rem/1 var(--font-display); color: var(--accent); min-width: 4ch; text-align: center; letter-spacing: -.02em; }
.xh-big.is-unset { opacity: .45; }
.xh-presets { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 14px; }
.xh-preset { min-height: 36px; min-width: 44px; padding: 4px 12px; border-radius: 999px; border: 2px solid var(--border); background: var(--surface); color: var(--ink); font: 800 .85rem var(--font-display); cursor: pointer; }
.xh-preset[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.xh-status { margin: 10px 0 0; font-weight: 700; font-size: .9rem; }
.xh-status.is-ok { color: var(--green-ink, #1a7f4b); }
.xh-status.is-ko { color: var(--danger, #c0392b); }
.xh-status .ic { vertical-align: -2px; }

/* regla / escala */
.xh-scale { margin: 6px 4px 0; }
.xh-track { position: relative; height: 14px; border-radius: 999px; background: var(--surface-2); margin: 22px 0 0; }
.xh-track.sm { height: 10px; margin: 8px 0 0; }
.xh-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }
.xh-seg { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); border-right: 2px solid var(--surface); }
.xh-seg.s1 { background: color-mix(in srgb, var(--accent) 22%, var(--surface-2)); } .xh-seg.s2 { background: color-mix(in srgb, var(--accent) 34%, var(--surface-2)); } .xh-seg.s3 { background: color-mix(in srgb, var(--accent) 48%, var(--surface-2)); }
.xh-seg em { position: absolute; top: 18px; left: 4px; font: 700 .62rem var(--font-display); color: var(--ink-2); font-style: normal; white-space: nowrap; }
.xh-seg:first-child { border-radius: 999px 0 0 999px; }
.xh-pin { position: absolute; top: -4px; width: 4px; height: 22px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
.xh-pin span { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); font: 800 .72rem var(--font-display); white-space: nowrap; color: var(--ink); }
.xh-pin.tgt { background: var(--accent); width: 6px; margin-left: -3px; height: 26px; top: -6px; }
.xh-pin.tgt span { display: grid; place-items: center; bottom: 28px; color: var(--accent); }
.xh-pin.est { background: var(--ink); }
.xh-pin.mark { background: var(--gold, #d49a00); }
.xh-pin.mark span { color: var(--gold, #b07d00); bottom: auto; top: 24px; }
.xh-track.sm .xh-pin { top: -3px; height: 16px; }
.xh-track.sm .xh-pin span { bottom: auto; top: 16px; font-size: .62rem; }
.xh-ends { display: flex; justify-content: space-between; margin-top: 4px; }
.xh-seg ~ .xh-ends { margin-top: 22px; }
.xh-papers .xh-track { margin-bottom: 22px; }

/* mapa de dominios */
.xh-map-sec + .xh-map-sec { margin-top: 14px; }
.xh-map-sec-h { margin: 0 0 8px; font: 800 .74rem var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.xh-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.xh-tile { position: relative; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 16px; border: 2px solid var(--border); border-bottom-width: 4px; background: var(--surface); color: var(--ink); text-decoration: none; min-width: 0; transition: transform .08s, border-color .15s; }
a.xh-tile:hover { border-color: var(--accent); }
a.xh-tile:active { transform: translateY(2px); border-bottom-width: 2px; }
.xh-tile.is-off { opacity: .55; }
.xh-tile-art { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); }
.xh-tile-body { display: grid; gap: 3px; min-width: 0; flex: 1; }
.xh-tile-body b { font: 800 .9rem/1.15 var(--font-display); overflow-wrap: anywhere; }
.xh-tile-body small { font-size: .72rem; }
.xh-tile-pct { font: 700 .72rem var(--font-display); color: var(--ink-2); }
.xh-bar { display: block; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; min-width: 40px; }
.xh-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.lv-hi .xh-bar i, .xh-tile.lv-hi .xh-bar i { background: var(--green-ink, #1a7f4b); }
.lv-mid .xh-bar i { background: var(--gold, #d49a00); }
.lv-lo .xh-bar i { background: var(--danger, #c0392b); }
.xh-tile.lv-hi { border-color: color-mix(in srgb, var(--green-ink, #1a7f4b) 45%, var(--border)); }
.xh-tile.lv-lo { border-color: color-mix(in srgb, var(--danger, #c0392b) 45%, var(--border)); }
.xh-tile.is-weak { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger, #c0392b) 25%, transparent); }
.xh-prio { position: absolute; top: -9px; right: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--danger, #c0392b); color: #fff; font: 800 .64rem var(--font-display); letter-spacing: .04em; text-transform: uppercase; }

/* tarjetas de sección (relojes / papeles / pruebas) */
.xh-sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.xh-sec { display: grid; gap: 6px; align-content: start; padding: 12px; border-radius: 16px; border: 2px solid var(--border); border-bottom-width: 4px; background: var(--surface); min-width: 0; }
.xh-sec.is-off { opacity: .6; }
.xh-sec header { display: flex; align-items: center; gap: 8px; }
.xh-sec h4 { margin: 0; font: 800 .95rem var(--font-display); }
.xh-sec-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex: none; }
.xh-clock { font: 900 1.9rem/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--accent); letter-spacing: -.02em; }
.xh-sec-facts, .xh-est { margin: 0; font-size: .8rem; color: var(--ink-2); }
.xh-est b { color: var(--ink); font-size: 1rem; }
.xh-pace { font: 700 .74rem var(--font-display); }
.xh-pace.ok { color: var(--green-ink, #1a7f4b); } .xh-pace.slow { color: var(--danger, #c0392b); }
.xh-sec-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.xh-sec-acts .btn { min-height: 40px; }
.xh-paper { margin: 2px 0 10px; }

/* regla de aprobado DELE */
.xh-rule h3 { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.xh-groups { display: grid; gap: 8px; }
.xh-group { display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--border); }
.xh-group span { font-size: .8rem; color: var(--ink-2); } .xh-group em { font: 800 .9rem var(--font-display); font-style: normal; }
.xh-group.ok { border-left-color: var(--green-ink, #1a7f4b); } .xh-group.ko { border-left-color: var(--danger, #c0392b); }

/* presupuesto de fallos DGT */
.xh-dots { display: grid; grid-template-columns: repeat(15, 1fr); gap: 6px; margin: 4px 0 8px; }
.xh-dot { aspect-ratio: 1; border-radius: 50%; background: color-mix(in srgb, var(--accent) 70%, var(--surface-2)); }
.xh-dot.allow { background: transparent; border: 2px dashed var(--gold, #d49a00); }
.xh-dot.bad { background: var(--danger, #c0392b); border: 0; }

/* Temario */
.xh-mast { display: inline-block; min-width: 3.2ch; text-align: center; padding: 2px 8px; border-radius: 999px; font: 800 .74rem var(--font-display); background: var(--surface-2); color: var(--ink-2); }
.xh-mast.lv-hi { background: color-mix(in srgb, var(--green-ink, #1a7f4b) 16%, var(--surface)); color: var(--green-ink, #1a7f4b); }
.xh-mast.lv-mid { background: color-mix(in srgb, var(--gold, #d49a00) 20%, var(--surface)); color: var(--gold, #8a6500); }
.xh-mast.lv-lo { background: color-mix(in srgb, var(--danger, #c0392b) 14%, var(--surface)); color: var(--danger, #c0392b); }
.xh-dom-m { display: inline-flex; align-items: center; gap: 8px; margin-left: 10px; vertical-align: middle; }
.xh-dom-m .xh-bar { width: 80px; display: inline-block; }
.xh-skm { flex: none; }

/* pestañas Errores / Estadísticas / Plan */
.xh-tab { display: grid; gap: 14px; }
.xh-err-hero { display: flex; gap: 16px; align-items: center; }
.xh-err-big { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); flex: none; text-align: center; }
.xh-err-big b { font: 900 2rem/1 var(--font-display); } .xh-err-big small { font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; }
.xh-err-txt { display: grid; gap: 6px; justify-items: start; min-width: 0; } .xh-err-txt p { margin: 0; }
.xh-err-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.xh-err-row { display: flex; align-items: center; gap: 10px; }
.xh-err-n { display: grid; place-items: center; min-width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--danger, #c0392b) 14%, var(--surface)); color: var(--danger, #c0392b); font: 800 .9rem var(--font-display); }
.xh-err-name { display: grid; flex: 1; min-width: 0; } .xh-err-name b { overflow-wrap: anywhere; font-size: .9rem; }
.xh-more { margin: 0; text-align: center; font-weight: 700; } .xh-more a { color: var(--accent); }
.xh-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.xh-kpi { display: grid; gap: 2px; padding: 12px 8px; border-radius: 16px; background: var(--surface); border: 2px solid color-mix(in srgb, var(--accent) 18%, var(--border)); text-align: center; }
.xh-kpi b { font: 900 1.4rem/1 var(--font-display); color: var(--accent); } .xh-kpi em { font-size: .8rem; font-style: normal; color: var(--ink-2); } .xh-kpi small { font-size: .68rem; }
.xh-row { display: grid; grid-template-columns: minmax(80px, 1.2fr) minmax(60px, 2fr) 3.5ch auto; align-items: center; gap: 10px; padding: 6px 0; }
.xh-row-n { font-weight: 700; font-size: .88rem; overflow-wrap: anywhere; } .xh-row b { font: 800 .85rem var(--font-display); text-align: right; } .xh-row small { color: var(--ink-2); }
.xh-card .xh-row + .xh-row { border-top: 1px solid var(--border); }
.xh-plan-top { display: grid; gap: 14px; }
.xh-count { display: grid; justify-items: center; gap: 2px; padding: 8px; }
.xh-count b { font: 900 3rem/1 var(--font-display); color: var(--accent); } .xh-count em { font-size: .8rem; color: var(--ink-2); font-style: normal; }
.xh-plan-fields { display: grid; gap: 12px; }
.xh-field { display: grid; gap: 6px; font-weight: 700; font-size: .85rem; }
.xh-field input[type="date"] { min-height: 44px; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); color: var(--ink); font: inherit; max-width: 100%; }
.xh-field .xh-presets { justify-content: flex-start; margin: 0; }
.xh-plan-line { margin: 0; font-size: .85rem; color: var(--ink-2); } .xh-plan-line b { color: var(--ink); }
.xh-week { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.xh-day { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 10px; border-radius: 14px; background: var(--surface-2); }
.xh-day.is-today { background: var(--accent-soft); outline: 2px solid var(--accent); }
.xh-day-h { display: grid; justify-items: center; } .xh-day-h b { font: 800 .8rem var(--font-display); text-transform: capitalize; } .xh-day-h small { font-size: 1.2rem; font-weight: 900; }
.xh-day-tasks { display: grid; gap: 6px; }
.xh-task { display: flex; gap: 8px; align-items: center; min-height: 40px; padding: 6px 10px; border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700; font-size: .84rem; border: 2px solid var(--border); }
.xh-task:hover { border-color: var(--accent); } .xh-task .ic { flex: none; color: var(--accent); } .xh-task span { min-width: 0; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 700px) { .xh-plan-top { grid-template-columns: 160px minmax(0, 1fr); align-items: center; } }
@media (max-width: 560px) {
  .xh-tiles, .xh-sec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .xh-tile { flex-direction: column; align-items: flex-start; padding: 10px; } .xh-tile-body { width: 100%; }
  .xh-kpis { grid-template-columns: repeat(2, 1fr); }
  .xh-row { grid-template-columns: minmax(70px, 1fr) minmax(50px, 1fr) 3.6ch auto; gap: 6px; }
  .xh-err-hero { flex-direction: column; text-align: center; } .xh-err-txt { justify-items: center; }
  .xh-big { font-size: 2.2rem; } .xh-clock { font-size: 1.6rem; } .xh-dom-m .xh-bar { width: 50px; }
  .xh-seg em { font-size: .56rem; }
}
.xh-sec { overflow: hidden; }
@media (max-width: 560px) { .xh-sec-acts { flex-direction: column; } .xh-sec-acts .btn { width: 100%; justify-content: center; white-space: normal; letter-spacing: 0; padding-inline: 8px; } }
@media (max-width: 560px) { .xh-sec-acts .btn { font-size: .66rem; padding-inline: 4px; } }

/* Plan adaptativo (js/study-plan-ui.js) */
.ap-today h3 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ap-phase { font: 800 .72rem var(--font-display); padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); }
.ap-list { display: grid; gap: 8px; margin-top: 8px; }
.ap-task { min-height: 52px; }
.ap-main { display: grid; gap: 2px; flex: 1; min-width: 0; } .ap-main small { font-weight: 600; color: var(--ink-2); font-size: .74rem; }
.ap-chip { font-style: normal; font-size: .72rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.ap-task.is-done { opacity: .6; border-color: var(--accent); } .ap-task.is-done b { text-decoration: line-through; }
.ap-fc { color: var(--ink-2); font-size: .74rem; }
.xh-adv { margin: 10px 0 0; font-size: .82rem; font-weight: 700; display: flex; gap: 8px; align-items: flex-start; }

/* Diagnóstico (insights-ui.js) */
.in-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .in-grid { grid-template-columns: 1fr; } }
.in-card h4 { margin: 0 0 6px; font-size: .9rem; }
.in-est b { font-size: 2rem; }
.in-weak { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.in-weak li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.in-weak small { display: block; color: var(--muted, #667); }
.in-pick { margin-top: 12px; }
.in-note { font-size: .8rem; margin: 8px 0 0; }
.in-sec { margin: 0 0 4px; font-weight: 600; }
.ib-page .in-card { margin: 16px 0; }

/* Tope de adelanto (js/plan-ahead.js): días cubiertos por la ventaja; conservan sus tareas */
.xh-ahead-card { display: grid; gap: 4px; } .xh-ahead { margin: 0; font-weight: 800; display: flex; gap: 6px; align-items: center; }
.xh-ahead-note { margin: 0; font-size: .82rem; }
.xh-day.is-ahead { background: rgba(255, 150, 40, .14); outline: 1px dashed rgba(255, 150, 40, .6); }
.xh-ahead-badge { display: inline-flex; gap: 3px; align-items: center; font: 700 .62rem var(--font-ui); color: var(--ink-2); }
