/* === Sistema de diseño del prototipo «Gym App» — copiado VERBATIM (s142). NO editar a mano salvo tokens. === */
/* Pantallas: inicio, rutinas, entreno en vivo, descanso, resumen, progreso, ajustes + rail 768/1600 */
/* ════════════════════════════════════════════════════════════
   GYM · estilos de pantallas (inicio, rutinas, vivo, resumen, progreso)
   ════════════════════════════════════════════════════════════ */

/* ── Inicio ─────────────────────────────────────────────────── */
.hero-streak {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 75%, #000));
  border-radius: var(--r-lg); padding: 20px 22px;
}
.hero-streak-bg { position: absolute; right: -10px; bottom: -30px; font-size: 150px; opacity: .18; line-height: 1; filter: saturate(.4); }

.today-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.today-badge {
  background: var(--surface-3); color: var(--text-2); font-size: 13px; font-weight: 500;
  padding: 6px 12px; border-radius: var(--r-pill);
}

.quick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-card {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 15px; color: var(--text); transition: all .15s var(--ease); min-height: 64px;
}
.quick-card:hover { background: var(--surface-2); }
.quick-card:active { transform: scale(.97); }
.quick-card > svg, .quick-card > span:first-child { color: var(--accent); flex-shrink: 0; }
.quick-repeat { border-color: var(--accent-soft); background: var(--accent-soft); }

.pr-pill { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; flex-shrink: 0; }

/* ── Cabecera de sección unificada + affordance de «tocable» (s177) ──────────── */
/* Da jerarquía clara a cada bloque de pantalla (sustituye al .eyebrow diminuto de
   bajo contraste) para que el usuario distinga dónde empieza y acaba cada sección. */
/* Separación por AIRE, no por texto: margen superior amplio sobre cada cabecera para
   que el espacio en blanco agrupe cada sección con su contenido (limpio, sin adornos). */
.gym-sec-block { display: flex; flex-direction: column; gap: 3px; margin-top: 18px; }
.gym-sec { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gym-sec-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 500; font-size: clamp(16px, 3.8vw, 18px);
  letter-spacing: .01em; line-height: 1.15; color: var(--text-2); margin: 0;
}
/* Marca de acento a la izquierda: separa secciones de un vistazo, sin texto.
   Fina y discreta para no recargar el contraste. */
.gym-sec-title::before {
  content: ""; flex-shrink: 0; width: 3px; height: 0.85em;
  border-radius: 2px; background: var(--accent); opacity: .7;
}
.gym-sec-hint { font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 52ch; }
/* Pill suave: el acento es color de RELLENO (lleva accent-ink/--text encima), nunca
   texto sobre el fondo — usarlo como texto falla AA en el tema claro «pista». Por eso
   fondo accent-soft + texto --text: contraste garantizado en los 3 temas y target ≥32px. */
.gym-sec-action {
  flex-shrink: 0; display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; font-weight: 600;
  color: var(--text); background: var(--accent-soft);
  padding: 7px 12px; min-height: 32px; border-radius: var(--r-pill);
  transition: background .15s, transform .12s var(--ease);
}
.gym-sec-action:hover { background: color-mix(in oklab, var(--accent) 24%, transparent); }
.gym-sec-action:active { transform: scale(.95); }

/* Foco visible por teclado en todos los elementos accionables del módulo (a11y) */
.routine-card:focus-visible,
.quick-card:focus-visible,
.gym-sec-action:focus-visible,
.icon-btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Affordance de fila navegable: chevron que indica «esto se abre» al pulsar.
   La fila debe reservar espacio a la derecha (padding-right) para no solapar el texto. */
.nav-row { position: relative; }
.nav-row::after {
  content: "›"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 22px; line-height: 1; color: var(--text-3); pointer-events: none;
  transition: transform .15s var(--ease), color .15s;
}
.nav-row:hover::after { color: var(--accent); transform: translateY(-50%) translateX(3px); }

/* ── Rutinas ────────────────────────────────────────────────── */
.routine-card {
  text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px 20px; transition: all .16s var(--ease);
  position: relative; overflow: hidden;
}
.routine-card:hover { background: var(--surface-2); }
.routine-card:active { transform: scale(.98); }
.routine-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.routine-meta { display: flex; gap: 14px; margin-top: 12px; }
.routine-meta-item { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-3); }

/* ════════════════════════════════════════════════════════════
   ENTRENO EN VIVO — la estrella
   ════════════════════════════════════════════════════════════ */
.live { height: 100%; display: flex; flex-direction: column; background: var(--bg); }
.live-top { padding: clamp(8px, 1.6dvh, 16px) 20px clamp(6px, 1dvh, 10px); }
.live-top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live-progress-track { height: 6px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-top: clamp(8px, 1.4dvh, 12px); }
.live-progress-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .5s var(--ease); }
.live-kcal-bar {
  margin-top: clamp(6px, 1dvh, 10px); padding: clamp(6px, .9dvh, 8px) 12px; border-radius: var(--r-md);
  background: var(--surface-2); font-size: clamp(11px, 1.5dvh, 12px); line-height: 1.4; color: var(--text-3);
}
/* #11 — HUD de volumen + series acumulados en tiempo real (cabecera live) */
.live-hud {
  margin-top: clamp(3px, .6dvh, 6px); font-family: var(--font-mono);
  font-size: clamp(11px, 1.4dvh, 12px); letter-spacing: .02em; color: var(--text-3);
}
.live-timer-wrap { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.live-play-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); }
.live-play-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.live-timer { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--text); min-width: 52px; text-align: center; }
.live-timer[data-paused="true"] { color: var(--text-3); }
.live-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.live-body { flex: 1; display: flex; flex-direction: column; padding: clamp(4px, 1dvh, 10px) 20px; overflow-y: auto; scrollbar-width: none; min-height: 0; }
.live-body::-webkit-scrollbar { display: none; }

.live-exname {
  font-family: var(--font-display); font-size: clamp(24px, min(7.5vw, 5dvh), 48px); line-height: .95; margin-top: clamp(2px, .6dvh, 6px);
  word-break: break-word; hyphens: auto;
}
.live-exmeta { display: flex; gap: 8px; margin-top: clamp(6px, 1.2dvh, 10px); flex-wrap: wrap; }

/* tarjeta objetivo grande */
.live-target {
  margin-top: clamp(10px, 2.2dvh, 20px); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: clamp(14px, 2.6dvh, 22px); flex-shrink: 0;
}
.live-pr-badge {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 8px 12px; border-radius: var(--r-pill); background: var(--surface-2);
  border: 1px solid var(--line); font-size: 13px; color: var(--text-2);
}
.live-set-dots { display: flex; gap: clamp(6px, 1.2dvh, 8px); justify-content: center; margin-bottom: clamp(8px, 1.8dvh, 18px); flex-wrap: wrap; }
.set-dot {
  width: clamp(32px, 4.6dvh, 38px); height: clamp(32px, 4.6dvh, 38px); border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  border: 2px solid var(--line-2); color: var(--text-3); transition: all .25s var(--ease-bounce);
}
.set-dot[data-state="done"] { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.set-dot[data-state="active"] { border-color: var(--accent); color: var(--accent); transform: scale(1.12); }
/* #11 extra (s183): una serie hecha es un botón (tocar = editar/deshacer) */
button.set-dot { cursor: pointer; }
button.set-dot:hover { filter: brightness(1.08); }
button.set-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.live-targets-row { display: flex; flex-direction: column; gap: clamp(10px, 2dvh, 18px); margin-top: clamp(4px, 1.2dvh, 12px); }
.live-target-box { flex: 1; min-width: 0; }
.live-target-box .eyebrow { text-align: center; margin-bottom: 8px; }

/* botón ENORME para registrar serie */
.tap-done {
  margin-top: clamp(10px, 2.2dvh, 18px); width: 100%; border-radius: var(--r-xl);
  background: var(--accent); color: var(--accent-ink);
  padding: clamp(14px, 3dvh, 26px); font-size: clamp(17px, 2.6dvh, 21px); font-weight: 700; letter-spacing: .01em;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  transition: transform .12s var(--ease), filter .2s;
  box-shadow: 0 14px 40px -14px var(--accent);
}
.tap-done:hover { filter: brightness(1.05); }
.tap-done:active { transform: scale(.97); }
.tap-done-sub { font-size: 13px; font-weight: 500; opacity: .7; margin-top: 2px; }

.live-foot { padding: clamp(8px, 1.4dvh, 12px) 20px calc(clamp(8px, 1.4dvh, 16px) + env(safe-area-inset-bottom)); display: flex; gap: 10px; }

/* motivación en vivo */
.live-cheer {
  display: flex; align-items: center; gap: 10px; background: var(--accent-soft);
  border: 1px solid var(--accent-soft); border-radius: var(--r-md); padding: clamp(8px, 1.2dvh, 12px) 16px;
  margin-top: clamp(8px, 1.4dvh, 14px); color: var(--text); font-weight: 500; font-size: clamp(12px, 1.7dvh, 14px);
  animation: pop .4s var(--ease-bounce);
}
.live-cheer .ic { color: var(--accent); flex-shrink: 0; }

.next-up { display: flex; align-items: center; gap: 12px; margin-top: clamp(8px, 1.6dvh, 18px); padding: clamp(8px, 1.2dvh, 12px) 16px; background: var(--surface-2); border-radius: var(--r-md); }
.next-up-num { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }

/* ── Descanso ───────────────────────────────────────────────── */
.rest-overlay {
  position: absolute; inset: 0; z-index: 50; background: var(--bg-grad);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px 24px 36px; animation: fadeUp .3s var(--ease);
  overflow-y: auto;
}
.rest-label {
  font-family: var(--font-mono); letter-spacing: .2em; text-transform: uppercase;
  font-size: 13px; color: var(--text-3); margin-bottom: 8px;
}
.rest-ring-wrap {
  position: relative; width: clamp(168px, 30dvh, 240px); height: clamp(168px, 30dvh, 240px); margin: 8px 0 10px; flex-shrink: 0;
}
.rest-ring-wrap svg { display: block; width: 100%; height: 100%; }
.rest-ring-wrap .rest-time {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-size: clamp(44px, 14vw, 56px); line-height: 1;
  margin: 0; pointer-events: none;
}
.rest-breathe {
  font-size: 15px; color: var(--text-3); letter-spacing: .04em; margin-bottom: 28px;
}
.rest-actions {
  display: flex; gap: 10px; align-items: stretch; width: 100%; max-width: 320px;
  justify-content: center;
}
.btn-rest-adjust {
  flex: 0 0 auto; min-width: 72px; padding: 13px 14px;
  border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text-2);
  font-family: var(--font-mono); font-size: 14px; font-weight: 500;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.btn-rest-adjust:hover { background: var(--surface-3); color: var(--text); }
.btn-rest-adjust:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-rest-skip {
  flex: 1; max-width: 168px; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; padding: 13px 18px;
  border-radius: var(--r-pill); border: none;
  background: var(--accent); color: var(--accent-ink, #111);
  font-size: 15px; font-weight: 600;
  transition: filter .15s var(--ease);
}
.btn-rest-skip:hover { filter: brightness(1.06); }
.btn-rest-skip:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.btn-rest-skip svg { flex-shrink: 0; }
.rest-done-summary {
  margin-top: 20px; text-align: center; max-width: 320px;
  font-size: 13px; font-weight: 600; color: var(--accent); line-height: 1.45;
}
.rest-next { margin-top: 32px; text-align: center; max-width: 320px; }
.rest-next-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 8px;
}
.rest-next-name {
  font-family: var(--font-display); font-size: clamp(24px, 7vw, 32px);
  letter-spacing: .04em; text-transform: uppercase; line-height: 1.05;
}
.rest-next-sub { font-weight: 600; font-size: 15px; color: var(--text); }
/* #12 — micro-recordatorio de técnica durante el descanso */
.rest-tip {
  margin-top: 22px; width: 100%; max-width: 320px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); padding: 12px 14px;
}
.rest-tip-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 6px;
}
.rest-tip-text {
  margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-2);
  white-space: pre-wrap; max-height: 22dvh; overflow-y: auto;
}

/* #11 — badge «mejoraste vs la última» (no récord) */
.rest-beat {
  margin-top: 18px; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--r-pill);
  background: var(--accent-soft); border: 1px solid var(--accent);
  color: var(--accent); font-size: 13px; font-weight: 600;
  animation: pop .4s var(--ease-bounce);
}

/* #11 — RPE por serie (un toque) durante el descanso */
.rest-feel { margin-top: 24px; width: 100%; max-width: 320px; text-align: center; }
.rest-feel-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 10px;
}
.rest-feel-chips { display: flex; gap: 8px; justify-content: center; }
.rest-feel-chip {
  flex: 1; min-width: 0; display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text-2);
  font-size: 12px; font-weight: 600; line-height: 1.2;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.rest-feel-chip > span:first-child { font-size: 18px; }
.rest-feel-chip:hover { background: var(--surface-3); color: var(--text); }
.rest-feel-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rest-feel-chip[aria-pressed="true"] {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent);
}

/* RF4 (#9) — aviso de semana suave (deload) en Inicio */
.gym-deload-note {
  border: 1px solid var(--line); border-left: 3px solid var(--info, #4a90d9);
  border-radius: 12px; background: var(--surface-2); padding: 14px 16px;
}
.gym-deload-note-title { font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.gym-deload-note-text { font-size: 13px; line-height: 1.5; color: var(--text-2); }

/* #9 — Check-in pre-entreno (toque rápido) */
.checkin-overlay {
  position: absolute; inset: 0; z-index: 55; background: var(--bg-grad);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto; animation: fadeUp .3s var(--ease);
}
.checkin-card { width: 100%; max-width: 360px; text-align: center; }
.checkin-eyebrow {
  font-family: var(--font-mono); letter-spacing: .2em; text-transform: uppercase;
  font-size: 12px; color: var(--text-3); margin-bottom: 8px;
}
.checkin-title { font-family: var(--font-display); font-size: clamp(26px, 8vw, 34px); line-height: 1.05; margin: 0 0 8px; }
.checkin-sub { font-size: 14px; color: var(--text-3); line-height: 1.5; margin: 0 0 24px; }
.checkin-faces { display: flex; gap: 10px; justify-content: center; margin-bottom: 18px; }
.checkin-face {
  flex: 1; max-width: 100px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface-2); color: var(--text-2);
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .1s var(--ease);
}
.checkin-face:hover { background: var(--surface-3); }
.checkin-face:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.checkin-face.is-selected { border-color: var(--accent); background: var(--surface-3); color: var(--text); }
.checkin-face-emoji { font-size: 30px; line-height: 1; }
.checkin-face-label { font-size: 12px; font-weight: 600; }
.checkin-chips { display: flex; gap: 8px; justify-content: center; margin-bottom: 24px; }
.checkin-chip {
  padding: 8px 16px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 500;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.checkin-chip:hover { background: var(--surface-3); }
.checkin-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.checkin-chip.is-on { border-color: var(--accent); background: var(--surface-3); color: var(--text); }
.checkin-actions { margin-top: 4px; }

/* Aviso efímero de intensidad del día (#9). Tarjeta propia, NO el toast-píldora:
   con 2 frases la píldora se volvía un óvalo enorme solapando kcal/Spotify/ejercicio. */
.intensity-cue {
  position: absolute; left: 50%; top: 70px; transform: translateX(-50%); z-index: 70;
  width: min(calc(100% - 28px), 420px); box-sizing: border-box;
  display: flex; flex-direction: column; gap: 3px;
  padding: 11px 16px; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: var(--shadow-pop); text-align: center;
  animation: intensity-cue-in .32s var(--ease-bounce);
}
.intensity-cue-head { font-weight: 700; font-size: 14px; line-height: 1.25; }
.intensity-cue-tip  { font-weight: 500; font-size: 12.5px; line-height: 1.3; }
.intensity-cue.is-leaving { animation: intensity-cue-out .28s var(--ease) forwards; }
@keyframes intensity-cue-in  { from { transform: translate(-50%, -14px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes intensity-cue-out { from { transform: translate(-50%, 0); opacity: 1; } to { transform: translate(-50%, -10px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .intensity-cue, .intensity-cue.is-leaving { animation: none; }
}

/* Pre-aviso últimos 3s: pulso sutil en el anillo de descanso */
@keyframes rest-arc-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .55; }
}
.rest-arc-ending { animation: rest-arc-pulse .6s ease-in-out infinite; }

/* ── Switch / Toggle de ajustes ──────────────────────────────── */
.gym-switch {
  position: relative; display: inline-flex; align-items: center;
  width: 48px; height: 28px; flex-shrink: 0;
  border-radius: var(--r-pill); border: none;
  background: var(--surface-3);
  transition: background .2s var(--ease);
  cursor: pointer;
}
.gym-switch::after {
  content: ''; position: absolute; left: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-2);
  transition: transform .2s var(--ease), background .2s var(--ease);
}
.gym-switch[aria-checked="true"] { background: var(--accent); }
.gym-switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--accent-ink, #111); }
.gym-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ════════════════════════════════════════════════════════════
   RESUMEN
   ════════════════════════════════════════════════════════════ */
.summary-hero { text-align: center; padding: 30px 24px 10px; }
.summary-medal { font-size: 64px; animation: pop .6s var(--ease-bounce); }
.summary-title { font-family: var(--font-display); font-size: 56px; line-height: .9; margin: 10px 0 6px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.stat-box .display { font-size: 42px; }
.stat-box.accent { background: var(--accent-soft); border-color: transparent; }
.achv-row { display: flex; align-items: center; gap: 13px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.achv-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--accent-soft); flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════
   PROGRESO
   ════════════════════════════════════════════════════════════ */
.seg { display: flex; gap: 4px; background: var(--surface-2); border-radius: var(--r-pill); padding: 4px; }
.seg-btn { flex: 1; padding: 10px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; color: var(--text-3); transition: all .15s; }
.seg-btn[data-on="true"] { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px -2px rgba(0,0,0,.3); }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 130px; }
.bar { flex: 1; background: var(--surface-3); border-radius: 5px 5px 2px 2px; transition: height .6s var(--ease); position: relative; min-height: 4px; }
.bar.hot { background: var(--accent); }

.cal-section { margin-top: 8px; }
.cal-section-label {
  font-size: 12px; color: var(--text-3); font-family: var(--font-mono);
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px;
}
.cal-grid { display: flex; flex-direction: column; gap: 5px; }
.cal-week { display: flex; gap: 5px; align-items: stretch; }
.cal-week-head { margin-bottom: 2px; }
.cal-dow {
  flex: 1; text-align: center; font-size: 11px; font-weight: 600;
  font-family: var(--font-mono); color: var(--text-3); letter-spacing: .04em;
  line-height: 1; padding: 2px 0 4px;
}
.cal-cell {
  flex: 1; aspect-ratio: 1; min-height: 32px; max-height: 44px;
  border-radius: 8px; background: var(--surface-2); border: 1px solid transparent;
  position: relative;
  transition: background .2s var(--ease);
}
.cal-day-num {
  position: absolute; top: 3px; left: 4px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  line-height: 1; color: var(--text-2);
  pointer-events: none;
}
.cal-cell[data-today="true"] .cal-day-num {
  color: var(--accent); font-weight: 700;
}
.cal-cell[data-on="true"] {
  background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 45%, transparent);
}
.cal-cell[data-on="true"] .cal-day-num { color: var(--accent); }
.cal-mark {
  position: absolute; left: 50%; top: 54%;
  transform: translate(-50%, -50%);
  font-size: 15px; line-height: 1;
  pointer-events: none;
  filter: saturate(1.1);
}
.cal-cell[data-on="true"] .cal-mark { opacity: .95; }
.cal-cell[data-future="true"][data-on="true"] .cal-mark { opacity: .55; }
.cal-cell[data-today="true"] {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.cal-cell[data-future="true"] {
  opacity: .28; background: var(--surface);
}
.cal-cell[data-future="true"][data-on="true"] { opacity: .45; }
/* Días de otro mes (aparecen en la primera/última semana del calendario) */
.cal-cell[data-outside="true"] { opacity: .25; }
.cal-cell[data-outside="true"][data-on="true"] { opacity: .40; }
.cal-legend {
  display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: 12px;
  font-size: 11px; color: var(--text-3);
}
.cal-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend-swatch {
  width: 14px; height: 14px; border-radius: 4px; background: var(--surface-2);
  border: 1px solid var(--line);
}
.cal-legend-swatch[data-kind="true"] {
  background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 45%, transparent);
}
.cal-legend-swatch[data-kind="today"] {
  background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--accent);
}

.hist-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.hist-day { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; }

/* ── Ajustes ────────────────────────────────────────────────── */
.set-section { margin-bottom: 22px; }
.set-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }

/* ════════════════════════════════════════════════════════════
   LAYOUT ANCHO — tablet, PC y TV (rail lateral).
   Móvil (<768px) se queda con la barra inferior, igual que estaba.
   Va aquí (último CSS) para ganar en la cascada a las reglas base.
   ════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  .app {
    max-width: 1120px;
    height: min(95dvh, 1000px);
    flex-direction: row;
    border-radius: 30px;
  }
  /* la barra inferior se convierte en rail lateral izquierdo */
  .bottomnav {
    order: -1;
    flex-direction: column;
    width: 250px; flex-shrink: 0;
    border-top: none; border-right: 1px solid var(--line);
    padding: 28px 18px 22px; gap: 5px;
    justify-content: flex-start;
    backdrop-filter: none;
    background: color-mix(in oklab, var(--bg) 55%, var(--surface));
  }
  /* rótulo de marca arriba del rail */
  .rail-brand {
    display: flex; flex-direction: column;
    padding: 2px 14px 16px; margin-bottom: 6px; border-bottom: 1px solid var(--line);
  }
  .rail-brand-name { font-size: 36px; }
  .rail-brand-tag {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
    text-transform: uppercase; color: var(--text-3); margin-top: 5px;
  }
  .navbtn {
    flex: 0 0 auto; flex-direction: row; justify-content: flex-start;
    gap: 14px; padding: 13px 16px; border-radius: var(--r-md);
    font-size: 15.5px; font-weight: 500; color: var(--text-2);
    transition: background .15s var(--ease), color .15s;
  }
  .navbtn svg { flex-shrink: 0; }
  .navbtn[data-on="true"] { background: var(--accent-soft); color: var(--text); }
  .navbtn:not([data-on="true"]):not(.nav-train):hover { background: var(--surface-2); color: var(--text); }
  /* "Entrenar": botón primario destacado */
  .nav-train {
    background: var(--accent); color: var(--accent-ink); font-weight: 600;
    margin: 6px 0; box-shadow: 0 10px 24px -12px var(--accent);
  }
  .nav-train:hover { filter: brightness(1.05); }
  .nav-train .fab {
    margin: 0; width: 30px; height: 30px; background: transparent;
    box-shadow: none; color: inherit;
  }
  /* "Ajustes" anclado abajo del rail */
  .nav-settings { display: flex; margin-top: auto; }

  /* contenido legible y centrado en el área principal */
  .screen { padding-top: 8px; }
  .screen > .topbar,
  .screen > .pad-x,
  .summary-hero,
  .summary-hero ~ .pad-x { max-width: 760px; margin-inline: auto; width: 100%; }
  /* en PC el saludo prescinde del engranaje del header (ya está en el rail) */
  .topbar > .icon-btn { display: none; }
  /* entreno en vivo: columna enfocada y centrada */
  .live-top, .live-body, .live-foot { max-width: 620px; margin-inline: auto; width: 100%; }
  /* con ancho de sobra, reps y kg caben lado a lado */
  .live-targets-row { flex-direction: row; gap: 14px; }
  /* onboarding centrado */
  .ob { max-width: 600px; margin-inline: auto; }
}

/* ── TV / pantallas muy grandes: lean-back, todo a mayor escala ── */
@media (min-width: 1600px) {
  .app { max-width: 1500px; height: min(92dvh, 1300px); }
  .bottomnav { width: 340px; padding: 44px 26px 30px; }
  .rail-brand-name { font-size: 44px; }
  .rail-brand-tag { font-size: 12px; }
  .navbtn { font-size: 21px; padding: 18px 22px; gap: 18px; }
  .navbtn svg { width: 30px; height: 30px; }
  .nav-train .fab { width: 38px; height: 38px; }
  .screen > .topbar, .screen > .pad-x,
  .summary-hero, .summary-hero ~ .pad-x { max-width: 1000px; }
  .live-top, .live-body, .live-foot { max-width: 820px; }
}

/* ── Música por rutina (multi-proveedor: Spotify / YouTube) ─────────────── */
.gym-music {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md, 12px);
  overflow: hidden;
  margin: 6px 0 2px;
}
.gym-music-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  text-align: left;
  transition: background .15s ease;
}
.gym-music-head:hover { background: var(--surface-3, rgba(255, 255, 255, .05)); }
.gym-music-head:focus-visible { outline: 2px solid var(--accent, #1db954); outline-offset: -2px; }
.gym-music-ico { display: inline-flex; flex: none; width: 24px; height: 24px; align-items: center; justify-content: center; }
.gym-music-ico svg { display: block; width: 24px; height: 24px; }
.gym-music-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gym-music-chev { flex: none; width: 18px; height: 18px; color: var(--text-3); transition: transform .2s ease; }
.gym-music[data-open="true"] .gym-music-chev { transform: rotate(180deg); }
.gym-music-body { padding: 0 12px 12px; }
.gym-music-body iframe { display: block; width: 100%; border: 0; border-radius: 12px; }

/* ── Programas con calendario (#4, alcance B, s182; rediseño «premium sobrio» s183) ──
   a11y: todo color de texto sobre accent/accent-soft usa --text/--text-2/--accent-ink
   (nunca --accent como texto) → AA garantizado en los 3 temas × 5 acentos (patrón s177). */

/* Bloque del programa activo: héroe con barra de progreso */
.prog-active {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--accent-soft), transparent 62%), var(--surface);
}
.prog-active-name {
  font-family: var(--font-display); font-weight: 600; letter-spacing: .01em;
  font-size: 20px; line-height: 1.05; margin: 2px 0 12px; word-break: break-word;
}
/* Tarjeta «Tu programa» en Inicio: misma barra de progreso, marco de acento */
.prog-home { background: var(--accent-soft); border: 1px solid var(--accent); }

/* Barra de progreso (días hechos / total) — reutilizada en Programas e Inicio */
.prog-bar {
  position: relative; height: 8px; border-radius: var(--r-pill);
  background: var(--surface-3); overflow: hidden; margin: 0 0 7px;
}
.prog-bar-fill {
  position: absolute; inset: 0 auto 0 0; height: 100%;
  border-radius: var(--r-pill); background: var(--accent);
  transition: width .5s var(--ease);
}
.prog-bar-meta {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--text-3); margin-bottom: 14px;
}
.prog-bar-meta strong { color: var(--text-2); font-weight: 600; }

/* «Hoy toca» dentro del bloque activo */
.prog-today {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
}
.prog-today-label { min-width: 0; }
.prog-today .btn { flex: none; }

/* ── Tarjeta de catálogo: medallón + chips + stat-pills ──────── */
.program-card { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; position: relative; }
.prog-medallion {
  flex: none; width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-display); font-size: 22px; font-weight: 600;
}
.prog-card-body { flex: 1; min-width: 0; }
.prog-card-name { font-weight: 600; font-size: 16px; line-height: 1.2; }
/* text-2 (no -3): info útil a 13px → AA ≥4.5:1 en los 3 temas (la barra alta del proyecto) */
.prog-card-desc { color: var(--text-2); font-size: 13px; margin-top: 3px; line-height: 1.4; }
.prog-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.prog-chip {
  font-size: 11.5px; font-weight: 600; padding: 4px 10px;
  border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-2);
}
.prog-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.prog-stat { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.prog-stat svg { flex: none; width: 15px; height: 15px; }
.prog-badge {
  position: absolute; top: 14px; right: 14px; flex: none;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-ink);
}

/* ── Calendario como timeline (línea de tiempo vertical) ─────── */
.prog-week { list-style: none; margin: 0 0 8px; padding: 0; }
.prog-day { display: flex; align-items: center; gap: 14px; padding: 10px 0; position: relative; }
/* Línea que une los nodos; se recorta en el primer/último día */
.prog-day::before {
  content: ""; position: absolute; left: 15px; top: 0; bottom: 0;
  width: 2px; background: var(--line); pointer-events: none;
}
.prog-day:first-child::before { top: 50%; }
.prog-day:last-child::before { bottom: 50%; }
/* Nodo: círculo numerado (o check cuando está hecho) */
.prog-node {
  flex: none; width: 32px; height: 32px; border-radius: 50%; position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  background: var(--surface); border: 2px solid var(--line); color: var(--text-2);
}
.prog-day[data-status="done"] .prog-node { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.prog-day[data-status="next"] .prog-node { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 4px var(--accent-soft); }
.prog-day-main { flex: 1; min-width: 0; }
.prog-day-label { font-weight: 500; font-size: 14px; }
.prog-day-sub { color: var(--text-2); font-size: 12px; }
.prog-day-status { flex: none; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
/* "Hoy" como píldora accent-soft con texto --text (AA en 3 temas, patrón s177) */
.prog-day-status[data-kind="next"] {
  color: var(--text); background: var(--accent-soft);
  padding: 3px 10px; border-radius: var(--r-pill);
}

@media (prefers-reduced-motion: reduce) { .prog-bar-fill { transition: none; } }

/* ── Plate calculator (#11 extra, s183) ──────────────────────────── */
.plate-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: max-content; margin: 10px auto 0; padding: 6px 13px; min-height: 34px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill);
  transition: background .15s var(--ease), transform .12s var(--ease);
}
.plate-btn svg { flex: none; }
.plate-btn:hover { background: var(--surface-3); }
.plate-btn:active { transform: scale(.96); }
.plate-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Sheet de discos */
.plate-headline { text-align: center; margin: 2px 0 8px; }
.plate-target { font-family: var(--font-display); font-weight: 600; font-size: 32px; line-height: 1; }
.plate-barsub { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.plate-explain { font-size: 12.5px; color: var(--text-2); line-height: 1.5; text-align: center; margin: 0 0 6px; }
/* Dibujo de la barra con discos */
.plate-svg { display: block; width: 100%; height: auto; margin: 4px 0 2px; }
.plate-bar-rect { fill: var(--text-3); }
.plate-collar { fill: var(--text-2); }
.plate-sumline { text-align: center; font-size: 15px; font-weight: 600; color: var(--text); margin-top: 2px; }
.plate-note { font-size: 13px; color: var(--text-2); line-height: 1.5; margin: 12px 0 0; text-align: center; }
.plate-barpick { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.plate-barpick-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-3); margin-right: 4px;
}
.plate-barpick .chip { min-height: 40px; padding: 8px 14px; cursor: pointer; }

/* ── Tu objetivo (#1 salud, s183) ─────────────────────────────────── */
.goal-banner {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 14px 16px; margin-bottom: 14px; transition: background .15s var(--ease), transform .12s var(--ease);
}
.goal-banner:hover { background: var(--surface-2); }
.goal-banner:active { transform: scale(.99); }
.goal-banner:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.goal-banner-empty { background: var(--accent-soft); border-color: var(--accent); }
.goal-banner-title { font-weight: 600; font-size: 16px; margin-top: 2px; }
.goal-banner-sub { font-size: 12.5px; color: var(--text-2); line-height: 1.45; margin-top: 3px; }
/* Sobre accent-soft, --text-2 cae bajo AA en temas oscuros → usar --text (patrón s177) */
.goal-banner-empty .goal-banner-sub { color: var(--text); }
/* Opciones del sheet de objetivo */
.goal-opt {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 13px 14px; margin-bottom: 8px; transition: background .15s var(--ease), border-color .15s;
}
.goal-opt:hover { background: var(--surface-3); }
.goal-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.goal-opt[data-on="true"] { border-color: var(--accent); background: var(--accent-soft); }
.goal-opt-emoji { flex: none; font-size: 24px; line-height: 1.1; }
.goal-opt-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.goal-opt-label { font-weight: 600; font-size: 15px; color: var(--text); }
.goal-opt-sub { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
/* Seleccionada (fondo accent-soft): subir el sub a --text para AA en temas oscuros */
.goal-opt[data-on="true"] .goal-opt-sub { color: var(--text); }

/* ── Movimiento de hoy / pasos (#3 salud, s183) ───────────────────── */
.steps-card { margin-bottom: 14px; }
.steps-big { font-family: var(--font-display); font-weight: 600; font-size: clamp(24px, 6vw, 30px); margin-top: 2px; }
.steps-sub { font-size: 12.5px; color: var(--text-2); margin-top: 8px; line-height: 1.45; }

/* (Indicador «sin conexión» de s186 retirado en el paso a offline-first real:
   la app funciona igual con o sin red → no hay un «modo» que anunciar.) */

/* ── Plan / diagnóstico de estado de forma (s197, Fase 1) ─────────────────────
   Estado por TEXTO + color (a11y: el color es refuerzo, nunca la única señal). El
   color de estado vive en el borde-izquierdo de la tarjeta y en un punto del badge;
   el texto del badge va en --text-2 (AA en los 3 temas). */
.coach-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.coach-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  padding: 4px 10px; border-radius: 999px; background: var(--surface-2);
}
.coach-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.coach-chip--good::before    { background: var(--good); }
.coach-chip--watch::before   { background: var(--warn); }
.coach-chip--improve::before { background: var(--bad); }

.coach-card { border-left: 3px solid var(--line-2); }
.coach-card--good    { border-left-color: var(--good); }
.coach-card--watch   { border-left-color: var(--warn); }
.coach-card--improve { border-left-color: var(--bad); }
.coach-card--info    { border-left-color: var(--line-2); }
.coach-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.coach-card-title { font-weight: 600; font-size: 15px; color: var(--text); }
.coach-card-value { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 2px; }
.coach-badge {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  font-size: 11px; font-weight: 600; color: var(--text-2); white-space: nowrap;
}
.coach-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.coach-badge--good::before    { background: var(--good); }
.coach-badge--watch::before   { background: var(--warn); }
.coach-badge--improve::before { background: var(--bad); }

/* Objetivos (Fase 2): barra de progreso por estado. El color es refuerzo del texto
   "current/target" + aria-valuetext (a11y: nunca solo color). */
.coach-obj-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.coach-obj-count { font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; font-family: var(--font-mono, monospace); }
.coach-obj-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.coach-obj-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width .35s ease; }
.coach-card--good .coach-obj-fill    { background: var(--good); }
.coach-card--watch .coach-obj-fill   { background: var(--warn); }
.coach-card--improve .coach-obj-fill { background: var(--bad); }
.coach-obj-action { margin-top: 12px; }
