/* =============================================================================
   Componentes
   ============================================================================= */

/* --- Botones --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-5);
  border: 1px solid transparent; border-radius: var(--pill);
  font-weight: 700; font-size: var(--fs-md); letter-spacing: 0.02em;
  text-decoration: none; cursor: pointer; user-select: none;
  transition: transform 0.15s var(--ease-out), background 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--olive); color: #FBF8EF; }
.btn-primary:hover:not([disabled]) { background: var(--olive-deep); }
.btn-dark { background: var(--espresso); color: var(--cream); }
.btn-dark:hover:not([disabled]) { background: #2A2118; }
.btn-gold { background: var(--gold); color: var(--espresso); }
.btn-gold:hover:not([disabled]) { background: var(--gold-light); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover:not([disabled]) { background: var(--paper); }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--gold-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.btn-lg { min-height: var(--tap); padding: var(--s-2) var(--s-5); font-size: var(--fs-md); line-height: 1.2; letter-spacing: 0.05em; text-transform: uppercase; text-align: center; }
@media (min-width: 720px) { .btn-lg { font-size: var(--fs-lg); padding: var(--s-2) var(--s-6); } }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 var(--s-4); font-size: var(--fs-sm); }

/* --- Tarjetas -------------------------------------------------------------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-card);
}
.card-dark {
  background: var(--espresso); color: var(--cream); border-color: transparent;
}
.card-dark .eyebrow { color: var(--gold-light); }
/* Tarjeta del recorrido: clara, con borde verde oliva (Tiziana prefiere evitar fondos oscuros). */
.card-journey { background: linear-gradient(160deg, #fff 0%, var(--olive-pale) 140%); border: 2px solid var(--olive-light); }
.card-journey .eyebrow { color: var(--olive-deep); }
.card-journey .progress > span { background: linear-gradient(90deg, var(--olive-deep), var(--olive-light)); }
.card-dark .muted { color: #C9C2B4; }

.card-link {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  text-decoration: none; color: inherit;
}

/* --- Formularios ----------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field label { font-weight: 600; font-size: var(--fs-sm); }
.input {
  width: 100%; min-height: var(--tap);
  padding: 0 var(--s-4);
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 1.0625rem; /* ≥16px evita el zoom automático de iOS */
}
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-pale); }
.input-code {
  text-align: center; font-family: var(--mono); font-size: var(--fs-2xl);
  letter-spacing: 0.4em; padding-left: 0.4em;
}

/* --- Avisos ---------------------------------------------------------------- */
.alert {
  padding: var(--s-3) var(--s-4); border-radius: var(--radius-sm);
  background: var(--gold-pale); color: var(--ink-soft); font-size: var(--fs-sm);
}
.alert-error { background: #F6E1DA; color: var(--danger); }
.alert-ok { background: var(--green-pale); color: #2E5E3B; }

.notebook-note {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: var(--s-4); border-radius: var(--radius);
  background: var(--gold-pale); border: 1px dashed var(--gold);
}
.notebook-note .icon { font-size: 1.5rem; line-height: 1; }

.badge {
  display: inline-flex; align-items: center; gap: var(--s-1);
  padding: 2px 10px; border-radius: var(--pill);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--paper-2); color: var(--ink-soft);
}
.badge-demo { background: #FCE9C8; color: #7A4B00; border: 1px solid #E8B860; }
.badge-done { background: var(--olive-pale); color: var(--olive-deep); }

.tags { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; font-weight: 600; }
.tags .sep { color: var(--gold); }

/* --- Progreso -------------------------------------------------------------- */
.progress { height: 8px; background: var(--paper-2); border-radius: var(--pill); overflow: hidden; }
.card-dark .progress { background: rgba(255, 255, 255, 0.12); }
.progress > span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-light));
  border-radius: inherit; transition: width 0.6s var(--ease-out);
}

.day-counter { font-family: var(--serif); font-size: var(--fs-3xl); font-weight: 600; line-height: 1; }
.day-counter small { font-family: var(--sans); font-size: var(--fs-md); font-weight: 600; color: var(--ink-mute); letter-spacing: 0.08em; }
.card-dark .day-counter small { color: #C9C2B4; }
.day-counter .day-counter-label { display: block; margin-bottom: 0.4rem; font-size: var(--fs-sm, 0.8125rem); letter-spacing: 0.14em; text-transform: uppercase; }

/* --- Mapa de días ---------------------------------------------------------- */
.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: var(--s-2); }
.day-cell {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); text-decoration: none; font-weight: 700;
}
.day-cell small { font-size: 0.625rem; font-weight: 600; letter-spacing: 0.08em; color: var(--ink-mute); }
.day-cell.is-available { background: var(--espresso); color: var(--cream); border-color: var(--espresso); }
.day-cell.is-available small { color: var(--gold-light); }
.day-cell.is-completed { background: var(--olive-pale); border-color: var(--olive-light); }
.day-cell.is-locked { opacity: 0.45; pointer-events: none; }

/* --- Entrenamiento --------------------------------------------------------- */
.session-head { display: flex; flex-direction: column; gap: var(--s-2); }
.session-head .row { justify-content: space-between; }

.exercise-head { display: flex; flex-direction: column; gap: var(--s-2); }
.exercise-type { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-deep); }

.info-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s-2); }
.info-item { background: var(--paper-2); border-radius: var(--radius-sm); padding: var(--s-3); }
.info-item dt { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute); }
.info-item dd { margin: 2px 0 0; font-weight: 700; font-size: var(--fs-lg); }
.info-notes { margin: 0; padding-left: 1.2em; color: var(--ink-soft); }

/* Plan de escuchas (●○○) */
.plan { display: flex; flex-direction: column; gap: var(--s-3); }
.plan-group { display: flex; flex-direction: column; gap: 6px; }
.plan-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); }
.dots { display: flex; flex-wrap: wrap; gap: 8px; }
.dot {
  position: relative; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line-strong); background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.625rem; font-weight: 700; color: var(--ink-mute);
}
.dot.is-half { background: linear-gradient(90deg, var(--gold) 50%, transparent 50%); border-color: var(--gold); }
.dot.is-done { background: var(--olive); border-color: var(--olive); color: #FBF8EF; }
.dot.is-current { box-shadow: 0 0 0 3px var(--gold-pale); border-color: var(--gold-deep); }

.listen-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s-4); }
.listen-step { font-family: var(--serif); font-size: var(--fs-2xl); font-weight: 600; }
.listen-take { font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-deep); }
.listen-after { font-size: var(--fs-lg); color: var(--ink-soft); max-width: 28ch; }

.play-btn { min-width: 220px; }
/* Botones del mismo ancho: en las tarjetas de escucha todos los principales miden igual
   y, lado a lado, se reparten el espacio en partes iguales. */
.listen-card .btn:not(.stop-btn):not(.tester-skip):not(.btn-link),
.card.center .btn:not(.stop-btn):not(.tester-skip):not(.btn-link) { width: 100%; max-width: 420px; min-height: 52px; }
.card.center > .stack, .listen-card > .stack { align-self: stretch; }
.speed-picker .btn { width: auto !important; min-height: 40px !important; flex: 1 1 0; }
.row > .btn { flex: 1 1 0; min-width: 160px; }
.play-btn .bars { display: none; gap: 3px; align-items: flex-end; height: 16px; }
.play-btn.is-playing .bars { display: inline-flex; }
.play-btn.is-playing .label-idle { display: none; }
.bars i { width: 3px; background: currentColor; border-radius: 2px; animation: bar 0.9s ease-in-out infinite; }
.bars i:nth-child(2) { animation-delay: 0.15s; }
.bars i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bar { 0%, 100% { height: 4px; } 50% { height: 16px; } }

/* Metrónomo */
.beats { display: flex; justify-content: center; gap: var(--s-2); min-height: 28px; }
.beat { width: 18px; height: 18px; border-radius: 50%; background: var(--paper-2); border: 2px solid var(--line-strong); transition: transform 0.08s; }
.beat.is-on { background: var(--gold); border-color: var(--gold-deep); transform: scale(1.25); }
.beat.is-on.is-accent { background: var(--olive); border-color: var(--olive-deep); }
.reading-status { font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-deep); min-height: 1.5em; text-align: center; }
.toggle { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 600; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--olive); }

/* --- Partituras ------------------------------------------------------------ */
.score {
  background: var(--score-bg); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.score-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: var(--s-3); }
.score-pages { display: flex; flex-direction: column; gap: var(--s-4); }
.score-pages img { width: 100%; height: auto; max-width: none; background: var(--score-bg); }
.score-tools { display: flex; justify-content: flex-end; gap: var(--s-2); padding: var(--s-2); border-top: 1px solid var(--line); background: #FDFBF7; }
.icon-btn {
  min-width: 44px; min-height: 44px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: #fff; cursor: pointer;
  font-weight: 700; font-size: var(--fs-lg); display: inline-flex; align-items: center; justify-content: center; padding: 0 var(--s-3);
}

/* Modal / pantalla completa */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16, 12, 8, 0.92);
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.modal-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); color: var(--cream); }
.modal-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; padding: var(--s-3); }
.modal-body img { background: var(--score-bg); border-radius: var(--radius-sm); margin: 0 auto var(--s-4); }
.modal .icon-btn { background: rgba(255, 255, 255, 0.1); color: var(--cream); border-color: rgba(255, 255, 255, 0.2); }

/* --- Corrección ------------------------------------------------------------ */
.correction-item { display: flex; flex-direction: column; gap: var(--s-4); }
.answer {
  border-left: 4px solid var(--green); background: var(--green-pale);
  padding: var(--s-3) var(--s-4); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.answer .eyebrow { color: #2E5E3B; }
.answer-text { font-family: var(--serif); font-size: var(--fs-xl); font-weight: 600; }
.answer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.answer-list li {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s-3);
}
.answer-list .num { font-weight: 800; color: var(--gold-deep); margin-right: var(--s-2); }
/* Botón "Escuchar" de las respuestas: ancho fijo y alineado a la derecha, también en el celular. */
.answer-list li > span { flex: 1 1 auto; min-width: 0; }
.answer-list li > .btn { flex: 0 0 auto; width: 128px; min-width: 0; padding: 0 var(--s-3); white-space: nowrap; }

.celebrate { font-size: 3rem; line-height: 1; }

.footer-actions { display: flex; flex-direction: column; gap: var(--s-3); }
@media (min-width: 720px) {
  .footer-actions { flex-direction: row; justify-content: center; }
  .footer-actions .btn-block { width: auto; flex: 1 1 0; max-width: 320px; white-space: nowrap; }
}

/* --- Modo prueba (solo testers) -------------------------------------------- */
.tester { position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 90; }
.tester-toggle {
  border: 0; border-radius: var(--pill); padding: 10px 14px; cursor: pointer;
  background: #2F4F3A; color: #F2F7F3; font-weight: 700; font-size: var(--fs-sm); box-shadow: var(--shadow-soft);
}
.tester-panel { width: min(340px, calc(100vw - 24px)); max-height: 80vh; overflow: auto; gap: var(--s-3); border: 2px solid #2F4F3A; }
.tester-panel hr { border: 0; border-top: 1px solid var(--line); margin: 0; width: 100%; }
.tester-panel .input { min-height: 40px; }
.tester-panel input[type=number] { width: 80px; }
.tester-skip { border-style: dashed; border-color: #2F4F3A; color: #2F4F3A; }

/* --- Opciones de ejecución (lectura a 2 voces) ----------------------------- */
.mode-options { display: flex; flex-direction: column; gap: var(--s-2); }
.mode-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: var(--s-3) var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--paper); cursor: pointer; font: inherit; color: inherit;
}
.mode-option.is-selected { border: 2px solid var(--olive); background: #fff; }
.mode-option[disabled] { opacity: 0.6; cursor: default; }

/* Selector de velocidad (lecturas melódicas) */
.speed-picker { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 4px 0 8px; }
.speed-picker .speed-label { width: 100%; text-align: center; font-size: .8rem; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .06em; }
.mode-option .clef-icon { font-size: 2.1rem; line-height: 1; width: 2.2rem; text-align: center; color: var(--olive-deep); }
.mode-option:has(.clef-icon) { flex-direction: row; align-items: center; gap: var(--s-3); }
.mode-option .clef-icon-treble { font-size: 3rem; margin-top: -0.3rem; }
.answer-list li { white-space: pre-line; }
.playback-controls { display: flex; justify-content: center; gap: var(--s-2); }
.playback-controls .btn { min-width: 130px; }
.hint-note { margin: 0; padding: var(--s-3) var(--s-4); border-left: 4px solid var(--olive); background: var(--olive-pale); border-radius: 8px; color: var(--ink-soft); font-size: var(--fs-sm); }

/* --- Mascota ---------------------------------------------------------------- */
.mascot-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); width: 100%; }
.mascot-option { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--s-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: var(--paper); cursor: pointer; font: inherit; font-weight: 600; color: inherit; }
.mascot-option.is-selected { border: 2px solid var(--olive); background: #fff; }
.mascot-option-img { width: 100%; max-width: 96px; height: auto; }
.mascot-hello { display: flex; align-items: center; gap: var(--s-4); }
.mascot-hello .mascot-img { width: 96px; height: 96px; flex: none; }
.mascot-bubble { position: relative; margin: 0; padding: var(--s-3) var(--s-4); background: var(--olive-pale); border-radius: 16px; color: var(--ink-soft); }
.mascot-bubble::before { content: ''; position: absolute; left: -8px; top: 22px; border: 8px solid transparent; border-right-color: var(--olive-pale); border-left: 0; }
.mascot-stars { margin: 0; letter-spacing: 4px; font-size: 1.15rem; color: var(--line-strong); }
.mascot-stars .is-on { color: var(--gold); }
.mascot-bob { animation: mascot-bob 3s ease-in-out infinite; }
@keyframes mascot-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.celebration { position: relative; overflow: hidden; padding-top: var(--s-4); }
.mascot-celebrate { width: 160px; height: 160px; animation: mascot-jump 0.9s ease-out 2; }
.mascot-celebrate.is-big { width: 200px; height: 200px; animation: mascot-jump 0.9s ease-out 4; }
@keyframes mascot-jump { 0%, 100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-18px) scale(1.05) rotate(-4deg); } 70% { transform: translateY(0) scale(0.98) rotate(2deg); } }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti span { position: absolute; top: -30px; color: var(--gold); opacity: 0; animation: confetti-fall 3.2s ease-in 1 forwards; }
.confetti span:nth-child(3n) { color: var(--olive); }
.confetti span:nth-child(4n) { color: var(--olive-light); }
@keyframes confetti-fall { 0% { opacity: 0; transform: translateY(0) rotate(0); } 10% { opacity: 1; } 100% { opacity: 0; transform: translateY(420px) rotate(160deg); } }
@media (prefers-reduced-motion: reduce) { .mascot-bob, .mascot-celebrate, .confetti span { animation: none; } .confetti { display: none; } }

/* --- Bienvenida, novedades y medallas -------------------------------------- */
.welcome-steps { display: flex; gap: 6px; }
.welcome-steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.welcome-steps span.is-on { background: var(--olive); }
.mascot-announce { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); text-align: left; }
.mascot-announce .mascot-bubble p { margin: 0 0 var(--s-2); }
.mascot-announce .mascot-bubble::before { left: 50%; top: -8px; border: 8px solid transparent; border-bottom-color: var(--olive-pale); border-top: 0; transform: translateX(-50%); }
.novelty-card { border: 2px solid var(--olive-light); }
.novelty-card .mascot-bubble p { margin: 0 0 6px; }
.novelty-card .mascot-bubble p:last-child { margin: 0; }
.medal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: var(--s-3); }
.medal { width: 72px; height: 72px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--paper-2); border: 3px dashed var(--line-strong); color: var(--ink-mute); justify-self: center; }
.medal.is-earned { background: radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold) 70%); border: 3px solid var(--gold-deep); color: var(--espresso);
  box-shadow: 0 3px 0 var(--gold-deep); }
.medal.is-big { width: 110px; height: 110px; animation: mascot-jump 0.9s ease-out 2; }
.medal-num { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; line-height: 1; }
.medal.is-big .medal-num { font-size: 2.4rem; }
.medal-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.medal-card { border: 2px solid var(--gold-light); }

/* --- Mapa del recorrido (inicio) -------------------------------------------- */
.day-map-row { display: flex; align-items: center; gap: var(--s-2); }
.day-map-label { flex: none; width: 70px; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute); }
.day-map-cells { flex: 1; display: grid; grid-template-columns: repeat(15, 1fr); gap: 3px; }
.day-map-cell { aspect-ratio: 1; border-radius: 4px; background: var(--paper-2); border: 1px solid var(--line); }
.day-map-cell.is-completed { background: var(--olive); border-color: var(--olive-deep); }
.day-map-cell.is-available { background: #fff; border-color: var(--olive-light); }
.day-map-cell.is-next { background: var(--gold); border-color: var(--gold-deep); box-shadow: 0 0 0 2px var(--gold-pale); }
.day-map-cell.is-locked { opacity: .55; }
/* Fuera del plan comprado (p.ej. prueba de 15 días): se ve el recorrido que sigue, punteado. */
.day-map-cell.is-beyond { background: transparent; border-style: dashed; border-color: var(--line-strong); opacity: .7; }

/* Botones apilados del mismo ancho (pantallas finales) */
.button-stack { display: flex; flex-direction: column; gap: var(--s-3); width: 100%; max-width: 420px; margin-inline: auto; }
.button-stack .btn { width: 100%; }

/* --- Páginas legales -------------------------------------------------------- */
.legal h2 { font-size: var(--fs-lg, 1.25rem); margin: 0; }
.legal p { margin: 0; line-height: 1.6; color: var(--ink-soft); }
.legal-list { margin: 0; padding-left: 1.2em; color: var(--ink-soft); line-height: 1.6; }
.legal-list li { margin-bottom: 6px; }
.site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* --- Práctica libre ------------------------------------------------------------ */
.practice-tabs { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.practice-tabs .btn { flex: 1 1 0; min-width: 150px; }
.practice-stage h2 { margin: 0; font-size: var(--fs-lg, 1.25rem); }
.practice-stage-name { font-family: var(--sans); font-size: .85rem; font-weight: 600; color: var(--ink-mute); }
.practice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: var(--s-2); }
.practice-item { display: flex; flex-direction: column; gap: 2px; padding: var(--s-2) var(--s-3); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--paper); color: inherit; text-decoration: none; }
.practice-item:hover { border-color: var(--olive); background: #fff; }
.practice-item.is-locked { opacity: .55; cursor: default; }
.extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-3); }
.extra-link { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border: 1px solid var(--olive-light);
  border-radius: var(--radius); background: var(--paper); color: inherit; text-decoration: none; }
.extra-link:hover { background: #fff; border-color: var(--olive); }
.extra-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--olive-pale); color: var(--olive-deep); font-size: 1.3rem; }

/* --- Mis materiales ---------------------------------------------------------- */
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s-3); }
.mat { display: flex; flex-direction: column; justify-content: space-between; gap: var(--s-3); padding: var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper); }
.mat.is-locked { opacity: .6; }
.mat-head { display: flex; gap: var(--s-3); align-items: flex-start; }
.mat-icon { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--olive-pale); color: var(--olive-deep); font-size: 1.6rem; font-family: "Apple Symbols", "Noto Music", serif; }
.mat .btn { width: 100%; }

/* --- Primera Vista ------------------------------------------------------------------------- */
.pv-entry { border: 2px solid var(--olive-light); background: linear-gradient(160deg, #fff 0%, var(--olive-pale) 140%); }
.pv-entry .eyebrow { color: var(--olive-deep); }
.pv-entry-arrow { font-size: 1.5rem; color: var(--olive-deep); }
.pv-tools { display: grid; grid-template-columns: 1fr; gap: var(--s-3); }
.pv-tool .extra-icon { font-size: 1.15rem; }
.practice-item.is-done { background: var(--olive-pale); border-color: var(--olive-light); }

.pv-settings { gap: var(--s-3); }
.pv-choice { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; width: 100%; max-width: 520px; }
.pv-choice .speed-label { width: 100%; text-align: center; font-size: .8rem; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .06em; }
.pv-choice .btn { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 0 var(--s-2); }
.card.center .pv-choice .btn, .card.center .speed-picker .btn { width: auto !important; max-width: none; min-height: 40px !important; }
.pv-run { width: 100%; align-items: center; }

/* Partitura con marcas */
.mscore-page { position: relative; width: 100%; }
.mscore-page img { display: block; width: 100%; height: auto; background: var(--score-bg); }
.mscore-layer { position: absolute; inset: 0; pointer-events: none; }
.mscore-page.is-tappable { cursor: pointer; }
.mscore-mark { position: absolute; border-radius: 6px; transition: left .12s linear, width .12s linear, top .12s linear; }
.mscore-mark.is-target { background: rgba(107, 123, 60, 0.16); box-shadow: inset 0 0 0 3px var(--olive); }
.mscore-mark.is-playing { background: rgba(176, 138, 80, 0.16); }
.mscore-mark.is-cover { background: repeating-linear-gradient(135deg, #EDE6D8 0 8px, #E4DBC9 8px 16px); border-radius: 4px; transition: none; }
.mscore-mark.is-chosen { background: rgba(176, 138, 80, 0.22); box-shadow: inset 0 0 0 3px var(--gold); }
.mscore-mark.is-right { background: rgba(78, 150, 99, 0.18); box-shadow: inset 0 0 0 3px var(--green); }
.mscore-mark.is-wrong { background: rgba(166, 66, 43, 0.14); box-shadow: inset 0 0 0 3px var(--danger); }
.mscore-mark.is-line { border-left: 3px solid var(--danger); border-radius: 0; }

/* Tarjetas de células */
.pv-card { position: relative; background: var(--score-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s-3);
  width: 100%; max-width: 520px; min-height: 120px; display: grid; place-items: center; overflow: hidden; }
.pv-card-img { width: 100%; height: auto; display: block; }
.pv-card-cover { position: absolute; inset: 0; display: grid; place-items: center; background: repeating-linear-gradient(135deg, #EDE6D8 0 10px, #E4DBC9 10px 20px);
  color: var(--olive-deep); font-family: var(--serif); font-size: 2.5rem; font-weight: 700; }
.pv-card.is-shown .pv-card-cover { display: none; }
.pv-card-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: transparent; }
.pv-card-timer span { display: block; height: 100%; width: 0; background: var(--olive); }
.pv-card.is-hidden .pv-card-timer span { width: 0 !important; }
.pv-card-key { font-weight: 700; color: var(--olive-deep); min-height: 1.4em; }
.pv-selfcheck { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); width: 100%; max-width: 420px; }
.card.center .pv-selfcheck .btn { width: 100%; min-height: 52px; }
.pv-chain { display: grid; grid-template-columns: 1fr; gap: var(--s-3); width: 100%; max-width: 520px; }
.pv-chain-slot { display: flex; flex-direction: column; gap: var(--s-1); align-items: stretch; }
.pv-chain-slot .pv-card { min-height: 90px; padding: var(--s-2); }
.pv-chain-slot.is-next .pv-card { box-shadow: 0 0 0 3px var(--olive); }
.pv-chain-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); font-weight: 700; }
.pv-chain-empty { min-height: 90px; border: 1px dashed var(--line-strong); border-radius: var(--radius); display: grid; place-items: center; color: var(--ink-mute); }
.pv-chain-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-2); }
.pv-chain-strip .pv-card { min-height: 60px; padding: var(--s-1); }
.pv-chain-strip .pv-card.is-playing { box-shadow: 0 0 0 3px var(--gold); }
@media (max-width: 480px) {
  .pv-choice .btn, .pv-settings .speed-picker .btn { font-size: .8rem; padding: 0 6px; line-height: 1.15; }
}

/* Inicio: accesos (anchos / de a dos / con candado) */
.extra-link.is-wide { width: 100%; }
.extras-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
@media (max-width: 520px) { .extras-pair { grid-template-columns: 1fr; } }
.extra-link.is-locked { background: #EFEBE3; border-color: var(--line-strong); }
.extra-link.is-locked strong { color: var(--ink-mute); }
.extra-link.is-locked .extra-icon { background: #E2DDD3; filter: grayscale(1); }
.extra-unlock { font-size: var(--fs-sm); font-weight: 700; color: var(--olive-deep); margin-top: 2px; }
.day-map-row.is-locked .day-map-label { color: var(--ink-mute); opacity: .7; }
.day-map-row.is-locked .day-map-cell { opacity: .45; background: #E6E1D7; border-color: transparent; }
.day-map-unlock { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }

/* Primera Vista: cierre de un entrenamiento y nivel */
.pv-done-title { font-family: var(--serif); font-size: var(--fs-xl); font-weight: 600; color: var(--ink); margin: 0; text-align: center; }
.pv-done.is-ok { border: 2px solid var(--olive-light); }
.pv-level-picker summary { cursor: pointer; color: var(--gold-deep); font-weight: 600; }
.pv-level-picker[open] { display: grid; gap: var(--s-2); }

/* --- Administradora: inicio, franja "viendo como" y panel de alumnos ---------------- */
.admin-option { width: 100%; font: inherit; text-align: left; cursor: pointer; }
.admin-option[disabled] { opacity: .6; cursor: wait; }
.admin-views { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-3); }
.admin-students-link { border: 2px solid var(--gold-light); background: linear-gradient(160deg, #fff 0%, var(--gold-pale) 140%); }
.admin-students-link .extra-icon { background: var(--gold-pale); }
.admin-arrow { margin-left: auto; font-size: 1.4rem; color: var(--gold-deep); }
.admin-bar { position: sticky; top: 0; z-index: 80; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--s-2); padding: var(--s-2) var(--s-4); background: #2F4F3A; color: #F2F7F3; font-size: var(--fs-sm); }
.admin-bar-back { background: #F2F7F3; color: #2F4F3A; border: 0; }
.admin-bar-back:hover:not([disabled]) { background: #fff; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--s-3); }
.stat { display: flex; flex-direction: column; gap: 2px; padding: var(--s-3) var(--s-4); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.stat strong { font-family: var(--serif); font-size: var(--fs-2xl); line-height: 1.1; }
.students-tools { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.students-tools input[type=search] { flex: 1 1 240px; }
.students-sort { flex: 0 1 200px; }
.students-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink-soft); border-radius: var(--pill);
  padding: 6px 12px; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.chip.is-on { background: var(--olive); border-color: var(--olive-deep); color: #fff; }
.students-list { display: grid; gap: var(--s-3); }
.student-row { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: var(--s-4); align-items: center; color: inherit; text-decoration: none; padding: var(--s-4); }
.student-row:hover { border-color: var(--olive); }
.student-who, .student-progress, .student-last { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.student-who .small { overflow-wrap: anywhere; }
.student-last { text-align: right; }
.student-last .is-inactive { color: var(--danger); }
.student-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.badge-off { background: #EFEBE3; color: var(--ink-mute); }
@media (max-width: 680px) {
  .student-row { grid-template-columns: 1fr; gap: var(--s-3); }
  .student-last { text-align: left; }
}
.student-days summary { cursor: pointer; color: var(--gold-deep); font-weight: 600; }
.student-days ul { margin: var(--s-2) 0 0; padding-left: var(--s-4); display: grid; gap: 4px; }
.student-map .day-map-cells { max-width: 420px; }
.logins { display: grid; gap: 2px; overflow-x: auto; }
.logins-head, .logins-row { display: grid; grid-template-columns: 1.2fr 1.2fr 1.3fr 1fr; gap: var(--s-3); padding: 6px var(--s-2); min-width: 520px; }
.logins-row:nth-child(even) { background: var(--paper-2); border-radius: 6px; }
.logins .mono { font-family: var(--mono); font-size: .8rem; overflow-wrap: anywhere; }

/* Instalar la app: aviso, íconos de los botones reales dentro de los pasos y guía con flecha */
.install-head { justify-content: space-between; flex-wrap: nowrap; }
.install-card .eyebrow { margin: 0; }
.install-ico { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.install-ico circle { fill: currentColor; stroke: none; }
.install-key { display: inline-flex; align-items: center; justify-content: center; padding: 2px 6px; margin: 0 2px; border: 1px solid var(--gold-light); border-radius: 8px; color: var(--gold-deep); background: var(--gold-pale); }
.install-steps { padding-left: 1.3em; display: grid; gap: var(--s-2); line-height: 1.55; margin: 0; }
.install-guide { position: fixed; inset: 0; z-index: 9998; isolation: isolate; background: rgba(16, 12, 8, 0.62); display: flex; align-items: center; justify-content: center; padding: var(--s-4); animation: install-fade .2s ease-out; }
.install-sheet { width: 100%; max-width: 420px; background: var(--paper); position: relative; z-index: 1; }
.install-arrow { position: fixed; z-index: 9999; color: var(--gold-light); pointer-events: none; filter: drop-shadow(0 0 10px rgba(216, 190, 142, 0.7)); }
.install-arrow-ico { width: 56px; height: 56px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.install-arrow--down { bottom: calc(8px + env(safe-area-inset-bottom)); left: 50%; margin-left: -28px; animation: install-bob-down 1.1s ease-in-out infinite; }
.install-arrow--down-right { bottom: calc(8px + env(safe-area-inset-bottom)); right: 14px; animation: install-bob-down 1.1s ease-in-out infinite; }
.install-arrow--up-right { top: calc(8px + env(safe-area-inset-top)); right: 14px; animation: install-bob-up 1.1s ease-in-out infinite; }
.install-arrow--up-left { top: calc(8px + env(safe-area-inset-top)); left: 14px; animation: install-bob-up 1.1s ease-in-out infinite; }
@keyframes install-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes install-bob-down { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(10px); } }
@keyframes install-bob-up { 0%, 100% { transform: rotate(180deg) translateY(0); } 50% { transform: rotate(180deg) translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .install-arrow, .install-guide { animation: none; } }

/* Mascotas con rango (Aprendiz, Intérprete, Maestro): dibujo de grabado, en chiquito solo el animal. */
.mascot-img, .mascot-option-img, .mascot-emblem { object-fit: contain; }
.mascot-emblem { width: 180px; height: 180px; filter: drop-shadow(0 6px 14px rgba(60, 50, 20, .14)); }
.mascot-emblem.is-big { width: 220px; height: 220px; }
.rank-card { text-align: center; gap: var(--s-2); }
.rank-card h2, .rank-card h3 { margin: 0; }
.rank-card .eyebrow { margin: 0; }
/* "Ver como": tarjetas que se marcan (uno o varios productos combinados). */
.admin-pick { position: relative; padding-right: 44px; }
.admin-pick .admin-check { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-size: .8rem; color: transparent; }
.admin-pick.is-picked { border-color: var(--olive); background: #fff; box-shadow: 0 0 0 1px var(--olive); }
.admin-pick.is-picked .admin-check { background: var(--olive); border-color: var(--olive); color: #fff; }
