/* ===== FUENTE: Inter variable (400-900 en un solo archivo), servida desde la app (vendor/inter) =====
   Antes venía de Google Fonts, que recibía tu IP cada vez que abrías la app. Subconjunto latino: todo el castellano. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../vendor/inter/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===== VARIABLES ===== */
[hidden] { display: none !important; }   /* fichas ocultas por el perfil (y el resto de «hidden») */
/* Los controles del sistema (calendario, desplegables, barras) siguen el tema */
:root { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

:root {
  --bg: #f0f4f8;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --green: #15803d;        /* claro: tonos oscuros para que el texto se lea (contraste ≥ 4,5) */
  --green-dark: #166534;
  --green-light: #dcfce7;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #dbeafe;
  --orange: #c2410c;
  --orange-light: #ffedd5;
  --red: #b91c1c;
  --red-light: #fee2e2;
  --yellow: #854d0e;
  --yellow-light: #fef9c3;
  --purple: #a855f7;
  --purple-light: #f3e8ff;
  /* Botones: fondo con el que el texto blanco se lee bien en los dos temas */
  --btn-green: #15803d;
  --btn-blue: #2563eb;
  --btn-red: #dc2626;
  --nav-text: #3b6fc4;   /* pestañas: texto e icono en azul, nunca gris */
  --nav-icon: #3b82f6;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.10);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --green: #22c55e;
  --green-dark: #4ade80;
  --blue: #60a5fa;
  --orange: #f97316;
  --red: #f87171;
  --yellow: #eab308;
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #162032;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --green-light: #14532d;
  --blue-light: #1e3a5f;
  --orange-light: #431407;
  --red-light: #450a0a;
  --yellow-light: #422006;
  --purple-light: #3b0764;
  --nav-text: #93b4ea;
  --nav-icon: #60a5fa;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.2);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}
button { cursor: pointer; font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ===== LAYOUT ===== */
.app-container { width: 100%; max-width: 480px; margin: 0 auto; padding-bottom: 40px; }

/* ===== HEADER ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: env(safe-area-inset-top, 0px) 0 0;   /* instalada en un móvil con muesca: nada queda debajo de la cámara */
}
/* Texto que solo oye el lector de pantalla */
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.header-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 10px;
}
.app-header h1 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.3px; }
.app-header span { font-size: 0.75rem; color: var(--text-muted); display: block; font-weight: 400; }
.theme-toggle {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: background var(--transition);
}
.theme-toggle:hover { background: var(--border); }
.theme-toggle .tema-ico { width: 20px; height: 20px; color: var(--nav-icon); }   /* sol y luna en azul, como las pestañas */

/* ===== NAV ===== */
.top-nav {
  display: flex;
  justify-content: space-around;
  border-top: 1px solid var(--border);
  padding: 4px 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.top-nav::-webkit-scrollbar { display: none; }
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: var(--nav-text);
  font-size: 0.6rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
  flex: 1 1 0;          /* las 7 caben a 360 px (antes con min-width 52px se cortaba «Semana» sin avisar) */
  min-width: 0;
  min-height: 48px;
}
.nav-item .icon { width: 22px; height: 22px; color: var(--nav-icon); transition: transform var(--transition); }
.nav-item.active { background: var(--btn-blue); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(59,130,246,0.35); }
.nav-item.active .icon { color: #fff; transform: scale(1.1); }

/* ===== SECTIONS ===== */
.section { display: none; padding: 20px; }
.section.active { display: block; }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
/* Iconos: tamaño base de los de línea (.ico) y de los macizos (.duo); los estados llevan su color */
.ico, .duo { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.estado.ok { color: var(--green); } .estado.alerta { color: var(--orange); } .estado.mal { color: var(--red); }
.estado.info { color: var(--blue); } .estado.racha { color: var(--orange); } .estado.idea, .estado.fiesta { color: var(--yellow); }
.setup-duo { width: 56px; height: 56px; color: var(--blue); }
.vacio-ico { width: 44px; height: 44px; color: var(--blue); margin-bottom: 8px; }
.logro-icon .duo { width: 28px; height: 28px; color: var(--blue); }
.w-del .ico, .setup-close .ico { width: 16px; height: 16px; }
.lab-tit .tit-ico { width: 18px; height: 18px; color: var(--blue); vertical-align: -3px; }
.card-title .tit-ico { width: 17px; height: 17px; color: var(--blue); vertical-align: -3px; margin-right: 4px; }
.card-title .tit-ico.aviso { color: var(--orange); }

/* ===== DASHBOARD ===== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: 0.62rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 6px; }
.stat-value { font-size: 1.4rem; font-weight: 800; line-height: 1; color: var(--text); }
.stat-unit { font-size: 0.6rem; color: var(--text-muted); margin-top: 4px; }
.stat-card.green { border-left-color: var(--green); }
.stat-card.blue { border-left-color: var(--blue); }
.stat-card.orange { border-left-color: var(--orange); }
.stat-card.purple { border-left-color: var(--purple); }

.progress-bar-wrap { margin-top: 8px; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.progress-bar {
  height: 10px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green), var(--blue));
  transition: width 0.5s ease;
}

.weight-input-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.weight-input-row .btn-datos { flex: 1; }   /* Exportar e Importar, mitad y mitad */
/* Registrar medidas: un hueco por medida (el nombre dentro y la unidad en una pastilla) y un solo botón «Guardar medidas» */
.medida-campo { position: relative; display: flex; min-width: 0; margin-top: 12px; }
.medida-guardar { margin-top: 14px; }
.medida-unidad {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); pointer-events: none;
  box-sizing: border-box; min-width: 2.7rem; text-align: center; line-height: 1.35;   /* todas del mismo ancho: «kg» y «cm» quedan alineadas */
  padding: 2px 6px; border-radius: 99px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 0.72rem; font-weight: 700;
}
/* El borde lleva el color de esa medida en las gráficas (peso azul, cintura naranja, barriga púrpura); el texto sigue gris para que se lea en claro y oscuro */
.medida-unidad.peso { border-color: #3b82f6; }
.medida-unidad.cintura { border-color: #f97316; }
.medida-unidad.barriga { border-color: #a855f7; }
.medida-campo input::-webkit-outer-spin-button, .medida-campo input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }   /* las flechitas taparían la unidad */
.medida-campo input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.medida-campo input {
  flex: 1;
  min-width: 0;
  padding: 10px 58px 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}
.medida-campo input:focus { outline: none; border-color: var(--blue); }
.btn {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  transition: opacity var(--transition), transform var(--transition);
}
.btn .ico { width: 18px; height: 18px; vertical-align: -4px; margin-right: 6px; }
.btn:active { transform: scale(0.97); opacity: 0.9; }
.btn-primary { background: var(--btn-blue); color: white; }
.btn-red { background: var(--btn-red); color: white; }   /* borrar */
.btn-green { background: var(--btn-green); color: white; }
.btn-full { width: 100%; padding: 14px; font-size: 1rem; }


/* ===== ENTRENAMIENTO ===== */
/* Sesión del gimnasio: pestañas de día, una tarjeta por ejercicio, el descanso con reloj circular y el cardio opcional */
.gym-dias { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.gym-dia {
  padding: 8px 4px; min-height: 44px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-muted); font: inherit; font-size: 0.75rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.gym-dia.active { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.campo-fecha { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 8px; font-size: 0.8rem; color: var(--text-muted); }
.gym-info { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 14px; }
.gym-lista { display: flex; flex-direction: column; gap: 10px; }
.gym-ej {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: background var(--transition), border-color var(--transition);
}
.gym-fila-ej { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.gym-fila-ej > .gym-ej { flex: 1; min-width: 0; }
/* Botón de la explicación: solo la flecha, al lado de la casilla que marca el ejercicio (fuera del <label>); zona táctil de 44 px */
.gym-info-btn { flex: 0 0 44px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--blue); font: inherit; font-size: 1.1rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.gym-info-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: var(--radius-sm); }
.gym-flecha { display: inline-block; transition: transform var(--transition); }
.gym-info-btn[aria-expanded="true"] .gym-flecha { transform: rotate(180deg); }
.gym-tip { flex: 1 0 100%; font-size: 0.8rem; color: var(--text-muted); padding: 2px 4px 4px; }
.gym-tip p { margin: 6px 0; }
.gym-tip-pasos { margin: 6px 0; padding-left: 20px; }
.gym-tip-fotos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
/* Los dibujos (SVG negro sobre transparente) van SIN tocar, en una tarjeta de blanco roto con marco y esquinas: se ven también de noche */
.gym-tip-figura { margin: 0; padding: 6px; text-align: center; font-size: 0.75rem; background: #f4f4f2; color: #475569; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.gym-tip-foto { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; }
/* Las fotos (no los dibujos) llenan la tarjeta: 4:3 recortando lo que sobra, sin franjas blancas */
.gym-tip-figura--foto { padding: 0; overflow: hidden; background: var(--surface2); }
.gym-tip-figura--foto .gym-tip-foto { aspect-ratio: 4 / 3; object-fit: cover; }
.gym-tip-figura--foto figcaption { padding: 4px 0; color: var(--text-muted); }
.gym-tip-aviso { color: var(--text); font-weight: 600; }
.gym-tip-pie { font-size: 0.72rem; opacity: 0.9; }
.gym-tip-pie a, .gym-tip-video { color: var(--blue); }
.gym-tip-video { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.gym-tip-etiqueta { font-size: 0.72rem; font-style: italic; }
.gym-ej.hecho { background: var(--green-light); border-color: var(--green); }
.gym-ej-num {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--blue-light); color: var(--blue);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem;
}
.gym-ej.hecho .gym-ej-num { background: var(--green); color: white; }
.gym-ej-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gym-ej-nombre { font-weight: 600; font-size: 0.9rem; }
.gym-ej-meta { font-size: 0.75rem; color: var(--text-muted); }
.gym-check {
  appearance: none; -webkit-appearance: none; width: 28px; height: 28px; margin: 0; flex-shrink: 0; cursor: pointer;
  border-radius: 50%; border: 2px solid var(--border); background: var(--surface); display: grid; place-content: center;
  transition: all var(--transition);
}
.gym-check:checked { background: var(--green); border-color: var(--green); }
.gym-check:checked::after { content: '✓'; color: white; font-size: 0.9rem; font-weight: 700; }
.gym-check:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* Descanso: un reloj que se vacía; toca para empezar o para parar */
.gym-reloj {
  position: relative; display: block; width: 170px; height: 170px; margin: 4px auto 0; padding: 0;
  border: none; background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.gym-reloj:active { transform: scale(0.97); }
.gym-reloj svg { display: block; transform: rotate(-90deg); }
.gym-reloj-fondo { fill: none; stroke: var(--border); stroke-width: 9; }
.gym-reloj-arco { fill: none; stroke: var(--blue); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke 0.3s; }
.gym-reloj.descansando .gym-reloj-arco { stroke: var(--green); }
.gym-reloj-num { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -65%); font-size: 3rem; font-weight: 900; color: var(--text); font-variant-numeric: tabular-nums; }
.gym-reloj-txt { position: absolute; left: 0; right: 0; top: 63%; padding: 0 28px; text-align: center; font-size: 0.7rem; font-weight: 600; line-height: 1.25; color: var(--text-muted); }
.gym-opcional { color: var(--text-muted); font-weight: 400; margin-left: 6px; text-transform: none; letter-spacing: 0; }
.gym-cardio + .gym-cardio { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.gym-cardio-tit { font-weight: 600; font-size: 0.9rem; }
.gym-cardio-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; }
.gym-cardio-quitar { min-height: 44px; padding: 0 10px; border: 0; background: none; color: var(--red); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.gym-cardio-mas { display: block; width: 100%; min-height: 44px; margin-top: 12px; border: 2px dashed var(--border); border-radius: var(--radius-sm); background: none; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; }
.gym-cardio-mas[hidden] { display: none; }
.gym-cardio-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.campo-fecha input, .gym-cardio-campos input { width: 100%; min-width: 0; font-size: 1rem; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface2); color: var(--text); }   /* 16 px: por debajo, el iPhone hace zoom al tocar */
.gym-cardio-nota { grid-column: 1 / -1; }
.campo-fecha input { width: auto; min-width: 9.5rem; flex-shrink: 0; }   /* la fecha entera a la vista; si no cabe junto al texto, baja a la línea de debajo */
#gymDescargo, #gymPuertaTexto { margin: 0 0 12px; }   /* el texto no pega con los botones de día ni con la fecha */
#gymLibreNota { flex: 1 1 100%; width: 100%; }        /* la nota, a todo el ancho (bajo su rótulo) */

/* Metas */
.metas-list { display: flex; flex-direction: column; gap: 10px; }
/* El plazo (Corto, Medio, Largo) como título arriba; debajo, en fila, el peso con su explicación y lo que falta.
   Si no cabe (móvil), lo que falta baja solo a la línea siguiente. */
.meta-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.meta-row.hecha { border-color: var(--green); background: var(--green-light); }
.meta-plazo { flex: 0 0 100%; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: var(--blue); }
.meta-info { flex: 0 0 100%; min-width: 0; display: flex; flex-direction: column; }   /* título, debajo el peso y su explicación, debajo lo que falta */
.meta-info strong { font-size: 1.05rem; }
.meta-info span { font-size: 0.78rem; color: var(--text-muted); }
.meta-falta { flex: 0 0 auto; font-size: 0.8rem; }
.meta-aviso { font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }

/* Análisis */
.labs-tabla { overflow-x: auto; }
table.labs { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
table.labs th, table.labs td { padding: 7px 6px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.labs th { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }
table.labs td small { display: block; font-size: 0.7rem; color: var(--text-muted); }
table.labs td.n { text-align: right; font-weight: 600; white-space: nowrap; }
table.labs td.fuera { color: var(--red); }
.lab-sec { border: 1px solid var(--border); border-radius: 12px; margin: 8px 0; overflow: hidden; transition: border-color .2s; }
.lab-sec[open] { border-color: var(--blue); }
.lab-sec summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px; cursor: pointer; user-select: none; }
.lab-sec summary::-webkit-details-marker { display: none; }
.lab-tit { flex: 1; font-weight: 600; }
.lab-tit small { display: block; font-weight: 400; font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.lab-flecha { flex: 0 0 20px; height: 20px; position: relative; }
.lab-flecha:before { content: ""; position: absolute; inset: 0; margin: auto; width: 8px; height: 8px; border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted); transform: translateY(-3px) rotate(45deg); transition: transform .25s; }
.lab-sec[open] > summary .lab-flecha:before { transform: translateY(2px) rotate(225deg); border-color: var(--blue); }
.lab-cuerpo { padding: 4px 12px 12px; border-top: 1px solid var(--border); }
.lab-cuerpo .lab-pdf, .lab-borrar { display: inline-flex; align-items: center; justify-content: center; margin: 8px 6px 4px 0; padding: 8px 14px; }
.lab-cuerpo .btn .ico { margin: 0; }
.lab-fila { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.lab-fila:last-child { border-bottom: none; }
.lab-fila-top { display: flex; justify-content: space-between; gap: 8px; }
.lab-fila-top strong { white-space: nowrap; }
.lab-fila-top strong small { font-weight: 400; color: var(--text-muted); }
.lab-fila.fuera strong { color: var(--red); }
.lab-fila-ref { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.lab-fila-que { font-size: 0.75rem; color: var(--text-muted); }
.lab-elegir { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.lab-elegir select { flex: 1; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface2); color: var(--text); font-size: 1rem; }
.lab-sug { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface2); font-size: 0.82rem; display: flex; flex-direction: column; gap: 6px; }
.lab-sug-tit { font-weight: 700; }
.lab-input { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0; font-size: 0.82rem; }
.lab-input input[type=number] { width: 90px; font-size: 1rem; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface2); color: var(--text); }   /* 16 px: por debajo, el iPhone hace zoom al tocar */
.lab-pdf-elegir { display: block; text-align: center; cursor: pointer; }
.lab-mano { margin-top: 12px; font-size: 0.85rem; }
.lab-mano summary { cursor: pointer; color: var(--text-muted); padding: 6px 0; }
.lab-cmp { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.lab-cmp div { flex: 1; }
.lab-cmp small { display: block; color: var(--text-muted); }
.lab-cmp em { font-style: normal; font-size: 0.75rem; font-weight: 700; }
.lab-cmp.mejora em { color: var(--green); }
.lab-cmp.peora em { color: var(--red); }
.lab-cmp.igual em, .lab-cmp.info em { color: var(--text-muted); }

/* ===== NUTRICIÓN ===== */
.meal-card {
  border-left: 4px solid var(--green);
  padding-left: 14px;
  margin-bottom: 16px;
}
.meal-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 6px; }
.meal-items { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.meal-items li { font-size: 0.85rem; color: var(--text-muted); }
.meal-items li::before { content: "• "; color: var(--green); font-weight: 700; }

.food-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.food-tag {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}
.food-tag.good { background: var(--green-light); color: var(--green-dark); }
.food-tag.limit { background: var(--red-light); color: var(--red); }

/* ===== MEDICACION ===== */
.med-card {
  border-left: 4px solid var(--purple);
  padding-left: 14px;
  margin-bottom: 16px;
}
.med-name { font-weight: 800; font-size: 1rem; color: var(--purple); }
.med-components { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 8px; }
.med-tips { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.med-tips li { font-size: 0.83rem; }
.med-aire { margin-top: 8px; }   /* separación sobre listas y fuentes dentro de una ficha */
.med-tips li::before { content: "✓ "; color: var(--green); font-weight: 700; }

.alert-card {
  background: var(--yellow-light);
  border: 1px solid var(--yellow);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
  font-size: 0.83rem;
}
.alert-card .alert-title { font-weight: 700; color: var(--yellow); margin-bottom: 6px; }

/* ===== PROGRESO ===== */
.chart-wrap.chart-medidas.vacia::after { content: "Aún no hay cintura ni barriga: apúntalas arriba"; }
.chart-wrap.vacia::after { content: "Aún no hay pesos: apunta el primero arriba"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-muted); font-size: 0.85rem; }
.chart-wrap { position: relative; height: 220px; margin: 10px 0; }
.weight-log { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.weight-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.weight-entry .w-date { color: var(--text-muted); }
/* Historial de cintura y barriga: la fecha arriba y debajo las dos medidas (rótulo encima del valor) con la papelera */
.weight-entry.medida-fila { display: grid; grid-template-columns: 1fr 1fr 44px; align-items: center; gap: 4px 8px; }
.medida-fila .w-date { grid-column: 1 / -1; }
.w-celda { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.w-rotulo { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.03em; color: var(--text-muted); }
.medida-fila .w-value { white-space: nowrap; }
.weight-entry .w-value { font-weight: 700; font-size: 1rem; color: var(--blue); }
.weight-entry .w-value.down { color: var(--green); }   /* el cambio: baja en verde, sube en rojo */
.weight-entry .w-value.up { color: var(--red); }
.weight-entry .w-del {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  width: 44px; height: 44px;   /* zona para el dedo (antes 28×20) */
  display: inline-flex; align-items: center; justify-content: center;
}

/* ===== CALENDARIO ===== */
/* Mi semana */
.semana-cab { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; color: var(--text-muted); font-size: 0.85rem; }
.semana-cuenta { font-size: 1.6rem; font-weight: 800; }
.semana-cuenta.verde { color: var(--green); } .semana-cuenta.naranja { color: var(--orange); } .semana-cuenta.rojo { color: var(--red); }
.semana-aviso { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; margin-bottom: 12px; border-left: 4px solid; background: var(--surface2); }
.semana-aviso.verde { border-color: var(--green); } .semana-aviso.naranja { border-color: var(--orange); } .semana-aviso.rojo { border-color: var(--red); }
.semana-dias { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.semana-dia { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.85rem; min-height: 42px; }
.semana-dia.hecho { border-color: var(--green); }
.semana-dia.hoy { border-color: var(--blue); }
.semana-dia.hoy span:last-child { color: var(--blue); font-weight: 600; }
.semana-letra { flex: 0 0 34px; font-weight: 800; display: flex; flex-direction: column; line-height: 1.1; }
.semana-letra small { font-weight: 400; font-size: 0.7rem; color: var(--text-muted); }

/* ===== SUPLEMENTOS ===== */
.suplement-card {
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.suplement-card.safe { border-left: 4px solid var(--green); }
.suplement-card.avoid { border-left: 4px solid var(--red); }
.sup-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sup-badge {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}
.safe .sup-badge { background: var(--green-light); color: var(--green-dark); }
.avoid .sup-badge { background: var(--red-light); color: var(--red); }
.sup-name { font-weight: 800; font-size: 0.95rem; }
.sup-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }

.disclaimer {
  background: var(--blue-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.78rem;
  color: var(--blue-dark);
  margin-bottom: 16px;
  line-height: 1.5;
}
[data-theme="dark"] .disclaimer { color: var(--blue); }

/* ===== LOGROS ===== */
.logros-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.logro {
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
  opacity: 0.6;          /* bloqueado: atenuado pero legible (antes 0,4) */
  transition: opacity var(--transition);
}
.logro.unlocked { opacity: 1; }
.logro-icon { font-size: 2rem; margin-bottom: 4px; }
.logro-name { font-size: 0.78rem; font-weight: 700; }
.logro-desc { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
/* ===== PLAN CARDS ===== */
.plan-cards { display: flex; flex-direction: column; gap: 10px; }
.plan-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.plan-card.current { border-color: var(--blue); background: var(--blue-light); }
/* Etiquetas dentro de cada semana: ENTRENOS encima de sus casillas; PESO, CINTURA y BARRIGA encima de su recuadro */
.plan-mini { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.55rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.02em; }   /* icono encima del nombre: todas caben sobre su recuadro */
.mini-ico { width: 12px; height: 12px; color: var(--blue); }
/* Entrenos: la etiqueta una vez y debajo una casilla por sesión del plan; las que pasan del mínimo, con borde discontinuo */
.plan-entrenos { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.plan-checks-fila { display: flex; gap: 6px; width: 100%; justify-content: center; }
.plan-checks-fila .plan-check { flex: 1; max-width: 58px; border-radius: 8px; }
.plan-check.extra:not(.checked) { border-style: dashed; }
.plan-card.past { opacity: 0.6; }
/* Cabecera de cada semana: «Semana N» y su fecha a la izquierda; peso, cintura y barriga a la derecha */
.plan-week-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;   /* en un móvil muy estrecho, las medidas bajan a la línea de debajo en vez de salirse de la tarjeta */
  gap: 8px;
  margin-bottom: 14px;
}
.plan-week-titulo { display: flex; flex-direction: column; gap: 2px; padding-top: 2px; }
.plan-week-label { font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.plan-medidas { margin-left: auto; }
.plan-date { font-size: 0.7rem; color: var(--text-muted); }
.plan-inputs { display: flex; gap: 6px; }
.plan-medidas .plan-real { width: 50px; }
.plan-input-group { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.plan-target { font-size: 0.6rem; color: var(--text-muted); }
.plan-target span { color: var(--blue); font-weight: 700; }
.plan-real { width: 58px; padding: 6px 4px; border: 1px solid var(--border); border-radius: 8px; text-align: center;
  font-size: 0.8rem; font-weight: 700; color: var(--text-muted); background: var(--surface2); font-variant-numeric: tabular-nums; }
.plan-real.con-dato { color: var(--text); }
/* Cómo estás: peso por el IMC (OMS) y cintura por cintura/altura (docs/FUENTES.md, S1) */
.plan-real.sem-verde { border-color: var(--green); color: var(--green); }
.plan-real.sem-amarillo { border-color: var(--yellow); color: var(--yellow); }
.plan-real.sem-naranja { border-color: var(--orange); color: var(--orange); }
.plan-real.sem-rojo { border-color: var(--red); color: var(--red); }
.plan-check {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--surface2);
  color: var(--text-muted);
  font-size: 0.7rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
  cursor: default; transition: all var(--transition);
}
.plan-check.checked { background: var(--green); border-color: var(--green); color: white; }
/* ===== SETUP ===== */
#setupOverlay {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: flex; justify-content: center;
  padding: 20px;
  overflow-y: auto;      /* en móviles bajos o con el teclado abierto se puede bajar hasta «Empezar» */
}
#setupOverlay .setup-card { margin: auto 0; }   /* centrado si cabe; arriba del todo si no */

/* Aviso (showToast): por encima de todo, centrado */
.toast {
  position: fixed; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); left: 50%; z-index: 2000;
  transform: translateX(-50%) translateY(10px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); width: max-content; text-align: center;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  padding: 10px 20px; border-radius: 99px; font-size: 0.85rem; font-weight: 600; transition: all 0.3s ease;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.setup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
}
.setup-close {
  position: absolute; top: 12px; right: 12px;
  width: 44px; height: 44px; border-radius: 50%;
  border: none; background: var(--surface2); color: var(--text-muted);
  font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.setup-close:hover { background: var(--border); color: var(--text); }
.setup-icon { font-size: 3rem; margin-bottom: 12px; }
.setup-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.setup-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 24px; }
.setup-field { text-align: left; margin-bottom: 16px; }
.setup-field label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.setup-field input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface2);
  color: var(--text); font-size: 1rem; font-family: inherit;
}
.setup-field input:focus { outline: none; border-color: var(--blue); }
/* Cuestionario del perfil */
.pf-barra { height: 6px; background: var(--surface2); border-radius: 99px; overflow: hidden; margin: -12px 0 20px; }
.pf-barra > div { height: 100%; width: 0; background: var(--blue); transition: width var(--transition); }
.pf-botones { display: flex; gap: 8px; margin-top: 8px; }
.pf-botones .setup-cancel { margin-top: 0 !important; }
.setup-grupo { border: none; padding: 0; }
.setup-grupo legend { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-size: 0.85rem; }
.chip input:checked + span { background: var(--btn-blue); border-color: var(--btn-blue); color: #fff; font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.header-botones { display: flex; gap: 8px; }
.pf-sub { margin-top: 12px; }
.meal-todas summary { cursor: pointer; font-size: 0.8rem; font-weight: 600; color: var(--blue); padding: 8px 0; min-height: 44px; display: flex; align-items: center; }
.pf-riesgo { color: var(--red); }
/* ===== En casa: entreno guiado (restaurado de la etiqueta calistenia-en-casa) ===== */
.phase-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
/* Bloques de fuerza (1, 2, 3): mismo estilo que las pestañas de fase */
.block-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.block-btn {
  padding: 7px 4px; min-height: 44px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: inherit; font: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer;
}
.block-btn.active { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.phase-tab:disabled, .block-btn:disabled { opacity: 0.45; cursor: not-allowed; }   /* entreno en marcha */
.phase-tab {
  padding: 8px 4px;
  min-height: 44px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  transition: all var(--transition);
}
.phase-tab.active { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }

.exercise-list { display: flex; flex-direction: column; gap: 10px; }
/* Cada ejercicio es un desplegable: cerrado, «1 Nombre ▾»; abierto, la explicación, los tiempos y el vídeo */
.exercise-item {
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.exercise-item.active-exercise { background: var(--blue-light); border-color: var(--blue); }
.exercise-item.done-exercise { opacity: 0.5; }
.exercise-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
  flex-shrink: 0;
}
.exercise-item summary { list-style: none; display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.exercise-item summary::-webkit-details-marker { display: none; }
.exercise-item[open] .lab-flecha:before { transform: translateY(2px) rotate(225deg); border-color: var(--blue); }
.exercise-name { flex: 1; min-width: 0; font-weight: 600; font-size: 0.9rem; }
.exercise-cuerpo { margin: 10px 0 0 44px; }
.exercise-tip { font-size: 0.8rem; color: var(--text-muted); }
.exercise-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.exercise-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
}
.exercise-video {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--red-light);
  color: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  transition: all var(--transition);
  flex-shrink: 0;
}
.exercise-video:hover { background: var(--red); color: white; transform: scale(1.1); }

/* TIMER */
.timer-display {
  text-align: center;
  padding: 30px 20px;
}
.timer-phase-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.timer-exercise-name {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 20px;
  min-height: 2rem;
}
.timer-circle-wrap {
  position: relative;
  width: 180px; height: 180px;
  margin: 0 auto 20px;
}
.timer-circle-wrap svg { transform: rotate(-90deg); }
.timer-circle-bg { fill: none; stroke: var(--border); stroke-width: 8; }
.timer-circle-fg {
  fill: none;
  stroke: var(--blue);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}
.timer-circle-fg.rest { stroke: var(--green); }
.timer-number {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  font-weight: 900;
  color: var(--text);
}
.timer-controls { display: flex; gap: 12px; justify-content: center; }
.timer-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--transition);
}
.timer-btn:active { transform: scale(0.92); }
.timer-btn.play { background: var(--btn-blue); color: white; width: 68px; height: 68px; font-size: 1.6rem; }
.timer-btn.stop { background: var(--red-light); color: var(--red); }
.timer-status { font-size: 0.8rem; color: var(--text-muted); margin-top: 12px; }
.timer-btn .ico { width: 24px; height: 24px; }
.timer-btn.play .ico { width: 28px; height: 28px; }

[aria-disabled="true"].gym-reloj, #startWorkoutBtn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }   /* el Timer lo usa el otro modo */

/* Modos de entreno: píldoras «Mis modos» (activan) y acordeones (pliegan) */
.modos { margin-bottom: 14px; }
.modos-titulo { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.modos-fila { display: flex; flex-wrap: wrap; gap: 8px; }
.pildora { min-height: 44px; padding: 8px 16px; border-radius: 99px; border: 2px solid var(--border); background: var(--surface); color: var(--text-muted);
  font: inherit; font-weight: 600; cursor: pointer; transition: all var(--transition); }
.pildora[aria-pressed="true"] { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.pildora[aria-disabled="true"] { cursor: not-allowed; }
.pildora:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.modos-estado { margin: 8px 0 0; min-height: 1.1em; font-size: 0.8rem; font-weight: 600; color: var(--red); }
.modo { margin-bottom: 12px; }
.modo > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 10px; cursor: pointer; user-select: none;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.modo > summary::-webkit-details-marker { display: none; }
.modo--solo > summary { display: none; }   /* con un solo modo no hay acordeón */
.modo[open] > summary .lab-flecha:before { transform: translateY(2px) rotate(225deg); border-color: var(--blue); }
.pf-error { margin: -4px 0 12px; font-size: 0.8rem; font-weight: 600; color: var(--red); }
.setup-note { font-size: 0.7rem; color: var(--text-muted); margin-top: 16px; line-height: 1.4; }
.setup-cancel {
  margin-top: 8px !important;
  background: var(--surface2) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border) !important;
}

/* ===== FOOTER ===== */
.app-footer {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  padding: 16px 20px;
  font-size: 0.65rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.app-footer strong { color: var(--text); font-weight: 700; }
.footer-links { display: flex; justify-content: center; gap: 16px; margin-top: 2px; }
.footer-links a { color: var(--blue); font-weight: 600; font-size: 0.65rem; }
.footer-links a:hover { text-decoration: underline; }

/* ===== RESPONSIVE ===== */
@media (min-width: 480px) {
  .app-container { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  .app-footer { max-width: 480px; }
}

/* PC y tablet apaisada: la app usa el ancho de la pantalla (en %, con un tope para que el texto no quede
   larguísimo en monitores grandes). Cada tarjeta a TODO el ancho, una debajo de otra (como en el móvil):
   así nada salta de sitio al abrir o cerrar algo (con columnas, las tarjetas se recolocaban solas). Lo que se
   reparte en horizontal es el CONTENIDO de cada tarjeta, en columnas automáticas. En el móvil no cambia nada. */
@media (min-width: 900px) {
  .app-container, .app-footer { max-width: max(50vw, 680px); }   /* 25 % de margen a cada lado; nunca más estrecha de 680 px */
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }   /* las 9 tarjetas en una fila en un portátil */
  #exerciseList { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
  /* Dentro de las tarjetas, en fila: comidas del día, todas las opciones, recomendaciones, alimentos, logros, metas, días */
  #comidasIdeas, #comidasTodasLista, #comidasConsejos { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: start; }
  .food-grid, .logros-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .metas-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .semana-dias { display: grid; grid-template-columns: repeat(7, 1fr); }
}

/* Editor del plan del gimnasio (constructor-plan.js) */
.btn-suave { padding: 8px 16px; margin-bottom: 12px; font-size: 0.75rem; background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); border-radius: 99px; }
.cons { margin-bottom: 14px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface2); }
.cons[hidden] { display: none; }
.cons-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.cons-sub { font-size: 0.75rem; color: var(--text-muted); }
.cons-campo { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.8rem; color: var(--text-muted); }
.cons-select, .cons-texto, .cons-num { min-width: 0; font: inherit; font-size: 1rem; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.cons-select, .cons-texto { flex: 1; }
.cons-num { width: 4.5rem; }
.cons-dias { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cons-dias .gym-dia { flex: 1 1 4.5rem; }
.cons-lista { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cons-fila { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cons-nombre { font-size: 0.85rem; }
.cons-quitar, .cons-quitar-dia, .semana-quitar { min-height: 36px; padding: 4px 12px; font: inherit; font-size: 0.75rem; color: var(--text-muted); background: transparent; border: 1px solid var(--border); border-radius: 99px; cursor: pointer; }
.cons-anadir { display: flex; gap: 8px; margin-bottom: 8px; }
.cons-mas { min-height: 44px; padding: 8px 14px; font-size: 0.85rem; white-space: nowrap; }
.cons-nuevo { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.semana-quitar { margin-left: 8px; min-height: 32px; vertical-align: middle; }
.pausa-editor { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 0.85rem; color: var(--text-muted); }
.pausa-editor[hidden] { display: none; }
.btn-icono { display: block; margin: 12px 0 0 auto; min-width: 44px; min-height: 44px; font-size: 1.3rem; line-height: 1; color: var(--blue); background: var(--blue-light); border: 2px solid var(--blue); border-radius: 50%; cursor: pointer; }
.semana-lapiz { margin-left: auto; min-width: 32px; min-height: 32px; border-radius: 50%; border: 2px solid var(--blue); background: var(--blue-light); color: var(--blue); font-size: 1rem; cursor: pointer; vertical-align: middle; }
.semana-editor { flex: 0 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: 0.8rem; color: var(--text-muted); }
.semana-editor label { display: flex; align-items: center; gap: 6px; }
.semana-fecha { font: inherit; font-size: 1rem; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.semana-sesiones { flex: 1; min-width: 0; }
.semana-ses { display: flex; flex-wrap: wrap; align-items: center; margin: 2px 0; }
.semana-ver { flex: 1; background: none; border: 0; padding: 6px 0; min-height: 32px; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.semana-flecha { margin-left: 4px; color: var(--text-muted); }
.semana-ver[aria-expanded="true"] .semana-flecha { display: inline-block; transform: rotate(180deg); }
.sesion-hecha { flex: 0 0 100%; display: flex; flex-direction: column; gap: 8px; margin: 8px 0; text-align: left; font-weight: 400; color: var(--text); }
.sesion-hecha-cab { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: capitalize; }
.sesion-hecha .gym-ej { cursor: default; }
button.plan-check { padding: 0; font-family: inherit; }
button.plan-check.checked { cursor: pointer; }
.plan-detalle { width: 100%; margin-top: 8px; }
.semana-dia.abierto { grid-column: 1 / -1; }
.sesion-hecha .cardio-fila { background: var(--blue-light); border-color: var(--blue); }
.sesion-hecha .cardio-fila .gym-ej-num { background: var(--blue); color: white; }
