/* ═══════════════════════════════════════════════════════════════════════
   GymBro — CoachAI (coach.html). Mobile-first, columna máx 520px como el
   portal del socio. Dos vistas: Mi rutina (calendario) y chat con el coach.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --color-primary: #f97316;
  --color-primary-oscuro: #c2590f;
  --color-accent: #facc15;
  --fondo: #f4f6f9;
  --superficie: #ffffff;
  --oscuro: #0c111d;
  --oscuro-2: #131a2a;
  --texto: #1c2434;
  --texto-suave: #5b6577;
  --borde: #e4e7ec;
  --exito: #16a34a;
  --peligro: #dc2626;
  --ambar: #d97706;
  --radio: 14px;
  --fuente: "Inter", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* `hidden` SIEMPRE gana, aunque la clase defina display */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: var(--fuente);
  background: var(--fondo);
  color: var(--texto);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, select, textarea, input { font-family: inherit; }

/* ─── Pantalla de bloqueo (sin sesión de socio) ───────────────────────── */
.pantalla-bloqueo {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(800px 400px at 90% -10%, color-mix(in srgb, var(--color-primary) 30%, transparent), transparent 60%),
    var(--oscuro);
  color: #f4f6fa;
  text-align: center;
}
.bloqueo-caja { width: min(400px, 100%); }
.bloqueo-icono { font-size: 3rem; display: block; margin-bottom: 14px; }
.bloqueo-caja h1 { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.02em; margin-bottom: 10px; }
.bloqueo-caja p { color: #b9c1d0; font-size: 0.92rem; margin-bottom: 22px; }
.btn-bloqueo {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  border-radius: 999px;
  padding: 13px 28px;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}
.btn-bloqueo:hover { background: var(--color-primary-oscuro); }
.bloqueo-nota { font-size: 0.8rem !important; color: #78829a !important; margin-top: 18px !important; }
.bloqueo-nota a { color: var(--color-accent); font-weight: 700; }

/* ─── Shell ───────────────────────────────────────────────────────────── */
.app {
  max-width: 520px;
  margin-inline: auto;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--fondo);
  box-shadow: 0 0 40px rgba(12, 17, 29, 0.12);
}

.app-header {
  flex: 0 0 auto;
  background: var(--oscuro);
  color: #f4f6fa;
  z-index: 30;
}
.app-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 8px;
}
.app-volver {
  color: #98a1b3;
  text-decoration: none;
  font-size: 1.25rem;
  padding: 4px 10px;
  border-radius: 8px;
}
.app-volver:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.app-titulo { flex: 1; min-width: 0; }
.app-titulo strong { display: block; font-size: 1rem; font-weight: 900; }
.app-titulo small { color: #98a1b3; font-size: 0.74rem; }
.app-avatar {
  width: 36px; height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  font-weight: 900;
  font-size: 0.82rem;
}

/* tabs segmentadas */
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 0 16px 12px; gap: 8px; }
.tab {
  position: relative;
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid transparent;
  color: #b9c1d0;
  border-radius: 999px;
  padding: 9px 10px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab.activo { background: var(--color-primary); color: #fff; }
.tab:not(.activo):hover { border-color: rgba(255, 255, 255, 0.25); color: #fff; }
.tab-punto {
  position: absolute;
  top: 6px; right: 12px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* ─── Main / vistas ───────────────────────────────────────────────────── */
.app-main { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 18px 30px; }
.app-main.modo-chat { overflow: hidden; padding: 0; }

.vista-titulo { font-size: 1.35rem; font-weight: 900; letter-spacing: -0.02em; margin-bottom: 4px; }
.vista-descripcion { color: var(--texto-suave); font-size: 0.88rem; margin-bottom: 18px; }
.nota-legal { font-size: 0.72rem; color: var(--texto-suave); margin-top: 14px; text-align: center; }

/* ─── Wizard ──────────────────────────────────────────────────────────── */
#form-wizard { display: grid; gap: 16px; }
.campo label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.campo label small { font-weight: 600; color: var(--texto-suave); }
.campo select, .campo textarea {
  width: 100%;
  border: 1.5px solid var(--borde);
  border-radius: 12px;
  background: var(--superficie);
  padding: 11px 12px;
  font-size: 0.92rem;
  color: var(--texto);
  resize: vertical;
}
.campo select:focus, .campo textarea:focus { outline: none; border-color: var(--color-primary); }
.campo-doble { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.chips-opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-opcion {
  border: 1.5px solid var(--borde);
  background: var(--superficie);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--texto-suave);
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip-opcion:hover { border-color: var(--color-primary); color: var(--color-primary); }
.chip-opcion.activo {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.form-error {
  color: var(--peligro);
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(220, 38, 38, 0.07);
  border-radius: 10px;
  padding: 10px 14px;
}

.btn-generar {
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-oscuro));
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  padding: 15px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--color-primary) 35%, transparent);
}
.btn-generar:hover { transform: translateY(-1px); }
.btn-generar:disabled { opacity: 0.6; cursor: wait; transform: none; }

/* ─── Generando (loading) ─────────────────────────────────────────────── */
.generando { text-align: center; padding: 70px 20px; }
.generando-anillo {
  width: 58px; height: 58px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 5px solid var(--borde);
  border-top-color: var(--color-primary);
  animation: gira 0.9s linear infinite;
}
@keyframes gira { to { transform: rotate(360deg); } }
.generando h2 { font-size: 1.2rem; font-weight: 900; margin-bottom: 6px; }
.generando p { color: var(--texto-suave); font-size: 0.88rem; }

/* ─── Cabecera de rutina ──────────────────────────────────────────────── */
.rutina-cabecera {
  border-radius: 18px;
  background:
    radial-gradient(400px 200px at 100% 0%, color-mix(in srgb, var(--color-accent) 25%, transparent), transparent 70%),
    linear-gradient(135deg, var(--color-primary), var(--color-primary-oscuro));
  color: #fff;
  padding: 18px 20px;
  margin-bottom: 14px;
}
.rutina-cabecera .rc-etiqueta { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; }
.rutina-cabecera h2 { font-size: 1.2rem; margin: 4px 0 4px; }
.rutina-cabecera p { font-size: 0.83rem; opacity: 0.92; }

/* ─── Stats (racha / semana / sesiones) ───────────────────────────────── */
.stats-fila { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.stat-mini {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 12px 8px;
  text-align: center;
}
.stat-mini strong { display: block; font-size: 1.25rem; font-weight: 900; letter-spacing: -0.02em; }
.stat-mini small { font-size: 0.68rem; font-weight: 700; color: var(--texto-suave); text-transform: uppercase; letter-spacing: 0.04em; }

/* ─── Calendario semanal ──────────────────────────────────────────────── */
.semana-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.semana-flecha {
  width: 34px; height: 34px;
  border: 1.5px solid var(--borde);
  background: var(--superficie);
  border-radius: 10px;
  font-size: 1.1rem;
  color: var(--texto-suave);
  cursor: pointer;
}
.semana-flecha:hover { border-color: var(--color-primary); color: var(--color-primary); }
.semana-etiqueta { font-size: 0.85rem; font-weight: 800; }

.calendario-semana {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
.dia-celda {
  border: 1.5px solid var(--borde);
  background: var(--superficie);
  border-radius: 12px;
  padding: 8px 2px 7px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
  position: relative;
}
.dia-celda:hover { border-color: var(--color-primary); }
.dia-celda .dc-dia { display: block; font-size: 0.62rem; font-weight: 800; text-transform: uppercase; color: var(--texto-suave); }
.dia-celda .dc-num { display: block; font-size: 0.98rem; font-weight: 900; }
.dia-celda .dc-icono { display: block; font-size: 0.82rem; line-height: 1.4; }
.dia-celda.descanso { opacity: 0.55; cursor: default; }
.dia-celda.descanso:hover { border-color: var(--borde); }
.dia-celda.hoy { border-color: var(--color-primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 25%, transparent); }
.dia-celda.completado { background: color-mix(in srgb, var(--exito) 10%, #fff); border-color: color-mix(in srgb, var(--exito) 45%, transparent); }
.dia-celda.seleccionado { background: var(--oscuro); border-color: var(--oscuro); color: #fff; }
.dia-celda.seleccionado .dc-dia { color: #b9c1d0; }

/* ─── Detalle del día ─────────────────────────────────────────────────── */
.dia-detalle { display: grid; gap: 12px; margin-bottom: 18px; }

.dd-cabecera {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 14px 16px;
}
.dd-cabecera h3 { font-size: 1.05rem; font-weight: 900; }
.dd-cabecera .dd-meta { font-size: 0.8rem; color: var(--texto-suave); }
.dd-bloque {
  font-size: 0.82rem;
  background: color-mix(in srgb, var(--color-accent) 12%, #fff);
  border-radius: 10px;
  padding: 8px 12px;
  margin-top: 10px;
}
.dd-bloque strong { font-weight: 800; }

.dd-descanso {
  background: var(--superficie);
  border: 1.5px dashed var(--borde);
  border-radius: var(--radio);
  padding: 22px 16px;
  text-align: center;
  color: var(--texto-suave);
  font-size: 0.88rem;
}

.ejercicio {
  display: flex;
  gap: 12px;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 12px 14px;
}
.ejercicio .ej-num {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--color-primary) 12%, #fff);
  color: var(--color-primary);
  font-weight: 900;
  font-size: 0.85rem;
}
.ejercicio.tappable { cursor: pointer; transition: border-color 0.15s ease, transform 0.1s ease; }
.ejercicio.tappable:hover { border-color: var(--color-primary); }
.ejercicio.tappable:active { transform: scale(0.99); }
.ejercicio .ej-picto {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: var(--color-primary);
}
.ejercicio .ej-picto svg { width: 100%; height: 100%; }
.ejercicio .ej-info { flex: 1; min-width: 0; }
.ejercicio h4 { font-size: 0.92rem; font-weight: 800; }
.ejercicio .ej-series { font-size: 0.8rem; font-weight: 700; color: var(--color-primary); }
.ejercicio .ej-tip { font-size: 0.78rem; color: var(--texto-suave); margin-top: 2px; }
.ejercicio .ej-preguntar {
  flex: 0 0 auto;
  align-self: center;
  background: none;
  border: 1.5px solid var(--borde);
  border-radius: 10px;
  padding: 7px 9px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.ejercicio .ej-preguntar:hover { border-color: var(--color-primary); }

/* botón de check-off */
.btn-checkoff {
  border: none;
  border-radius: 999px;
  padding: 15px;
  font-size: 0.98rem;
  font-weight: 900;
  cursor: pointer;
  background: var(--exito);
  color: #fff;
  transition: transform 0.12s ease;
}
.btn-checkoff:hover { transform: translateY(-1px); }
.btn-checkoff.hecho {
  background: #fff;
  color: var(--exito);
  border: 2px solid color-mix(in srgb, var(--exito) 50%, transparent);
}
.btn-checkoff:disabled { background: var(--borde); color: var(--texto-suave); cursor: not-allowed; transform: none; }

/* botón de entreno guiado */
.btn-entrenar {
  border: none;
  border-radius: 999px;
  padding: 15px;
  font-size: 0.98rem;
  font-weight: 900;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-oscuro));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--color-primary) 32%, transparent);
  transition: transform 0.12s ease;
}
.btn-entrenar:hover { transform: translateY(-1px); }
.btn-entrenar:active { transform: scale(0.98); }

.btn-nueva-rutina {
  width: 100%;
  background: none;
  border: 1.5px solid var(--borde);
  border-radius: 999px;
  padding: 12px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--texto-suave);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-nueva-rutina:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ─── Vista chat (tema claro, mismo lenguaje que GymBot) ──────────────── */
.vista-chat {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chat-mensajes {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.burbuja {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: burbuja-entra 0.2s ease;
}
@keyframes burbuja-entra {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.burbuja.bot {
  align-self: flex-start;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-bottom-left-radius: 5px;
}
.burbuja.usuario {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-oscuro));
  color: #fff;
  border-bottom-right-radius: 5px;
}
.burbuja.error {
  align-self: center;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: var(--peligro);
  font-size: 0.82rem;
  text-align: center;
}
.burbuja strong { font-weight: 800; }
.burbuja .folio {
  background: color-mix(in srgb, var(--color-primary) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);
  color: var(--color-primary-oscuro);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.escribiendo {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: 16px;
  border-bottom-left-radius: 5px;
  font-size: 0.8rem;
  color: var(--texto-suave);
}
.escribiendo .puntos { display: inline-flex; gap: 4px; }
.escribiendo .puntos span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--texto-suave);
  animation: punto-brinca 1.2s infinite;
}
.escribiendo .puntos span:nth-child(2) { animation-delay: 0.15s; }
.escribiendo .puntos span:nth-child(3) { animation-delay: 0.3s; }
@keyframes punto-brinca {
  0%, 60%, 100% { transform: none; opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-sugerencias {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 16px;
  scrollbar-width: none;
  flex: 0 0 auto;
}
.chat-sugerencias::-webkit-scrollbar { display: none; }
.chip-sugerencia {
  flex: 0 0 auto;
  background: var(--superficie);
  border: 1.5px solid var(--borde);
  color: var(--texto-suave);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip-sugerencia:hover { border-color: var(--color-primary); color: var(--color-primary); }

.chat-entrada {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--superficie);
  border-top: 1px solid var(--borde);
  flex: 0 0 auto;
}
#chat-input {
  flex: 1;
  resize: none;
  max-height: 120px;
  background: var(--fondo);
  border: 1.5px solid var(--borde);
  border-radius: 14px;
  color: var(--texto);
  font-size: 0.92rem;
  line-height: 1.45;
  padding: 11px 14px;
}
#chat-input:focus { outline: none; border-color: var(--color-primary); }
#chat-input::placeholder { color: var(--texto-suave); }

#chat-enviar {
  width: 44px; height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.15s ease, transform 0.1s ease;
}
#chat-enviar:hover { background: var(--color-primary-oscuro); }
#chat-enviar:active { transform: scale(0.94); }
#chat-enviar:disabled { opacity: 0.45; cursor: not-allowed; }

/* ═══ MODO ENTRENO GUIADO (overlay inmersivo) ═══════════════════════════ */
#entreno-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 500px at 50% -10%, color-mix(in srgb, var(--color-primary) 26%, transparent), transparent 60%),
    linear-gradient(160deg, #101418, #1a2026);
  color: #eef2f7;
  animation: ent-entra 0.28s ease;
}
@keyframes ent-entra {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.ent-cabecera {
  flex: 0 0 auto;
  width: min(520px, 100%);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
}
#ent-cerrar {
  width: 40px; height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #cfd7e2;
  font-size: 1.05rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
#ent-cerrar:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
#ent-titulo {
  grid-column: 2;
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
#ent-progreso {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 6px;
}
.ent-punto {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.2s ease, transform 0.2s ease;
}
.ent-punto.hecho { background: var(--color-accent); }
.ent-punto.actual { background: var(--color-primary); transform: scale(1.35); }

#ent-contenido {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  width: min(520px, 100%);
  margin-inline: auto;
  padding: 8px 22px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.ent-pantalla {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  animation: ent-pantalla-entra 0.25s ease;
}
@keyframes ent-pantalla-entra {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.ent-pantalla h2 { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.02em; }
.ent-emoji { font-size: 3rem; line-height: 1; }
.ent-sub { color: #aeb8c6; font-size: 0.95rem; font-weight: 700; }
.ent-texto {
  color: #cfd7e2;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 14px 16px;
  max-width: 360px;
}
.ent-meta { color: var(--color-accent); font-size: 1rem; font-weight: 800; }
.ent-tip { color: #9aa5b3; font-size: 0.85rem; max-width: 320px; }

/* pictograma grande */
.ent-picto-grande {
  width: 120px; height: 120px;
  color: var(--color-primary);
  filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--color-primary) 45%, transparent));
}
.ent-picto-grande svg { width: 100%; height: 100%; }

/* botón gigante de tap de serie */
.ent-tap {
  width: 190px; height: 190px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--color-primary) 88%, #fff), var(--color-primary-oscuro));
  box-shadow: 0 16px 44px color-mix(in srgb, var(--color-primary) 45%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: transform 0.1s ease;
  margin-top: 4px;
}
.ent-tap:active { transform: scale(0.96); }
.ent-tap-serie { font-size: 1.15rem; font-weight: 900; letter-spacing: -0.01em; }
.ent-tap-sub { font-size: 0.78rem; font-weight: 700; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.05em; }

/* botones */
.ent-btn-primario {
  width: min(360px, 100%);
  border: none;
  border-radius: 999px;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-oscuro));
  box-shadow: 0 12px 30px color-mix(in srgb, var(--color-primary) 40%, transparent);
  transition: transform 0.1s ease;
  margin-top: 6px;
}
.ent-btn-primario:active { transform: scale(0.98); }
.ent-btn-sec {
  background: none;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 11px 20px;
  color: #cfd7e2;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.ent-btn-sec:hover { border-color: rgba(255, 255, 255, 0.45); color: #fff; }

/* descanso: anillo con número enorme */
.ent-animo { font-size: 1.1rem; font-weight: 800; color: #eef2f7; max-width: 320px; }
.ent-anillo {
  width: 210px; height: 210px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(closest-side, #1a2026 78%, transparent 79%),
    conic-gradient(var(--color-primary) calc(var(--pct, 0) * 1%), rgba(255, 255, 255, 0.12) 0);
}
.ent-cuenta { font-size: 4.5rem; font-weight: 900; letter-spacing: -0.03em; color: #fff; }
.ent-descanso-lbl { color: #9aa5b3; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }

/* captura de marcas (steppers) */
.ent-campos { width: min(360px, 100%); display: grid; gap: 14px; margin-top: 4px; }
.ent-campo { text-align: left; }
.ent-campo label {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  color: #aeb8c6;
  margin-bottom: 6px;
}
.ent-stepper {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 8px;
}
.ent-step {
  width: 100%; height: 48px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.ent-step:hover { background: rgba(255, 255, 255, 0.18); }
.ent-step:active { transform: scale(0.94); }
.ent-step-val {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 900;
  color: #fff;
}
/* iOS: ≥16px evita el zoom automático al enfocar */
.ent-stepper, .ent-step-val { font-size: max(1rem, 16px); }

/* resumen */
.ent-stats {
  width: min(360px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 4px;
}
.ent-stat {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px 6px;
}
.ent-stat strong { display: block; font-size: 1.15rem; font-weight: 900; }
.ent-stat small { font-size: 0.66rem; font-weight: 700; color: #9aa5b3; text-transform: uppercase; letter-spacing: 0.04em; }
.ent-cierre { color: #cfd7e2; font-size: 0.95rem; max-width: 340px; font-weight: 600; }

/* ═══ F11: zonas, banner de entreno en curso, frase del día, técnica ════ */

/* chips de zona deshabilitados al llegar al tope de 3 */
.chip-opcion.deshabilitado {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* chips de zona en la cabecera de la rutina activa */
.rc-zonas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rc-zona {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
}

/* banner "continuar entreno" */
.entreno-continuar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  background:
    radial-gradient(300px 120px at 100% 0%, color-mix(in srgb, var(--color-accent) 30%, transparent), transparent 70%),
    linear-gradient(135deg, var(--oscuro), var(--oscuro-2));
  color: #f4f6fa;
  border-radius: var(--radio);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 10px 26px rgba(12, 17, 29, 0.22);
}
.entreno-continuar .ec-texto { flex: 1; min-width: 160px; }
.entreno-continuar .ec-texto strong { display: block; font-size: 0.92rem; font-weight: 900; }
.entreno-continuar .ec-texto p { font-size: 0.8rem; color: #c7cede; margin-top: 2px; }
.entreno-continuar .ec-botones { display: flex; gap: 8px; flex-wrap: wrap; }
.entreno-continuar .ec-continuar {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 900;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-oscuro));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--color-primary) 40%, transparent);
  transition: transform 0.12s ease;
}
.entreno-continuar .ec-continuar:hover { transform: translateY(-1px); }
.entreno-continuar .ec-descartar {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #cfd7e2;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.entreno-continuar .ec-descartar:hover { border-color: rgba(255, 255, 255, 0.45); color: #fff; }

/* frase motivacional del día en la intro del entreno */
.ent-frase-dia {
  color: var(--color-accent);
  font-size: 0.92rem;
  font-weight: 800;
  max-width: 340px;
  font-style: italic;
}

/* ─── F14: intro del entreno especial del Symbiotiq Studio ────────────── */
.ent-esp-intro { padding: 24px 0; }

.ent-esp-chip {
  font-size: 0.74rem;
  font-weight: 800;
  color: #c4b5fd;
  background: rgba(124, 58, 237, 0.22);
  border: 1px solid rgba(167, 139, 250, 0.4);
  border-radius: 999px;
  padding: 4px 12px;
}

.ent-esp-bonus {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fbbf24;
}

.ent-esp-spotify {
  width: min(360px, 100%);
  border-radius: 14px;
  overflow: hidden;
}

.ent-esp-lista {
  width: min(360px, 100%);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 12px 16px;
  max-height: 180px;
  overflow-y: auto;
  text-align: left;
}
.ent-esp-ej {
  color: #cfd7e2;
  font-size: 0.86rem;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ent-esp-ej:last-child { border-bottom: none; }

/* botón discreto "¿cómo se hace?" en serie/resultado */
.ent-tecnica-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #dfe6f0;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ent-tecnica-btn:hover { border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.14); }

/* hoja inferior de técnica (dentro del overlay) */
.ent-sheet {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.ent-sheet-fondo {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 12, 0.55);
  animation: ent-sheet-fondo-entra 0.2s ease;
}
@keyframes ent-sheet-fondo-entra { from { opacity: 0; } to { opacity: 1; } }
.ent-sheet-panel {
  position: relative;
  width: min(520px, 100%);
  margin-inline: auto;
  max-height: 78%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #171e26, #10151b);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.45);
  padding: 8px 20px calc(24px + env(safe-area-inset-bottom));
  animation: ent-sheet-sube 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes ent-sheet-sube {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.ent-sheet-cab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
}
.ent-sheet-cab::before {
  content: "";
  position: absolute;
  top: 2px; left: 50%;
  transform: translateX(-50%);
  width: 40px; height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}
.ent-sheet-picto {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: var(--color-primary);
}
.ent-sheet-picto svg { width: 100%; height: 100%; }
.ent-sheet-cab strong { flex: 1; min-width: 0; font-size: 1rem; font-weight: 900; color: #f4f6fa; }
.ent-sheet-cerrar {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #cfd7e2;
  font-size: 0.95rem;
  cursor: pointer;
}
.ent-sheet-cerrar:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.ent-sheet-cuerpo { overflow-y: auto; padding-top: 14px; }
.ent-sheet-cargando { color: #aeb8c6; font-size: 0.92rem; font-weight: 700; padding: 20px 0; text-align: center; }
.ent-sheet-texto { color: #dfe6f0; font-size: 0.92rem; line-height: 1.65; white-space: normal; }
.ent-sheet-texto.ent-sheet-error { color: #f3b0b0; }
.ent-sheet-texto strong { color: #fff; font-weight: 800; }

/* ─── Toast ───────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--oscuro);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
  animation: toast-entra 0.25s ease;
}
@keyframes toast-entra {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
