/* Harmonia Academy — hoja propia.
 *
 * No importa style-redesign.css: serían 4.098 líneas de acoplamiento para
 * reusar veinte variables. Se repiten los tokens de la paleta del Estudio
 * (docs/DESIGN-BRIEF.md) y Academy queda independiente de verdad. */

:root {
  --bg: #171210;
  --bg-panel: #1f1813;
  --bg-card: #271e16;
  --bg-hover: #35291d;
  --border: #3e3022;
  --text: #f2e9da;
  --text-dim: #a8977f;
  --accent: #e8a558;
  --accent-soft: rgba(232, 165, 88, 0.16);
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, 0.14);
  --warn: #fbbf24;
  --danger: #f87171;
  --top-light: inset 0 1px 0 rgba(255, 234, 200, 0.07);
  --font-display: 'Righteous', 'Avenir Next', -apple-system, sans-serif;
  --font-body: -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r-sm: 5px;
  --r-md: 8px;
  --r-lg: 14px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  font-size: 15px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86em;
  background: rgba(0, 0, 0, 0.28);
  padding: 1px 5px;
  border-radius: var(--r-sm);
}

/* --- barra superior ----------------------------------------------------- */

.ac-top {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-5);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--top-light);
  flex-wrap: wrap;
}

.ac-brand { display: flex; align-items: baseline; gap: var(--sp-2); }
.ac-logo { font-family: var(--font-display); font-size: 1.15rem; color: var(--accent); }
.ac-mode {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
}

.ac-curriculum {
  flex: 1 1 220px;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- botones ------------------------------------------------------------ */

.ac-btn {
  font: inherit;
  font-size: 0.82rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 6px 12px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.ac-btn:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--accent); }
.ac-btn:disabled { opacity: 0.35; cursor: default; }
.ac-btn.on { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }

/* --- cuenta --------------------------------------------------------------- */

.ac-account { display: flex; align-items: center; gap: var(--sp-2); flex: 0 0 auto; }
.ac-account-email { font-size: 0.8rem; color: var(--text-dim); }
.ac-account-email-input {
  font: inherit;
  font-size: 0.82rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 5px 10px;
  width: 9rem;
}
.ac-account-status { font-size: 0.75rem; color: var(--text-dim); flex-basis: 100%; }

/* --- navegación de días ------------------------------------------------- */

.ac-daynav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.ac-daynav:empty { display: none; }
.ac-nav-pos { font-size: 0.78rem; color: var(--text-dim); }

/* --- cuerpo ------------------------------------------------------------- */

.ac-main {
  flex: 1;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: var(--sp-5);
}

.ac-day-head { margin-bottom: var(--sp-5); }

.ac-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.ac-crumb {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 5px 11px;
  min-width: 62px;
}
.ac-crumb i {
  font-style: normal;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.ac-crumb b { font-size: 0.88rem; font-weight: 600; }
.ac-crumb-wide { min-width: 0; }

.ac-day-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0 0 var(--sp-3);
  line-height: 1.25;
}

.ac-day-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.ac-pill {
  font-size: 0.74rem;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 11px;
}
.ac-pill-time { color: var(--accent); border-color: rgba(232, 165, 88, 0.4); }
.ac-pill-ok { color: var(--ok); border-color: rgba(74, 222, 128, 0.4); }

.ac-progress {
  height: 5px;
  background: var(--bg-card);
  border-radius: 999px;
  overflow: hidden;
}
.ac-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.2s ease;
}
.ac-progress-fill.done { background: var(--ok); }

.ac-day-done { color: var(--ok); font-size: 0.84rem; margin: var(--sp-3) 0 0; }

/* --- bloques ------------------------------------------------------------ */

.ac-blocks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }

.ac-block {
  display: flex;
  gap: var(--sp-3);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  box-shadow: var(--top-light);
}
.ac-block.done { border-left-color: var(--ok); }
.ac-block.done .ac-objective { color: var(--text-dim); }

.ac-block-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  min-width: 34px;
}
.ac-block-n {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.ac-block.done .ac-block-n { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.ac-block-min { font-size: 0.7rem; color: var(--accent); }

.ac-block-body { flex: 1; min-width: 0; }

.ac-block-top { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
/* El título humano que puso el profesor. El id técnico no se muestra acá. */
.ac-block-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}
.ac-type {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1px 6px;
}

.ac-variant { margin: var(--sp-1) 0 0; font-size: 0.8rem; font-weight: 600; color: var(--accent); }
.ac-objective { margin: var(--sp-2) 0 0; font-size: 0.88rem; line-height: 1.55; color: var(--text-dim); }

.ac-progression { display: flex; gap: var(--sp-1); margin: var(--sp-2) 0 0; flex-wrap: wrap; }
.ac-progression span {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  color: var(--text);
  background: var(--accent-soft);
  border-radius: var(--r-sm);
  padding: 2px 8px;
}

.ac-instructions { margin: var(--sp-3) 0 0; }
.ac-instructions summary {
  cursor: pointer;
  font-size: 0.76rem;
  color: var(--text-dim);
  list-style: none;
}
.ac-instructions summary::-webkit-details-marker { display: none; }
.ac-instructions summary::before { content: '▸ '; }
.ac-instructions[open] summary::before { content: '▾ '; }
.ac-instructions summary:hover { color: var(--accent); }
.ac-instructions ul { margin: var(--sp-2) 0 0; padding-left: 1.1rem; }
.ac-instructions li { font-size: 0.82rem; line-height: 1.55; color: var(--text-dim); margin-bottom: 3px; }

.ac-block-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.ac-criteria { display: flex; flex-wrap: wrap; gap: var(--sp-1); min-width: 0; }
.ac-chip {
  font-size: 0.68rem;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
}
.ac-chip-aid { color: var(--warn); border-color: rgba(251, 191, 36, 0.32); }

.ac-block-actions { display: flex; align-items: center; gap: var(--sp-2); }
.ac-attempts { font-size: 0.68rem; color: var(--text-dim); }

/* --- estados ------------------------------------------------------------ */

.ac-empty, .ac-fatal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}
.ac-fatal { border-color: var(--danger); }
.ac-fatal h2 { margin: 0 0 var(--sp-3); font-family: var(--font-display); font-weight: 400; color: var(--danger); font-size: 1.15rem; }
.ac-fatal ul { margin: 0; padding-left: 1.1rem; }
.ac-fatal li { font-size: 0.86rem; line-height: 1.6; margin-bottom: var(--sp-2); }
.ac-fatal-note { margin: var(--sp-4) 0 0; font-size: 0.82rem; color: var(--text-dim); }
.ac-empty h2 { margin: 0 0 var(--sp-2); font-family: var(--font-display); font-weight: 400; }

.ac-foot {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
}

/* --- celular ------------------------------------------------------------ */

@media (max-width: 620px) {
  .ac-main { padding: var(--sp-3); }
  .ac-top { padding: var(--sp-3); gap: var(--sp-2); }
  .ac-curriculum { order: 3; flex-basis: 100%; }
  .ac-block { padding: var(--sp-3); gap: var(--sp-2); }
  .ac-block-rail { min-width: 28px; }
  .ac-day-title { font-size: 1.25rem; }
  .ac-block-foot { align-items: flex-start; }
  .ac-block-actions { width: 100%; justify-content: flex-end; }
}

/* ===========================================================================
   Runner — la pantalla donde se practica
   =========================================================================== */

:root {
  /* Una voz, un color. Los mismos en el mástil y en el teclado. */
  --v1: #e8a558;   /* voz grave */
  --v2: #5bd1cd;   /* voz aguda */
}

.rv { display: grid; gap: var(--sp-4); }

.rv-head { display: flex; align-items: flex-start; gap: var(--sp-3); flex-wrap: wrap; }
.rv-head-text { flex: 1; min-width: 200px; }
.rv-head h2 { margin: 0; font-size: 1.15rem; font-weight: 600; line-height: 1.25; }
.rv-head p { margin: var(--sp-1) 0 0; font-size: 0.84rem; color: var(--text-dim); line-height: 1.5; }

.rv-instructions {
  margin: 0; padding: var(--sp-3) var(--sp-3) var(--sp-3) calc(var(--sp-3) + 1rem);
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--r-md);
}
.rv-instructions li { font-size: 0.82rem; line-height: 1.55; color: var(--text-dim); margin-bottom: 3px; }
.rv-instructions li:last-child { margin-bottom: 0; }

/* --- tonalidad ----------------------------------------------------------- */

.rv-keybar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.rv-key {
  display: flex; align-items: baseline; gap: var(--sp-2);
  background: var(--bg-card); border: 1px solid var(--accent); border-radius: var(--r-md);
  padding: 4px 14px;
  /* sin esto el flex lo encoge y el "1/12" se cae debajo de la tónica */
  flex-shrink: 0; white-space: nowrap;
}
.rv-key b { font-family: var(--font-display); font-size: 1.35rem; color: var(--accent); font-weight: 400; }
.rv-key small { font-size: 0.7rem; color: var(--text-dim); }

/* --- tira de acordes ----------------------------------------------------- */

.rv-strip { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.rv-chord {
  font: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: var(--bg-panel); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 6px 18px; transition: all 0.12s ease;
}
.rv-chord b { font-size: 0.95rem; font-weight: 600; }
.rv-chord small { font-size: 0.62rem; font-family: ui-monospace, Menlo, monospace; }
/* El acorde en curso tiene que gritar: es lo que se mira mientras se toca. */
.rv-chord.on {
  background: var(--accent); color: #201509; border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(232, 165, 88, 0.3);
}
.rv-chord.on small { color: rgba(32, 21, 9, 0.7); }

.rv-countin {
  display: none; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--warn); color: #241a04;
  font-family: var(--font-display); font-size: 1.4rem;
}
.rv-countin.on { display: grid; }

/* --- escenario ----------------------------------------------------------- */

.rv-stage {
  display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-4); box-shadow: var(--top-light);
}
.rv-now { min-width: 128px; }
.rv-now-chord { font-family: var(--font-display); font-size: 1.6rem; color: var(--text); line-height: 1.1; }
.rv-voices { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: grid; gap: 3px; }
.rv-voice { display: flex; align-items: baseline; gap: 6px; font-size: 0.9rem; }
.rv-voice b { font-family: ui-monospace, Menlo, monospace; font-size: 0.78rem; min-width: 22px; }
.rv-voice span { color: var(--text-dim); font-size: 0.7rem; }
.rv-voice i { font-style: normal; font-weight: 600; }
.rv-voice i small { font-size: 0.62rem; color: var(--text-dim); }
.rv-voice.v1 b, .rv-voice.v1 i { color: var(--v1); }
.rv-voice.v2 b, .rv-voice.v2 i { color: var(--v2); }

.rv-instrument { flex: 1; min-width: 0; overflow-x: auto; }
.rv-window { display: block; text-align: center; color: var(--text-dim); font-size: 0.72rem; }

/* --- mástil -------------------------------------------------------------- */

.rv-neck { display: grid; gap: 2px; min-width: min-content; }
.rv-row, .rv-fretnums {
  display: grid;
  grid-template-columns: 30px repeat(var(--rv-frets), minmax(38px, 1fr));
  align-items: center; gap: 2px;
}
.rv-string-label {
  font-size: 0.7rem; color: var(--text-dim); text-align: right; padding-right: 5px;
  display: flex; align-items: baseline; justify-content: flex-end; gap: 3px;
}
.rv-string-label small { font-size: 0.55rem; opacity: 0.6; }
.rv-cell {
  height: 34px; display: grid; place-items: center;
  background: var(--bg-card); border-radius: var(--r-sm);
  /* la cuerda: una línea fina que cruza la celda */
  background-image: linear-gradient(var(--border), var(--border));
  background-size: 100% 1px; background-position: center; background-repeat: no-repeat;
}
.rv-note {
  display: grid; place-items: center; gap: 0;
  width: 32px; height: 32px; border-radius: 50%;
  font-style: normal; line-height: 1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.rv-note i { font-style: normal; font-size: 0.72rem; font-weight: 700; }
.rv-note em { font-style: normal; font-size: 0.5rem; opacity: 0.75; }
.rv-note.v1 { background: var(--v1); color: #201509; }
.rv-note.v2 { background: var(--v2); color: #04201f; }

.rv-fretnum {
  text-align: center; font-size: 0.68rem; color: var(--text-dim);
  display: flex; flex-direction: column; align-items: center; line-height: 1.1;
}
.rv-fretnum.nut { color: var(--accent); }
.rv-fretnum i { font-style: normal; font-size: 0.55rem; opacity: 0.7; }

/* --- teclado ------------------------------------------------------------- */

.rv-keyboard { position: relative; height: 116px; min-width: 240px; }
.rv-whites { display: grid; grid-template-columns: repeat(var(--rv-whites), 1fr); gap: 2px; height: 100%; }
.rv-blacks { position: absolute; inset: 0; height: 62%; pointer-events: none; }
/* .rv-pk y no .rv-key: la tonalidad ya usa ese nombre y la tecla del piano le
   pisaba el padding y el display, dejando la tónica de 17px de ancho. */
.rv-pk {
  font: inherit; padding: 0; cursor: default; border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 1px; padding-bottom: 5px;
}
.rv-pk.white { background: #ddd2c2; color: #241a10; border-radius: 0 0 var(--r-sm) var(--r-sm); }
.rv-pk.black {
  position: absolute; top: 0; height: 100%;
  width: calc(100% / var(--rv-whites) * 0.62);
  transform: translateX(-50%);
  background: #1a1512; color: var(--text); border-radius: 0 0 4px 4px; z-index: 2;
}
.rv-pk i { font-style: normal; font-size: 0.7rem; font-weight: 700; }
.rv-pk em { font-style: normal; font-size: 0.5rem; opacity: 0.8; }
.rv-pk small { font-size: 0.5rem; opacity: 0.45; }
.rv-pk.on.v1 { background: var(--v1); color: #201509; border-color: var(--v1); }
.rv-pk.on.v2 { background: var(--v2); color: #04201f; border-color: var(--v2); }
.rv-pk.black.on { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5); }

/* --- transporte ---------------------------------------------------------- */

.rv-transport {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4);
}
.rv-play { min-width: 96px; font-weight: 600; }
.rv-play.on { background: var(--danger); border-color: var(--danger); color: #2a0b0b; }
.rv-bpm { display: flex; align-items: center; gap: var(--sp-2); font-size: 0.78rem; color: var(--text-dim); }
.rv-bpm input { width: 130px; accent-color: var(--accent); }
.rv-bpm input:disabled { opacity: 0.4; }
.rv-bpm output { font-family: ui-monospace, Menlo, monospace; color: var(--text); min-width: 26px; }
.rv-bpm i { font-style: normal; font-size: 0.66rem; opacity: 0.7; }
.rv-toggle.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.rv-passcount { font-size: 0.72rem; color: var(--text-dim); margin-left: auto; }

/* --- veredicto ----------------------------------------------------------- */

.rv-verdict { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.rv-verdict small { color: var(--text-dim); font-size: 0.72rem; }
.rv-pass { border-color: var(--ok); color: var(--ok); }
.rv-pass:hover { background: var(--ok-soft); border-color: var(--ok); }
.rv-fail { border-color: var(--danger); color: var(--danger); }

.rv-result {
  display: grid; gap: var(--sp-2);
  background: var(--bg-panel); border: 1px solid var(--border);
  border-left: 3px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4);
}
.rv-result.pass { border-left-color: var(--ok); }
.rv-result.fail { border-left-color: var(--danger); }
.rv-result b { font-size: 1rem; }
.rv-result.pass b { color: var(--ok); }
.rv-result.fail b { color: var(--danger); }
.rv-result span { font-size: 0.8rem; color: var(--text-dim); }
.rv-result-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-2); }

.rv-warnings { margin: 0; padding-left: 1.1rem; }
.rv-warnings li { font-size: 0.76rem; color: var(--warn); line-height: 1.5; }
.rv-empty { color: var(--text-dim); font-size: 0.84rem; }

.ac-btn-open { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.ac-btn-open:hover { background: var(--accent-soft); }
.ac-btn-done { min-width: 34px; }

@media (max-width: 620px) {
  /* Apilado: al lado del panel del acorde el mástil se queda sin ancho y la
     segunda voz cae fuera de la vista. Las dos notas tienen que verse juntas
     sin scrollear — es lo único que se mira mientras se toca. */
  .rv-stage { padding: var(--sp-3); gap: var(--sp-3); flex-direction: column; align-items: stretch; }
  .rv-now { min-width: 0; display: flex; align-items: baseline; gap: var(--sp-4); flex-wrap: wrap; }
  .rv-now-chord { font-size: 1.35rem; }
  .rv-voices { margin: 0; grid-auto-flow: column; gap: var(--sp-3); }
  .rv-transport { padding: var(--sp-3); }
  .rv-bpm input { width: 92px; }
  .rv-passcount { margin-left: 0; }
  .rv-row, .rv-fretnums { grid-template-columns: 26px repeat(var(--rv-frets), minmax(34px, 1fr)); }
}

/* --- panel de la semana --------------------------------------------------- */

.ac-week {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
}
.ac-week summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap;
}
.ac-week summary::-webkit-details-marker { display: none; }
.ac-week summary::before { content: '▸'; color: var(--accent); }
.ac-week[open] summary::before { content: '▾'; }
.ac-week summary b { font-size: 0.9rem; }
.ac-week summary span { font-size: 0.72rem; color: var(--text-dim); }
.ac-week-objective { margin: var(--sp-3) 0 0; font-size: 0.86rem; line-height: 1.6; color: var(--text-dim); }
.ac-week h4 {
  margin: var(--sp-3) 0 var(--sp-1); font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent);
}
.ac-week ul { margin: 0; padding-left: 1.1rem; }
.ac-week li { font-size: 0.8rem; line-height: 1.55; color: var(--text-dim); }
.ac-week-criteria li { color: var(--text); }
.ac-type.guided { color: var(--text-dim); opacity: 0.75; }

/* --- práctica guiada ------------------------------------------------------ */

.gr-meta { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.gr-steps {
  margin: 0; padding: var(--sp-4) var(--sp-4) var(--sp-4) calc(var(--sp-4) + 1.2rem);
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--top-light);
}
.gr-steps li { font-size: 0.95rem; line-height: 1.65; margin-bottom: var(--sp-2); }
.gr-steps li:last-child { margin-bottom: 0; }
.gr-steps li::marker { color: var(--accent); font-weight: 600; }

.gr-timer {
  display: grid; gap: var(--sp-3); justify-items: center;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-4); box-shadow: var(--top-light);
}
.gr-clock {
  font-family: var(--font-display); font-size: 2.6rem; line-height: 1;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.gr-clock.done { color: var(--ok); }
.gr-timer .ac-progress { width: 100%; }
.gr-controls { display: flex; gap: var(--sp-2); }

/* --- Improvisation Trainer ------------------------------------------------ */

.ir-progression { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.ir-bar {
  font: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg-panel); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 10px 24px; transition: all 0.12s ease;
}
.ir-bar b { font-size: 1.25rem; font-weight: 600; line-height: 1; }
.ir-bar small { font-size: 0.62rem; font-family: ui-monospace, Menlo, monospace; }
/* El acorde en curso es lo único que el alumno mira mientras improvisa. */
.ir-bar.on {
  background: var(--accent); color: #201509; border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(232, 165, 88, 0.32);
}
.ir-bar.on small { color: rgba(32, 21, 9, 0.7); }

.ir-targets-box {
  min-height: 74px;
  display: flex; flex-direction: column; justify-content: center; gap: var(--sp-2);
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4); box-shadow: var(--top-light);
}
.ir-targets-box .strip-eyebrow {
  font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim);
}
.ir-targets { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--sp-5); flex-wrap: wrap; }
.ir-targets li { display: flex; align-items: baseline; gap: var(--sp-2); }
.ir-targets b {
  font-family: ui-monospace, Menlo, monospace; font-size: 0.86rem;
  color: var(--text-dim); min-width: 24px;
}
.ir-targets span { color: var(--text-dim); font-size: 0.72rem; }
.ir-targets i { font-style: normal; font-size: 1.5rem; font-weight: 600; color: var(--accent); line-height: 1; }
.ir-targets-off { margin: 0; color: var(--text-dim); font-size: 0.82rem; }

.ir-mix {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4);
}
.ir-volume { display: flex; align-items: center; gap: var(--sp-2); font-size: 0.76rem; color: var(--text-dim); margin-left: auto; }
.ir-volume input { width: 110px; accent-color: var(--accent); }
.ir-volume output { font-family: ui-monospace, Menlo, monospace; color: var(--text); min-width: 26px; }

@media (max-width: 620px) {
  .ir-bar { padding: 8px 14px; }
  .ir-bar b { font-size: 1.05rem; }
  .ir-volume { margin-left: 0; }
  .ir-volume input { width: 92px; }
}

/* --- Reading Trainer ---------------------------------------------------- */

.rd-instructions {
  margin: 0 0 14px;
  padding: 12px 16px 12px 30px;
  list-style: disc;
  background: var(--ac-surface, rgba(255, 255, 255, .03));
  border: 1px solid var(--ac-line, rgba(255, 255, 255, .09));
  border-radius: 10px;
}
.rd-instructions li { margin: 3px 0; font-size: .93rem; line-height: 1.45; }

.rd-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.rd-seed { font-variant-numeric: tabular-nums; }
.rd-seed b { margin-left: 5px; letter-spacing: .04em; }

/* El pentagrama sobre fondo claro y con tinta oscura: VexFlow dibuja en negro
   y una partitura se lee en papel, no en modo oscuro. Es la única parte de
   Academy que rompe la paleta, y lo hace por legibilidad. */
.rd-stage-wrap { margin: 0 0 16px; }

/* En escritorio el pentagrama se sale de la columna de texto. La columna de
   Academy es angosta a propósito — está pensada para leer párrafos — pero acá
   el contenido ES la partitura, y cuanto más ancha entre, más grande se dibuja
   cada nota sin perder los cuatro compases por sistema. */
@media (min-width: 900px) {
  .rd-stage-wrap {
    width: min(1180px, calc(100vw - 64px));
    margin-left: calc(50% - min(1180px, calc(100vw - 64px)) / 2);
  }
}
.rd-stage,
.rd-stage-loading,
.rd-stage-error {
  background: #fcfcfa;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 12px;
  padding: 6px 4px;
  overflow-x: auto;
}
.rd-stage svg { display: block; max-width: 100%; height: auto; }

/* La nota que suena ahora. Se pinta la cabeza y la plica y nada más: ni el
   accidental, ni la armadura, ni las otras notas. Es color y no un recuadro
   porque el bbox de una cabeza de nota es la caja em de la fuente — mide unas
   dieciséis veces la tinta — y cualquier rectángulo calculado saldría enorme.
   El azul es fuerte sobre el papel claro del pentagrama, que es claro siempre:
   una partitura se lee en papel, en cualquier tema de la aplicación. */
.rd-stage .vf-stavenote.rd-note-on .vf-notehead text { fill: #1d4ed8; }
.rd-stage .vf-stavenote.rd-note-on .vf-stem path {
  stroke: #1d4ed8;
  fill: #1d4ed8;
  stroke-width: 2;
}
.rd-stage-loading { color: #555; padding: 40px 16px; text-align: center; font-size: .95rem; }
.rd-stage-error { color: #7a1f1f; padding: 18px 16px; font-size: .92rem; }
.rd-stage-error p { margin: 4px 0; }
.rd-fallback { color: #444; font-style: italic; }

.rd-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.rd-keys .strip-eyebrow { margin-right: 4px; }
.rd-key { min-width: 52px; font-weight: 600; }
.rd-key-chip { font-weight: 600; }

.rd-loop { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.rd-loop .strip-eyebrow { margin-right: 4px; }
.rd-range { min-width: 48px; }
.rd-range:disabled { opacity: .45; cursor: not-allowed; }

.rd-transport {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.rd-listen { font-weight: 600; }
.rd-beat {
  min-width: 66px; font-variant-numeric: tabular-nums; font-size: .85rem;
  color: var(--ac-dim, rgba(255, 255, 255, .55));
}
.rd-beat.countin { font-size: 1.3rem; font-weight: 700; color: var(--ac-accent, #e8b96b); }
.rd-timer-note { grid-column: 1 / -1; color: var(--ac-dim, rgba(255, 255, 255, .5)); font-size: .8rem; }

/* El mástil va DEBAJO del pentagrama y nunca al lado: al lado le robaría ancho
   a la partitura, y el pentagrama no se achica por una ayuda opcional. En
   teléfono queda apilado igual, sin scroll horizontal. */
.rd-neck-wrap { margin: 0 0 14px; }
.rd-neck-note { margin-left: 10px; font-size: .85rem; color: var(--ac-dim, rgba(255,255,255,.6)); }
.rd-neck-note b { color: var(--ac-accent, #e8b96b); font-variant-numeric: tabular-nums; }
.rd-neck { margin-top: 10px; max-width: 100%; overflow-x: auto; }

/* La posición escrita: sólida y con el nombre. Es la respuesta. */
.rd-neck .rv-note.rd-pos { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
/* La misma nota en otra octava: contorno tenue y sin nombre. Es contexto —
   sirve para ir viendo que una nota vive en varios lugares — pero no es lo que
   hay que tocar, y tiene que notarse la diferencia de un vistazo. */
.rd-neck .rv-note.rd-pos-2 {
  background: transparent;
  border: 1px dashed rgba(29, 78, 216, .55);
  color: transparent;
  box-shadow: none;
}

/* Los cuatro niveles de la jerarquía. El orden en que están escritos es el
   orden en que se leen de un vistazo, y no es casualidad: la nota activa tiene
   fondo sólido y color saturado, la octava sólo contorno, la escala es un
   punto, y la cromática —cuando exista— tiene su propio color para no
   confundirse con nada de lo anterior. */

/* 3. el resto de la escala: contexto. Un punto cuando no lleva etiqueta, y un
   círculo apenas insinuado cuando muestra nombre o grado. Medido: en una zona
   de ocho trastes la escala pone entre 27 y 30 círculos, así que si compitiera
   de igual a igual la nota que hay que leer sería una entre treinta. */
.rd-neck .rv-note.rd-scale {
  width: 10px; height: 10px;
  background: rgba(255, 255, 255, .2);
  border: none; box-shadow: none; color: transparent;
}
.rd-neck .rv-note.rd-scale-txt {
  width: 26px; height: 26px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .5);
}
.rd-neck .rv-note.rd-scale i { font-size: .62rem; font-weight: 500; }

/* 4. cromática: todavía no se genera, pero el nivel existe y se distingue de
   la escala por color y no sólo por tamaño. */
.rd-neck .rv-note.rd-chrom {
  width: 10px; height: 10px;
  background: rgba(232, 185, 107, .25);
  border: none; box-shadow: none; color: transparent;
}

.rd-neck-controls { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; }
.rd-seg { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.rd-seg .ac-btn { padding: 4px 10px; font-size: .8rem; }
.rd-zone-why { display: block; margin-top: 6px; color: var(--text-dim); font-size: .72rem; }
.rd-neck-notice {
  margin: 8px 0 0; padding: 7px 10px; font-size: .78rem; line-height: 1.4;
  border-radius: var(--r-sm);
  background: rgba(232, 185, 107, .1);
  border: 1px solid rgba(232, 185, 107, .3);
  color: var(--text);
}
.rd-neck-notice[hidden] { display: none; }

/* Perfil rítmico de prueba: se ve distinto a propósito, para que nadie confunda
   una lectura de desarrollo con la del currículo. */
.rd-meta .rd-dev-chip {
  border-color: rgba(232, 185, 107, .5);
  color: var(--ac-accent, #e8b96b);
}

/* Vista previa: los botones de veredicto quedan apagados y se dice por qué.
   Deshabilitados y no ocultos: que el alumno vea que existen y que hoy no
   aplican es más claro que hacerlos desaparecer sin explicación. */
.rv-verdict.rd-preview .ac-btn[disabled] { opacity: .4; cursor: not-allowed; }
.rd-preview-note {
  align-self: center; font-size: .8rem;
  color: var(--ac-accent, #e8b96b);
}

.rd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.rd-new { font-weight: 600; }

.rd-timer {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 14px;
}
.rd-timer .ac-progress { margin: 0; }

@media (max-width: 640px) {
  .rd-timer .ac-progress { grid-column: 1 / -1; }
  .rd-loop { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.rd-loop .strip-eyebrow { margin-right: 4px; }
.rd-range { min-width: 48px; }
.rd-range:disabled { opacity: .45; cursor: not-allowed; }

.rd-transport { gap: 6px; }
  .rd-transport .rv-bpm { flex: 1 1 100%; }
  .rd-actions .ac-btn { flex: 1 1 auto; }
  .rd-instructions { padding-left: 26px; }
}

/* --- Note Recognition ------------------------------------------------------ */

.nr-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.nr-seed b { font-family: var(--mono, ui-monospace, monospace); color: var(--ac-accent, #e8b96b); }
.nr-preview-chip { border-color: rgba(232, 185, 107, .5); color: var(--ac-accent, #e8b96b); }

/* La tarjeta: papel claro y una nota grande. Es lo único que se mira mientras
   se responde, así que ocupa el centro y no compite con nada. */
.nr-stage-wrap { display: flex; justify-content: center; margin-bottom: 10px; }
.nr-stage {
  background: #fbfaf7; border-radius: var(--r-lg, 14px);
  padding: 6px 10px;
  /* Ancho DEFINIDO, no deducido del contenido. El SVG pide `width: 100%` y el
     contenedor es un flex item: si el ancho del padre dependiera del hijo y el
     del hijo del padre, la tarjeta colapsa a cero. Medido: la nota
     desaparecía en escritorio y se veía bien en teléfono, que es la clase de
     bug que uno descubre tarde. */
  width: min(560px, 100%);
  flex: 0 1 auto;
}
.nr-stage svg { display: block; max-width: 100%; height: auto; }

/* El feedback ocupa su lugar SIEMPRE, aunque esté vacío: si apareciera y
   desapareciera, los botones saltarían entre pregunta y pregunta y el pulgar
   erraría. */
.nr-feedback {
  min-height: 1.7em; margin: 0 0 12px; text-align: center;
  font-size: 1.15rem; font-weight: 600; line-height: 1.4;
}
.nr-feedback.ok { color: #4ade80; }
.nr-feedback.bad { color: #f87171; }

.nr-answers {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 8px; margin-bottom: 8px;
}
.nr-answer {
  min-height: 56px; font-size: 1.25rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.nr-answer:disabled { opacity: 1; }   /* bloqueado no es "apagado": sigue leyéndose */

/* La marca no es sólo color: el símbolo y el borde grueso dicen lo mismo, así
   que el ejercicio se lee igual sin distinguir rojo de verde. */
.nr-answer.nr-ok { border-color: #4ade80; border-width: 3px; color: #4ade80; }
.nr-answer.nr-ok::after { content: ' ✓'; font-size: .8em; }
.nr-answer.nr-bad { border-color: #f87171; border-width: 3px; color: #f87171; }
.nr-answer.nr-bad::after { content: ' ✕'; font-size: .8em; }

.nr-hint, .nr-keys { display: block; text-align: center; color: var(--text-dim); font-size: .75rem; }
.nr-hint { min-height: 1.1em; color: var(--ac-accent, #e8b96b); }

.nr-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 16px;
}
.nr-stats { display: flex; align-items: baseline; gap: 12px; font-size: .85rem; color: var(--text-dim); }
.nr-stats b { font-size: 1.15rem; color: var(--text); font-variant-numeric: tabular-nums; }
.nr-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.nr-table-wrap { margin-top: 14px; }
.nr-table { width: 100%; max-width: 380px; border-collapse: collapse; font-size: .9rem; }
.nr-table th, .nr-table td { padding: 5px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.nr-table th { width: 2.5em; font-weight: 700; color: var(--ac-accent, #e8b96b); }
.nr-table td { font-variant-numeric: tabular-nums; }
.nr-table .nr-seen { color: var(--text-dim); font-size: .8rem; text-align: right; }
.nr-empty { color: var(--text-dim); font-size: .85rem; }

/* El acuse de lo que se guardó. Dice explícitamente que se guardó el resumen y
   no las respuestas: el alumno tiene que saber qué queda registrado de él. */
.nr-saved {
  margin-top: 12px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: .85rem; color: var(--text-dim);
}
.nr-saved b { color: var(--text); font-variant-numeric: tabular-nums; }

/* En el teléfono los siete botones no entran cómodos en una fila: cuatro y
   tres, con altura de pulgar. */
@media (max-width: 560px) {
  .nr-answers { grid-template-columns: repeat(4, 1fr); }
  .nr-answer { min-height: 64px; font-size: 1.35rem; }
  .nr-bar { flex-direction: column; align-items: stretch; }
}

/* --- Instrument Mapping --------------------------------------------------- */

.map-runner { display: flex; flex-direction: column; gap: var(--sp-3); }

.map-modes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.map-mode { min-width: 96px; }
.map-mode.on { background: var(--ac-accent, #e8b96b); border-color: var(--ac-accent, #e8b96b); color: #201509; font-weight: 700; }
.map-mode-chip { font-weight: 600; }

.map-stage-wrap { display: flex; justify-content: center; }
/* Más chica que la tarjeta del reconocimiento de notas: acá el pentagrama
   comparte pantalla con el instrumento, y los dos tienen que entrar juntos sin
   scrollear — mirar la nota y buscarla es un solo gesto. */
.map-stage {
  width: min(340px, 100%); flex: 0 1 auto;
  background: #f7f3ec; border-radius: var(--r-lg); padding: 8px 6px;
}

.map-feedback { min-height: 1.6em; margin: 0; text-align: center; font-size: 1.05rem; font-weight: 600; }
.map-feedback.ok { color: var(--ok, #6fcf97); }
.map-feedback.bad { color: var(--danger, #e07a7a); }
.map-feedback.octave { color: var(--ac-accent, #e8b96b); }
.map-feedback.reveal { color: var(--text-dim); font-weight: 500; }

.map-instrument { display: flex; justify-content: center; overflow-x: auto; }

/* El mástil en modo control. Las medidas no son las del mástil de lectura: acá
   cada celda es un blanco que hay que poder tocar con el pulgar. Seis cuerdas
   por ocho trastes no entran a 44 px de ancho en un teléfono —serían 352 px
   sólo de celdas más la etiqueta—, así que la altura se lleva a 44 y el ancho
   queda en 36, bastante por encima del mínimo de 24 de la WCAG. */
.rv-neck-live .rv-row,
.rv-neck-live .rv-fretnums { grid-template-columns: 24px repeat(var(--rv-frets), minmax(36px, 1fr)); }
.rv-cell-btn {
  height: 44px; font: inherit; cursor: pointer; padding: 0;
  border: 1px solid transparent;
}
.rv-cell-btn:hover:not(:disabled) { border-color: var(--ac-accent, #e8b96b); }
.rv-cell-btn:focus-visible { outline: 2px solid var(--accent, #e8b96b); outline-offset: 1px; }
.rv-cell-btn:disabled { cursor: default; }

/* Las tres marcas. Se distinguen por forma y símbolo además de por color:
   la exacta es sólida, la de otra octava es un contorno hueco, y el error
   lleva su aspa. */
.rv-note.map-exact { background: var(--ok, #6fcf97); color: #04200f; border: none; }
.rv-note.map-related {
  background: transparent; color: var(--text-dim);
  border: 2px dashed var(--border); width: 26px; height: 26px;
}
.rv-note.map-wrong { background: var(--danger, #e07a7a); color: #2a0b0b; border: none; }
.rv-note.map-octave { background: var(--ac-accent, #e8b96b); color: #201509; }
.rv-note.map-picked { box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }

/* El teclado en modo control. Las negras viven en una capa con
   `pointer-events: none` para no tapar a las blancas: acá hay que devolvérselo
   a las teclas mismas, o serían las únicas que no se pueden tocar. */
.rv-keyboard-live { height: 132px; width: min(520px, 100%); }
.rv-keyboard-live .rv-blacks { pointer-events: none; }
.rv-pk-live { cursor: pointer; }
.rv-pk-live:disabled { cursor: default; }
.rv-keyboard-live .rv-pk-live.black { pointer-events: auto; }
.rv-pk-live:focus-visible { outline: 2px solid var(--accent, #e8b96b); outline-offset: -2px; z-index: 3; }
.rv-pk-live.white:hover:not(:disabled) { background: #eee5d6; }
.rv-pk-mark {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font-size: .72rem; font-weight: 700; font-style: normal; margin-bottom: 4px;
}
.rv-pk-mark.map-exact { background: var(--ok, #6fcf97); color: #04200f; }
.rv-pk-mark.map-related { background: transparent; border: 2px dashed var(--text-dim); }
.rv-pk-mark.map-wrong { background: var(--danger, #e07a7a); color: #2a0b0b; }
.rv-pk-mark.map-octave { background: var(--ac-accent, #e8b96b); color: #201509; }

.map-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.map-next { font-weight: 600; }
.map-note { margin: 0; font-size: .78rem; color: var(--text-dim); max-width: 60ch; }
.map-table-head { margin: 0 0 6px; font-size: .75rem; color: var(--text-dim); font-family: ui-monospace, Menlo, monospace; }
.map-tag-octave { color: var(--ac-accent, #e8b96b); }
.map-tag-reveal { color: var(--text-dim); }

@media (max-width: 560px) {
  .rv-neck-live .rv-row,
  .rv-neck-live .rv-fretnums { grid-template-columns: 20px repeat(var(--rv-frets), minmax(34px, 1fr)); }
  .map-modes { gap: 6px; }
  .map-mode { min-width: 0; flex: 1 1 auto; }
  /* Quince teclas blancas repartidas en 351 px darían 20,8 px cada una, por
     debajo del mínimo táctil. Se les pone un ancho de suelo y el teclado
     scrollea DENTRO de su caja —nunca la página—, que es preferible a un
     blanco que se falla la mitad de las veces. */
  .rv-keyboard-live { min-width: 400px; }
  /* Con eso las blancas quedan en 24,8 px —las quince, que son las que
     contienen las nueve alturas del nivel—. Las negras quedan en 16,5, por
     debajo del mínimo: hoy no son respuesta de nada, así que fallar una no
     puede costarle un punto a nadie. Cuando lleguen las alteraciones habrá que
     bajar el teclado del teléfono a una octava, y ahí sí serán blancos de
     verdad. Anotado, no arreglado: arreglarlo ahora sería angostar el
     ejercicio por una tecla que no se usa. */
}

/* --- Ear Training --------------------------------------------------------- */

.ear-runner { display: flex; flex-direction: column; gap: var(--sp-3); }

/* El botón de escuchar es lo primero que se toca en cada pregunta y lo único
   que hay que encontrar sin mirar. Por eso es el más grande de la pantalla. */
.ear-play-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ear-play {
  min-width: 240px; min-height: 64px;
  font-size: 1.15rem; font-weight: 700;
  background: var(--ac-accent, #e8b96b); border-color: var(--ac-accent, #e8b96b); color: #201509;
}
.ear-play:disabled { opacity: .55; }
.ear-plays { min-height: 1.2em; font-size: .8rem; color: var(--text-dim); }

.ear-answers { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.ear-answer {
  min-height: 58px; font-size: 1.3rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ear-answer:disabled { opacity: .35; }
.ear-answer.nr-ok { background: var(--ok, #6fcf97); border-color: var(--ok, #6fcf97); color: #04200f; }
.ear-answer.nr-bad { background: var(--danger, #e07a7a); border-color: var(--danger, #e07a7a); color: #2a0b0b; }

/* En el teléfono, cuatro y tres: siete columnas darían 45 px por botón y la
   respuesta es lo que más se toca en toda la sesión. */
@media (max-width: 560px) {
  .ear-answers { grid-template-columns: repeat(4, 1fr); }
  .ear-answer { min-height: 64px; font-size: 1.4rem; }
  .ear-play { width: 100%; min-width: 0; }
}

/* --- Guide Tone Ear Training ---------------------------------------------- */

.gt-prompt {
  margin: 0; text-align: center; font-size: 1.15rem; font-weight: 700;
  min-height: 1.5em; color: var(--text);
}
.gt-answers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-width: 420px; margin: 0 auto; width: 100%; }
.gt-check { min-width: 200px; }

/* `hidden` es un atributo, y `display: grid`/`flex` en una clase le gana por
   especificidad: sin esto, la grilla de respuestas seguía ocupando su lugar en
   la modalidad de canto y dejaba un hueco en el medio de la pantalla. */
.gt-answers[hidden], .gt-reports[hidden] { display: none; }

/* El informe del alumno sobre su propio canto. Se ve distinto de una respuesta
   corregida a propósito: no es un veredicto, es una anotación. */
.gt-reports { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.gt-reports small { color: var(--text-dim); font-size: .78rem; text-align: center; max-width: 46ch; }
.gt-report-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.gt-report { font-size: .85rem; border-style: dashed; }

@media (max-width: 560px) {
  .gt-answers { grid-template-columns: repeat(2, 1fr); }
  .gt-check { width: 100%; min-width: 0; }
  .gt-report { flex: 1 1 auto; }
}

/* --- Referencia visual del oído ------------------------------------------- */
/*
   Es una AYUDA, no un control: se dibuja con los mismos renderizadores del
   mástil y del teclado que usan Reading, Guide Tones e Instrument Mapping,
   pero en modo lectura. Encontrar la nota con el dedo es el ejercicio
   siguiente, no éste.
*/
.gt-visual-pick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.gt-visual-pick small { color: var(--text-dim); font-size: .78rem; margin-right: 2px; }
.gt-visual-btn { font-size: .82rem; padding: 5px 12px; }
.gt-visual-btn.on { background: var(--ac-accent, #e8b96b); border-color: var(--ac-accent, #e8b96b); color: #201509; font-weight: 700; }

.gt-visual:empty { display: none; }
.gt-visual { display: flex; justify-content: center; overflow-x: auto; }

/* Las tres marcas. El contexto es tenue y hueco; la guide tone revelada es
   sólida: se distinguen por forma además de por color. */
.rv-note.gtv-root, .rv-pk-mark.gtv-root,
.rv-note.gtv-fifth, .rv-pk-mark.gtv-fifth {
  background: transparent; color: var(--text-dim);
  border: 2px solid var(--border);
}
.rv-note.gtv-target, .rv-pk-mark.gtv-target {
  background: var(--ac-accent, #e8b96b); color: #201509; border: none; font-weight: 700;
}
.rv-pk-mark.gtv-root, .rv-pk-mark.gtv-fifth { border-color: var(--text-dim); }

/* El diagrama del oído se vuelve tocable recién después de responder: hasta
   ahí es una referencia, no un instrumento. */
.gt-visual .rv-cell-btn:hover:not(:disabled) { border-color: var(--ac-accent, #e8b96b); }
.gt-visual-hint { display: block; text-align: center; font-size: .78rem; color: var(--text-dim); min-height: 1.1em; }

/* --- Material en prueba ---------------------------------------------------- */
/*
   Trainers que existen pero todavía no están en el currículo. Se ven
   claramente aparte del plan del día —borde punteado, tono apagado— porque no
   suman minutos ni progreso y nada de lo que se haga ahí se guarda.
*/
.ac-previews {
  margin-top: var(--sp-5); padding-top: var(--sp-4);
  border-top: 1px dashed var(--border);
}
.ac-previews h3 { margin: 0 0 4px; font-size: .95rem; color: var(--text-dim); font-weight: 600; }
.ac-previews p { margin: 0 0 10px; font-size: .8rem; color: var(--text-dim); max-width: 62ch; }
.ac-preview-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-preview { border-style: dashed; font-size: .88rem; }
.ac-preview:hover { border-color: var(--ac-accent, #e8b96b); border-style: solid; }

@media (max-width: 560px) {
  .ac-preview { flex: 1 1 auto; min-height: 44px; }
}
