/* OkiroSport — Secciones específicas */

/* ════════════════════════════════════════════════════════════════ */
/* SECCIONES BASE                                                   */
/* ════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════ */
/* COMPONENTES DE TARJETA (compartidos por todas las secciones)    */
/* ════════════════════════════════════════════════════════════════ */

.ct {
  font-family:    var(--font-sans);
  font-size:      10px;
  color:          var(--text-3);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom:  10px;
}

.tr {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         9px 0;
  box-shadow:       inset 0 -0.5px 0 rgba(255,255,255,0.08);
}

.tr:last-child { border-bottom: none; }

.tl {
  font-family: var(--font-sans);
  font-size:   12px;
  color:       var(--text-2);
}

/* Input grande para valores numéricos (sueño) */
.mi {
  background:  none;
  border:      none;
  color:       var(--text-2);
  font-family: var(--font-sans);
  font-size:   28px;
  width:       100%;
  outline:     none;
}

/* ════════════════════════════════════════════════════════════════ */
/* HOY — Dashboard y registro diario                               */
/* ════════════════════════════════════════════════════════════════ */

/* Aquí vivía .dashboard-grid con sus .dash-card: el panel de tarjetas
   que sustituyeron las .hoy-check-card. Ninguna de sus nueve reglas se
   usaba ya en la app. */

/* ── DATE NAVIGATOR ─────────────────────────────────────────────── */
.date-nav {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         10px 14px;
  margin-bottom:   12px;
}

.date-nav-btn {
  background:      rgba(255, 255, 255, 0.06);
  border:          none;
  color:           var(--text-3);
  font-size:       12px;
  width:           34px;
  height:          34px;
  border-radius:   50%;
  display:         flex;
  align-items:     center;
  justify-content: center;
  cursor:          pointer;
  flex-shrink:     0;
  transition:      all 0.2s ease;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 0 0 0.5px rgba(255,255,255,0.1);
}

.date-nav-btn:hover,
.date-nav-btn:active {
  background: rgba(139, 77, 255, 0.12);
  color:      var(--brand);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    inset 0 0 0 0.5px rgba(139, 77, 255, 0.45),
    0 0 12px rgba(139, 77, 255, 0.2);
}

.date-nav-btn:active { transform: scale(0.92); }

.date-nav-center {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            3px;
}

.date-nav-label {
  font-family:    var(--font-mono);
  font-size:      13px;
  color:          var(--text-1);
  font-weight:    600;
  letter-spacing: 1px;
}

.date-nav-badge {
  font-family:    var(--font-sans);
  font-size:      9px;
  color:          var(--text-4);
  text-transform: uppercase;
  letter-spacing: 2.5px;
}

.date-nav-badge.today { color: var(--brand); }

/* ── TASK DOTS ───────────────────────────────────────────────────── */
.task-dots {
  display:         flex;
  gap:             10px;
  justify-content: center;
  margin:          0 0 12px;
}

.task-dot {
  width:         40px;
  height:        40px;
  border-radius: 50%;
  background:    rgba(255, 255, 255, 0.04);
  border:        none;
  cursor:        pointer;
  position:      relative;
  overflow:      hidden;
  transition:    all 0.2s ease;
  flex-shrink:   0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    inset 0 0 0 0.5px rgba(255,255,255,0.1);
}

.task-dot::after {
  content:       '';
  position:      absolute;
  inset:         7px;
  border-radius: 50%;
  background:    rgba(255, 255, 255, 0.07);
  transition:    all 0.2s ease;
}

.task-dot.active {
  background: rgba(139, 77, 255, 0.12);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.3),
    inset 0 0 0 1px rgba(139, 77, 255, 0.5),
    0 0 14px rgba(139, 77, 255, 0.25);
}

.task-dot.active::after {
  background: linear-gradient(180deg, #A87BFF 0%, #6425D0 100%);
  box-shadow: 0 0 8px rgba(139, 77, 255, 0.7);
}

.task-dot:active { transform: scale(0.9); }

/* Task counter */
.td-bar {
  height:        8px;
  background:    rgba(0,0,0,0.4);
  border-radius: 4px;
  overflow:      hidden;
  box-shadow:    inset 0 2px 4px rgba(0,0,0,0.6), inset 0 -1px 0 rgba(255,255,255,0.05);
  position:      relative;
  margin:        8px 0;
}

.td-fill,
#td-fill {
  height:        100%;
  background:    linear-gradient(90deg, var(--brand) 0%, var(--success) 100%);
  border-radius: 4px;
  box-shadow:
    0 0 12px rgba(139, 77, 255,0.5),
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -1px 0 rgba(0,0,0,0.2);
  position:      relative;
  transition:    width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.td-fill::after,
#td-fill::after {
  content:       '';
  position:      absolute;
  top: 0; left: 0; right: 0;
  height:        50%;
  background:    linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
  border-radius: 4px 4px 0 0;
  pointer-events: none;
}

.td-btn {
  width:           36px;
  height:          36px;
  background:      var(--surface-2);
  box-shadow:      inset 0 0 0 0.5px rgba(255,255,255,0.08);
  color:           var(--text-2);
  font-size:       18px;
  cursor:          pointer;
  display:         flex;
  align-items:     center;
  justify-content: center;
  transition:      all 80ms;
}

.td-btn:active {
  transform:  scale(0.9);
  background: var(--brand);
  color:      #000;
}

#td {
  font-family: var(--font-sans);
  font-size:   24px;
  color:       var(--brand);
  min-width:   32px;
  text-align:  center;
}

#td-num {
  font-family: var(--font-sans);
  font-size:   11px;
  color:       var(--text-3);
}

/* ════════════════════════════════════════════════════════════════ */
/* HOY — Dashboard de solo lectura (nuevo)                         */
/* ════════════════════════════════════════════════════════════════ */

/* Anillo SVG de energía */
.hoy-energy-ring {
  display:         flex;
  justify-content: center;
  align-items:     center;
  padding:         4px 0 8px;
  margin-bottom:   10px;
}

.ring-wrap {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            6px;
}

.ring-label {
  font-family:    var(--font-sans);
  font-size:      10px;
  letter-spacing: 3px;
  font-weight:    700;
}

/* Checklist de 4 cards */
.hoy-checklist {
  display:        flex;
  flex-direction: column;
  gap:            8px;
  margin-bottom:  12px;
}

.hoy-check-card {
  background:    var(--surface-1);
  box-shadow:    inset 0 0 0 0.5px rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding:       11px 14px;
  display:       flex;
  align-items:   center;
  gap:           12px;
  transition:    box-shadow 0.25s ease, background 0.25s ease;
}

/* ── OBJETIVOS DE LA MISIÓN (modal) ────────────────────────────── */
.mm-objetivos { list-style: none; margin: 0 0 10px; padding: 0; text-align: left; }

.mm-obj {
  display:     flex;
  align-items: center;
  gap:         9px;
  padding:     6px 0;
}

.mm-obj-box {
  flex-shrink:   0;
  width:         18px;
  height:        18px;
  border-radius: 5px;
  border:        1px solid rgba(255, 255, 255, 0.22);
  color:         var(--brand-soft);
  font-size:     11px;
  display:         flex;
  align-items:     center;
  justify-content: center;
}

.mm-obj-txt { font-family: var(--font-sans); font-size: 12px; color: var(--text-2); }

.mm-obj-ok .mm-obj-box { background: var(--brand); border-color: var(--brand); color: #fff; }
.mm-obj-ok .mm-obj-txt { color: var(--text-4); text-decoration: line-through; }

.mm-nota {
  font-family: var(--font-sans);
  font-size:   10px;
  color:       var(--text-4);
  margin:      6px 0 0;
}

/* La tarjeta de Inglés es un enlace a tutoringles: mismo aspecto que las
   demás, pero sin el subrayado ni el color de enlace del navegador. */
a.hoy-check-card {
  text-decoration: none;
  color:           inherit;
  cursor:          pointer;
}

a.hoy-check-card:hover {
  box-shadow: inset 0 0 0 0.5px rgba(139, 77, 255, 0.45);
}

.hoy-card-icon {
  font-size:   18px;
  flex-shrink: 0;
  width:       26px;
  text-align:  center;
}

.hoy-card-body {
  flex:      1;
  min-width: 0;
}

.hoy-card-title {
  font-family:   var(--font-sans);
  font-size:     12px;
  font-weight:   600;
  color:         var(--text-2);
  margin-bottom: 1px;
}

.hoy-card-sub {
  font-family:   var(--font-sans);
  font-size:     10px;
  color:         var(--text-3);
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
}

.hoy-card-status {
  font-family: var(--font-mono);
  font-size:   13px;
  color:       var(--text-3);
  flex-shrink: 0;
  min-width:   28px;
  text-align:  right;
  font-weight: 700;
}

/* Estado: completado */
.hoy-check-card.done {
  box-shadow: inset 0 0 0 0.5px rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.04);
}

.hoy-check-card.done .hoy-card-status { color: var(--success); }
.hoy-check-card.done .hoy-card-title  { color: var(--success); }

/* Estado: incompleto / aviso */
.hoy-check-card.warning {
  box-shadow: inset 0 0 0 0.5px rgba(251, 191, 36, 0.3);
}

.hoy-check-card.warning .hoy-card-status { color: var(--warning); }

/* Estado: crítico */
.hoy-check-card.danger {
  box-shadow: inset 0 0 0 0.5px rgba(248, 113, 113, 0.3);
}

.hoy-check-card.danger .hoy-card-status { color: var(--danger); }

/* Mini barra de nutrición dentro de la card */
.hoy-nutri-bar {
  height:        3px;
  background:    rgba(255,255,255,0.06);
  border-radius: 2px;
  margin-top:    5px;
  overflow:      hidden;
}

.hoy-nutri-fill {
  height:        100%;
  background:    linear-gradient(90deg, var(--brand) 0%, var(--success) 100%);
  border-radius: 2px;
  box-shadow:    0 0 6px rgba(139, 77, 255, 0.4);
  transition:    width 0.6s ease;
}

/* Línea de XP / nivel */
.hoy-streak-bar {
  display:       flex;
  align-items:   center;
  gap:           10px;
  padding:       9px 14px;
  margin-bottom: 12px;
  background:    var(--surface-1);
  box-shadow:    inset 0 0 0 0.5px rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  font-family:   var(--font-sans);
  font-size:     11px;
  color:         var(--text-3);
}

.hoy-streak-fire { font-size: 14px; }

.hoy-streak-xp {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size:   10px;
  color:       var(--brand);
}

/* Textarea de nota */
.hoy-nota-wrap { margin-bottom: 16px; }

.hoy-nota {
  width:       100%;
  min-height:  68px;
  background:  none;
  border:      none;
  color:       var(--text-2);
  font-family: var(--font-sans);
  font-size:   13px;
  line-height: 1.65;
  resize:      vertical;
  outline:     none;
  padding:     0;
  box-sizing:  border-box;
}

.hoy-nota::placeholder { color: var(--text-4); }

/* Estado de carga */
.hoy-loading {
  font-family:    var(--font-sans);
  font-size:      11px;
  color:          var(--text-4);
  text-align:     center;
  padding:        28px 0;
  letter-spacing: 1px;
  animation:      pulse 1.5s infinite;
}

/* ════════════════════════════════════════════════════════════════ */
/* GYM                                                             */
/* ════════════════════════════════════════════════════════════════ */

.rc {
  background:  var(--surface-1);
  box-shadow:  inset 0 0 0 0.5px rgba(255,255,255,0.08);
  padding:     16px;
  margin-bottom: 10px;
  cursor:      pointer;
  transition:  box-shadow var(--transition);
}

.rc:hover,
.rc:active { box-shadow: inset 0 0 0 0.5px var(--brand); }

/* La que toca hoy según los días de la rutina */
.rc-hoy { box-shadow: inset 0 0 0 1px var(--brand); }
.rc-hoy .rn { color: var(--text-1); }
.rc-hoy-tag {
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(139,77,255,0.18);
  color: var(--brand);
  font-family: var(--font-sans);
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  vertical-align: 2px;
}

.rn {
  font-family:   var(--font-sans);
  font-size:     16px;
  font-weight:   600;
  color:         var(--text-2);
  margin-bottom: 4px;
}

.rd {
  font-family: var(--font-sans);
  font-size:   11px;
  color:       var(--text-3);
}

/* Ejercicio card */
.ec {
  background:    var(--surface-1);
  box-shadow:      inset 0 0 0 0.5px rgba(255,255,255,0.08);
  padding:       14px;
  margin-bottom: 10px;
}

.en {
  font-family:   var(--font-sans);
  font-size:     15px;
  font-weight:   600;
  color:         var(--text-2);
  margin-bottom: 8px;
}

.er2 {
  font-family:   var(--font-sans);
  font-size:     11px;
  color:         var(--text-3);
  margin-bottom: 10px;
}

/* ── Series de un toque ──────────────────────────────────────────
   La fila sale ya escrita: el check la da por hecha sin abrir nada y los
   números abren el ajuste. Los dos blancos pasan de 44 px, que es el mínimo
   para acertar con el pulgar de pie y con las manos sudadas. */
.sp-fila {
  display: grid;
  grid-template-columns: 22px 1fr 48px;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
  box-shadow: inset 0 -0.5px 0 rgba(255,255,255,0.06);
}

.sp-num {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-4);
}

.sp-vals {
  display: flex; align-items: baseline; gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  background: none; border: none;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: var(--font-sans);
  cursor: pointer; text-align: left;
}
.sp-vals:active { background: rgba(255,255,255,0.05); }
.sp-peso  { font-size: 16px; font-weight: 600; }
.sp-vacio { color: var(--text-4); font-weight: 400; }
.sp-x     { font-size: 11px; color: var(--text-4); }
.sp-reps  { font-size: 14px; color: var(--text-3); }

.sp-chk {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  padding: 0;
  background: rgba(255,255,255,0.03);
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.10);
  color: var(--text-4);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.sp-chk svg { width: 18px; height: 18px; }
.sp-chk:active { transform: scale(0.94); }

.sp-fila.done .sp-chk   { background: var(--success); color: #04150E; box-shadow: none; }
.sp-fila.done .sp-peso  { color: var(--success); }
.sp-fila.done .sp-reps  { color: var(--success); opacity: 0.75; }

.sp-pie { display: flex; justify-content: flex-end; margin-top: 8px; }

/* Ajuste sin teclado: ± para el día que cambia el peso */
.sp-edit {
  margin-top: 10px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 0.5px rgba(139,77,255,0.35);
}
.sp-edit-tit {
  font-family: var(--font-sans);
  font-size: 9px; letter-spacing: 1.5px;
  color: var(--brand);
  margin-bottom: 8px;
}
.sp-paso {
  display: grid;
  grid-template-columns: 46px 1fr 34px 46px;
  gap: 8px; align-items: center;
  margin-bottom: 8px;
}
.sp-paso button {
  height: 44px;
  background: rgba(255,255,255,0.05);
  border: none; border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 20px; line-height: 1;
  cursor: pointer;
}
.sp-paso button:active { background: rgba(139,77,255,0.25); }
.sp-paso input {
  height: 44px;
  background: var(--surface-1);
  border: none; border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.10);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 18px; font-weight: 600;
  text-align: center;
  outline: none;
}
.sp-paso input:focus { box-shadow: inset 0 0 0 1px var(--brand); }
/* Las flechitas del navegador estorban al lado de unos ± de 44 px */
.sp-paso input::-webkit-outer-spin-button,
.sp-paso input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sp-paso input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.sp-un {
  font-family: var(--font-sans);
  font-size: 11px; color: var(--text-4);
}
.sp-ok {
  width: 100%; height: 44px;
  background: var(--brand);
  border: none; border-radius: var(--radius-sm);
  color: #000;
  font-family: var(--font-sans);
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px;
  cursor: pointer;
}

/* Progreso de la sesión */
.ses-prog { margin: 0 0 14px; }
.ses-prog-txt {
  font-family: var(--font-sans);
  font-size: 11px; color: var(--text-3);
  margin-bottom: 6px;
}
.ses-prog-txt strong { color: var(--text-1); font-size: 13px; }
.ses-prog-bar {
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.ses-prog-fill {
  height: 100%;
  background: var(--brand);
  border-radius: var(--radius-pill);
  transition: width 320ms cubic-bezier(0.16,1,0.3,1);
}

/* Descanso: aparece al marcar y se va solo */
.desc-barra {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  z-index: 2500;
  max-width: 536px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px; align-items: center;
  padding: 10px 12px;
  background: rgba(18, 11, 30, 0.94);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 0.5px rgba(139,77,255,0.35), 0 10px 30px rgba(0,0,0,0.5);
  animation: subirHoja 200ms cubic-bezier(0.16,1,0.3,1);
}
.desc-txt { text-align: center; line-height: 1.1; }
#desc-num {
  font-family: var(--font-sans);
  font-size: 20px; font-weight: 700;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}
.desc-lbl {
  display: block;
  font-family: var(--font-sans);
  font-size: 8px; letter-spacing: 1.5px;
  color: var(--text-4);
}
.desc-barra button {
  height: 38px; padding: 0 12px;
  background: rgba(255,255,255,0.06);
  border: none; border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 11px; letter-spacing: 0.5px;
  cursor: pointer;
}
.desc-barra button:active { background: rgba(139,77,255,0.25); }

.add-set-btn {
  padding:     8px 12px;
  background:  none;
  box-shadow:  inset 0 0 0 0.5px rgba(255,255,255,0.08);
  color:       var(--text-3);
  font-family: var(--font-sans);
  font-size:   11px;
  cursor:      pointer;
  white-space: nowrap;
}

.add-set-btn { border-radius: var(--radius-sm); min-height: 38px; }

/* Sesión completada */
.gym-done-card {
  background:              rgba(52, 211, 153, 0.08);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter:         blur(40px) saturate(180%);
  border-radius:           var(--radius-lg);
  padding:                 32px 16px;
  text-align:              center;
  margin-top:              16px;
  position:                relative;
  overflow:                hidden;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1.5px 0 rgba(0, 0, 0, 0.4),
    0 0 0 0.5px rgba(52, 211, 153, 0.5),
    0 0 24px rgba(52, 211, 153, 0.25),
    0 16px 40px rgba(0, 0, 0, 0.6);
}

.dungeon-cleared {
  font-family:    var(--font-sans);
  font-size:      28px;
  font-weight:    700;
  letter-spacing: 6px;
  color:          var(--success);
  animation:      pulse 2s infinite;
}

/* ════════════════════════════════════════════════════════════════ */
/* NUTRICIÓN                                                       */
/* ════════════════════════════════════════════════════════════════ */

/* Header de calorías */
.kcal-big {
  font-family:  var(--font-sans);
  font-size:    36px;
  color:        var(--brand);
  line-height:  1;
}

.kcal-label {
  font-family:    var(--font-sans);
  font-size:      9px;
  color:          var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top:     2px;
}

/* Grid de macros */
.macro-grid {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   10px;
  margin-bottom:         16px;
}

.macro-card {
  background:     var(--surface-1);
  border-left:    3px solid;
  padding:        12px;
  display:        flex;
  flex-direction: column;
  gap:            4px;
}

.macro-card.prot { border-color: var(--brand); }
.macro-card.carb { border-color: var(--warning); }
.macro-card.fat  { border-color: var(--warning); }
.macro-card.kcal { border-color: var(--success); }

.macro-num {
  font-family: var(--font-sans);
  font-size:   22px;
  color:       inherit;
  line-height: 1;
}

/* Reutiliza .macro-label desde components.css pero lo redefine para macros */
.macro-label {
  display:         flex;
  justify-content: space-between;
  font-family:     var(--font-sans);
  font-size:       10px;
  color:           var(--text-3);
  text-transform:  uppercase;
  margin-bottom:   4px;
}

/* Barras de macros */
.macro-bar-wrap { margin-bottom: 10px; }

.macro-bar-label {
  display:         flex;
  justify-content: space-between;
  font-family:     var(--font-sans);
  font-size:       10px;
  color:           var(--text-3);
  margin-bottom:   4px;
}

.macro-bar {
  height:     6px;
  background: var(--surface-2);
  overflow:   hidden;
}

.macro-fill {
  height:     100%;
  transition: width 0.5s ease;
}

.macro-fill.prot { background: var(--brand); }
.macro-fill.carb { background: var(--warning); }
.macro-fill.fat  { background: var(--warning); }

/* Tarjetas de comida */
.meal-card {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  padding:         10px 14px;
  box-shadow:       inset 0 -0.5px 0 rgba(255,255,255,0.08);
}

.meal-name {
  font-family:  var(--font-sans);
  font-size:    14px;
  font-weight:  500;
  color:        var(--text-2);
}

.meal-macros {
  font-family: var(--font-sans);
  font-size:   10px;
  color:       var(--text-3);
  text-align:  right;
}

/* Formulario de nueva comida */
.add-meal-form {
  background:    var(--surface-1);
  box-shadow:      inset 0 0 0 0.5px rgba(255,255,255,0.08);
  padding:       14px;
  margin-bottom: 10px;
  display:       none;
}

.add-meal-form.open { display: block; }

.form-row {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   8px;
  margin-bottom:         8px;
}

.form-field {
  display:        flex;
  flex-direction: column;
  gap:            4px;
}

.form-field label {
  font-family:    var(--font-sans);
  font-size:      9px;
  color:          var(--text-4);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* Photo button */
.photo-btn {
  width:          100%;
  height:         44px;
  background:     transparent;
  border:         1px dashed rgba(255,255,255,0.12);
  color:          var(--text-3);
  font-family:    var(--font-sans);
  font-size:      11px;
  letter-spacing: 1px;
  cursor:         pointer;
  transition:     all var(--transition);
  margin-bottom:  12px;
}

.photo-btn:hover {
  border-color: rgba(139, 77, 255, 0.6);
  color:        var(--brand);
}

/* ════════════════════════════════════════════════════════════════ */
/* PROYECTOS                                                       */
/* ════════════════════════════════════════════════════════════════ */

.pc {
  background:              rgba(20, 20, 26, 0.55);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter:         blur(40px) saturate(180%);
  border-radius:           var(--radius-lg);
  padding:                 16px;
  margin-bottom:           12px;
  position:                relative;
  overflow:                hidden;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 0 0 0.5px rgba(255, 255, 255, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.6);
}

.pc::before {
  content:        '';
  position:       absolute;
  top: 0; left: 8%; right: 8%;
  height:         1px;
  background:     linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
}

.pp {
  font-family:   var(--font-sans);
  font-size:     16px;
  font-weight:   700;
  color:         var(--text-2);
  margin-bottom: 4px;
}

.po {
  font-family:   var(--font-sans);
  font-size:     11px;
  color:         var(--text-3);
  margin-bottom: 12px;
}

.ph {
  height:        8px;
  background:    rgba(0,0,0,0.4);
  border-radius: 4px;
  overflow:      hidden;
  box-shadow:    inset 0 2px 4px rgba(0,0,0,0.6), inset 0 -1px 0 rgba(255,255,255,0.05);
  position:      relative;
  margin-bottom: 8px;
}

.ph > .pf {
  height:        100%;
  background:    linear-gradient(90deg, var(--brand) 0%, var(--success) 100%);
  border-radius: 4px;
  box-shadow:
    0 0 12px rgba(139, 77, 255,0.5),
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -1px 0 rgba(0,0,0,0.2);
  position:      relative;
  transition:    width 0.5s ease;
}

.pi {
  font-family: var(--font-sans);
  font-size:   10px;
  color:       var(--text-4);
}

/* ════════════════════════════════════════════════════════════════ */
/* LOG                                                             */
/* ════════════════════════════════════════════════════════════════ */

.li {
  background:              rgba(20, 20, 26, 0.4);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter:         blur(20px);
  border-radius:           var(--radius-md);
  display:                 flex;
  gap:                     12px;
  padding:                 12px 14px;
  margin-bottom:           8px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 0 0 0.5px rgba(255,255,255,0.06),
    0 4px 12px rgba(0,0,0,0.3);
}

.li-date {
  font-family:  var(--font-sans);
  font-size:    11px;
  color:        var(--text-3);
  white-space:  nowrap;
  min-width:    80px;
}

.li-content {
  flex:        1;
  font-family: var(--font-sans);
  font-size:   11px;
  color:       var(--text-2);
  line-height: 1.6;
}

.li-badge { font-size: 16px; }

/* ════════════════════════════════════════════════════════════════ */
/* IA                                                              */
/* ════════════════════════════════════════════════════════════════ */

.ak {
  width:         100%;
  background:    var(--surface-2);
  box-shadow:      inset 0 0 0 0.5px rgba(255,255,255,0.08);
  color:         var(--text-2);
  font-family:   var(--font-sans);
  font-size:     12px;
  padding:       10px 12px;
  outline:       none;
  transition:    box-shadow var(--transition);
  margin-bottom: 8px;
  display:       block;
}

.ak:focus { box-shadow: inset 0 0 0 0.5px var(--brand); }

#aks {
  font-family:   var(--font-sans);
  font-size:     10px;
  margin-bottom: 16px;
}

/* Indicador de estado (dot) */
.sd {
  display:       inline-block;
  width:         6px;
  height:        6px;
  border-radius: 50%;
  margin-right:  6px;
  vertical-align: middle;
}

.sd.ok  { background: var(--success); }
.sd.er  { background: var(--warning); }

/* Texto placeholder del output IA */
.ip {
  font-family: var(--font-sans);
  font-size:   12px;
  color:       var(--text-4);
  line-height: 1.6;
}

/* Texto del análisis generado */
.it {
  font-family:  var(--font-sans);
  font-size:    13px;
  color:        var(--text-2);
  line-height:  1.7;
  white-space:  pre-wrap;
}

/* ════════════════════════════════════════════════════════════════ */
/* PROYECTOS — formulario nuevo proyecto                            */
/* ════════════════════════════════════════════════════════════════ */

.np-toggle-btn {
  margin-bottom: 12px;
}

.np-form {
  background:              rgba(20, 20, 26, 0.65);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter:         blur(40px) saturate(180%);
  border-radius:           var(--radius-lg);
  padding:                 16px;
  margin-bottom:           14px;
  display:                 none;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 0 0 0.5px rgba(139, 77, 255, 0.25),
    0 8px 24px rgba(0, 0, 0, 0.6);
}

.np-form.open {
  display: block;
}

/* Cabecera de tarjeta proyecto (badge rango + botón eliminar) */
.pc-header {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  margin-bottom:   8px;
}

.proj-del-btn {
  background:  none;
  border:      none;
  color:       var(--text-4);
  font-size:   15px;
  cursor:      pointer;
  padding:     4px 8px;
  line-height: 1;
  transition:  color var(--transition);
  flex-shrink: 0;
}

.proj-del-btn:hover,
.proj-del-btn:active {
  color: var(--danger);
}

/* ════════════════════════════════════════════════════════════════ */
/* PROYECTOS — modal de edición (reemplaza prompt())               */
/* ════════════════════════════════════════════════════════════════ */

#edit-proj-overlay {
  position:                fixed;
  inset:                   0;
  background:              rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter:         blur(10px);
  z-index:                 200;
  align-items:             center;
  justify-content:         center;
  padding:                 24px;
}

.ep-modal {
  width:                   100%;
  max-width:               400px;
  background:              rgba(14, 14, 20, 0.95);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter:         blur(40px) saturate(180%);
  border-radius:           var(--radius-lg);
  padding:                 24px;
  /* El modal pasó de dos campos a definir el fin completo: en móvil no cabe
     de una vez, así que se desplaza por dentro en lugar de desbordar. */
  max-height:              calc(100vh - 48px);
  overflow-y:              auto;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.18),
    0 0 0 0.5px rgba(139, 77, 255, 0.2),
    0 24px 60px rgba(0, 0, 0, 0.85);
}

/* Separadores de sección dentro del modal */
.ep-sep {
  font-family:    var(--font-sans);
  font-size:      9px;
  font-weight:    700;
  letter-spacing: 2px;
  color:          var(--brand-soft);
  text-transform: uppercase;
  margin:         4px 0 10px;
  padding-top:    12px;
  border-top:     1px solid rgba(139, 77, 255, 0.14);
}

.lbl-hint {
  color:          var(--text-4);
  text-transform: none;
  letter-spacing: 0;
  font-weight:    400;
}

/* Dos campos por fila (meta + unidad, voy por + categoría) */
.np-row {
  display:        grid;
  grid-template-columns: 1fr 1fr;
  gap:            10px;
  margin-bottom:  8px;
}

/* Aviso de que el progreso es un cálculo, no una opinión */
.ep-calculado {
  font-family:   var(--font-sans);
  font-size:     10px;
  color:         var(--brand-soft);
  background:    rgba(139, 77, 255, 0.10);
  border-radius: 10px;
  padding:       8px 10px;
  margin-bottom: 16px;
}

.ep-historial {
  margin-bottom: 18px;
  max-height:    140px;
  overflow-y:    auto;
}

.ep-hist-item {
  display:       flex;
  gap:           8px;
  font-family:   var(--font-sans);
  font-size:     10px;
  padding:       5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ep-hist-fecha { color: var(--text-4); flex-shrink: 0; font-family: var(--font-mono); }
.ep-hist-txt   { color: var(--text-3); }
.ep-hist-vacio { font-family: var(--font-sans); font-size: 10px; color: var(--text-4); padding: 6px 0; }

/* ════════════════════════════════════════════════════════════════ */
/* PROYECTOS — el fin, la jerarquía y el abandono                   */
/* ════════════════════════════════════════════════════════════════ */

/* Contador de cabecera: cuántos proyectos y cuántos sin fin declarado */
.proj-resumen {
  display:        flex;
  justify-content: space-between;
  font-family:    var(--font-sans);
  font-size:      10px;
  color:          var(--text-4);
  padding:        0 4px 10px;
}

.proj-resumen-alerta { color: var(--warning); }
.proj-resumen-ok     { color: var(--success); }

/* Grupo: la marca y debajo los trabajos que firma */
.proj-grupo  { margin-bottom: 18px; }

.proj-hijos {
  margin-left:  14px;
  padding-left: 12px;
  border-left:  1px solid rgba(139, 77, 255, 0.22);
}

.pc-hijo { margin-bottom: 10px; }

/* Un proyecto parado más de un mes se marca por el borde, sin gritar */
.pc-parado { box-shadow: inset 3px 0 0 var(--warning); }

.pc-head-right {
  display:     flex;
  align-items: center;
  gap:         8px;
}

.pc-cat {
  font-family:    var(--font-sans);
  font-size:      8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color:          var(--text-4);
  border:         1px solid rgba(255, 255, 255, 0.10);
  border-radius:  var(--radius-pill);
  padding:        2px 7px;
}

.pc-dias {
  font-family: var(--font-mono);
  font-size:   9px;
  color:       var(--text-4);
}

/* ── EL FIN: el bloque que manda en la tarjeta ── */
.pm {
  background:    rgba(139, 77, 255, 0.08);
  border-radius: 12px;
  padding:       10px 12px;
  margin-bottom: 12px;
}

.pm-meta {
  font-family:   var(--font-sans);
  font-size:     11px;
  font-weight:   600;
  color:         var(--text-2);
  margin-bottom: 3px;
}

.pm-cifra {
  font-family: var(--font-sans);
  font-size:   10px;
  color:       var(--text-3);
}

.pm-cifra strong {
  font-family: var(--font-mono);
  font-size:   14px;
  color:       var(--brand-soft);
}

.pm-falta     { color: var(--text-4); margin-left: 6px; }
.pm-engloba   { font-family: var(--font-sans); font-size: 9px; color: var(--text-4); margin-top: 4px; }

/* Registrar el avance sin abrir el modal: el número, en la propia tarjeta */
.pc-quick {
  display:       flex;
  align-items:   center;
  gap:           8px;
  margin:        10px 0 8px;
  padding:       8px 10px;
  background:    rgba(139, 77, 255, 0.06);
  border-radius: var(--radius-sm);
}

.pc-quick label {
  font-family:    var(--font-sans);
  font-size:      10px;
  color:          var(--text-4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pc-quick input {
  width:         72px;
  padding:       6px 8px;
  background:    rgba(0, 0, 0, 0.35);
  border:        0.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color:         var(--text-1);
  font-family:   var(--font-mono, var(--font-sans));
  font-size:     14px;
  text-align:    center;
}

.pc-quick input:focus {
  outline:      none;
  border-color: var(--brand);
}

.pc-quick-un {
  flex:        1;
  font-family: var(--font-sans);
  font-size:   10px;
  color:       var(--text-4);
}

.pc-quick-ok {
  padding:        7px 12px;
  background:     linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  border:         none;
  border-radius:  8px;
  color:          #000;
  font-family:    var(--font-sans);
  font-size:      10px;
  font-weight:    700;
  letter-spacing: 1px;
  cursor:         pointer;
}

.pc-quick-ok:active { transform: scale(0.96); }

/* Proyecto que se mide solo: no hay nada que teclear */
.pc-auto {
  display:     flex;
  align-items: center;
  gap:         6px;
  margin:      10px 0 8px;
  font-family: var(--font-sans);
  font-size:   10px;
  color:       var(--success);
}

.pc-auto svg { width: 12px; height: 12px; }

.ep-auto {
  font-family:   var(--font-sans);
  font-size:     10px;
  line-height:   1.5;
  color:         var(--success);
  background:    rgba(63, 178, 127, 0.08);
  border-radius: var(--radius-sm);
  padding:       8px 10px;
  margin-bottom: 12px;
}

/* Composición corporal (pestaña GYM) */
.mc-card   { padding: 14px; }
.mc-datos  { display: flex; justify-content: space-between; gap: 8px; }
.mc-dato   { flex: 1; text-align: center; }

.mc-val {
  font-family: var(--font-mono, var(--font-sans));
  font-size:   22px;
  color:       var(--text-1);
  line-height: 1.1;
}

.mc-un  { font-size: 11px; color: var(--text-4); }

.mc-lbl {
  font-family:    var(--font-sans);
  font-size:      9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color:          var(--text-4);
  margin-top:     4px;
}

.mc-sube  { color: var(--success); }
.mc-baja  { color: var(--danger); }
.mc-igual { color: var(--text-4); }

.mc-fecha {
  font-family: var(--font-sans);
  font-size:   9px;
  color:       var(--text-4);
  text-align:  center;
  margin-top:  10px;
}

.mc-vacio {
  font-family: var(--font-sans);
  font-size:   11px;
  line-height: 1.5;
  color:       var(--text-4);
  text-align:  center;
  padding:     4px 8px 10px;
}

.mc-form      { display: none; padding-top: 12px; }
.mc-form.open { display: block; }
.mc-btn       { margin-top: 10px; height: 40px; font-size: 11px; letter-spacing: 1.5px; }

/* Enlace a la web del proyecto, junto al nombre */
.pc-link {
  font-family:    var(--font-sans);
  font-size:      9px;
  font-weight:    400;
  letter-spacing: 0.5px;
  color:          var(--brand-soft);
  text-decoration: none;
  border:         1px solid rgba(139, 77, 255, 0.35);
  border-radius:  var(--radius-pill);
  padding:        2px 8px;
  margin-left:    8px;
  white-space:    nowrap;
  vertical-align: middle;
}

.pc-link:hover { background: rgba(139, 77, 255, 0.15); }

/* ── HITOS ─────────────────────────────────────────────────────── */
.hitos { margin-top: 10px; }

.hito-lista { list-style: none; margin: 0; padding: 0; }

.hito {
  display:     flex;
  align-items: center;
  gap:         8px;
  padding:     5px 0;
}

/* La casilla es el gesto principal: grande para el pulgar */
.hito-box {
  flex-shrink:   0;
  width:         20px;
  height:        20px;
  border-radius: 6px;
  border:        1px solid rgba(255, 255, 255, 0.20);
  background:    transparent;
  color:         var(--brand-soft);
  font-size:     12px;
  line-height:   1;
  cursor:        pointer;
  display:         flex;
  align-items:     center;
  justify-content: center;
}

.hito-box:hover { border-color: var(--brand); }

.hito-txt {
  flex:        1;
  font-family: var(--font-sans);
  font-size:   11px;
  color:       var(--text-2);
}

.hito-ok .hito-box { background: var(--brand); border-color: var(--brand); color: #fff; }
.hito-ok .hito-txt { color: var(--text-4); text-decoration: line-through; }

.hito-fecha {
  font-family: var(--font-mono);
  font-size:   9px;
  color:       var(--text-4);
}

.hito-tarde .hito-fecha { color: var(--danger); }

.hito-del {
  background: none;
  border:     none;
  color:      var(--text-4);
  font-size:  14px;
  cursor:     pointer;
  padding:    0 2px;
  opacity:    0;
  transition: opacity .15s;
}

.hito:hover .hito-del { opacity: 1; }

.hito-toggle {
  background:     none;
  border:         none;
  color:          var(--text-4);
  font-family:    var(--font-sans);
  font-size:      9px;
  letter-spacing: 0.5px;
  cursor:         pointer;
  padding:        4px 0;
}

.hito-add input {
  width:         100%;
  background:    transparent;
  border:        none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
  color:         var(--text-2);
  font-family:   var(--font-sans);
  font-size:     11px;
  padding:       6px 0;
  margin-top:    2px;
}

.hito-add input::placeholder { color: var(--text-4); }
.hito-add input:focus { outline: none; border-bottom-color: var(--brand); }

/* Estado del puente con Notion */
.notion-estado {
  font-family:   var(--font-sans);
  font-size:     10px;
  color:         var(--text-4);
  padding:       0 4px 10px;
}

.notion-medio { color: var(--warning); }
.notion-ok    { color: var(--success); }

/* El enlace a la base se pinta como botón, pero es un <a> */
.nt-abrir {
  display:         flex;
  align-items:     center;
  justify-content: center;
  margin-top:      6px;
  text-decoration: none;
}

.nt-abrir[hidden] { display: none; }

/* Crear la base es de una sola vez: se pliega para no pulsarla por error */
.nt-mas {
  font-family:     var(--font-sans);
  font-size:       10px;
  color:           var(--text-4);
  text-align:      center;
  padding:         14px 0 4px;
  cursor:          pointer;
  text-decoration: underline;
}

.nt-base      { display: none; padding-top: 8px; }
.nt-base.open { display: block; }

.nt-aviso {
  font-family:   var(--font-sans);
  font-size:     10px;
  line-height:   1.5;
  color:         var(--warning);
  background:    rgba(224, 164, 43, 0.08);
  border-radius: var(--radius-sm);
  padding:       8px 10px;
  margin-bottom: 12px;
}
.pm-hecho     { color: var(--success); margin-left: 6px; }
.pm-sincifra  { color: var(--text-4); font-style: italic; }
.pm-padre     { font-family: var(--font-sans); font-size: 10px; color: var(--text-4); }

/* Sin fin declarado: es un botón, porque definirlo es la acción pendiente */
.pm-vacia {
  display:        block;
  width:          100%;
  text-align:     left;
  background:     rgba(224, 164, 43, 0.10);
  border:         1px dashed rgba(224, 164, 43, 0.45);
  color:          var(--warning);
  font-family:    var(--font-sans);
  font-size:      10px;
  letter-spacing: 0.5px;
  cursor:         pointer;
}

.pc-bottom {
  display:         flex;
  justify-content: space-between;
  align-items:     baseline;
  gap:             10px;
  margin-top:      8px;
}

.pc-pct {
  font-family: var(--font-mono);
  font-size:   11px;
  color:       var(--brand-soft);
  flex-shrink: 0;
}

.pc-btn { margin-top: 10px; width: 100%; }

/* ════════════════════════════════════════════════════════════════ */
/* OFFLINE BANNER                                                   */
/* ════════════════════════════════════════════════════════════════ */

#offline-banner {
  position:                fixed;
  bottom:                  calc(100px + env(safe-area-inset-bottom, 0px));
  left:                    50%;
  transform:               translateX(-50%) translateY(12px);
  background:              rgba(248, 113, 113, 0.12);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter:         blur(20px);
  border-radius:           var(--radius-pill);
  padding:                 8px 18px;
  font-family:             var(--font-sans);
  font-size:               11px;
  font-weight:             600;
  color:                   var(--danger);
  letter-spacing:          1.5px;
  text-transform:          uppercase;
  z-index:                 150;
  pointer-events:          none;
  box-shadow:
    inset 0 0 0 0.5px rgba(248, 113, 113, 0.35),
    0 4px 16px rgba(0, 0, 0, 0.5);
  opacity:                 0;
  transition:              opacity 0.3s ease, transform 0.3s ease;
  white-space:             nowrap;
}

#offline-banner.visible {
  opacity:   1;
  transform: translateX(-50%) translateY(0);
}

/* ════════════════════════════════════════════════════════════════ */
/* GYM — historial de sesiones                                      */
/* ════════════════════════════════════════════════════════════════ */

.gh-item {
  background:    var(--surface-1);
  box-shadow:    inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding:       12px 14px;
  margin-top:    8px;
  cursor:        pointer;
  transition:    box-shadow var(--transition);
}

.gh-item:hover,
.gh-item:active {
  box-shadow: inset 0 0 0 0.5px var(--brand);
}

.gh-row {
  display:     flex;
  align-items: center;
  gap:         10px;
}

.gh-date {
  font-family: var(--font-mono);
  font-size:   10px;
  color:       var(--text-3);
  white-space: nowrap;
  min-width:   72px;
}

.gh-rutina {
  flex:        1;
  font-family: var(--font-sans);
  font-size:   13px;
  font-weight: 600;
  color:       var(--text-2);
}

.gh-series {
  font-family: var(--font-mono);
  font-size:   10px;
  color:       var(--success);
  white-space: nowrap;
}

/* Detalle expandible */
.gh-detail {
  display:    none;
  margin-top: 10px;
  padding-top: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.gh-detail.open {
  display: block;
}

.gh-exercise {
  display:        flex;
  flex-direction: column;
  gap:            2px;
  padding:        6px 0;
  box-shadow:     inset 0 -0.5px 0 rgba(255, 255, 255, 0.06);
}

.gh-exercise:last-child {
  box-shadow: none;
}

.gh-ej-name {
  font-family: var(--font-sans);
  font-size:   12px;
  color:       var(--text-2);
  font-weight: 600;
}

.gh-ej-sets {
  font-family: var(--font-mono);
  font-size:   10px;
  color:       var(--text-3);
}

/* ════════════════════════════════════════════════════════════════ */
/* GYM — SECCIÓN TÉCNICA DE EJERCICIO                              */
/* ════════════════════════════════════════════════════════════════ */

.tech-loading {
  font-family:    var(--font-sans);
  font-size:      10px;
  letter-spacing: 1px;
  color:          var(--text-4);
  padding:        8px 0;
  animation:      pulse 1.5s infinite;
}

/* GIF del ejercicio */

.tech-gif {
  max-height:    220px;
  width:         auto;
  max-width:     100%;
  display:       block;
  border-radius: var(--radius-md);
}

.tech-gif-err {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            6px;
  padding:        24px;
  color:          var(--text-4);
  font-family:    var(--font-sans);
  font-size:      11px;
  text-align:     center;
}

/* Badges de músculos */
.tech-muscles {
  display:         flex;
  flex-wrap:       wrap;
  gap:             6px;
  margin-bottom:   10px;
}

.muscle-badge {
  font-family:    var(--font-sans);
  font-size:      9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding:        3px 8px;
  border-radius:  20px;
  line-height:    1.4;
}

.muscle-badge.primary {
  background: rgba(139, 77, 255, 0.12);
  color:      var(--brand);
  box-shadow: inset 0 0 0 0.5px rgba(139, 77, 255, 0.4);
}

.muscle-badge.secondary {
  background: rgba(255, 255, 255, 0.05);
  color:      var(--text-3);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.10);
}

/* Botón / acordeón de instrucciones */

.tech-instructions {
  margin:      0;
  padding-left: 18px;
}

.tech-instructions li {
  font-family:  var(--font-sans);
  font-size:    11px;
  color:        var(--text-3);
  line-height:  1.7;
  padding:      4px 0;
  box-shadow:   inset 0 -0.5px 0 rgba(255,255,255,0.06);
}

.tech-instructions li:last-child { box-shadow: none; }

/* ════════════════════════════════════════════════════════════════ */
/* GYM — SECCIÓN "MIS OBJETIVOS"                                   */
/* ════════════════════════════════════════════════════════════════ */

.gym-obj-loading {
  font-family:    var(--font-sans);
  font-size:      10px;
  letter-spacing: 1px;
  color:          var(--text-4);
  padding:        10px 0;
  animation:      pulse 1.5s infinite;
}

.gym-objectives-section {
  padding:                 14px;
  margin-bottom:           4px;
  background:              rgba(139, 77, 255, 0.03);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter:         blur(20px);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    inset 0 0 0 0.5px rgba(139, 77, 255, 0.12);
}

.gym-obj-title {
  font-family:    var(--font-sans);
  font-size:      9px;
  letter-spacing: 2px;
  color:          var(--text-3);
  text-transform: uppercase;
  margin-bottom:  12px;
}

.gym-obj-card {
  margin-bottom: 14px;
}

.gym-obj-card:last-child { margin-bottom: 0; }

.gym-obj-header {
  display:     flex;
  align-items: center;
  gap:         10px;
  margin-bottom: 6px;
}

.gym-obj-icon { font-size: 20px; flex-shrink: 0; }

.gym-obj-info { flex: 1; min-width: 0; }

.gym-obj-name {
  font-family:  var(--font-sans);
  font-size:    13px;
  font-weight:  600;
  color:        var(--text-2);
  line-height:  1.2;
}

.gym-obj-goal {
  font-family: var(--font-sans);
  font-size:   10px;
  color:       var(--text-4);
  margin-top:  2px;
}

.gym-obj-pct {
  font-family: var(--font-sans);
  font-size:   16px;
  font-weight: 700;
  color:       var(--brand);
  flex-shrink: 0;
  min-width:   40px;
  text-align:  right;
  line-height: 1;
}

.gym-obj-bar {
  height:     6px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 3px;
  overflow:   hidden;
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.5),
    inset 0 -1px 0 rgba(255,255,255,0.04);
}

.gym-obj-fill {
  height:        100%;
  background:    linear-gradient(90deg, var(--brand) 0%, var(--success) 100%);
  border-radius: 3px;
  box-shadow:    0 0 8px rgba(139, 77, 255, 0.5);
  transition:    width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  position:      relative;
}

.gym-obj-fill::after {
  content:       '';
  position:      absolute;
  inset:         0;
  background:    linear-gradient(180deg, rgba(255,255,255,0.35), transparent);
  border-radius: 3px;
  pointer-events: none;
}

/* ════════════════════════════════════════════════════════════════ */
/* GYM — DUNGEON CLEARED ENHANCED                                   */
/* ════════════════════════════════════════════════════════════════ */

.done-sub {
  font-family:    var(--font-sans);
  color:          var(--success);
  margin-top:     12px;
  font-size:      11px;
  letter-spacing: 1.5px;
}

.done-stats-row {
  display:         flex;
  justify-content: center;
  gap:             28px;
  margin-top:      20px;
  padding-top:     16px;
  box-shadow:      inset 0 1px 0 rgba(255,255,255,0.10);
}

.done-stat { text-align: center; }

.done-stat-val {
  font-family: var(--font-sans);
  font-size:   26px;
  font-weight: 700;
  color:       var(--text-2);
  line-height: 1;
}

.done-stat-lbl {
  font-family:    var(--font-sans);
  font-size:      8px;
  letter-spacing: 1.5px;
  color:          var(--text-4);
  margin-top:     5px;
  text-transform: uppercase;
}

/* Cards de resumen de ejercicios */
.done-exercises-wrap {
  margin-top: 16px;
}

.done-section-title {
  font-family:    var(--font-sans);
  font-size:      9px;
  letter-spacing: 2px;
  color:          var(--text-3);
  text-transform: uppercase;
  margin-bottom:  10px;
}

.done-ej-card {
  background:    var(--surface-1);
  box-shadow:    inset 0 0 0 0.5px rgba(255,255,255,0.08);
  padding:       12px 14px;
  margin-bottom: 8px;
  border-left:   2px solid rgba(139, 77, 255, 0.2);
}

.done-ej-name {
  font-family:   var(--font-sans);
  font-size:     13px;
  font-weight:   600;
  color:         var(--text-2);
  margin-bottom: 6px;
}

.done-ej-sets {
  display:       flex;
  flex-wrap:     wrap;
  gap:           4px;
  margin-bottom: 4px;
}

.done-set-pill {
  background: rgba(139, 77, 255, 0.08);
  box-shadow: inset 0 0 0 0.5px rgba(139, 77, 255, 0.22);
  color:      var(--brand);
  font-family: var(--font-mono);
  font-size:  10px;
  padding:    2px 8px;
  border-radius: 2px;
}

.done-ej-vol {
  font-family: var(--font-mono);
  font-size:   9px;
  color:       var(--text-4);
  margin-top:  4px;
  letter-spacing: 0.5px;
}

/* Gráfico de barras CSS puro */
.done-chart {
  margin-top: 16px;
  padding:    14px;
  background: var(--surface-1);
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.08);
}

.done-chart-title {
  font-family:    var(--font-sans);
  font-size:      9px;
  letter-spacing: 2px;
  color:          var(--text-3);
  text-transform: uppercase;
  margin-bottom:  14px;
}

.done-bars {
  display:     flex;
  align-items: stretch;
  gap:         6px;
  height:      120px;
}

.done-bar-col {
  flex:           1;
  display:        flex;
  flex-direction: column;
  align-items:    center;
  height:         100%;
}

.done-bar-val {
  font-family:   var(--font-mono);
  font-size:     9px;
  color:         var(--brand);
  flex-shrink:   0;
  margin-bottom: 4px;
}

.done-bar-track {
  flex:           1;
  width:          100%;
  display:        flex;
  align-items:    flex-end;
  background:     rgba(255,255,255,0.04);
  border-radius:  2px;
  overflow:       hidden;
}

.done-bar-fill {
  width:         100%;
  height:        0%;
  background:    linear-gradient(180deg, var(--brand) 0%, var(--success) 100%);
  border-radius: 2px;
  box-shadow:    0 0 10px rgba(139, 77, 255, 0.35);
  transition:    height 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  position:      relative;
}

.done-bar-fill::after {
  content:    '';
  position:   absolute;
  top: 0; left: 0; right: 0;
  height:     40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.3), transparent);
  pointer-events: none;
}

.done-bar-label {
  font-family:    var(--font-sans);
  font-size:      8px;
  color:          var(--text-4);
  text-align:     center;
  margin-top:     4px;
  flex-shrink:    0;
  overflow:       hidden;
  text-overflow:  ellipsis;
  white-space:    nowrap;
  width:          100%;
  line-height:    1.3;
}

/* ── CRUCE DE DATOS ─────────────────────────────────────────────── */
.cruce-rango {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
}

.cruce-btn {
  flex: 1;
  height: 32px;
  background: transparent;
  border: none;
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all var(--transition);
}

.cruce-btn.active {
  color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
  background: rgba(139, 77, 255, 0.06);
}

/* La misión de recuperación avisa de que hoy se paga lo de ayer */
.mm-castigo {
  color:       var(--warning);
  font-weight: 600;
}

/* El aliento: se lee, no grita. Va en el violeta de marca, no en verde de
   "enhorabuena" — el sistema reconoce, no anima. */
.mm-aliento {
  font-family:   var(--font-sans);
  font-size:     11px;
  line-height:   1.5;
  color:         var(--brand-soft);
  background:    rgba(139, 77, 255, 0.10);
  border-radius: 10px;
  padding:       9px 11px;
  margin:        10px 0 4px;
  text-align:    left;
}

.hoy-mision-aliento {
  font-family: var(--font-sans);
  font-size:   10px;
  line-height: 1.45;
  color:       var(--brand-soft);
  margin-top:  5px;
}

/* ════════════════════════════════════════════════════════════════ */
/* GYM v13 — LA TÉCNICA SE VE, Y LAS RUTINAS SE EDITAN              */
/* ════════════════════════════════════════════════════════════════ */

/* ── Tarjeta de rutina: se puede entrar o editar ─────────────── */
.rc { display: flex; align-items: center; gap: 10px; }
.rc-main { flex: 1; min-width: 0; }

.rc-edit {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.04);
  border: none; border-radius: var(--radius-pill);
  color: var(--text-3); cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
.rc-edit:hover { color: var(--brand); background: rgba(139,77,255,0.12); }
.rc-edit svg { width: 17px; height: 17px; }

.gym-nueva-rutina {
  width: 100%; height: 42px; margin-top: 4px;
  font-size: 11px; letter-spacing: 1.5px;
}

/* ── Cabecera del ejercicio: miniatura + datos ───────────────── */
.ej-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.ej-info { flex: 1; min-width: 0; }

/* La miniatura ES el acceso a la técnica: 72px, tocable de sobra */
.ej-prev {
  position: relative;
  flex: 0 0 auto;
  width: 72px; height: 72px;
  padding: 0; border: none;
  border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer;
  background: rgba(0,0,0,0.35);
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.10);
  transition: box-shadow var(--transition);
}
.ej-prev:hover, .ej-prev:active { box-shadow: inset 0 0 0 1px var(--brand); }
.ej-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ej-prev img.err { display: none; }

.ej-prev-play {
  position: absolute; right: 4px; bottom: 4px;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  background: rgba(10,6,18,0.82);
  border-radius: var(--radius-pill);
  color: var(--brand);
  font-size: 8px; line-height: 1;
  padding-left: 1px;
}

.ej-prev-vacio {
  display: grid; place-items: center; gap: 2px;
  color: var(--text-4);
  background: rgba(255,255,255,0.02);
}
.ej-prev-vacio svg { width: 22px; height: 22px; }
.ej-prev-lbl { font-family: var(--font-sans); font-size: 8px; letter-spacing: 0.5px; }

/* Con cuánto peso te quedaste la última vez */
.ej-ultima {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--text-3);
  margin-top: 5px;
}
.ej-ultima strong { color: var(--text-2); font-weight: 600; }
.ej-ultima-vacia { color: var(--text-4); }

.ej-record {
  color: var(--warning);
  margin-left: 4px;
  font-size: 9px;
  letter-spacing: 0.5px;
}

.ej-musc { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }

/* ── Hoja deslizante: visor de técnica, buscador y macros ────── */
#tecnica-overlay, #buscador-overlay, #macros-overlay {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(6, 3, 12, 0.78);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

.hoja {
  width: 100%; max-width: 560px;
  max-height: 92vh; overflow-y: auto;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  background: #120B1E;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.10), 0 -18px 50px rgba(0,0,0,0.55);
  animation: subirHoja 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.hoja-corta { max-height: none; }

@keyframes subirHoja {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.tec-cab {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}

.tec-titulo {
  font-family: var(--font-sans);
  font-size: 16px; font-weight: 600;
  color: var(--text-1); margin: 0;
  line-height: 1.3;
}

.tec-sub {
  font-family: var(--font-sans);
  font-size: 11px; color: var(--text-3);
  margin: 3px 0 0; line-height: 1.4;
}

.tec-cerrar {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.05);
  border: none; border-radius: var(--radius-pill);
  color: var(--text-3); cursor: pointer;
  font-size: 14px; line-height: 1;
}
.tec-cerrar:hover { color: var(--text-1); }
.tec-cerrar svg { width: 15px; height: 15px; }

.tec-gif-wrap {
  display: flex; align-items: center; justify-content: center;
  background: #fff;                 /* los GIFs del catálogo van sobre blanco */
  border-radius: var(--radius-md);
  overflow: hidden; margin-bottom: 12px;
  min-height: 180px;
}
/* La animación viene a 720 px del backend y se enseña a 340: por encima de eso
   se estira más de lo que el material da y reaparece el pixelado que teníamos. */
.tec-gif {
  width: 100%; max-width: 340px; height: auto;
  display: block; background: #fff;
}

/* El vídeo de persona real está grabado en 16:9 y sobre fondo oscuro, así que
   ni se limita a 340 ni se pone sobre blanco: se le deja el ancho de la hoja. */
.tec-gif-wrap.con-video { background: #000; display: block; }
.tec-real { max-width: 100%; background: #000; }

.tec-cambiar {
  width: 100%; height: 42px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.10);
  border: none; border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: var(--font-sans); font-size: 11px;
  letter-spacing: 1.4px; text-transform: uppercase;
  cursor: pointer; transition: all var(--transition);
}
.tec-cambiar:hover, .tec-cambiar:focus-visible {
  color: var(--text-1);
  box-shadow: inset 0 0 0 1px var(--brand);
  outline: none;
}
.tec-cambiar svg { width: 15px; height: 15px; }

/* Cuando el clip no es exactamente tu ejercicio, se dice. Enseñar otra cosa
   sin avisar es peor que no enseñar nada. */
.tec-aviso {
  margin: 8px 0 0;
  font-family: var(--font-sans); font-size: 11.5px; line-height: 1.5;
  color: var(--warning);
}

.tec-pasos { margin-top: 14px; }

.tec-pasos-tit {
  font-family: var(--font-sans);
  font-size: 10px; letter-spacing: 1.5px;
  color: var(--text-3); margin-bottom: 8px;
}

/* ── Buscador del catálogo ───────────────────────────────────── */
.busc-input {
  width: 100%; height: 44px;
  padding: 0 14px; margin-bottom: 12px;
  background: rgba(255,255,255,0.04);
  border: none; border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: var(--font-sans); font-size: 15px;
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.10);
}
.busc-input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--brand); }

.busc-res { display: flex; flex-direction: column; gap: 6px; }

.busc-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.05);
}

.busc-mini {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  object-fit: cover; border-radius: 10px;
  background: rgba(0,0,0,0.3);
}

.busc-datos { flex: 1; min-width: 0; cursor: pointer; }

.busc-nom {
  font-family: var(--font-sans); font-size: 13px;
  color: var(--text-2); line-height: 1.3;
}

.busc-meta {
  font-family: var(--font-sans); font-size: 10px;
  color: var(--text-4); margin-top: 2px;
}

.busc-add {
  flex: 0 0 auto;
  min-width: 34px; height: 34px;
  padding: 0 10px;
  background: rgba(139,77,255,0.14);
  border: none; border-radius: var(--radius-pill);
  color: var(--brand); cursor: pointer;
  font-family: var(--font-sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.5px;
}
.busc-add:hover { background: rgba(139,77,255,0.26); }

/* ── Editor de rutinas ───────────────────────────────────────── */
.ed-cab {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}

.ed-volver, .ed-borrar-rut {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-sans); font-size: 10px; letter-spacing: 1.5px;
  padding: 6px 0;
}
.ed-volver { color: var(--text-3); }
.ed-volver:hover { color: var(--text-1); }
.ed-borrar-rut { color: var(--text-4); }
.ed-borrar-rut:hover { color: var(--danger); }

.ed-ficha { margin-bottom: 4px; }

.ed-dias { display: flex; flex-wrap: wrap; gap: 5px; }

.ed-dia {
  flex: 1 1 auto; min-width: 40px; height: 32px;
  background: rgba(255,255,255,0.04);
  border: none; border-radius: var(--radius-sm);
  color: var(--text-4); cursor: pointer;
  font-family: var(--font-sans); font-size: 10px; letter-spacing: 0.5px;
  transition: color var(--transition), background var(--transition);
}
.ed-dia.on {
  background: rgba(139,77,255,0.16); color: var(--brand);
  box-shadow: inset 0 0 0 0.5px rgba(139,77,255,0.45);
}

.ed-ej {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; margin-bottom: 6px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.06);
}

.ed-ej-orden { display: flex; flex-direction: column; gap: 2px; }

.ed-ej-orden button {
  width: 22px; height: 20px;
  background: rgba(255,255,255,0.04);
  border: none; border-radius: 6px;
  color: var(--text-3); cursor: pointer;
  font-size: 8px; line-height: 1;
}
.ed-ej-orden button:disabled { opacity: 0.25; cursor: default; }
.ed-ej-orden button:not(:disabled):hover { color: var(--brand); }

.ed-ej-mini {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  object-fit: cover; border-radius: 9px;
  background: rgba(0,0,0,0.3);
}
.ed-ej-mini-vacia { display: grid; place-items: center; color: var(--text-4); }
.ed-ej-mini-vacia svg { width: 18px; height: 18px; }

.ed-ej-datos { flex: 1; min-width: 0; }

.ed-ej-nombre {
  width: 100%; height: 26px;
  padding: 0 6px;
  background: transparent; border: none;
  color: var(--text-2);
  font-family: var(--font-sans); font-size: 13px;
  border-radius: 6px;
}
.ed-ej-nombre:focus { outline: none; background: rgba(255,255,255,0.05); }

.ed-ej-num { display: flex; align-items: center; gap: 5px; margin-top: 3px; }

.ed-ej-num input {
  height: 24px; padding: 0 5px;
  background: rgba(255,255,255,0.04); border: none;
  border-radius: 6px; color: var(--text-3);
  font-family: var(--font-sans); font-size: 11px;
  text-align: center;
}
.ed-ej-num input:focus {
  outline: none; color: var(--text-1);
  box-shadow: inset 0 0 0 0.5px var(--brand);
}
#gym-content .ed-ej-num input[type="number"] { width: 40px; }
#gym-content .ed-ej-num input[type="text"]   { width: 62px; }
.ed-ej-num span { color: var(--text-4); font-size: 10px; }

.ed-ej-tec {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  color: var(--text-4);
  font-family: var(--font-sans); font-size: 9px; letter-spacing: 0.5px;
  padding: 4px 6px; border-radius: 6px;
  white-space: nowrap;
}
.ed-ej-tec:hover { color: var(--brand); background: rgba(139,77,255,0.10); }

.ed-ej-del {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: none; border: none;
  color: var(--text-4); cursor: pointer;
  border-radius: var(--radius-pill);
}
.ed-ej-del:hover { color: var(--danger); background: rgba(224,82,82,0.10); }
.ed-ej-del svg { width: 13px; height: 13px; }

/* ── Objetivos de macros ─────────────────────────────────────── */
.mo-calc {
  font-family: var(--font-sans); font-size: 10px;
  color: var(--text-3); line-height: 1.6;
  margin-top: 10px; padding-top: 10px;
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.07);
}
.mo-calc strong { color: var(--text-2); }
.mo-calc .mo-desvio { color: var(--warning); }
