﻿/* =============================================
   JYM — Dark Fitness Theme
   ============================================= */

:root {
  /* ---- TEMA OSCURO (default) ---- */
  --bg: #0b0b0e;
  --surface: #141417;
  --card: #18181d;
  --card-2: #202026;
  --border: #28282f;
  --border-2: #3a3a44;

  /* Marca: verde (como el logo) */
  --accent: #00CC44;
  --accent-light: #00E676;
  --accent-dim: rgba(0,204,68,0.14);
  --on-accent: #141417;      /* texto/icono sobre naranja */
  --logo-mid: #ffffff;       /* texto del logo (blanco en tema oscuro) */
  --glow: rgba(0,0,0,0.5);   /* sombra neutra (gris/negro, sin color) */

  --cyan: #22d3ee;
  --cyan-dim: rgba(34,211,238,0.14);
  --green: #34d399;
  --green-dim: rgba(52,211,153,0.14);
  --orange: #fbbf24;
  --orange-dim: rgba(251,191,36,0.14);
  --red: #f87171;
  --red-dim: rgba(248,113,113,0.14);

  --day-a: #00CC44;
  --day-b: #22d3ee;
  --day-c: #34d399;
  --day-d: #fb923c;
  --day-e: #eab308;

  --text: #ffffff;
  --text-2: #dcdce8;
  --text-3: #b0b0c0;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-full: 999px;

  --nav-h: 68px;
  --topbar-h: 70px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

/* ---- TEMA CLARO (segun el dispositivo del usuario) ---- */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f5f1;
    --surface: #ffffff;
    --card: #ffffff;
    --card-2: #efefe9;
    --border: #e6e6df;
    --border-2: #d6d6cd;

    --accent: #00CC44;
    --accent-light: #00963A;
    --accent-dim: rgba(0,122,47,0.16);
    --on-accent: #1a1a1a;
    --logo-mid: #141414;     /* texto del logo (negro en tema claro) */
    --glow: rgba(0,0,0,0.14);

    --text: #18181b;
    --text-2: #52525b;
    --text-3: #8a8a92;
  }
}

/* ---- Splash screen ---- */
.splash {
  position: fixed; inset: 0; z-index: 99999;
  background: #060610;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.splash.splash-out { opacity: 0; visibility: hidden; }

/* ---- Disclaimer médico (encima del plan) ---- */
.medical-bar {
  font-size: 11px;
  color: var(--text-3, #888);
  text-align: center;
  padding: 6px 12px;
  margin: 0 0 4px;
  border-bottom: 1px solid var(--line, #222);
}
.medical-bar a { color: var(--accent); text-decoration: none; }

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; color-scheme: dark light; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ---- App shell ---- */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* ---- Views ---- */
.view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease;
  will-change: opacity, transform;
}
.view.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* ---- Topbar ---- */
.topbar {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: calc(var(--safe-t) + 14px) 20px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
  z-index: 10;
}
.topbar-left {}
.topbar-eyebrow { font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 2px; }
.topbar-title { font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* ---- View body ---- */
.view-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px calc(var(--nav-h) + var(--safe-b) + 16px);
  -webkit-overflow-scrolling: touch;
}

/* ---- Bottom Nav ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 0 0;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
  transition: color 150ms ease;
  min-height: 50px;
}
.nav-item.active { color: var(--accent-light); }
.nav-ico { width: 22px; height: 22px; }
.nav-center { padding-top: 4px; }
.nav-center-circle {
  width: 48px;
  height: 48px;
  background: var(--accent);
  box-shadow: 0 6px 20px var(--glow);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -18px;
  box-shadow: 0 4px 20px var(--glow);
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.nav-center.active .nav-center-circle { background: var(--accent-light); }
.nav-center-circle .nav-ico { width: 20px; height: 20px; stroke: var(--on-accent); }

/* ---- Cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.card-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 4px; }
.card-sub { font-size: 13px; color: var(--text-2); }

/* ---- Gym Card ---- */
.gym-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.gym-card.done { border-color: var(--green); background: var(--green-dim); }
.gym-day-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  flex-shrink: 0;
}
.day-a .gym-day-badge, .badge-a { background: rgba(0,204,68,0.12); color: #fff; border: 1px solid rgba(0,204,68,0.30); }
.day-b .gym-day-badge, .badge-b { background: rgba(34,211,238,0.12); color: #fff; border: 1px solid rgba(34,211,238,0.30); }
.day-c .gym-day-badge, .badge-c { background: rgba(52,211,153,0.12); color: #fff; border: 1px solid rgba(52,211,153,0.30); }
.day-d .gym-day-badge, .badge-d { background: rgba(251,146,60,0.12); color: #fff; border: 1px solid rgba(251,146,60,0.30); }
.day-e .gym-day-badge, .badge-e { background: rgba(234,179,8,0.12); color: #fff; border: 1px solid rgba(234,179,8,0.30); }
.gym-info { flex: 1; min-width: 0; }
.gym-name { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gym-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.gym-done-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: all 150ms ease;
}
.gym-done-btn.done { background: var(--green); border-color: var(--green); }
.gym-rest-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-3);
  font-size: 14px;
}

/* ---- Meal Cards ---- */
.meal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 200ms ease;
}
.meal-card.logged-yes { border-color: var(--green); }
.meal-card.logged-partial { border-color: var(--orange); }
.meal-card.logged-no { border-color: var(--red); opacity: 0.7; }
.meal-type-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-breakfast { background: var(--orange); }
.dot-lunch { background: var(--cyan); }
.dot-dinner { background: var(--accent-light); }
.dot-snack { background: var(--green, #10b981); }
.recipe-link { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--accent-light); text-decoration: none; }
.recipe-link:hover { text-decoration: underline; }
.prep-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--accent-dim); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.prep-banner-title { font-weight: 700; font-size: 14px; }
.prep-banner-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
/* Gamificacion */
.gamify-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; box-shadow: 0 4px 16px var(--glow); }
.gamify-card.done { border-color: var(--green); }
.gamify-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.gamify-streak { display: flex; align-items: baseline; gap: 6px; font-size: 22px; font-weight: 800; }
.gamify-streak small { font-size: 11px; font-weight: 500; color: var(--text-3); }
.gamify-xp { font-size: 13px; font-weight: 700; color: var(--accent); }
.gamify-bar { height: 10px; background: var(--card-2); border-radius: 999px; overflow: hidden; }
.gamify-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #00E676); border-radius: 999px; transition: width 400ms ease; }
.gamify-card.done .gamify-fill { background: var(--green); }
.gamify-msg { font-size: 12px; color: var(--text-2); margin-top: 8px; }
/* Logros / badges */
.badges-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 8px; }
.badge { text-align: center; opacity: 0.32; filter: grayscale(1); transition: opacity 200ms ease, filter 200ms ease; }
.badge.got { opacity: 1; filter: none; }
.badge-ico { font-size: 26px; line-height: 1; }
.badge-name { font-size: 10px; color: var(--text-3); margin-top: 4px; line-height: 1.2; }
.badge.got .badge-name { color: var(--text-2); }
/* Resumen semanal */
.recap-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.recap-item { text-align: center; background: var(--card-2); border-radius: var(--radius-sm); padding: 12px 4px; }
.recap-val { font-size: 20px; font-weight: 800; color: var(--accent); }
.recap-lbl { font-size: 10px; color: var(--text-3); margin-top: 3px; }
.recap-ai { margin-top: 12px; padding: 12px 14px; background: var(--accent-dim); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; color: var(--text); }
.recap-regen { margin-top: 8px; background: none; border: none; color: var(--text-3); font-size: 11px; cursor: pointer; padding: 4px 0; }
.ss-record { margin-top: 12px; text-align: center; font-weight: 600; font-size: 14px; color: var(--accent); background: var(--accent-dim); border-radius: var(--radius-sm); padding: 8px; }
.recap-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.challenge { padding: 10px 0; border-bottom: 1px solid var(--border-1); }
.challenge:last-child { border-bottom: none; }
.challenge-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.challenge-label { font-size: 13px; font-weight: 600; color: var(--text); }
.challenge-xp { font-size: 11px; font-weight: 700; color: var(--accent); flex-shrink: 0; }
.challenge-bar { height: 6px; background: var(--card-2); border-radius: var(--radius-full); overflow: hidden; }
.challenge-fill { height: 100%; background: var(--accent); border-radius: var(--radius-full); transition: width 300ms ease; }
.challenge-prog { font-size: 11px; color: var(--text-3); margin-top: 4px; text-align: right; }
.challenge.done .challenge-fill { background: var(--ok, #10b981); }
.recap-regen:active { color: var(--accent); }
.meal-info { flex: 1; min-width: 0; }
.meal-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); }
.meal-name { font-size: 14px; font-weight: 600; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-macros { font-size: 11px; color: var(--text-2); margin-top: 3px; }
.meal-status {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.status-yes { background: var(--green-dim); color: var(--green); }
.status-partial { background: var(--orange-dim); color: var(--orange); }
.status-no { background: var(--red-dim); color: var(--red); }
.status-pending { background: var(--border); color: var(--text-3); }

/* ---- Section headers ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
}
.section-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.macros-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-light);
  background: var(--accent-dim);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

/* ---- Week view ---- */
.week-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.week-day-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.week-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}
.week-day-header:active { background: var(--card-2); }
.week-day-name { font-size: 14px; font-weight: 700; }
.week-day-date { font-size: 12px; color: var(--text-3); }
.week-day-tags { display: flex; gap: 6px; align-items: center; }
.tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}
.tag-gym-a { background: rgba(0,204,68,0.12); color: #fff; border: 1px solid rgba(0,204,68,0.28); }
.tag-gym-b { background: rgba(34,211,238,0.12); color: #fff; border: 1px solid rgba(34,211,238,0.28); }
.tag-gym-c { background: rgba(52,211,153,0.12); color: #fff; border: 1px solid rgba(52,211,153,0.28); }
.tag-gym-d { background: rgba(251,146,60,0.12); color: #fff; border: 1px solid rgba(251,146,60,0.28); }
.tag-gym-e { background: rgba(234,179,8,0.12); color: #fff; border: 1px solid rgba(234,179,8,0.28); }
.tag-rest { background: var(--border); color: var(--text-3); }
.tag-luna { background: rgba(167,139,250,0.15); color: #c4b5fd; }
.week-day-chevron { color: var(--text-3); transition: transform 200ms ease; font-size: 12px; }
.week-day-card.open .week-day-chevron { transform: rotate(180deg); }

.week-day-body { display: none; padding: 0 16px 14px; border-top: 1px solid var(--border); }
.week-day-card.open .week-day-body { display: block; }

.week-meal-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.week-meal-row:last-child { border-bottom: none; }
.week-meal-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.week-meal-info {}
.week-meal-type { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }
.week-meal-name { font-size: 13px; font-weight: 600; margin-top: 1px; }
.week-meal-macros { font-size: 11px; color: var(--text-2); margin-top: 2px; }

.week-gym-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 4px;
  font-size: 13px;
}
.week-gym-row .gym-day-badge { width: 32px; height: 32px; font-size: 14px; border-radius: 8px; }

/* ---- Luna setup card ---- */
.luna-setup-card { margin-bottom: 16px; }
.luna-setup-title { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.moon-icon { font-size: 28px; flex-shrink: 0; }

/* ---- Day chips ---- */
.day-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.day-chip {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition: all 150ms ease;
}
.day-chip.selected {
  background: rgba(167,139,250,0.15);
  border-color: var(--accent-light);
  color: var(--accent-light);
}
.day-times { margin-top: 12px; }
.day-times-lbl { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.day-time-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.day-time-row span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.day-time-input { padding: 6px 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--border-2); background: var(--card-2); color: var(--text); font-size: 13px; }

/* ---- Chip row ---- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition: all 150ms ease;
  white-space: nowrap;
}
.chip.active, .chip:focus { border-color: var(--accent); color: var(--accent-light); background: var(--accent-dim); outline: none; }

/* ---- Banner fecha pasada ---- */
.past-date-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 204, 68, 0.12);
  border: 1px solid rgba(0, 204, 68, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-light);
}
.pdb-close {
  background: none;
  border: 1px solid rgba(0, 204, 68, 0.4);
  border-radius: 6px;
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
}

/* ---- Log view ---- */
.seg-control {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
}
.seg-btn {
  flex: 1;
  padding: 9px 4px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  color: var(--text-3);
  transition: all 150ms ease;
}
.seg-btn.active { background: var(--card); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }

.panel-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 8px; }

.planned-preview {
  margin-top: 8px;
  background: var(--card-2);
  border-color: var(--border-2);
}
.planned-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 4px; }
.planned-name { font-size: 15px; font-weight: 700; }
.planned-macros { display: flex; gap: 12px; margin-top: 6px; }
.macro-item { font-size: 12px; color: var(--text-2); }
.macro-val { font-weight: 700; color: var(--text); }

.compliance-row { display: flex; gap: 8px; }
.compliance-btn {
  flex: 1;
  padding: 12px 0;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-2);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  transition: all 150ms ease;
}
.compliance-btn.yes.active { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.compliance-btn.partial.active { background: var(--orange-dim); border-color: var(--orange); color: var(--orange); }
.compliance-btn.no.active { background: var(--red-dim); border-color: var(--red); color: var(--red); }

textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 15px;
  color: var(--text);
  resize: none;
  line-height: 1.5;
}
textarea:focus { outline: none; border-color: var(--accent); }
textarea::placeholder { color: var(--text-3); }

/* Workout exercise inputs */
.exercise-input-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.exercise-input-name { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.sets-row { display: flex; flex-direction: column; gap: 8px; }
.set-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}
.set-label { width: 40px; flex-shrink: 0; font-weight: 600; }
.set-input {
  flex: 1;
  background: var(--card-2);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  -webkit-appearance: none;
}
.set-input:focus { outline: none; border-color: var(--accent); }
.set-unit { font-size: 11px; color: var(--text-3); width: 28px; }
.add-set-btn {
  width: 100%;
  padding: 8px;
  margin-top: 6px;
  border: 1.5px dashed var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  transition: all 150ms ease;
}
.add-set-btn:active { border-color: var(--accent); color: var(--accent-light); }

/* Weight input */
.big-input-wrapper { position: relative; display: flex; align-items: center; margin-bottom: 12px; }
.big-input {
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius);
  padding: 20px 60px 20px 20px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  -webkit-appearance: none;
}
.big-input:focus { outline: none; border-color: var(--accent); }
.big-input-unit {
  position: absolute;
  right: 20px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-3);
}
.weight-trend-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; text-align: center; font-size: 13px; color: var(--text-2); }

/* ---- Progress ---- */
.progress-card { margin-bottom: 12px; }
.progress-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.progress-big-num { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.progress-delta {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.delta-down { background: var(--green-dim); color: var(--green); }
.delta-up { background: var(--red-dim); color: var(--red); }
.delta-same { background: var(--border); color: var(--text-3); }
.chart-footer { font-size: 11px; color: var(--text-3); margin-top: 8px; text-align: center; }

.compliance-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.compliance-bar-label { font-size: 11px; font-weight: 600; color: var(--text-2); width: 24px; text-align: right; }
.compliance-bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.compliance-bar-fill { height: 100%; border-radius: 4px; background: var(--green); transition: width 600ms ease; }
.compliance-bar-pct { font-size: 11px; color: var(--text-3); width: 30px; }

.gym-dot-row { display: flex; gap: 8px; flex-wrap: wrap; }
.gym-dot { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.gym-dot.done { background: var(--green-dim); color: var(--green); }
.gym-dot.missed { background: var(--accent-dim); color: var(--accent); }
.gym-dot.rest { background: var(--border); color: var(--text-3); opacity: 0.4; }

.exercise-record-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.exercise-record-row:last-child { border-bottom: none; }
.record-name { font-weight: 600; }
.record-val { font-size: 15px; font-weight: 800; color: var(--accent-light); }
.record-meta { font-size: 11px; color: var(--text-3); }

/* ---- Settings ---- */
.settings-group { margin-bottom: 24px; }
.settings-group-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 8px; padding-left: 4px; }
.settings-card { padding: 16px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.cfg-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 15px;
  color: var(--text);
  -webkit-appearance: none;
}
.cfg-input:focus { outline: none; border-color: var(--accent); }
.cfg-input::placeholder { color: var(--text-3); }

.cal-status-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}
.status-dot.connected { background: var(--green); box-shadow: 0 0 8px rgba(16,185,129,0.5); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  transition: all 150ms ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: 0 4px 16px var(--glow); transition: transform 120ms ease, box-shadow 200ms ease, filter 150ms ease; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: translateY(1px) scale(0.99); box-shadow: 0 2px 8px var(--glow); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:active { background: var(--card-2); color: var(--text); }
.btn-outline { border: 1.5px solid var(--border-2); color: var(--text-2); }
.btn-outline:active { border-color: var(--accent); color: var(--accent-light); }
.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid var(--red); }
.btn-sm { padding: 8px 14px; font-size: 12px; border-radius: 8px; }
.full-width { width: 100%; }
.btn-row { display: flex; gap: 8px; }

/* ---- Icon button ---- */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: all 150ms ease;
}
.icon-btn:active { background: var(--card-2); color: var(--text); }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 200ms ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  animation: slideUp 250ms cubic-bezier(0.34,1.56,0.64,1);
  padding-bottom: var(--safe-b);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; font-weight: 800; }
.modal-close { width: 30px; height: 30px; border-radius: 50%; background: var(--border); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.modal-body { flex: 1; overflow-y: auto; padding: 16px 20px; -webkit-overflow-scrolling: touch; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; }

/* Grocery list */
.grocery-category { margin-bottom: 16px; }
.grocery-cat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-light); margin-bottom: 8px; }
.grocery-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.grocery-item:last-child { border-bottom: none; }
.grocery-item-check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-2); flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.grocery-item-check.checked { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.grocery-item-name { flex: 1; }
.grocery-item-amount { font-size: 12px; color: var(--text-3); }

/* ---- Loading ---- */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.loader-box { text-align: center; }
.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  margin: 0 auto 14px;
}
#loader-msg { font-size: 14px; font-weight: 600; color: var(--text-2); }

/* ---- Toast ---- */
#toast-stack {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 360px;
}
.toast {
  background: var(--card-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 300ms cubic-bezier(0.34,1.4,0.64,1);
  pointer-events: all;
}
.toast.success { border-color: var(--green); background: var(--green-dim); color: var(--green); }
.toast.error { border-color: var(--red); background: var(--red-dim); color: var(--red); }
.toast.info { border-color: var(--accent); background: var(--accent-dim); color: var(--accent-light); }

/* ---- Empty states ---- */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 52px; margin-bottom: 16px; }
.empty-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.empty-sub { font-size: 14px; color: var(--text-2); line-height: 1.5; }

/* ---- Utilities ---- */
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.text-muted { color: var(--text-3); }

/* ---- Animations ---- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ---- Scrollbar (desktop) ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

/* ---- iOS PWA fixes ---- */
input[type="number"] { -webkit-appearance: none; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ============================================================
   AUTH + ONBOARDING OVERLAY
   ============================================================ */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 16px;
}

.auth-card,
.onboard-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 32px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
}

.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}

/* ---- Logo Jym club ---- */
.jym-logo {
  font-family: 'Roboto', -apple-system, sans-serif;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  display: inline-block;
  font-size: 40px;
  background: var(--accent);
  color: var(--logo-mid);
  border-radius: 0.14em;
  padding: 0.06em 0.22em 0.12em;
  user-select: none;
}

/* ============ Tips / datos curiosos ============ */
.tip-line {
  font-size: 12.5px; line-height: 1.55;
  color: var(--text-2, #c9c9d4);
  background: rgba(245,147,0,0.10);
  border-left: 3px solid var(--accent, #00CC44);
  border-radius: 8px; padding: 11px 13px; margin-top: 10px;
}

/* ===== Acordeón de ejercicios (Log → Entreno): compacto y premium ===== */
.exercise-input-card.ex-acc { padding: 0; overflow: hidden; }
.ex-acc-head {
  width: 100%; display: flex; align-items: center; gap: 11px;
  padding: 15px 16px; background: transparent; border: 0; cursor: pointer;
  text-align: left; color: var(--text, #fff); font: inherit;
}
.ex-acc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-2, #3a3a4a); flex: 0 0 auto; transition: background .2s, box-shadow .2s; }
.ex-acc.filled .ex-acc-dot { background: var(--green, #10b981); box-shadow: 0 0 0 3px rgba(16,185,129,0.18); }
.ex-acc-title { flex: 1; font-size: 14px; font-weight: 700; min-width: 0; }
.ex-acc-meta { font-size: 12px; color: var(--text-3, #9a9ab0); font-weight: 600; flex: 0 0 auto; }
.ex-acc-chev { font-size: 12px; color: var(--text-3, #9a9ab0); transition: transform .25s; flex: 0 0 auto; }
.ex-acc.open .ex-acc-chev { transform: rotate(180deg); }
.ex-acc.open .ex-acc-head { border-bottom: 1px solid var(--border, #26263a); }
.ex-acc-body {
  max-height: 0; overflow: hidden; opacity: 0; padding: 0 16px;
  transition: max-height .32s ease, opacity .25s ease, padding .32s ease;
}
.ex-acc.open .ex-acc-body { max-height: 1200px; opacity: 1; padding: 14px 16px 16px; }
.ex-acc-tech { display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--accent-light, #00E676); text-decoration: none; }
.ex-acc .tip-line { margin: 10px 0 14px; }
.ex-acc .sets-row { gap: 10px; }
.ex-acc .set-input { padding: 10px 12px; }
.ex-acc .add-set-btn { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) {
  .ex-acc-body, .ex-acc-chev { transition: none; }
}

/* ===== Escáner de alimentos / Despensa ===== */
.scan-reader { width: 100%; border-radius: 12px; overflow: hidden; background: #000; min-height: 4px; }
.scan-reader video { width: 100% !important; border-radius: 12px; }
.scan-status { font-size: 13px; color: var(--text-3, #9a9ab0); margin: 10px 0 6px; text-align: center; }
.scan-manual-row { display: flex; gap: 8px; margin-bottom: 12px; }
.scan-manual-row input {
  flex: 1; background: var(--card-2, #1d1d24); border: 1px solid var(--border-2, #2f2f3a);
  border-radius: 8px; padding: 9px 11px; font-size: 14px; color: var(--text, #fff);
}
.scan-manual-row input:focus { outline: none; border-color: var(--accent, #00CC44); }
.scan-card { background: var(--card-2, #1d1d24); border: 1px solid var(--border, #26263a); border-radius: 12px; padding: 14px; }
.scan-img { width: 72px; height: 72px; object-fit: contain; border-radius: 8px; background: #fff; display: block; margin-bottom: 8px; }
.scan-name { font-size: 16px; font-weight: 800; line-height: 1.25; }
.scan-sub { font-size: 12.5px; color: var(--text-3, #9a9ab0); margin-bottom: 8px; }
.nutri { display: inline-block; font-size: 11px; font-weight: 800; color: #fff; padding: 3px 9px; border-radius: 99px; letter-spacing: .3px; }
.nutri-a { background: #2e7d32; } .nutri-b { background: #7cb342; } .nutri-c { background: #f9a825; }
.nutri-d { background: #ef6c00; } .nutri-e { background: #d32f2f; }
.scan-flags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.scan-flag { font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 99px; }
.scan-flag.good { background: rgba(16,185,129,0.15); color: #34d399; }
.scan-flag.bad { background: rgba(239,68,68,0.15); color: #f87171; }
.scan-compare { font-size: 13px; font-weight: 600; padding: 10px 12px; border-radius: 10px; margin: 10px 0; background: rgba(150,150,170,0.12); }
.scan-compare.good { background: rgba(16,185,129,0.14); color: #34d399; }
.scan-compare.bad { background: rgba(239,68,68,0.14); color: #f87171; }
.scan-ntable { margin-top: 12px; border-top: 1px solid var(--border, #26263a); padding-top: 10px; }
.scan-ntitle { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3, #9a9ab0); margin-bottom: 8px; }
.scan-nrow { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--border, #26263a); }
.scan-nrow:last-child { border-bottom: 0; }
.scan-ai-out { font-size: 13px; line-height: 1.55; color: var(--text-2, #c9c9d4); margin-top: 10px; }
.scan-missing { font-size: 13px; line-height: 1.5; color: var(--text-2, #c9c9d4); background: var(--accent-dim); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 10px; }
.man-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.man-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-2, #c9c9d4); }
.man-row input { width: 110px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--border-2); background: var(--card-2); color: var(--text); font-size: 14px; }
.walk-block { margin-top: 16px; padding: 14px; border: 1.5px solid var(--border-2); border-radius: var(--radius-sm); background: var(--card-2); }
.walk-row { display: flex; gap: 12px; margin-top: 8px; }
.walk-field { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2, #c9c9d4); }
.walk-field input { width: 100%; padding: 9px 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--border-2); background: var(--card); color: var(--text); font-size: 15px; }
.walk-kcal { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--accent); min-height: 18px; }
.ss-walk { margin-top: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--card-2); font-size: 13px; color: var(--text-2, #c9c9d4); text-align: center; }
.snack-adder { margin-top: 14px; }
.snack-form { margin-top: 10px; padding: 12px; border: 1.5px dashed var(--border-2); border-radius: var(--radius-sm); background: var(--card-2); }
.snack-form input { width: 100%; padding: 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--border-2); background: var(--card); color: var(--text); font-size: 14px; }
.snack-actions { display: flex; gap: 8px; margin-top: 8px; }
.snack-actions .btn { flex: 1; }
.snack-macros { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--accent); min-height: 16px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.avatar-btn { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--border-2); background: var(--card-2); padding: 0; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-btn-ph { font-size: 18px; line-height: 1; }
.profile-menu { position: fixed; top: calc(56px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 100001; background: var(--card, #1a1a24); border: 1.5px solid var(--border-2); border-radius: var(--radius-sm); box-shadow: 0 8px 30px rgba(0,0,0,.35); min-width: 220px; padding: 6px; }
.profile-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; color: var(--text); font-size: 14px; padding: 11px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.profile-menu-item:active, .profile-menu-item:hover { background: var(--card-2); }
.profile-menu-item.danger { color: var(--danger, #ef4444); }
.beta-tag { display: inline-block; margin-left: 8px; vertical-align: middle; font-size: 10px; font-weight: 800; letter-spacing: .5px; color: #fff; background: var(--accent); padding: 2px 7px; border-radius: 999px; text-transform: uppercase; }
.doc-overlay { position: fixed; inset: 0; z-index: 100000; background: var(--bg, #12121a); display: flex; flex-direction: column; }
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px; border-bottom: 1px solid var(--border-2); background: var(--card, #1a1a24); }
.doc-head span { font-weight: 700; font-size: 15px; color: var(--text); }
.doc-close { background: var(--accent); border: none; color: #fff; border-radius: var(--radius-sm); padding: 9px 16px; font-size: 13px; font-weight: 600; }
.doc-frame { flex: 1; width: 100%; border: none; background: #fff; }
.doc-content { flex: 1; overflow-y: auto; padding: 16px 20px 40px; color: var(--text); background: var(--bg); line-height: 1.6; font-size: 14px; }
.doc-content h1,.doc-content h2,.doc-content h3 { color: var(--text); margin: 1em 0 0.5em; }
.doc-content p { margin: 0.5em 0; color: var(--text-2); }
.doc-content a { color: var(--accent); }
.doc-link { color: var(--accent); text-decoration: underline; cursor: pointer; font-weight: 700; }
.ob-legal-lbl { font-size: 13px; color: var(--text-2, #c9c9d4); margin-bottom: 10px; font-weight: 600; }
.scan-despensa { margin-top: 16px; }
.scan-hist-title { font-size: 12px; font-weight: 700; color: var(--text-3, #9a9ab0); margin-bottom: 8px; }
.scan-hist-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px; margin-bottom: 6px; background: var(--card-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm); color: var(--text); }
.scan-hist-row img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.scan-hist-noimg { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: var(--card); border-radius: 6px; flex-shrink: 0; }
.scan-hist-name { flex: 1; font-size: 13px; }
.despensa-title { font-size: 12px; font-weight: 700; color: var(--text-3, #9a9ab0); margin-bottom: 8px; }
.despensa-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border, #26263a); }
.despensa-row:last-child { border-bottom: 0; }
.despensa-name { font-size: 13.5px; font-weight: 600; }
.despensa-sub { font-size: 11.5px; color: var(--text-3, #9a9ab0); }

/* ===== Historial (Progreso) ===== */
.wh-cmp { display: flex; gap: 8px; }
.wh-cell { flex: 1; text-align: center; background: var(--card-2, #1d1d24); border-radius: 10px; padding: 10px 6px; }
.wh-val { font-size: 16px; font-weight: 800; }
.wh-lbl { font-size: 11px; color: var(--text-3, #9a9ab0); margin-top: 2px; }
.wh-delta { font-size: 11px; font-weight: 700; }
.wh-delta.delta-up { color: #34d399; }
.wh-delta.delta-down { color: #f87171; }
.wh-list-title { font-size: 12px; font-weight: 700; color: var(--text-3, #9a9ab0); margin: 14px 0 6px; }
.wh-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--border, #26263a); color: var(--text-2, #c9c9d4); }
.wh-row:last-child { border-bottom: 0; }
.dh-list { max-height: 420px; overflow-y: auto; }
.dh-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border, #26263a); }
.dh-row:last-child { border-bottom: 0; }
.dh-date { font-size: 12.5px; font-weight: 600; color: var(--text-2, #c9c9d4); white-space: nowrap; }
.dh-act { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.dh-tag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 99px; background: var(--card-2, #1d1d24); color: var(--text-2, #c9c9d4); }
.dh-tag.dh-gym { background: rgba(0,204,68,0.18); color: var(--accent-light, #00E676); }
.dh-tag.dh-xp { background: rgba(16,185,129,0.16); color: #34d399; }
.dh-del { background: none; border: 0; color: var(--text-3, #9a9ab0); font-size: 14px; padding: 2px 4px 2px 8px; cursor: pointer; flex: 0 0 auto; }
.dh-del:active { color: #f87171; }

/* ============ Nivel (XP -> nivel) ============ */
.gamify-level { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lvl-badge {
  flex: 0 0 auto; min-width: 44px; height: 44px; border-radius: 12px; padding: 0 8px;
  background: linear-gradient(135deg, #00CC44, #00E676); color: #fff;
  font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,204,68,0.35);
}
.lvl-info { flex: 1; min-width: 0; }
.lvl-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.lvl-bar { height: 7px; border-radius: 99px; background: rgba(150,150,170,0.18); overflow: hidden; }
.lvl-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg,#00CC44,#00E676); transition: width .6s cubic-bezier(.22,1,.36,1); }
.lvl-sub { font-size: 11px; color: var(--text-3, #9a9ab0); margin-top: 3px; }
.gamify-fill { transition: width .6s cubic-bezier(.22,1,.36,1); }

/* ============ Topbar: nivel + avatar ============ */
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-level {
  font-size: 11px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg,#00CC44,#00E676);
  padding: 3px 8px; border-radius: 99px;
}
.topbar-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent,#00CC44); }
.topbar-avatar-empty { display: inline-flex; align-items: center; justify-content: center; font-size: 18px; background: var(--card,#18181d); }

/* ============ Avatar en Config ============ */
.avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.avatar-wrap { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; border: 2px solid var(--accent,#00CC44); display: flex; align-items: center; justify-content: center; background: var(--card,#18181d); }
.avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.avatar-ph { font-size: 32px; }
.avatar-actions { display: flex; flex-direction: column; gap: 6px; }

/* ============ Animaciones dopamínicas ============ */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden; }
.confetti-layer i { position: absolute; top: -14px; width: 9px; height: 14px; border-radius: 2px; animation: confetti-fall 2.2s linear forwards; }
@keyframes confetti-fall {
  0% { transform: translateY(-14px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(106vh) rotate(720deg); opacity: .9; }
}
.gamify-card.done { animation: pop-in .5s cubic-bezier(.22,1.4,.4,1); }
@keyframes pop-in { 0% { transform: scale(.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }

/* ===== Subida de nivel (overlay) ===== */
.levelup-overlay {
  position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
  background: rgba(8,8,12,0.78); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: lvup-fade .25s ease;
}
@keyframes lvup-fade { from { opacity: 0; } to { opacity: 1; } }
.levelup-card { position: relative; text-align: center; padding: 30px 26px; animation: lvup-pop .55s cubic-bezier(.18,1.5,.4,1); }
@keyframes lvup-pop { 0% { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
.levelup-ring { position: absolute; top: 92px; left: 50%; width: 150px; height: 150px; margin-left: -75px; border-radius: 50%; border: 3px solid var(--accent, #00CC44); animation: lvup-ring 1.1s ease-out infinite; pointer-events: none; }
@keyframes lvup-ring { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(2.3); opacity: 0; } }
.levelup-spark { font-size: 40px; animation: lvup-spin 1.4s ease-in-out infinite; }
@keyframes lvup-spin { 0%,100% { transform: rotate(-12deg) scale(1); } 50% { transform: rotate(12deg) scale(1.15); } }
.levelup-kick { font-size: 13px; font-weight: 800; letter-spacing: 2px; color: var(--accent-light, #00E676); margin-top: 6px; }
.levelup-num {
  font-size: 84px; font-weight: 900; line-height: 1; margin: 4px 0;
  background: linear-gradient(135deg, #00CC44, #00FFAA); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 6px 30px rgba(0,204,68,0.5);
}
.levelup-rank { font-size: 18px; font-weight: 800; color: #fff; }
.levelup-tap { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 16px; }

/* ===== "+XP" flotante ===== */
.xp-fly {
  position: fixed; left: 50%; top: 38%; z-index: 10000; pointer-events: none;
  font-size: 30px; font-weight: 900;
  background: linear-gradient(135deg,#00CC44,#00FFAA); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 4px 16px rgba(0,204,68,0.45);
  animation: xpfly 1.5s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes xpfly {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  45% { transform: translate(-50%, -6px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -72px) scale(.95); }
}
@media (prefers-reduced-motion: reduce) {
  .levelup-overlay, .levelup-card, .levelup-ring, .levelup-spark, .xp-fly { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .lvl-fill, .gamify-fill { transition: none; }
  .confetti-layer { display: none; }
  .gamify-card.done { animation: none; }
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,.05);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2, #94a3b8);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms;
}

.auth-tab.active {
  background: var(--accent);
  color: #fff;
}

#form-login,
#form-register {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

#form-login input,
#form-register input {
  width: 100%;
  padding: 12px 16px;
  background: var(--card-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  box-sizing: border-box;
}
#form-login input::placeholder,
#form-register input::placeholder { color: var(--text-3); }

/* ======================================================
   PREMIUM UI LAYER v2 — Jym club
   ====================================================== */

/* Fondo con profundidad sutil */
body {
  background-image: radial-gradient(ellipse 75% 50% at 10% -10%, rgba(0,204,68,0.09) 0%, transparent 65%);
}
@media (prefers-color-scheme: light) {
  body { background-image: radial-gradient(ellipse 75% 50% at 10% -10%, rgba(0,122,47,0.07) 0%, transparent 65%); }
}

/* Topbar: blur premium */
.topbar {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(11,11,14,0.88) !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}
@media (prefers-color-scheme: light) {
  .topbar { background: rgba(245,245,241,0.88) !important; border-bottom: 1px solid rgba(0,0,0,0.07) !important; }
}

/* Cards: vidrio sutil */
.card {
  background: rgba(24,24,29,0.84) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.07) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.04);
}
@media (prefers-color-scheme: light) {
  .card {
    background: rgba(255,255,255,0.9) !important;
    border: 1px solid rgba(0,0,0,0.07) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07), inset 0 1px 0 rgba(255,255,255,0.95) !important;
  }
}

/* Botón primario: gradiente + glow */
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #00E65A 100%) !important;
  box-shadow: 0 4px 20px rgba(0,204,68,0.38), inset 0 1px 0 rgba(255,255,255,0.12) !important;
  color: var(--on-accent) !important;
}
.btn-primary:active { box-shadow: 0 2px 10px rgba(0,204,68,0.25) !important; }
@media (prefers-color-scheme: light) {
  .btn-primary {
    background: linear-gradient(135deg, #007A2F 0%, #00963A 100%) !important;
    box-shadow: 0 4px 20px rgba(0,122,47,0.32) !important;
    color: #fff !important;
  }
}

/* Nav centro: gradiente + sombra */
.nav-center-circle {
  background: linear-gradient(135deg, var(--accent) 0%, #00E65A 100%) !important;
  box-shadow: 0 6px 24px rgba(0,204,68,0.45), 0 2px 8px rgba(0,0,0,0.3) !important;
}
.nav-center.active .nav-center-circle {
  box-shadow: 0 8px 32px rgba(0,204,68,0.55), 0 2px 8px rgba(0,0,0,0.3) !important;
}

/* Nav item activo: punto glow */
.nav-item { position: relative; }
.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent), 0 0 16px rgba(0,204,68,0.4);
}

/* Gym card: borde lateral del color del día */
.gym-card.day-a { border-left: 3px solid var(--day-a) !important; }
.gym-card.day-b { border-left: 3px solid var(--day-b) !important; }
.gym-card.day-c { border-left: 3px solid var(--day-c) !important; }
.gym-card.day-d { border-left: 3px solid var(--day-d) !important; }
.gym-card.day-e { border-left: 3px solid var(--day-e) !important; }

/* Números grandes: texto degradado */
.progress-big-num {
  background: linear-gradient(135deg, var(--text) 20%, var(--text-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Badges: circular premium */
.badges-grid { grid-template-columns: repeat(4, 1fr); gap: 14px 10px; }
.badge-ico {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--card-2);
  border: 2px solid var(--border);
  margin: 0 auto 6px;
  transition: border-color 250ms, box-shadow 250ms;
}
.badge.got .badge-ico {
  background: var(--accent-dim);
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(0,204,68,0.32);
}
.badge.got .badge-name { color: var(--text); font-weight: 600; }

/* Barras gradiente */
.compliance-bar-fill, .challenge-fill {
  background: linear-gradient(90deg, var(--accent) 0%, #00E676 100%);
}

/* Recap valores gradiente */
.recap-val {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* XP fly y level-up: verde en lugar de naranja */
.xp-fly {
  background: linear-gradient(135deg, var(--accent), #00E676) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  text-shadow: 0 4px 16px rgba(0,204,68,0.45) !important;
}
.levelup-num {
  background: linear-gradient(135deg, var(--accent), #00E676) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  text-shadow: 0 6px 30px rgba(0,204,68,0.5) !important;
}

/* Banner offline */
.offline-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(0,20,10,0.92);
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 8px 16px;
  z-index: 9999;
  transform: translateY(-100%);
  transition: transform 280ms cubic-bezier(0.4,0,0.2,1);
}
.offline-banner.visible { transform: translateY(0); }

/* Fotos de progreso */
.progress-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.progress-photo-thumb {
  aspect-ratio: 3/4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card-2);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
}
.progress-photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.progress-photo-date {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.72));
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  padding: 8px 6px 4px;
  text-align: center;
}
.progress-photo-add {
  aspect-ratio: 3/4;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms;
  background: none;
  width: 100%;
}
.progress-photo-add:active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.progress-photo-thumb { transition: transform 180ms ease; }
.progress-photo-thumb:hover { transform: scale(1.03); }

/* ── Visor de foto de progreso ── */
.photo-viewer-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.93);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 16px; gap: 14px;
  animation: pv-in 220ms cubic-bezier(0.2,0,0,1);
}
@keyframes pv-in { from { opacity: 0; } to { opacity: 1; } }

.pv-close {
  position: absolute; top: 16px; right: 20px;
  color: rgba(255,255,255,0.6); font-size: 22px;
  cursor: pointer; padding: 8px; line-height: 1;
  transition: color 150ms;
}
.pv-close:hover { color: #fff; }

.pv-img-wrap {
  position: relative;
  width: 100%; max-width: 360px;
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}
.pv-img { display: block; width: 100%; aspect-ratio: 4/5; object-fit: cover; }

/* Barra superior editorial */
.pv-badge-top {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 14px 16px 10px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.60) 0%, transparent 100%);
  display: flex; align-items: center; justify-content: space-between;
}
.pv-brand {
  font-size: 15px; font-weight: 800; color: #fff;
  letter-spacing: 0.5px;
}
.pv-week {
  font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.6);
  font-family: "SF Mono", "Roboto Mono", monospace;
  letter-spacing: 1.5px;
}

/* Overlay inferior con datos */
.pv-badge-bottom {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 40px 16px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, transparent 100%);
}
.pv-date-txt {
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.65);
  font-family: "SF Mono", "Roboto Mono", monospace;
  letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 2px;
}
.pv-weight-txt {
  font-size: 44px; font-weight: 900; line-height: 1;
  color: var(--accent, #00CC44);
  text-shadow: 0 0 20px rgba(0,204,68,0.4);
}
.pv-delta-txt {
  font-size: 12px; color: rgba(255,255,255,0.5);
  font-family: "SF Mono", "Roboto Mono", monospace;
  margin-top: 2px;
}

/* Botones de acción del visor */
.pv-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}
.pv-actions-row { display: flex; gap: 10px; width: 100%; }
.pv-actions-row .btn { flex: 1; }
.pv-share-btn { background: linear-gradient(135deg,#00CC44,#00E65A) !important; color: #0b140d !important; font-weight: 700 !important; }

/* Toggle "mostrar peso" */
.pv-weight-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  user-select: none;
}
.pv-weight-toggle input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Pantalla celebración fin de sesión ── */
.ss-celebration-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.82);
  opacity: 0;
  transition: opacity 300ms ease;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.ss-celebration-overlay.ss-visible { opacity: 1; }

.ss-confetti-wrap {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.ss-conf {
  position: absolute; top: -20px;
  animation: ss-fall linear forwards;
}
@keyframes ss-fall {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  80%  { opacity: 0.9; }
  100% { transform: translateY(110vh) rotate(720deg) scale(0.4); opacity: 0; }
}

.ss-card {
  background: var(--card, rgba(4,4,12,0.95));
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 28px 28px 0 0;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  padding: 28px 24px 36px;
  width: 100%; max-width: 500px;
  max-height: 92vh; overflow-y: auto;
  transform: translateY(60px);
  transition: transform 350ms cubic-bezier(0.34,1.56,0.64,1);
  -webkit-overflow-scrolling: touch;
}
.ss-celebration-overlay.ss-visible .ss-card { transform: translateY(0); }

.ss-trophy { text-align: center; font-size: 60px; line-height: 1; margin-bottom: 8px; }
.ss-headline {
  text-align: center; font-size: 26px; font-weight: 800;
  color: var(--text, #fff); margin: 0 0 20px;
  background: linear-gradient(135deg, #44FF66, #00CC44);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.ss-stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-bottom: 16px;
}
.ss-stat {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 14px 8px; text-align: center;
}
.ss-stat-val {
  font-size: 22px; font-weight: 800;
  color: var(--accent, #44FF66); line-height: 1.1;
}
.ss-stat-unit { font-size: 13px; font-weight: 500; opacity: 0.7; margin-left: 2px; }
.ss-stat-lbl { font-size: 11px; color: var(--text-3, #b0b0c0); margin-top: 4px; }

.ss-maxreps {
  text-align: center; font-size: 13px; color: var(--text-2, #dcdce8);
  margin-bottom: 12px;
}
.ss-walk-row {
  text-align: center; font-size: 13px; color: var(--text-3, #b0b0c0);
  margin-bottom: 12px;
}

/* Comparación con sesión anterior */
.ss-comp {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 14px;
}
.ss-comp-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 8px; }
.ss-comp-list { display: flex; flex-direction: column; gap: 6px; }
.ss-comp-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.ss-ex-name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.ss-delta { font-weight: 700; font-size: 13px; flex-shrink: 0; }
.ss-pr .ss-delta  { color: #FFD700; }
.ss-up .ss-delta  { color: #44FF66; }
.ss-dn .ss-delta  { color: rgba(255,100,100,0.85); }

/* Safety tip */
.ss-safety {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px; padding: 12px 14px;
  font-size: 13px; color: var(--text-2); line-height: 1.5;
  margin-bottom: 16px;
}
.ss-safety svg { flex-shrink: 0; margin-top: 1px; opacity: 0.6; }

.ss-ai-msg { margin-bottom: 18px; }
.ss-done-btn { font-size: 17px; font-weight: 800; height: 54px; }

/* Medical bar actualizada */
.medical-bar {
  background: rgba(0,204,68,0.04) !important;
  border-bottom: 1px solid rgba(0,204,68,0.1) !important;
}

/* Gamify card: sombra verde sutil cuando activo */
.gamify-card { box-shadow: 0 4px 20px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.04); }
.gamify-card.done { box-shadow: 0 4px 20px rgba(52,211,153,0.15), 0 0 0 1px rgba(52,211,153,0.15); }

#form-login input:focus,
#form-register input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-full {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
}

.auth-divider {
  text-align: center;
  color: var(--text-3, #475569);
  font-size: 13px;
  margin: 12px 0;
  position: relative;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: rgba(255,255,255,.1);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.btn-google {
  width: 100%;
  padding: 12px;
  background: var(--card-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 200ms;
  margin-bottom: 12px;
}

.btn-google:hover { background: var(--border); }

.auth-msg {
  text-align: center;
  font-size: 13px;
  min-height: 18px;
  margin-top: 4px;
}

/* ---- Onboarding ---- */

.onboard-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}

.ob-sub {
  font-size: 13px;
  color: var(--text-3, #475569);
  margin: 0 0 20px;
}

#ob-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
  max-height: 55vh;
  overflow-y: auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2, #94a3b8);
}

.form-group input,
.form-group select {
  padding: 11px 14px;
  background: var(--card-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
}
.form-group input::placeholder { color: var(--text-3); }

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group select option {
  background: var(--card);
  color: var(--text);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.ob-nav {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-secondary {
  padding: 11px 20px;
  background: var(--card-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

/* ---- Aviso de versión nueva (service worker): no intrusivo, abajo ---- */
.sw-update-banner {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 76px);
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  padding: 10px 12px 10px 16px;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
  font-size: 14px;
  font-weight: 500;
  animation: swUpIn 220ms ease;
}
@keyframes swUpIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.sw-update-x {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
@media (prefers-reduced-motion: reduce) { .sw-update-banner { animation: none; } }

/* ---- Unidades de peso (Fase 2): calculadora kg/lb + notas de mancuerna ---- */
.set-conv {
  font-size: 11px;
  color: var(--text-3);
  min-width: 58px;
  white-space: nowrap;
}
.db-note {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
  background: var(--accent-dim);
  border-radius: 8px;
  padding: 6px 9px;
  margin: 2px 0 8px;
}
.db-note b { color: var(--text); }
.custom-ex-del {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-left: 6px;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: var(--card-2);
  color: var(--text-3);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.custom-ex-del:hover { color: var(--red, #ef4444); border-color: var(--red, #ef4444); }

/* ---- Barra de sesión de entreno (cronómetro) F3.1 ---- */
.ws-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 4px;
  padding: 10px 12px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.ws-bar.ws-running { border-color: var(--accent); }
.ws-time { display: flex; flex-direction: column; line-height: 1.15; }
.ws-clock { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.ws-bar.ws-running .ws-clock { color: var(--accent); }
.ws-state { font-size: 11px; color: var(--text-3); }
.ws-actions { display: flex; gap: 8px; }

/* ---- Macros de comida distinta al plan (visibles y fijos) ---- */
.meal-macros-box {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.mm-title { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.mm-aprox { color: var(--text-3); }
.mm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mm-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mm-val { font-size: 16px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.mm-lbl { font-size: 10px; color: var(--text-3); }
.mm-loading { font-size: 12px; color: var(--text-3); }

/* ---- Tarjeta de agua del día (F5.4) ---- */
.water-card {
  margin: 14px 0;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.water-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; color: var(--text); }
.water-amt { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.water-bar { height: 10px; border-radius: 6px; background: var(--card-2); overflow: hidden; margin: 9px 0 8px; }
.water-fill { height: 100%; border-radius: 6px; transition: width 250ms ease; background: #38bdf8; }
.water-fill.water-low { background: #f59300; }
.water-fill.water-mid { background: #38bdf8; }
.water-fill.water-near { background: #22b8cf; }
.water-fill.water-ok { background: #10b981; }
.water-sub { font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.water-actions { display: flex; gap: 8px; }
.water-actions .btn { flex: 1; }
@media (prefers-reduced-motion: reduce) { .water-fill { transition: none; } }

/* ---- Leyenda de dots de entrenos (Progreso, F5.6) ---- */
.gym-dots-legend { font-size: 11px; color: var(--text-3); margin-top: 8px; }
.gym-dots-legend .leg-done { color: var(--green, #10b981); }
.gym-dots-legend .leg-missed { color: var(--accent); }
.gym-dots-legend .leg-rest { color: var(--text-3); }

/* ---- Línea de carga progresiva (F6) ---- */
.prog-line {
  font-size: 12px;
  color: var(--text-2);
  background: var(--card-2);
  border-radius: 8px;
  padding: 6px 9px;
  margin: 2px 0 8px;
  line-height: 1.4;
}
.prog-line b { color: var(--accent); }
.prog-hint { color: var(--text-3); }

/* ---- Agua: entrada de cantidad libre (ml/L) ---- */
.water-input-row { display: flex; gap: 8px; align-items: center; }
.water-amount { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--card-2); color: var(--text); font-size: 15px; }
.water-unit { padding: 9px 8px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--card-2); color: var(--text); font-size: 14px; }
.water-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.water-chip { padding: 5px 10px; border: 1px solid var(--border-2); border-radius: 999px; background: var(--card-2); color: var(--text-2); font-size: 12px; cursor: pointer; }
.water-chip:hover { border-color: var(--accent); color: var(--text); }
.water-chip.water-fix { margin-left: auto; color: var(--text-3); }

/* ---- Aviso de edición de entreno ya registrado ---- */
.edit-wk-banner {
  font-size: 12px;
  color: var(--text);
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 8px 11px;
  margin: 8px 0;
}

/* ---- Comida cambiada por el usuario (en vez de la sugerida) ---- */
.meal-instead { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.meal-changed { color: var(--accent); font-size: 11px; font-weight: 600; }

/* ---- Botón quitar ejercicio sugerido (no hay equipo) ---- */
.ex-remove-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  background: none;
  border: 1px dashed var(--border-2);
  border-radius: 8px;
  color: var(--text-3);
  font-size: 12px;
  cursor: pointer;
}
.ex-remove-btn:hover { color: var(--red, #f87171); border-color: var(--red, #f87171); }

/* ---- Día Casa / peso corporal (tipo H) ---- */
:root { --day-h: #a78bfa; }
.day-h .gym-day-badge, .badge-h { background: rgba(167,139,250,0.2); color: var(--day-h); }
.tag-gym-h { background: rgba(167,139,250,0.2); color: var(--day-h); }
.chip.day-h.active { border-color: var(--day-h); color: var(--day-h); }

/* ---- Calendario mensual (Semana) ---- */
#month-calendar { margin-bottom: 16px; }
.mc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mc-title { font-size: 15px; font-weight: 700; color: var(--text); text-transform: capitalize; }
.mc-nav { width: 34px; height: 34px; border-radius: 9px; background: var(--card-2); border: 1px solid var(--border); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; }
.mc-nav:hover { border-color: var(--accent); }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mc-dow { text-align: center; font-size: 10px; color: var(--text-3); padding: 2px 0; }
.mc-cell { position: relative; aspect-ratio: 1; border: 1px solid transparent; border-radius: 9px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0; color: var(--text-2); font-size: 13px; }
.mc-cell.mc-empty { background: none; }
.mc-cell.mc-has { background: var(--card-2); cursor: pointer; color: var(--text); }
.mc-cell.mc-has:hover { border-color: var(--accent); }
.mc-cell[disabled] { cursor: default; }
.mc-cell.mc-today { border-color: var(--accent); }
.mc-num { font-weight: 600; }
.mc-dots { display: flex; gap: 2px; height: 5px; }
.mc-dot { width: 5px; height: 5px; border-radius: 50%; }
.mc-dot.mc-gym { background: var(--green, #34d399); }
.mc-dot.mc-meal { background: var(--accent); }
.mc-dot.mc-water { background: #38bdf8; }
/* Detalle de día */
.dd-sec { margin-bottom: 14px; }
.dd-h { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.dd-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-2); padding: 5px 0; border-bottom: 1px solid var(--border); }

/* Feedback (beta) — selector de tipo */
.fb-kind { flex: 1; }
.fb-kind.is-active { background: var(--accent); border-color: var(--accent); color: #1a1205; font-weight: 700; }
#fb-message { background: var(--card-2, var(--card)); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; font: inherit; }

/* ═══════════════════════════════════════════════════
   MESH GRADIENT CANVAS — fondo fluido animado
   Canvas dibujado por JS (_initAurora en app.js)
   ═══════════════════════════════════════════════════ */

#aurora-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  width: 100vw;
  height: 100vh;
}

#grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.68' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: 0.07;
}

/* Cards con vidrio líquido */
.card, .settings-section, .gamify-card, .recap-card {
  background: rgba(4, 4, 12, 0.76) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
}

@media (prefers-color-scheme: light) {
  .card, .settings-section, .gamify-card, .recap-card {
    background: rgba(255,255,255,0.88) !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
  }
  #grain-overlay { opacity: 0.03; }
}

/* Z-index: todo el contenido sobre el canvas */
#app { position: relative; z-index: 2; }

/* Logo SVG en pantalla de login */
.auth-logo svg {
  display: block;
  margin: 0 auto;
  width: 240px;
  height: 169px;
  overflow: visible;
  filter: drop-shadow(0 0 32px rgba(60,255,20,0.50));
}

/* ---- Tour de bienvenida ---- */
.tour-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg); overflow: hidden;
  display: flex; flex-direction: column;
}
.tour-prog-track {
  position: absolute; top: 16px; left: 22px; right: 22px;
  height: 3px; background: var(--border); border-radius: 2px; z-index: 10;
}
.tour-prog-fill {
  height: 100%; border-radius: 2px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  box-shadow: 0 0 8px rgba(0,204,68,0.4); transition: width .4s ease;
}
.tour-slides {
  display: flex; height: 100%;
  transition: transform .4s cubic-bezier(.4,0,.2,1); will-change: transform;
}
.tour-slide {
  flex-shrink: 0; width: 100vw; height: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: 44px 20px 126px; overflow-y: auto;
}
.tour-slide::-webkit-scrollbar { display: none; }
.tour-dots {
  position: absolute; bottom: 78px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px; z-index: 10;
}
.tour-dot {
  width: 6px; height: 6px; border-radius: 50%; border: none; padding: 0;
  background: var(--border-2); cursor: pointer; transition: all .3s;
}
.tour-dot.active { background: var(--accent); width: 20px; border-radius: 3px; }
.tour-nav {
  position: absolute; bottom: 18px; left: 18px; right: 18px;
  display: flex; gap: 9px; z-index: 10;
}
.tour-btn-skip {
  flex: 1; padding: 13px; border-radius: 13px; font-family: inherit;
  border: 1px solid var(--border-2); background: transparent;
  color: var(--text-3); font-size: 14px; font-weight: 600; cursor: pointer;
}
.tour-btn-next {
  flex: 2; padding: 13px; border-radius: 13px; border: none; font-family: inherit;
  background: linear-gradient(135deg,#00DD44,#00AA33); color: #000;
  font-size: 14px; font-weight: 800; cursor: pointer;
  box-shadow: 0 0 20px rgba(0,204,68,.25);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
/* Logo wordmark con glow radial */
.tour-logo-wrap { position: relative; text-align: center; margin-bottom: 22px; }
.tour-logo-halo {
  position: absolute; width: 280px; height: 170px; border-radius: 50%;
  background: radial-gradient(ellipse at center,rgba(0,255,60,.5) 0%,rgba(0,200,50,.2) 40%,transparent 70%);
  filter: blur(22px); top: 50%; left: 50%; transform: translate(-50%,-58%);
  pointer-events: none;
}
.tour-wordmark {
  font-size: 52px; font-weight: 900; letter-spacing: -2px; line-height: 1;
  color: #fff; position: relative; z-index: 1;
  text-shadow: 0 0 28px rgba(0,255,60,.55), 0 0 60px rgba(0,200,50,.25);
}
.tour-wordmark .tw-c { font-weight: 300; color: rgba(255,255,255,.8); text-shadow: none; }
/* Mock screen dentro del tour */
.t-mock {
  width: 100%; border-radius: 15px; overflow: hidden;
  border: 1px solid var(--border-2); background: var(--surface);
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
.t-mock + .t-mock { margin-top: 9px; }
.t-bar {
  padding: 10px 13px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02);
}
.t-bar-title { font-size: 15px; font-weight: 800; letter-spacing: -.3px; }
.t-body { padding: 10px; display: flex; flex-direction: column; gap: 7px; }
.t-row {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 11px; padding: 10px 11px;
  display: flex; align-items: center; gap: 9px;
}
.t-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.t-row-t { flex: 1; min-width: 0; }
.t-rtitle { font-size: 11px; font-weight: 700; margin-bottom: 2px; }
.t-rsub { font-size: 10px; color: var(--text-3); }
.t-chip {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 6px; white-space: nowrap; flex-shrink: 0;
}
.t-pb { height: 4px; background: var(--border); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.t-pb-f { height: 100%; border-radius: 3px; }
.t-nav {
  border-top: 1px solid var(--border); background: rgba(255,255,255,.02);
  display: flex; padding: 7px 10px 5px;
}
.t-ni { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.t-nd { width: 4px; height: 4px; border-radius: 50%; }
.t-nl { font-size: 8px; font-weight: 700; }
.t-ni.on .t-nd { background: var(--accent); }
.t-ni.on .t-nl { color: var(--accent); }
.t-ni:not(.on) .t-nd { background: var(--border-2); }
.t-ni:not(.on) .t-nl { color: var(--text-3); }
/* Week grid */
.t-wg { display: flex; gap: 4px; }
.t-wd {
  flex: 1; border-radius: 8px; padding: 5px 2px; text-align: center;
  font-size: 9px; font-weight: 700;
  background: var(--card); border: 1px solid var(--border); color: var(--border-2);
}
.t-wd.done { background: var(--accent-dim); border-color: rgba(0,204,68,.3); color: var(--accent); }
.t-wd.today { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* Scan frame */
.t-scan {
  width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 11px;
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.t-scan-inner {
  width: 52%; aspect-ratio: 3/1; border: 2px solid var(--accent); border-radius: 5px;
  position: relative; box-shadow: 0 0 14px rgba(0,204,68,.3);
}
.t-scan-line {
  position: absolute; left: 0; right: 0; top: 40%; height: 2px;
  background: var(--accent); animation: tsl 1.5s ease-in-out infinite alternate;
}
@keyframes tsl { from{top:10%} to{top:90%} }
/* History dots */
.t-hist { display: flex; gap: 4px; }
.t-hd {
  flex: 1; border-radius: 7px; padding: 7px 2px; text-align: center;
  background: var(--card); border: 1px solid var(--border);
}
.t-hd.full { background: var(--accent-dim); border-color: rgba(0,204,68,.3); }
.t-hd.part { background: rgba(250,204,21,.1); border-color: rgba(250,204,21,.25); }
.t-hd-l { font-size: 9px; font-weight: 700; color: var(--text-3); margin-bottom: 3px; }
.t-hd-d { width: 7px; height: 7px; border-radius: 50%; margin: 0 auto; background: var(--border-2); }
.full .t-hd-d { background: var(--accent); }
.part .t-hd-d { background: #facc15; }
/* Photos grid */
.t-photos { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; }
.t-photo {
  aspect-ratio: 3/4; border-radius: 9px;
  border: 1px solid var(--border-2); position: relative; overflow: hidden;
  display: flex; align-items: flex-end; padding: 5px;
  font-size: 9px; font-weight: 700; color: var(--text-3);
}
/* Notif */
.t-notif {
  background: var(--card-2); border: 1px solid var(--border-2);
  border-radius: 13px; padding: 11px 12px;
  display: flex; gap: 9px; align-items: flex-start;
}
.t-notif-ic {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
/* Scan corners */
.t-sc { position: absolute; width: 9px; height: 9px; border-color: var(--accent); border-style: solid; }
.t-sc.tl{top:-1px;left:-1px;border-width:2px 0 0 2px}
.t-sc.tr{top:-1px;right:-1px;border-width:2px 2px 0 0}
.t-sc.bl{bottom:-1px;left:-1px;border-width:0 0 2px 2px}
.t-sc.br{bottom:-1px;right:-1px;border-width:0 2px 2px 0}
/* Install steps */
.t-install {
  background: var(--card-2); border: 1px solid var(--border-2);
  border-radius: 14px; padding: 13px; margin-bottom: 9px;
}
.t-install-hd { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; margin-bottom: 11px; }
.t-istep { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 7px; }
.t-istep:last-child { margin-bottom: 0; }
.t-snum {
  width: 22px; height: 22px; border-radius: 50%; font-size: 10px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.t-snum.g { background: var(--accent); color: var(--on-accent); }
.t-snum.d { background: var(--card); border: 1px solid var(--border-2); color: var(--text); }
/* Ready */
.t-ready-circle {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(135deg,#00FF55,#00AA33);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 48px rgba(0,204,68,.4); margin: 0 auto 18px; flex-shrink: 0;
}
/* Tut header */
.t-num { font-size: 10px; font-weight: 800; color: var(--accent); letter-spacing: .12em; text-transform: uppercase; text-align: center; margin-bottom: 4px; }
.t-h { font-size: 22px; font-weight: 900; letter-spacing: -.5px; text-align: center; line-height: 1.2; margin-bottom: 7px; }
.t-p { font-size: 13px; color: var(--text-2); text-align: center; line-height: 1.6; margin-bottom: 16px; }
/* Feature pill grid */
.t-pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; width: 100%; }
.t-pill {
  background: var(--card-2); border: 1px solid var(--border-2);
  border-radius: 11px; padding: 10px 11px;
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; color: var(--text-2);
}
.t-pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
