/* GANAS — sistema visual premium (F0–F3).
   Identidad: el piso de hule del gimnasio (grafito), la magnesia (blanco cálido) y los discos de competición
   (rojo 25 · azul 20 · amarillo 15 · verde 10), que aquí codifican DATOS: grupos musculares, macros, niveles.
   El naranja GANAS se reserva para la acción principal de cada pantalla. Tipografía: Archivo (variable, con eje
   de anchura), condensada para los números. Oscuro según el sistema; claro y oscuro también forzables. */

@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* Magnesia (claro) */
  --bg: #f1f1ee;
  --surface: #ffffff;
  --surface-2: #e9eae6;
  --surface-3: #dcded9;
  --border: #d9dbd5;
  --text: #16181a;
  --muted: #555b61;
  --faint: #63696f;
  --accent: #d2470f;
  --accent-2: #ef5c1f;
  --accent-ink: #ffffff;
  --accent-soft: rgba(210, 71, 15, 0.11);
  /* Discos de competición */
  --plate-red: #c8213a;
  --plate-blue: #1f5bc4;
  --plate-yellow: #c99700;
  --plate-green: #23874e;
  --plate-white: #8b9096;
  --protein: var(--plate-blue);
  --carbs: var(--plate-yellow);
  --fat: var(--plate-red);
  --good: var(--plate-green);
  --warn: #946000;
  --bad: #c8213a;
  --track: rgba(22, 24, 26, 0.09);
  --focus: #1f5bc4;
  /* Bloque protagonista: losa de grafito en claro */
  --slab: #1d2023;
  --slab-2: #2a2e32;
  --slab-text: #eceae4;
  --slab-muted: #b4b8bc;
  --shadow: 0 1px 2px rgba(22, 24, 26, 0.05);
  --shadow-lift: 0 10px 28px rgba(22, 24, 26, 0.16);
  --radius: 14px;
  --radius-sm: 10px;
  --r-hero: 24px;
  --nav-h: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* Áreas seguras (notch, barra de estado, barra de gestos). En la app Android, Capacitor además
     inyecta --safe-area-inset-* cuando el WebView no reporta env(); se usa el mayor. */
  --safe-t: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px));
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px));
  --safe-l: max(env(safe-area-inset-left, 0px), var(--safe-area-inset-left, 0px));
  --safe-r: max(env(safe-area-inset-right, 0px), var(--safe-area-inset-right, 0px));
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17191b;
    --surface: #202326;
    --surface-2: #282b2f;
    --surface-3: #33373c;
    --border: #2f3337;
    --text: #eceae4;
    --muted: #a8acb0;
    --faint: #8a8f94;
    --accent: #ff6a2b;
    --accent-2: #ff8a52;
    --accent-ink: #1a0a03;
    --accent-soft: rgba(255, 106, 43, 0.14);
    --plate-red: #ff5a6e;
    --plate-blue: #6e9bff;
    --plate-yellow: #f4c842;
    --plate-green: #4cc985;
    --plate-white: #c9ccd0;
    --warn: #f0a92e;
    --bad: #ff6b6b;
    --track: rgba(236, 234, 228, 0.09);
    --focus: #8fb2ff;
    --slab: #23272b;
    --slab-2: #2e3337;
    --slab-text: #eceae4;
    --slab-muted: #a8acb0;
    --shadow: none;
    --shadow-lift: 0 14px 34px rgba(0, 0, 0, 0.45);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17191b;
  --surface: #202326;
  --surface-2: #282b2f;
  --surface-3: #33373c;
  --border: #2f3337;
  --text: #eceae4;
  --muted: #a8acb0;
  --faint: #8a8f94;
  --accent: #ff6a2b;
  --accent-2: #ff8a52;
  --accent-ink: #1a0a03;
  --accent-soft: rgba(255, 106, 43, 0.14);
  --plate-red: #ff5a6e;
  --plate-blue: #6e9bff;
  --plate-yellow: #f4c842;
  --plate-green: #4cc985;
  --plate-white: #c9ccd0;
  --warn: #f0a92e;
  --bad: #ff6b6b;
  --track: rgba(236, 234, 228, 0.09);
  --focus: #8fb2ff;
  --slab: #23272b;
  --slab-2: #2e3337;
  --slab-text: #eceae4;
  --slab-muted: #a8acb0;
  --shadow: none;
  --shadow-lift: 0 14px 34px rgba(0, 0, 0, 0.45);
}

/* ── Base ───────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body.no-scroll { overflow: hidden; }
html, body { overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a, [data-action], label { touch-action: manipulation; }
button, .chip, .tab, .nav-item, .seg-item, .btn { -webkit-user-select: none; user-select: none; }
a { color: var(--accent); }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.set-in:focus-visible, .input:focus-visible { outline: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.005em; text-wrap: balance; }
h1 { font-size: 1.85rem; font-weight: 800; font-stretch: 78%; }
h2 { font-size: 1.28rem; font-weight: 750; font-stretch: 86%; }
h3 { font-size: 1.04rem; font-weight: 700; }
p { margin: 0; text-wrap: pretty; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.88rem; }
.tiny { font-size: 0.78rem; }
.num { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.mt { margin-top: 12px; }
.mt2 { margin-top: 20px; }
.mb { margin-bottom: 12px; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }
.ico { flex-shrink: 0; }

/* Números: la cifra manda (Archivo condensada, cifras tabulares). */
.kpi, .rest-time, .ses-time, .ring-label strong, .stat b, .rank-score, .plan .price, .lvl-badge, .hero-title, .set-in {
  font-stretch: 74%; font-variant-numeric: tabular-nums;
}

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }
.screen { padding: calc(12px + var(--safe-t)) calc(16px + var(--safe-r)) calc(var(--nav-h) + 28px + var(--safe-b)) calc(16px + var(--safe-l)); }
.screen-sesion, .screen-bienvenida { padding-bottom: calc(150px + var(--safe-b)); }

/* Transición de pantalla (View Transitions; sin ella la pantalla cambia sin animación). */
::view-transition-old(root) { animation: 120ms var(--ease) both vt-out; }
::view-transition-new(root) { animation: 200ms var(--ease) both vt-in; }
.bottom-nav { view-transition-name: ganas-nav; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* ── Barra superior ─────────────────────────────────────── */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 16px; }
.topbar .title { min-width: 0; }
.topbar .title small { display: block; color: var(--muted); font-size: 0.86rem; font-weight: 600; }
.icon-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); display: inline-grid; place-items: center; color: var(--text); flex-shrink: 0;
  transition: background-color 0.15s ease, transform 0.12s ease;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; background: var(--slab); color: var(--slab-text);
  display: grid; place-items: center; font-weight: 800; font-stretch: 80%; font-size: 1.15rem; border: none; flex-shrink: 0;
}

/* ── Módulos (antes «tarjetas»): planos; la jerarquía la da el protagonista ── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.card + .card, .card + .section, .section + .card { margin-top: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.card-head h3 .ico { color: var(--faint); }
/* Protagonista: losa de grafito con canto de disco. Una por pantalla. */
.card-hero {
  position: relative; overflow: hidden;
  background: var(--slab); color: var(--slab-text); border: none; border-radius: var(--r-hero);
  padding: 20px 18px 18px; box-shadow: var(--shadow-lift);
}
.card-hero::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 0 4px 4px 0; background: var(--plate, var(--accent)); }
.card-hero h2 { font-size: 2.1rem; font-stretch: 72%; font-weight: 850; line-height: 1.02; }
.card-hero .card-head h3 { color: var(--slab-muted); font-size: 0.92rem; font-weight: 700; }
.card-hero .card-head h3 .ico { color: var(--accent); }
.card-hero .muted, .card-hero small { color: var(--slab-muted); }
.card-hero .btn-primary { background: var(--accent); color: var(--accent-ink); }
.card-hero .btn-ghost, .card-hero .btn:not(.btn-primary) { background: var(--slab-2); color: var(--slab-text); border-color: transparent; }
.card-soft { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.card.accent-border { border-color: var(--accent); }
.section { margin-top: 24px; }
.section-title { font-size: 0.95rem; color: var(--muted); font-weight: 700; margin: 0 2px 10px; letter-spacing: 0; }
.kpi { font-size: 2.3rem; font-weight: 850; letter-spacing: -0.01em; line-height: 1; }
.kpi small { font-size: 0.95rem; color: var(--muted); font-weight: 600; font-stretch: 100%; }

/* ── Botones ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); font-weight: 700; text-decoration: none; color: var(--text); min-width: 0;
  transition: transform 0.12s ease, opacity 0.15s ease, background-color 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.quick-actions .btn { flex-direction: column; gap: 4px; min-height: 64px; padding: 6px 4px; font-size: 0.8rem; border-radius: 12px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--bad); color: #fff; border-color: transparent; }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 0 14px; border-radius: 10px; font-size: 0.92rem; }
.btn-xl { min-height: 58px; font-size: 1.08rem; border-radius: 14px; font-stretch: 90%; letter-spacing: 0.01em; }
.link-btn { background: none; border: none; color: var(--accent); font-weight: 700; padding: 12px 4px; min-height: 44px; }

/* ── Chips y segmentados ────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 0.9rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.chip.on { background: var(--text); color: var(--bg); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg-item { flex: 1; min-height: 44px; border: none; border-radius: 9px; background: transparent; font-weight: 700; color: var(--muted); transition: background-color 0.15s ease, color 0.15s ease; }
.seg-item.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; overscroll-behavior-x: contain; }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; border: 1px solid var(--border); background: transparent; border-radius: 999px; min-height: 40px; padding: 0 16px; font-weight: 700; font-size: 0.9rem; color: var(--muted); transition: background-color 0.15s ease, color 0.15s ease; }
.tab.on { background: var(--text); color: var(--bg); border-color: transparent; }

/* ── Opciones grandes (onboarding) ──────────────────────── */
.options { display: grid; gap: 10px; }
.options.two { grid-template-columns: 1fr 1fr; }
.option {
  text-align: left; border: 1.5px solid var(--border); background: var(--surface); border-radius: 14px;
  padding: 14px 16px; display: flex; gap: 12px; align-items: center; min-height: 64px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.option.on { border-color: var(--accent); background: var(--accent-soft); }
.option .opt-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); flex-shrink: 0; }
.option.on .opt-ico { background: var(--accent); color: var(--accent-ink); }
.option strong { display: block; }
.option small { color: var(--muted); }

/* ── Campos ─────────────────────────────────────────────── */
.field { display: block; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; } /* grupos de opciones (motivos de reporte) sin el marco del navegador */
.field > span { display: block; font-size: 0.86rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); padding: 0 14px; outline: none;
}
select.input { background-color: var(--surface-2); color: var(--text); }
textarea.input { padding: 12px 14px; min-height: 96px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-big { font-size: 1.9rem; font-weight: 850; font-stretch: 74%; text-align: center; min-height: 68px; font-variant-numeric: tabular-nums; }
.search { position: relative; }
.search .ico { position: absolute; left: 14px; top: 14px; color: var(--faint); }
.search .input { padding-left: 44px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); min-height: 56px; }
.toggle:last-child { border-bottom: none; }
.switch { width: 52px; height: 32px; border-radius: 999px; background: var(--surface-3); border: none; position: relative; flex-shrink: 0; transition: background-color 0.18s ease; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.18s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch::before { content: ""; position: absolute; inset: -8px -4px; } /* zona táctil de 48 px sin cambiar el aspecto */
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); }

/* ── Listas ─────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--border); min-height: 56px;
  background: none; border-left: none; border-right: none; border-top: none; text-align: left; width: 100%; color: var(--text);
}
/* Listas largas (historial, búsqueda): el navegador salta lo que no está en pantalla. */
.list > .list-item { content-visibility: auto; contain-intrinsic-size: auto 60px; }
.list-item:last-child { border-bottom: none; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-main strong { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-main small { color: var(--muted); }
.li-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); flex-shrink: 0; }
.icon-btn[disabled] { opacity: 0.35; pointer-events: none; }
.badge { white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; font-size: 0.74rem; font-weight: 750; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted); vertical-align: middle; }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge.pro { background: var(--slab); color: var(--slab-text); }

/* Glifos (sustituyen a los emojis): íconos de trazo y puntos de color de disco. */
.glyph { display: inline-grid; place-items: center; vertical-align: -0.18em; color: currentColor; }
.lvl-dot { display: inline-block; width: 0.62em; height: 0.62em; border-radius: 50%; background: var(--plate, var(--faint)); vertical-align: 0.05em; box-shadow: 0 0 0 2px color-mix(in srgb, var(--plate, var(--faint)) 22%, transparent); }
.plate-red { --plate: var(--plate-red); }
.plate-blue { --plate: var(--plate-blue); }
.plate-yellow { --plate: var(--plate-yellow); }
.plate-green { --plate: var(--plate-green); }
.plate-white { --plate: var(--plate-white); }

/* ── Barras y anillos ───────────────────────────────────── */
.bar { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.3s var(--ease); }
.bar.protein > span { background: var(--protein); }
.bar.carbs > span { background: var(--carbs); }
.bar.fat > span { background: var(--fat); }
.bar.good > span { background: var(--good); }
.bar.bar-over > span { background: var(--warn); }
.ring { position: relative; color: var(--accent); flex-shrink: 0; }
.ring svg { display: block; }
.ring svg circle { transition: stroke-dasharray 0.4s var(--ease); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--text); }
.ring-label strong { font-size: 1.7rem; font-weight: 850; line-height: 1; }
.ring-label small { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.macro { display: grid; grid-template-columns: minmax(64px, 92px) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 0.9rem; }
.macro + .macro { margin-top: 9px; }
.macro b { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 750; }
.ring-row { flex-wrap: wrap; justify-content: center; }
.ring-row > .grow { min-width: 190px; }

/* ── Navegación inferior ────────────────────────────────── */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}
.bottom-nav .inner { max-width: 560px; margin: 0 auto; height: var(--nav-h); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
.nav-item { position: relative; background: none; border: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 100%; font-size: 0.72rem; font-weight: 700; color: var(--faint); transition: color 0.15s ease; }
.nav-item::before { content: ""; position: absolute; top: 0; left: 50%; width: 28px; height: 3px; margin-left: -14px; border-radius: 0 0 3px 3px; background: var(--accent); transform: scaleX(0); transition: transform 0.2s var(--ease); }
.nav-item.on { color: var(--text); }
.nav-item.on::before { transform: scaleX(1); }
.nav-item.on .ico { color: var(--text); }
.nav-plus { justify-self: center; width: 56px; height: 56px; border-radius: 16px; border: none; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 38%, transparent); transition: transform 0.12s ease; }
.nav-plus:active { transform: scale(0.94); }

/* ── Hojas inferiores ───────────────────────────────────── */
#sheet-root { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
#sheet-root.open { pointer-events: auto; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); animation: fade 0.18s ease; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto;
  background: var(--surface); border-radius: 22px 22px 0 0; max-height: 88vh; max-height: min(88vh, calc(100dvh - var(--safe-t) - 16px)); display: flex; flex-direction: column;
  padding-bottom: var(--safe-b); animation: up 0.24s var(--ease);
}
.sheet-tall { height: 88vh; height: min(88vh, calc(100dvh - var(--safe-t) - 16px)); }
.sheet-handle { width: 40px; height: 5px; border-radius: 99px; background: var(--surface-3); margin: 8px auto 2px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 8px; gap: 10px; }
.sheet-body { padding: 4px 16px 20px; overflow-y: auto; overscroll-behavior: contain; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ── Avisos ─────────────────────────────────────────────── */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 16px + var(--safe-b)); z-index: 80; display: flex; justify-content: center; pointer-events: none; opacity: 0; transform: translateY(10px); transition: opacity 0.2s ease, transform 0.2s var(--ease); padding: 0 16px; }
#toast-root.show { opacity: 1; transform: none; }
/* Oculto no recibe toques (antes, invisible, tapaba botones debajo). */
#toast-root:not(.show) .toast { pointer-events: none; }
.toast { pointer-events: auto; background: var(--slab); color: var(--slab-text); padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 0.92rem; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow-lift); max-width: 520px; }
.toast-btn { background: none; border: none; color: var(--accent); font-weight: 800; min-height: 40px; }

/* ── Vacíos: una invitación a actuar ────────────────────── */
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty > .ico { box-sizing: content-box; padding: 16px; border-radius: 50%; background: var(--surface-2); color: var(--faint); }
.empty h3 { color: var(--text); margin: 14px 0 6px; font-size: 1.2rem; font-stretch: 86%; }
.empty .btn { margin-top: 16px; }
/* Recuperación del almacenamiento (solo cuando hace falta) */
.screen-recovery { min-height: 70vh; display: flex; align-items: center; }
.recovery { width: 100%; text-align: center; padding: 28px 20px; }
.recovery-icon { color: var(--muted); margin-bottom: 8px; }
.recovery h2 { margin: 6px 0 8px; }

/* ── Onboarding ─────────────────────────────────────────── */
.ob-progress { display: flex; gap: 6px; margin: 4px 0 20px; }
.ob-progress span { flex: 1; height: 4px; border-radius: 99px; background: var(--track); transition: background-color 0.2s ease; }
.ob-progress span.on { background: var(--accent); }
.ob-hero { text-align: center; padding: 52px 8px 24px; }
.ob-hero h1 { font-size: 2.2rem; font-stretch: 72%; line-height: 1.02; }
.brand { font-weight: 900; letter-spacing: 0.04em; font-size: 2.7rem; font-stretch: 125%; }
.brand span { color: var(--accent); }
.ob-footer { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + var(--safe-b)); background: linear-gradient(transparent, var(--bg) 28%); z-index: 20; }
.ob-footer .inner { max-width: 528px; margin: 0 auto; display: flex; gap: 10px; }

/* ── Sesión de entrenamiento ────────────────────────────── */
.session-head {
  position: sticky; top: 0; z-index: 10; margin: calc(-12px - var(--safe-t)) -16px 14px; padding: calc(10px + var(--safe-t)) 16px 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.ses-title { font-size: 1.05rem; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ses-clock { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.ses-time { font-size: 3rem; font-weight: 850; line-height: 1; letter-spacing: -0.01em; }
.ses-sub { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.ses-progress { margin-top: 10px; height: 5px; }
.ses-status { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 0.88rem; color: var(--muted); }
.ses-status .ses-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); flex-shrink: 0; }
.ses-status.paused .ses-dot { background: var(--warn); }
.ses-help { margin: -4px 2px 12px; font-size: 0.84rem; color: var(--muted); }
.ses-help summary { font-weight: 600; color: var(--muted); min-height: 36px; display: flex; align-items: center; gap: 6px; }
.ses-help p { margin-top: 6px; }
.ex-card { padding: 16px 14px; transition: opacity 0.2s ease; }
.ex-card.is-current { border: 1.5px solid var(--text); box-shadow: var(--shadow-lift); position: relative; overflow: hidden; }
.ex-card.is-current::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--plate, var(--accent)); }
.ex-card.done { opacity: 0.72; }
.ex-card.skipped { opacity: 0.5; }
.ex-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ex-title h3 { font-size: 1.12rem; font-weight: 750; }
.ex-card.is-current .ex-title h3 { font-size: 1.32rem; font-stretch: 86%; }
.ex-plate { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--plate, var(--faint)); margin-right: 6px; vertical-align: 0.08em; }
.ex-meta { font-size: 0.86rem; color: var(--muted); margin-top: 3px; }
.ex-suggest { margin-top: 10px; background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; font-size: 0.88rem; }
.ex-suggest summary { min-height: 28px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ex-suggest strong { color: var(--accent); }
.set-table { width: 100%; margin-top: 10px; border-collapse: separate; border-spacing: 0 6px; }
.set-table th { font-size: 0.74rem; color: var(--faint); font-weight: 700; text-align: center; padding: 0 2px; }
.set-table td { text-align: center; padding: 0 3px; }
.set-idx { width: 28px; font-weight: 850; color: var(--muted); font-stretch: 80%; font-size: 1.05rem; }
.set-idx.warm { color: var(--warn); }
.set-prev { font-size: 0.78rem; color: var(--faint); width: 60px; font-variant-numeric: tabular-nums; }
.set-in { width: 100%; min-width: 0; height: 52px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); text-align: center; font-weight: 850; font-size: 1.3rem; transition: background-color 0.18s ease, border-color 0.18s ease; }
.set-in:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.set-done { width: 52px; height: 52px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); display: grid; place-items: center; color: var(--faint); transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease; }
.set-done:active { transform: scale(0.92); }
.set-row.is-done .set-done { background: var(--good); border-color: transparent; color: #04170d; }
.set-row.is-done .set-in { background: transparent; border-color: transparent; }
.rir-row { display: flex; gap: 6px; justify-content: flex-end; align-items: center; margin: -2px 0 6px; }
.rir-chip { min-width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 800; font-size: 0.9rem; color: var(--muted); transition: background-color 0.15s ease, color 0.15s ease; }
.rir-chip.on { background: var(--text); color: var(--bg); border-color: transparent; }
.rest-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 12px 16px calc(12px + var(--safe-b));
  background: var(--slab); color: var(--slab-text); box-shadow: 0 -12px 30px rgba(0,0,0,.28);
}
.rest-bar .inner { max-width: 528px; margin: 0 auto; display: flex; align-items: center; gap: 8px; }
.rest-time { font-size: 2.3rem; font-weight: 850; min-width: 86px; line-height: 1; }
.rest-bar .bar { flex: 1; height: 6px; background: rgba(236, 234, 228, 0.14); }
.rest-bar .bar > span { width: 100%; transform-origin: left center; transform: scaleX(0); transition: transform 0.5s linear; background: var(--accent); }
.rest-bar .btn { background: var(--slab-2); color: var(--slab-text); border-color: transparent; min-width: 52px; }
.rest-bar.done .rest-time { color: var(--plate-green); }
.rest-bar.done .bar > span { background: var(--plate-green); }
.pr-flag { color: var(--warn); font-weight: 800; font-size: 0.78rem; display: inline-flex; align-items: center; gap: 3px; }

/* ── Gráficas ───────────────────────────────────────────── */
.chart { width: 100%; height: auto; display: block; }
.chart .axis { font-size: 10px; fill: var(--faint); font-family: var(--font); }
.chart .grid { stroke: var(--track); stroke-width: 1; }
.chart .goal { stroke: var(--good); stroke-dasharray: 4 4; stroke-width: 1.2; }
.chart-empty { padding: 26px 0; text-align: center; font-size: 0.9rem; color: var(--muted); }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; font-size: 0.86rem; }
.hbar-track { position: relative; height: 10px; border-radius: 99px; background: var(--track); overflow: hidden; }
.hbar-range { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--good) 20%, transparent); }
.hbar-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 99px; background: var(--plate-blue); }
.hbar-fill.low { background: var(--warn); }
.hbar-fill.high { background: var(--plate-red); }
.hbar-val { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
.heatmap .hm0 { fill: var(--track); }
.heatmap .hm1 { fill: color-mix(in srgb, var(--accent) 35%, transparent); }
.heatmap .hm2 { fill: color-mix(in srgb, var(--accent) 65%, transparent); }
.heatmap .hm3 { fill: var(--accent); }

/* ── Calendario ─────────────────────────────────────────── */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 0.74rem; color: var(--faint); font-weight: 700; padding-bottom: 4px; }
.cal-day { aspect-ratio: 1 / 1.1; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 5px 2px; font-size: 0.82rem; }
.cal-day.out { opacity: 0.35; }
.cal-day.today { border-color: var(--accent); border-width: 1.5px; }
.cal-day .n { font-weight: 750; font-variant-numeric: tabular-nums; }
.cal-dots { display: flex; gap: 3px; min-height: 8px; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.dot-train { background: var(--accent); }
.dot-plan { border: 1.5px solid var(--accent); }
.dot-food { background: var(--protein); }
.dot-pr { background: var(--plate-yellow); }
.dot-weight { background: var(--good); }

/* ── Semana (tira) ──────────────────────────────────────── */
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ws-day { text-align: center; font-size: 0.74rem; color: var(--faint); font-weight: 700; min-width: 0; padding: 0; min-height: 48px; }
.ws-day .c { width: 36px; height: 36px; margin: 4px auto 0; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--border); color: var(--muted); font-size: 0.88rem; font-weight: 750; font-variant-numeric: tabular-nums; transition: background-color 0.18s ease; }
.ws-day.done .c { background: var(--text); border-color: transparent; color: var(--bg); }
.ws-day.today .c { border-color: var(--accent); border-width: 2px; color: var(--text); }
.ws-day.today { color: var(--text); }

/* ── Pro ────────────────────────────────────────────────── */
.pro-hero { text-align: center; padding: 20px 8px 8px; }
.pro-hero .crown { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--slab); color: var(--accent); }
.plan { border: 2px solid var(--border); border-radius: 16px; padding: 14px 16px; background: var(--surface); text-align: left; width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 64px; transition: border-color 0.15s ease, background-color 0.15s ease; }
.plan.on { border-color: var(--accent); background: var(--accent-soft); }
.plan .price { font-size: 1.5rem; font-weight: 900; }
.feature { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.feature .li-ico { background: var(--accent-soft); color: var(--accent); }
.lock-card { position: relative; overflow: hidden; }
.lock-overlay { position: absolute; inset: 0; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(3px); display: grid; place-content: center; text-align: center; gap: 8px; padding: 16px; }
.lock-overlay .ico { margin: 0 auto; color: var(--faint); }

/* ── Varios ─────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.note { background: var(--surface-2); border-radius: 12px; padding: 11px 13px; font-size: 0.88rem; color: var(--muted); }
.note.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--text); }
/* Estado de la sincronización: una línea discreta, sin términos técnicos */
.sync-line { display: flex; align-items: center; gap: 6px; margin: 6px 0; font-size: 0.86rem; color: var(--muted); }
.sync-line svg { flex: none; }
.sync-line.ok svg { color: var(--good); }
.sync-line.warn { color: var(--text); }
.sync-line.warn svg { color: var(--warn); }
/* Diagnóstico técnico (solo desarrollo/staging) */
.diag summary { cursor: pointer; }
.diag-text { margin-top: 10px; max-height: 50vh; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 0.72rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); border-radius: 10px; padding: 10px; }
.note.danger { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--text); }
.why { margin-top: 8px; font-size: 0.86rem; color: var(--muted); }
.why li + li { margin-top: 4px; }
.why ul { padding-left: 18px; margin: 6px 0 0; }
details summary { cursor: pointer; font-weight: 700; color: var(--accent); list-style: none; }
details summary::-webkit-details-marker { display: none; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.scanner video { width: 100%; border-radius: 16px; background: #000; aspect-ratio: 4 / 3; object-fit: cover; }
/* Lector incluido (Android sin Google Play Services): la cámara nativa está detrás del WebView; mientras se
   escanea, la página es transparente y solo se ve el visor (scanner.js · showCameraView). */
html.barcode-scanner-active, html.barcode-scanner-active body { background: transparent !important; }
html.barcode-scanner-active body > :not(.scan-cam) { visibility: hidden !important; }
.scan-cam { position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 24px 24px calc(24px + env(safe-area-inset-bottom)); color: #fff; }
.scan-cam-frame { width: min(78vw, 320px); aspect-ratio: 16 / 10; border: 3px solid rgba(255,255,255,.92); border-radius: 18px;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
.scan-cam-hint { margin: 0; font-weight: 600; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.scan-cam-cancel { position: absolute; bottom: calc(32px + env(safe-area-inset-bottom)); min-width: 180px; }
.food-meta { font-size: 0.8rem; color: var(--muted); }
.meal-head { display: flex; justify-content: space-between; align-items: baseline; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 12px 8px; text-align: center; }
.stat b { display: block; font-size: 1.55rem; font-weight: 850; line-height: 1.05; }
.stat small { color: var(--muted); font-size: 0.75rem; }

@media (min-width: 620px) {
  .screen { padding-left: 8px; padding-right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Tutoriales escritos, sin reproductor ni dependencias gráficas. */
.tut-tags{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:16px}
.tut-muscles{display:flex;align-items:center;gap:20px;padding:16px;background:var(--surface-2);border-radius:var(--radius);margin-bottom:24px}
.tut-map{width:108px;flex-shrink:0}.tut-map svg{width:100%;height:auto;display:block}
.tut-mlist{min-width:0}.tut-h{display:flex;gap:8px;align-items:center;margin:24px 0 12px}
.steps{padding-left:25px;line-height:1.65}.steps li{padding:0 0 10px 5px}.steps li::marker{color:var(--accent);font-weight:700}
.tut-note{display:flex;gap:10px;align-items:flex-start;line-height:1.6;padding:12px 0}.tut-note svg{flex-shrink:0;margin-top:3px}
.tut details{padding:14px;background:var(--surface-2);border-radius:var(--radius-sm)}
@media(max-width:350px){.tut-muscles{gap:12px;padding:12px}.tut-map{width:80px}}

.save-notice { position:fixed; z-index:10000; bottom:0; left:0; right:0; padding:16px 16px calc(16px + var(--safe-b)); background:#7a2412; color:white; text-align:center; }
.save-notice button { padding:8px 12px; margin-left:8px; border-radius:8px; min-height: 40px; }

/* ── Plan: alta, cambiar plan y biblioteca ──────────────── */
.option[disabled] { opacity: .5; cursor: not-allowed; }
.option .opt-emoji { font-size: 1.35rem; background: var(--surface-2); color: var(--text); }
.option.on .opt-emoji { background: var(--accent-soft); color: var(--accent); }
.option .grow { min-width: 0; }
.option .badge { flex-shrink: 0; align-self: center; }
.rec-card { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; padding: 16px; margin-bottom: 12px; border-radius: var(--radius); border: 2px solid var(--border); background: var(--surface); color: var(--text); }
.rec-card.on { border-color: var(--accent); background: var(--accent-soft); }
.rec-card .rec-top { display: flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 750; color: var(--accent); }
.rec-card strong { font-size: 1.3rem; font-stretch: 84%; }
.warn-text { color: var(--warn); }
.builder-day { padding: 10px 0; border-bottom: 1px solid var(--border); }
.builder-day:last-child { border-bottom: none; }
.builder-day .chips { gap: 6px; }
.week-plan { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.day-prev { background: var(--surface-2); border-radius: var(--radius-sm); padding: 0; }
.day-prev > summary { display: flex; align-items: center; gap: 10px; padding: 12px; color: var(--text); min-height: 52px; }
.day-prev > summary > svg { margin-left: auto; color: var(--faint); transition: transform .15s; flex-shrink: 0; }
.day-prev[open] > summary > svg { transform: rotate(180deg); }
.day-prev .day-t { display: flex; flex-direction: column; min-width: 0; }
.day-prev .day-t small { color: var(--muted); font-weight: 500; }
.day-prev .list { padding: 0 12px 6px; }
.day-n { flex-shrink: 0; font-size: .74rem; font-weight: 800; color: var(--text); background: var(--surface-3); border-radius: 999px; padding: 3px 9px; font-variant-numeric: tabular-nums; }
.week-list .list-item { gap: 10px; }
.list-item.on { background: var(--accent-soft); border-radius: 12px; }
.list-item[disabled] { opacity: .5; }
.list-item .li-ico { flex-shrink: 0; }
.lib-card { display: block; width: 100%; text-align: left; color: var(--text); }
.lib-card .card-head { margin-bottom: 6px; }
.lib-card .card-head h3 { flex-wrap: wrap; }
.lib-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: .85rem; color: var(--muted); }
.lib-facts span { display: inline-flex; align-items: center; gap: 4px; }

/* ── Gamificación: nivel, misiones, logros y puntaje ────── */
.lvl-row { display: flex; align-items: center; gap: 12px; }
.lvl-row .grow { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lvl-badge { flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 1.4rem; color: var(--slab-text); background: var(--slab); box-shadow: inset 0 0 0 3px var(--accent); }
.bar.xp > span { background: var(--accent); }
.game-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: .84rem; color: var(--muted); }
.game-stats span { display: inline-flex; align-items: center; gap: 4px; }
.missions { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.mission { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .9rem; min-height: 48px; }
.mission .grow { min-width: 0; }
.mission .m-check { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; color: #fff; transition: background-color 0.18s ease, border-color 0.18s ease; }
.mission.done .m-check { background: var(--good); border-color: var(--good); }
.mission.done .grow { color: var(--muted); text-decoration: line-through; }
.mission .m-emoji { flex-shrink: 0; color: var(--muted); display: inline-grid; }
.mission .m-xp { flex-shrink: 0; font-size: .78rem; font-weight: 750; color: var(--accent); font-variant-numeric: tabular-nums; }
.mission.done .m-xp { color: var(--good); }
.missions .bar { margin: -2px 10px 4px; height: 5px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 8px; }
.ach { display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 2px solid transparent; min-width: 0; }
.ach .ach-emoji { font-size: 1.6rem; line-height: 1.2; display: inline-grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: var(--surface); color: var(--text); margin-bottom: 4px; }
.ach strong { font-size: .9rem; }
.ach small { color: var(--muted); font-size: .76rem; }
.ach .bar { height: 5px; margin-top: 4px; }
.ach.tier-bronce:not(.locked) { border-color: #b8712f; }
.ach.tier-bronce:not(.locked) .ach-emoji { color: #b8712f; }
.ach.tier-plata:not(.locked) { border-color: #9aa3ad; }
.ach.tier-plata:not(.locked) .ach-emoji { color: #8f99a3; }
.ach.tier-oro:not(.locked) { border-color: #d4a500; }
.ach.tier-oro:not(.locked) .ach-emoji { color: #d4a500; }
.ach.locked { opacity: .72; }
.ach.locked .ach-emoji { filter: grayscale(1); color: var(--faint); }
.score-row { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; }
.xp-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.xp-rows .row span { min-width: 0; }
.rank-list { display: flex; flex-direction: column; gap: 6px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); min-height: 56px; }
.rank-row.me { background: var(--accent-soft); outline: 2px solid var(--accent); }
.rank-row .grow { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rank-row small { font-size: .76rem; }
.rank-pos { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 850; font-size: .9rem; background: var(--surface); font-variant-numeric: tabular-nums; }
.rank-score { flex-shrink: 0; font-size: 1.5rem; font-weight: 900; }
.friend-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; }
.rank-right { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.rank-delta { font-size: .74rem; font-weight: 800; color: var(--muted); }
.rank-delta.up { color: var(--good); }
.rank-delta.down { color: var(--warn); }

/* Conectividad: aviso discreto arriba, respetando la barra de estado. */
.net-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 90; padding: calc(6px + var(--safe-t)) 16px 6px; text-align: center; font-size: .8rem; font-weight: 700; background: var(--slab); color: var(--slab-text); }
.net-banner[hidden] { display: none; }
.net-banner[data-state="reconnecting"] { background: var(--good); color: #04170d; }
html.has-net-banner .screen { padding-top: calc(42px + var(--safe-t)); }

/* Aviso de privacidad y términos dentro de la app */
.legal-doc h1 { font-size: 1.5rem; margin: 0 0 6px; }
.legal-doc h2 { font-size: 1.1rem; margin: 20px 0 6px; }
.legal-doc p, .legal-doc li { color: var(--muted); font-size: .92rem; line-height: 1.55; margin-top: 6px; }
.legal-doc ul { padding-left: 18px; }
.legal-doc .draft { background: var(--accent-soft); color: var(--text); padding: 10px 12px; border-radius: 10px; }

/* Approved start/end assets; labels remain HTML, never inside the images. */
.exercise-image-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:16px 0; }
.exercise-image-pair figure { margin:0; min-width:0; }
.exercise-image-pair img { display:block; width:100%; height:auto; border-radius:12px; background:#f4f4f4; }
.exercise-image-pair figcaption { text-align:center; font-size:.85rem; margin-top:6px; }

/* ── Hoy: el entrenamiento manda ────────────────────────── */
.screen-hoy .topbar h1 { font-size: 2.15rem; }
.today-week { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(236, 234, 228, 0.12); }
.card-hero .ws-day { color: var(--slab-muted); }
.card-hero .ws-day .c { border-color: rgba(236, 234, 228, 0.22); color: var(--slab-muted); }
.card-hero .ws-day.done .c { background: var(--slab-text); color: var(--slab); }
.card-hero .ws-day.today .c { border-color: var(--accent); color: var(--slab-text); }
.card-hero .ws-day.today { color: var(--slab-text); }
.hero-meta { margin-top: 8px; color: var(--slab-muted); font-size: 0.92rem; }
.screen-hoy .card:not(.card-hero):not(.card-soft) { box-shadow: none; }

/* ── Resumen: el momento del récord ─────────────────────── */
.summary-hero { text-align: center; padding: 28px 12px 18px; }
.summary-hero .kpi { font-size: 3.4rem; }
.pr-moment { animation: pr-in 0.6s var(--ease) both; }
.pr-moment:nth-child(2) { animation-delay: 0.08s; }
.pr-moment:nth-child(3) { animation-delay: 0.16s; }
@keyframes pr-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
