*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── AUTH LOADING ── */
#auth-loading {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}

/* ── LOGIN SCREEN ── */
#login-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 1.5rem;
  overflow: hidden;
}
.login-bg-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0; pointer-events: none;
}
.login-bg-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to bottom, rgba(12,11,10,0.55), rgba(12,11,10,0.75));
}
.login-card {
  position: relative; z-index: 2;
  width: 100%; max-width: 360px;
  background: transparent; border: none;
  padding: 1.5rem 1.75rem;
  display: flex; flex-direction: column; gap: 1.25rem;
  margin: auto;
}
.login-logo { text-align: center; }
.login-brand {
  display: block; font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem; font-weight: 700; color: #fff;
  letter-spacing: 0.02em; line-height: 1;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.login-tagline { display: block; font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 4px; }
.login-error {
  display: none; font-size: 12.5px; color: #ffa5a5;
  background: rgba(180,60,60,0.25); border: 1px solid rgba(255,100,100,0.4);
  border-radius: 8px; padding: 0.6rem 0.75rem; line-height: 1.4;
}
#login-form, #register-form { display: flex; flex-direction: column; gap: 0; }
.login-input {
  width: 100%; padding: 0.9rem 1rem;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 10px; color: #fff; font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s;
  margin-bottom: 1rem;
}
.login-input:focus { outline: none; border-color: rgba(255,255,255,0.7); }
.login-input::placeholder { color: rgba(255,255,255,0.45); }
.login-btn {
  width: 100%; padding: 0.8rem;
  background: #fff; border: none; border-radius: 10px;
  color: #0C0B0A; font-size: 15px; font-weight: 600;
  font-family: 'DM Sans', sans-serif; cursor: pointer;
  transition: opacity 0.2s;
}
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.login-btn:active { opacity: 0.85; }
.login-link {
  background: none; border: none; color: rgba(255,255,255,0.6);
  font-size: 12.5px; font-family: 'DM Sans', sans-serif;
  cursor: pointer; text-align: center; padding: 0.2rem;
}
.login-link:hover { color: rgba(255,255,255,0.85); }
.login-switch { font-size: 13px; color: rgba(255,255,255,0.6); text-align: center; }
.login-link-inline {
  background: none; border: none; color: #fff;
  font-size: 13px; font-family: 'DM Sans', sans-serif;
  cursor: pointer; font-weight: 600; padding: 0;
}
.login-btn-google {
  width: 100%; padding: 0.75rem 1rem;
  background: #fff; border: none; border-radius: 10px;
  color: #3c4043; font-size: 14px; font-weight: 500;
  font-family: 'DM Sans', sans-serif; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: opacity 0.15s;
}
.login-btn-google:active { opacity: 0.85; }
.login-divider {
  display: flex; align-items: center; gap: 0.75rem;
  color: rgba(255,255,255,0.5); font-size: 12px;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.2);
}
/* Disable long-press callout, selection and double-tap zoom on interactive elements */
button, label, .day-pill, .check-btn, .ex-view-btn, .macro-pill,
.swipe-inner, .avatar-upload-wrap, .meal-row, .card, .stat-card,
[onclick], [ontouchstart] {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
/* Allow selection only in real input/text areas */
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }
:root {
  --gold: #C9943D; --gold-light: #E8B96A; --gold-dim: rgba(201,148,61,0.12);
  --burgundy: #7D1E3A; --burg-dim: rgba(125,30,58,0.2);
  --bg: #09090F; --surface: #0F1119; --surface2: #161A27; --surface3: #1D2235;
  --border: rgba(255,255,255,0.07); --border2: rgba(255,255,255,0.14);
  --text: #F0EEF8; --text-muted: #9896A8; --text-dim: #56546A;
  --radius: 14px; --radius-sm: 10px;
  --green: #30D158; --green-dim: rgba(48,209,88,0.15);
  --green-bright: #4ade80;
  --red: #B43C3C; --red-dim: rgba(180,60,60,0.15);
  --blue: #4A9EFF; --blue-dim: rgba(74,158,255,0.15);
}
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; padding-bottom: calc(3.5rem + env(safe-area-inset-bottom)); }

/* ── EXERCISE GIF MODAL ── */
#gif-modal { position:fixed;inset:0;z-index:2000;display:none;align-items:flex-end;justify-content:center;background:rgba(0,0,0,0.75); }
#gif-modal.open { display:flex; }
#gif-modal-inner { background:var(--surface);border-radius:20px 20px 0 0;width:100%;max-width:480px;padding:1.5rem;padding-bottom:calc(1.5rem + env(safe-area-inset-bottom)); }
#gif-modal-title { font-family:'Inter',sans-serif;font-size:1.15rem;font-weight:700;letter-spacing:-0.02em;color:var(--gold-light);margin-bottom:0.3rem; }
#gif-modal-series { font-size:13px;color:var(--text-muted);margin-bottom:1rem; }
#gif-modal-img { width:100%;border-radius:12px;background:var(--surface2);min-height:200px;object-fit:cover;display:block;max-height:320px; }
#gif-modal-tip { font-size:13px;color:var(--text-muted);margin-top:0.9rem;line-height:1.5; }
#gif-modal-close { margin-top:1.1rem;width:100%;padding:0.7rem;background:var(--surface2);border:1px solid var(--border);color:var(--text);border-radius:10px;font-size:14px;cursor:pointer; }

/* ── TOAST ── */
#toast {
  position: fixed; bottom: 5rem; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface3); border: 1px solid var(--border2); border-radius: 999px;
  padding: 0.5rem 1.25rem; font-size: 13px; color: var(--gold-light);
  opacity: 0; transition: all 0.3s ease; pointer-events: none; z-index: 999; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { border-color: rgba(180,60,60,0.5); color: #E88A8A; }

/* ── HEADER ── */
header {
  position: relative; z-index: 10;
  padding: calc(2.5rem + env(safe-area-inset-top)) 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.025) 0%, transparent 100%);
}
.header-inner { max-width: 720px; margin: 0 auto; }
.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.6rem; }
h1 { font-family: 'Inter', sans-serif; font-size: clamp(1.9rem, 6vw, 3rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; margin-bottom: 0.4rem; }
h1 span { color: var(--gold); }
.subtitle { font-size: 14px; color: var(--text-muted); font-weight: 300; margin-bottom: 1.75rem; max-width: 400px; }

/* ── STATS CIRCLES ── */
/* ── STAT CARDS — diseño moderno con tarjetas de color ── */
.stat-cards-top {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 0.55rem;
  margin-bottom: 0.55rem;
}
.stat-cards-bottom {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 0.55rem;
  margin-bottom: 1rem;
}
.scard {
  border-radius: 16px; padding: 0.7rem 0.5rem 0.6rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.28rem;
  cursor: pointer; position: relative; overflow: hidden;
  transition: transform 0.14s, filter 0.14s;
  -webkit-tap-highlight-color: transparent;
}
.scard:active { transform: scale(0.96); }
@media (hover:hover) { .scard:hover { filter: brightness(1.1); } }
.scard-green { background: rgba(48,209,88,0.09);  border: 1px solid rgba(48,209,88,0.22); }
.scard-blue  { background: rgba(74,158,255,0.09); border: 1px solid rgba(74,158,255,0.22); }
.scard-gold  { background: rgba(201,148,61,0.09); border: 1px solid rgba(201,148,61,0.22); }
.scard-icon-row {
  display: flex; align-items: center; gap: 4px; align-self: flex-start; width: 100%; padding: 0 2px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  font-family: 'DM Sans', sans-serif; white-space: nowrap; overflow: hidden;
}
.scard-icon-row span { overflow: hidden; text-overflow: ellipsis; }
.scard-green .scard-icon-row { color: #30D158; }
.scard-blue  .scard-icon-row { color: #4A9EFF; }
.scard-gold  .scard-icon-row { color: #C9943D; }
.scard-icon-row i { font-size: 9px; }
/* Ring dentro de scard-top */
.scard-ring {
  width: clamp(58px,16vw,72px); height: clamp(58px,16vw,72px);
}
.scard .ring-mini-svg-wrap { width: clamp(58px,16vw,72px); height: clamp(58px,16vw,72px); }
.scard .ring-mini-svg { width: 100%; height: 100%; }
.scard-label {
  font-size: clamp(7px,1.7vw,9px); letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-dim); font-family: 'DM Sans', sans-serif;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; padding: 0 2px;
}
/* Tarjetas numéricas (fila de abajo) */
.scard-num { padding: 0.7rem 0.55rem 0.6rem; align-items: flex-start; gap: 0.3rem; }
.scard-num-val {
  font-family: 'Inter', sans-serif; font-size: clamp(1rem,4.2vw,1.35rem);
  font-weight: 800; color: var(--text); letter-spacing: -0.03em; line-height: 1;
  display: flex; align-items: baseline; gap: 2px;
}
.scard-unit { font-size: 0.52em; font-weight: 600; color: var(--text-dim); letter-spacing: 0; }
.scard-prog-bar {
  width: 100%; height: 3px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; margin-top: 2px;
}
.scard-prog-fill {
  height: 100%; background: linear-gradient(90deg,#C9943D,#E8B86D); border-radius: 2px;
  transition: width 0.9s cubic-bezier(0.4,0,0.2,1);
}
/* ── STATS GRID (legacy, kept for compat) ── */
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.875rem 1rem; cursor: pointer; transition: border-color 0.2s;
  position: relative;
}
@keyframes cardSweep {
  from { transform: translateX(-100%) skewX(-12deg); }
  to   { transform: translateX(350%) skewX(-12deg); }
}
.stat-card { overflow: hidden; }
.stat-card--sweep::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
  animation: cardSweep 0.55s cubic-bezier(0.4,0,0.2,1) forwards;
}
.stat-card:hover { border-color: var(--border2); }
.stat-card:hover .edit-badge { opacity: 1; }
.edit-badge {
  position: absolute; top: 6px; right: 8px; font-size: 10px; color: var(--gold);
  opacity: 0; transition: opacity 0.2s; letter-spacing: 0.05em;
}
.stat-label { font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 0.2rem; }
.stat-value { font-family: 'Inter', sans-serif; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-value.gold { color: var(--gold); }

/* ── PROGRESS BAR ── */
.progress-bar-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.875rem 1.25rem;
}
.progress-bar-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 0.6rem; }
.progress-bar-label strong { color: var(--gold); }
.bar-bg { height: 5px; background: var(--surface2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--burgundy), var(--gold)); border-radius: 999px; transition: width 1.2s cubic-bezier(0.4,0,0.2,1); }
@keyframes barShimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 300% center; }
}
.bar-fill--shimmer {
  background: linear-gradient(90deg, var(--burgundy) 0%, var(--gold) 40%, #fff8e7 55%, var(--gold) 70%, var(--burgundy) 100%);
  background-size: 250% auto;
  animation: barShimmer 0.9s linear forwards;
}
.last-updated { font-size: 11px; color: var(--text-dim); margin-top: 0.5rem; text-align: right; }

/* ── MAIN ── */
main { max-width: 720px; margin: 0 auto; padding: 2rem 1.25rem 0.5rem; position: relative; z-index: 10; }

/* ── DAY PILLS ── */
.days-nav {
  display: grid; grid-template-columns: repeat(7, minmax(0, 56px));
  justify-content: space-between;
  gap: 0.35rem; margin-bottom: 1.5rem;
}
.day-pill {
  aspect-ratio: 1; width: 100%; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); font-size: clamp(11px, 2.5vw, 15px);
  font-weight: 600; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: all 0.2s ease;
  font-family: 'DM Sans', sans-serif; position: relative;
  -webkit-tap-highlight-color: transparent;
}
.day-pill:hover { border-color: var(--border2); color: var(--text); }
.day-pill.active { background: var(--gold); border-color: var(--gold); color: #1a1000; font-weight: 700; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4.5px var(--gold); }
.day-pill.rest   { background: rgba(139,92,246,0.15); border-color: rgba(139,92,246,0.4); color: #a78bfa; opacity: 1; }
.day-pill.active.full { background: var(--green); border-color: var(--green); color: #001a08; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4.5px var(--green); }
.day-pill.active.rest { background: rgba(139,92,246,0.25); border-color: #a78bfa; color: #a78bfa; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4.5px #a78bfa; }

/* ── DAY SECTION ── */
.day-section { display: none; animation: fadeUp 0.35s ease; }
.day-section.active { display: block; }
@keyframes fadeUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.section-heading { font-family: 'Inter', sans-serif; font-size: 1.75rem; font-weight: 800; letter-spacing: -0.025em; margin-bottom: 0.15rem; }
.section-meta { font-size: 12px; color: var(--text-dim); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1.5rem; }

/* ── CARD ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; overflow: hidden; transition: border-color 0.4s, box-shadow 0.4s, background 0.4s; }
.card--complete-rutina,
.card--complete-comida {
  border-color: #4caf7d;
  box-shadow: 0 0 0 1px #4caf7d33, 0 4px 16px #4caf7d22;
  background: color-mix(in srgb, var(--surface) 96%, #4caf7d);
}

/* Todo el contenido de cards completadas → verde */
.card--complete-rutina *,
.card--complete-comida * {
  color: #4caf7d !important;
  border-color: #4caf7d33 !important;
}
.card--complete-rutina .card-icon,
.card--complete-comida .card-icon {
  background: rgba(76,175,125,0.15) !important;
}
.card--complete-rutina .check-btn.done,
.card--complete-comida .check-btn.done {
  background: #4caf7d !important;
  border-color: #4caf7d !important;
}
.card--complete-rutina .check-btn.done svg,
.card--complete-comida .check-btn.done svg,
.card--complete-rutina .check-btn.done svg *,
.card--complete-comida .check-btn.done svg * {
  color: #fff !important;
  stroke: #fff !important;
}
.card--complete-rutina .card-body,
.card--complete-comida .card-body { border-top-color: #4caf7d44 !important; }

/* Sweep de luz al completar card */
.card--flash { position: relative; }
.card--flash::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  border-radius: inherit; z-index: 3;
  background: linear-gradient(105deg, transparent 20%, rgba(255,220,100,0.45) 50%, transparent 80%);
  animation: cardSweep 0.7s cubic-bezier(0.4,0,0.2,1) forwards;
}

/* XP flotando */
.xp-float {
  position: fixed; pointer-events: none; z-index: 9999;
  transform: translateX(-50%);
  font-family: 'Inter', sans-serif; font-size: 1.6rem; font-weight: 900;
  color: #C9943D;
  text-shadow: 0 0 20px rgba(201,148,61,0.9), 0 0 40px rgba(201,148,61,0.5), 0 2px 8px rgba(0,0,0,0.5);
  white-space: nowrap;
  animation: xpFloat 1.3s cubic-bezier(0.22,1,0.36,1) forwards;
}
@keyframes xpFloat {
  0%   { opacity: 0; transform: translateX(-50%) translateY(0)    scale(0.3); }
  18%  { opacity: 1; transform: translateX(-50%) translateY(-18px) scale(1.35); }
  55%  { opacity: 1; transform: translateX(-50%) translateY(-55px) scale(1.05); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-95px) scale(0.9); }
}
.card:hover { border-color: var(--border2); }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; cursor: pointer; gap: 1rem; }
.card-title-group { display: flex; align-items: center; gap: 0.75rem; flex: 1; }
.card-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }
.card-icon.workout { background: var(--burg-dim); }
.card-icon.meal { background: var(--gold-dim); }
.card-title { font-weight: 500; font-size: 15px; }
.card-sub { font-size: 12px; color: var(--text-dim); margin-top: 1px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.btn-edit {
  background: transparent; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-dim); font-size: 12px; padding: 3px 8px; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: all 0.2s;
}
.btn-edit:hover { border-color: var(--gold); color: var(--gold); }
.chevron { color: var(--text-dim); transition: transform 0.3s ease; flex-shrink: 0; }
.card.open .chevron { transform: rotate(180deg); }
.card-body { max-height: 0; overflow: hidden; transition: max-height 0.45s cubic-bezier(0.4,0,0.2,1); }
.card-body-inner { padding: 0 1.2rem 1.2rem; border-top: 1px solid var(--border); padding-top: 1rem; }

/* ── CARD IMAGE ── */
.card-img-wrap { width: 100%; height: 150px; overflow: hidden; border-radius: var(--radius-sm); margin-bottom: 1rem; background: var(--surface2); position: relative; }
.card-img { width: 100%; height: 100%; object-fit: cover; display: block; filter: brightness(0.8) saturate(0.85); }
.img-error { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--text-dim); font-size: 13px; position: absolute; inset: 0; }

/* ── EXERCISES ── */
.exercise-list { list-style: none; display: flex; flex-direction: column; gap: 0; }
.exercise-item {
  display: flex; flex-direction: column; gap: 0;
  padding: 0.75rem 0.85rem; border-radius: 12px;
  background: var(--surface2); margin-bottom: 0.5rem;
  border: 1px solid var(--border);
}
/* Fila 1: check + nombre + Ver */
.ex-top-row {
  display: flex; align-items: center; gap: 0.65rem;
  margin-bottom: 0.45rem;
}
/* Fila 2: series · reps · descanso */
.ex-stats-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding-left: calc(28px + 0.65rem); /* alineado bajo el nombre */
  margin-bottom: 0.35rem;
}
/* Fila 3: badge de peso */
.ex-weight-row {
  padding-left: calc(28px + 0.65rem);
}
.exercise-name { flex: 1; color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; transition: color 0.2s; }
.exercise-name:hover { color: var(--gold-light); }
.exercise-name.done-text { color: var(--text-dim); text-decoration: line-through; text-decoration-color: var(--green); }
.exercise-sets {
  font-size: 11.5px; color: var(--text-muted); font-weight: 500; white-space: nowrap;
  display: flex; align-items: center; gap: 3px;
}
.ex-view-btn { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; background: var(--surface2); border: 1px solid var(--border); border-radius: 5px; color: var(--text-dim); font-size: 11px; font-family: 'DM Sans', sans-serif; cursor: pointer; white-space: nowrap; transition: border-color 0.15s, color 0.15s; }
.ex-view-btn:hover { border-color: var(--gold); color: var(--gold); }
.ex-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 4px; letter-spacing: 0.04em; white-space: nowrap; flex-shrink: 0; }
.ex-badge.elite { background: rgba(201,148,61,0.15); color: var(--gold); border: 1px solid rgba(201,148,61,0.35); }
.ex-badge.top   { background: rgba(48,209,88,0.12);  color: var(--green); border: 1px solid rgba(48,209,88,0.3); }

/* ── REGENERAR EJERCICIO ── */
.ex-regen-row { margin-top: 0.6rem; padding-top: 0.55rem; border-top: 1px solid var(--border); }
.btn-regen-ex { width: 100%; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0.4rem 0.75rem; background: transparent; border: 1px solid var(--border); border-radius: 7px; color: var(--text-muted); font-size: 11.5px; font-family: 'DM Sans', sans-serif; cursor: pointer; transition: border-color 0.15s, color 0.15s; }
.btn-regen-ex:hover { border-color: var(--border2); color: var(--text-dim); }
.ex-regen-confirm { display: flex; flex-direction: column; gap: 0.45rem; }
.ex-regen-msg { font-size: 11.5px; color: var(--text-dim); line-height: 1.45; }
.ex-regen-msg i { color: var(--gold); margin-right: 3px; }
.ex-regen-btns { display: flex; gap: 0.45rem; }
.btn-regen-cancel { flex: 1; padding: 0.38rem 0; background: transparent; border: 1px solid var(--border2); border-radius: 7px; color: var(--text-muted); font-size: 11.5px; font-family: 'DM Sans', sans-serif; cursor: pointer; }
.btn-regen-ok { flex: 1; padding: 0.38rem 0; background: var(--gold-dim); border: 1px solid var(--gold); border-radius: 7px; color: var(--gold-light); font-size: 11.5px; font-family: 'DM Sans', sans-serif; font-weight: 600; cursor: pointer; }

/* ── MEALS ── */
.macros-banner { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 0.6rem; }
.macro-pill { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 8px 10px; cursor: pointer; position: relative; transition: border-color 0.18s, background 0.18s; }
.macro-pill:hover { border-color: var(--border2); background: var(--surface3); }
.macro-pill--prot { border-color: var(--border); }
.macro-pill--prot:hover { border-color: var(--border2); background: var(--surface3); }
.macro-pill--custom { border-style: dashed; }
.macro-val { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1; }
.macro-pill--prot .macro-val { color: var(--gold-light); }
.macro-lbl { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); margin-top: 4px; }
.macro-edit-icon { position: absolute; top: 6px; right: 8px; font-size: 8px; color: var(--text-dim); opacity: 0.6; }
.macro-info-pill { cursor: default; background: var(--surface); border-style: solid; }
.macro-info-pill:hover { border-color: var(--border); background: var(--surface); }
.macro-info-pill .macro-val { font-size: 16px; color: var(--text-muted); }
.macro-info-pill--carbs .macro-val { color: var(--blue); }
.macro-info-pill--fat .macro-val { color: rgba(255,180,80,0.85); }
.macros-note { font-size: 10px; color: var(--text-dim); text-align: center; margin-bottom: 0.9rem; letter-spacing: 0.02em; }
.macro-info-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.macro-info-card strong { color: var(--text); }
.macro-modal-icon-i { color: var(--gold); margin-right: 4px; }
.meal-list { list-style: none; display: flex; flex-direction: column; }
.meal-item { display: flex; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.meal-item:last-child { border-bottom: none; }
.meal-time-wrap { display: flex; flex-direction: column; min-width: 68px; flex-shrink: 0; padding-top: 2px; }
.meal-time { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); font-weight: 500; white-space: nowrap; }
.meal-target { font-size: 9px; color: var(--text-dim); font-weight: 500; white-space: nowrap; margin-top: 3px; line-height: 1.2; }
.card-macro-sub { font-size: 10px; color: var(--gold-light); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.85; }
.card-macro-sub i { font-size: 9px; margin-right: 2px; }
.meal-scale-note { font-size: 10px; color: var(--text-dim); background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.meal-scale-note i { color: var(--gold); font-size: 9px; }
.meal-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; flex: 1; min-width: 0; overflow-wrap: break-word; word-break: break-word; transition: color 0.2s; }
.meal-desc.done-text { color: var(--text-dim); text-decoration: line-through; text-decoration-color: var(--green); }
.tag { display: inline-block; max-width: calc(100% - 8px); padding: 1px 7px; background: var(--gold-dim); border: 1px solid rgba(201,148,61,0.3); border-radius: 999px; font-size: 11px; color: var(--gold-light); margin-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }

/* ── CHECK BUTTON (nueva feature #1) ── */
.check-btn {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--border2);
  background: transparent; cursor: pointer; flex-shrink: 0;
  transition: all 0.22s cubic-bezier(0.34,1.56,0.64,1);
  display: flex; align-items: center; justify-content: center;
  position: relative; outline: none;
}
.check-btn:hover { border-color: var(--green); transform: scale(1.1); }
.check-btn svg { opacity: 0; transition: opacity 0.2s; }
.check-btn.done {
  background: var(--green); border-color: var(--green);
  color: #fff;
  transform: scale(1.0);
  box-shadow: 0 0 0 3px var(--green-dim);
}
.check-btn.done svg { opacity: 1; }
.check-btn.done:hover { background: var(--green); border-color: var(--green-bright); transform: scale(1.1); }

/* ── TIMER ROW (nueva feature #2) ── */
.timer-row {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.65rem 0.85rem;
  margin-bottom: 1rem; transition: border-color 0.2s;
}
.timer-row.timer-active { border-color: rgba(201,148,61,0.35); }
.timer-row.timer-done { border-color: rgba(58,138,90,0.4); background: rgba(58,138,90,0.06); }

.timer-play-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--gold); background: var(--gold-dim);
  color: var(--gold); cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.2s; outline: none;
}
.timer-play-btn:hover { background: var(--gold); color: #1a1000; transform: scale(1.05); }
.timer-play-btn.running { border-color: #E8A06A; color: #E8A06A; background: rgba(232,160,106,0.12); }
.timer-play-btn.running:hover { background: #E8A06A; color: #1a1000; }
.timer-play-btn.done-state { border-color: var(--green); color: var(--green); background: var(--green-dim); cursor: default; }
.timer-play-btn.done-state:hover { transform: none; }

.timer-track-wrap { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.timer-label-row { display: flex; justify-content: space-between; align-items: center; }
.timer-time {
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  font-variant-numeric: tabular-nums; letter-spacing: 0.03em;
}
.timer-time.done-state { color: var(--green); font-weight: 600; }
.timer-time.running-state { color: var(--gold-light); }
.timer-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; }

.timer-track { height: 4px; background: var(--surface3); border-radius: 999px; overflow: hidden; }
.timer-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--burgundy), var(--gold));
  border-radius: 999px; transition: width 1s linear;
}
.timer-bar.done-state { background: var(--green); width: 100% !important; }

.timer-edit-btn {
  background: transparent; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-dim); font-size: 11px; padding: 4px 8px; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: all 0.2s; white-space: nowrap; flex-shrink: 0;
}
.timer-edit-btn:hover { border-color: var(--gold); color: var(--gold); }
.timer-edit-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── REST NOTE ── */
.rest-note { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 0.875rem 2.5rem 0.875rem 1.25rem; font-size: 13px; color: var(--text-muted); margin-top: 0.5rem; position: relative; }
.rest-note strong { color: var(--gold); }
.swipe-wrap { position: relative; overflow: hidden; border-radius: var(--radius-sm); margin-bottom: 0; }
.swipe-wrap .rest-note { margin-top: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.swipe-del-bg { position: absolute; right: 0; top: 0; bottom: 0; width: 72px; background: #b83232; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; opacity: 0; transition: opacity 0.1s; }
.swipe-wrap.swiping .swipe-del-bg { opacity: 1; }
.swipe-inner { position: relative; width: 100%; will-change: transform; touch-action: pan-y; }
.swipe-x-btn { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); background: none; border: none; color: var(--text-dim); opacity: 0; transition: opacity 0.15s; cursor: pointer; padding: 4px 6px; font-size: 13px; line-height: 1; }
.swipe-wrap:hover .swipe-x-btn { opacity: 1; }
/* En desktop ocultar el fondo rojo — solo tiene sentido en táctil */
@media (hover: hover) and (pointer: fine) {
  .swipe-del-bg { display: none; }
}

/* ── WEEKLY SUMMARY BUTTON ── */
.summary-week-btn {
  width: 100%; padding: 0.65rem 1rem;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); border-radius: var(--radius-sm);
  font-size: 13px; cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: all 0.2s; display: flex; align-items: center;
  justify-content: center; gap: 8px; margin-top: 0;
}
.summary-week-btn:hover { border-color: var(--gold); color: var(--gold-light); background: var(--gold-dim); }

/* ── WEEKLY SUMMARY MODAL CONTENT ── */
.summary-score-wrap { text-align: center; padding: 0.5rem 0 1rem; }
.summary-score {
  font-family: 'Inter', sans-serif;
  font-size: 4rem; font-weight: 800; letter-spacing: -0.04em; color: var(--gold);
  line-height: 1; display: block;
}
.summary-grade { font-size: 13px; color: var(--text-muted); display: block; margin-top: 0.35rem; }

.summary-day-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem; margin-bottom: 1.25rem;
}
.summary-day-cell {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.5rem 0.25rem; text-align: center;
}
.summary-day-name { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px; }
.summary-day-pct { font-family: 'Inter', sans-serif; font-size: 1.2rem; font-weight: 600; }
.pct-perfect { color: var(--green); }
.pct-good { color: var(--gold); }
.pct-ok { color: var(--text-muted); }
.pct-bad { color: var(--text-dim); }

.summary-metrics { display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 1.25rem; }
.summary-metric-header {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted); margin-bottom: 4px;
}
.summary-metric-header strong { color: var(--gold-light); font-weight: 500; }
.summary-metric-bar { height: 5px; background: var(--surface3); border-radius: 999px; overflow: hidden; }
.summary-metric-fill { height: 100%; border-radius: 999px; transition: width 0.9s cubic-bezier(0.4,0,0.2,1); }
.fill-gold { background: linear-gradient(90deg, var(--burgundy), var(--gold)); }
.fill-green { background: var(--green); }
.fill-blue { background: var(--blue); }

.summary-week-label { font-size: 11px; color: var(--text-dim); margin-bottom: 0.75rem; }
.summary-reset-btn {
  background: transparent; border: 1px solid rgba(180,60,60,0.3);
  color: #E88A8A; border-radius: var(--radius-sm);
  padding: 0.5rem 1rem; font-size: 12px; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: all 0.2s;
}
.summary-reset-btn:hover { background: var(--red-dim); border-color: rgba(180,60,60,0.5); }

/* ── SCROLL TOP ── */
/* ════════════════════════════════════
   MODAL OVERLAY
════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
  touch-action: none;
}
@media(min-width:600px){ .modal-overlay { align-items: center; } }
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius) var(--radius) 0 0; width: 100%; max-width: 560px;
  max-height: 90vh; display: flex; flex-direction: column;
  transform: translateY(30px); transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
@media(min-width:600px){ .modal { border-radius: var(--radius); transform: scale(0.96) translateY(10px); } }
.modal-overlay.open .modal { transform: translateY(0); }
@media(min-width:600px){ .modal-overlay.open .modal { transform: scale(1) translateY(0); } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-title { font-family: 'Inter', sans-serif; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.modal-close {
  width: 30px; height: 30px; border-radius: 50%; background: var(--surface2);
  border: 1px solid var(--border); color: var(--text-muted); font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.modal-close:hover { border-color: var(--border2); color: var(--text); }

.modal-body { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }

.modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: 0.75rem; justify-content: flex-end; flex-shrink: 0; }

/* ── FORM ELEMENTS ── */
label.field-label { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 0.35rem; }
input[type=text], input[type=number], input[type=search], textarea {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-family: 'DM Sans', sans-serif;
  font-size: 16px; padding: 0.6rem 0.875rem; outline: none; transition: border-color 0.2s;
  -webkit-appearance: none; appearance: none; box-sizing: border-box;
}
input[type=text]:focus, input[type=number]:focus, input[type=search]:focus, textarea:focus { border-color: var(--gold); }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }

.form-row { display: grid; gap: 0.75rem; grid-template-columns: 1fr 1fr; }
@media(max-width:400px){ .form-row { grid-template-columns: 1fr; } }

/* ── EXERCISE ROWS in modal ── */
.ex-row {
  display: grid; grid-template-columns: 1fr 100px 32px; gap: 0.5rem; align-items: start;
}
@media(max-width:400px){ .ex-row { grid-template-columns: 1fr; gap: 0.35rem; } }
.ex-row input { margin: 0; }
.ex-row-wrap { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.6rem; display: flex; align-items: center; gap: 0.6rem; }
.ex-thumb-wrap { position: relative; width: 62px; height: 62px; flex-shrink: 0; border-radius: 6px; overflow: hidden; cursor: pointer; background: var(--surface3); }
.ex-thumb-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-thumb-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.42); color: #fff; font-size: 13px; transition: background 0.15s; pointer-events: none; }
.ex-thumb-overlay.playing { background: rgba(0,0,0,0.06); }
.ex-thumb-overlay.playing i { opacity: 0; }
.ex-thumb-placeholder { width: 62px; height: 62px; flex-shrink: 0; border-radius: 6px; background: var(--surface3); border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 1.1rem; }
.ex-fields { flex: 1; display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.ex-series-row { display: flex; gap: 6px; }
.ex-series-field { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 5px 7px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ex-series-label { font-size: 9px; color: var(--text-dim); display: flex; align-items: center; gap: 3px; text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; }
input.ex-series-input { border: none !important; background: transparent !important; padding: 0 !important; margin: 0 !important; font-size: 13px; font-weight: 600; color: var(--text); width: 100%; box-shadow: none !important; outline: none !important; }
input.ex-series-input:focus { outline: none !important; box-shadow: none !important; border: none !important; }
.ex-img-row { display: grid; grid-template-columns: 1fr 32px; gap: 0.5rem; align-items: center; }
.ex-img-preview { width: 100%; height: 60px; object-fit: cover; border-radius: 6px; display: block; background: var(--surface3); border: 1px solid var(--border); }
.ex-img-preview.hidden { display: none; }
.ex-img-placeholder { width: 100%; height: 60px; border-radius: 6px; background: var(--surface3); border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-dim); }
.ex-img-placeholder.hidden { display: none; }

/* ── MEAL ROWS in modal ── */
.meal-row { display: flex; flex-direction: column; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 0.5rem; overflow: hidden; }
.meal-row-top { display: flex; justify-content: flex-end; padding: 5px 5px 0; }
.meal-row-fields { display: grid; grid-template-columns: 90px 1fr 100px; gap: 0.5rem; padding: 0.4rem 0.6rem 0.6rem; }
@media(max-width:500px){ .meal-row-fields { grid-template-columns: 1fr; } }
.meal-row input { margin: 0; }
.meal-row-delete { width: 28px; height: 28px; background: transparent; border: 1px solid var(--border); border-radius: 6px; color: var(--text-dim); font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.meal-row-delete:hover { border-color: rgba(180,60,60,0.5); color: #E88A8A; }

.btn-remove {
  width: 32px; height: 32px; background: transparent; border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-dim); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0;
}
.btn-remove:hover { border-color: rgba(180,60,60,0.5); color: #E88A8A; }

.btn-add {
  background: transparent; border: 1px dashed var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 13px; padding: 0.5rem; cursor: pointer;
  font-family: 'DM Sans', sans-serif; width: 100%; transition: all 0.2s; text-align: center;
}
.btn-add:hover { border-color: var(--gold); color: var(--gold); }

/* ── SECTION DIVIDER ── */
.modal-section-title { font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-dim); border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }

/* ── BUTTONS ── */
.btn-primary {
  background: var(--gold); color: #1a1000; border: none; border-radius: var(--radius-sm);
  padding: 0.6rem 1.25rem; font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.88; }
.btn-secondary {
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); padding: 0.6rem 1.25rem; font-size: 14px; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: border-color 0.2s;
}
.btn-secondary:hover { border-color: var(--border2); color: var(--text); }

/* ── LOADING ── */
#loading { display: flex; align-items: center; justify-content: center; position: fixed; inset: 0; }
.spinner { width: 28px; height: 28px; border: 2px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Pull-to-refresh ── */
#ptr-indicator {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  display: flex; justify-content: center; align-items: flex-start;
  transform: translateY(-70px); opacity: 0; pointer-events: none;
}
.ptr-pill {
  margin-top: 10px; background: var(--surface2);
  border: 1px solid var(--border2); border-radius: 999px;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.ptr-icon { font-size: 16px; color: var(--gold); }
.ptr-loading .ptr-icon { animation: spin 0.65s linear infinite; }

/* ── SAVING INDICATOR ── */
.saving-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  display: inline-block; margin-right: 5px; animation: pulse 1.5s ease infinite;
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.3; } }

/* ── TIMER EDIT INPUT ── */
.timer-duration-input {
  width: 60px; background: var(--surface); border: 1px solid var(--gold);
  border-radius: 6px; color: var(--gold-light); font-family: 'DM Sans', sans-serif;
  font-size: 16px; padding: 2px 6px; outline: none; text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ── WATER TRACKER ── */
/* ── Inline water card (home) ── */
.water-inline-card {
  background: var(--surface); border: 1px solid rgba(58,122,170,0.3);
  border-radius: var(--radius-sm); padding: 0.85rem 1rem;
  margin-top: 0.5rem; position: relative; overflow: hidden; transition: border-color 0.3s;
}
.water-inline-card.water-done { border-color: rgba(107,187,245,0.5); }
.wic-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.wic-left { display: flex; align-items: center; gap: 0.55rem; }
.wic-icon { color: #6BBBF5; font-size: 15px; }
.wic-labels { display: flex; flex-direction: column; gap: 1px; }
.wic-title { font-size: 12px; font-weight: 700; color: #6BBBF5; text-transform: uppercase; letter-spacing: 0.05em; }
.wic-sub { font-size: 11px; color: var(--text-dim); }
.wic-amount { font-size: 1.25rem; font-weight: 700; color: var(--text); font-family: 'Inter', sans-serif; }
.wic-goal { font-size: 0.75rem; color: var(--text-dim); font-weight: 400; font-family: 'DM Sans', sans-serif; }
.wic-bar-bg { height: 5px; background: var(--surface2); border-radius: 999px; overflow: hidden; margin-bottom: 0.65rem; }
.wic-bar-fill { height: 100%; background: linear-gradient(90deg, #3A7AAA, #6BBBF5); border-radius: 999px; transition: width 0.5s ease; }
.wic-btns { display: flex; gap: 0.4rem; }
.wic-btn {
  flex: 1; background: rgba(58,122,170,0.1); border: 1px solid rgba(58,122,170,0.25);
  border-radius: 8px; color: #6BBBF5; font-size: 12px; font-weight: 600;
  padding: 0.45rem 0; cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: all 0.18s; text-align: center;
}
.wic-btn:active { background: rgba(58,122,170,0.25); transform: scale(0.96); }
.wic-reset {
  flex: 0 0 38px; background: transparent; border-color: var(--border);
  color: var(--text-dim); font-size: 13px;
}
.wic-reset:active { color: var(--text); }

.water-widget {
  background: var(--surface); border: 1px solid rgba(58,122,170,0.35);
  border-radius: var(--radius-sm); padding: 0.875rem 1rem; margin-top: 0.75rem;
  position: relative; overflow: hidden;
}
.water-widget--standalone {
  margin: 0 0 1rem 0;
  border-radius: var(--radius);
}
.water-widget-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.water-title { font-size: 12px; font-weight: 500; color: var(--blue); display: flex; align-items: center; gap: 6px; }
.water-amount { font-family: 'Inter', sans-serif; font-size: 1.3rem; font-weight: 600; color: var(--text); }
.water-amount span { font-size: 0.8rem; color: var(--text-muted); font-family: 'DM Sans', sans-serif; font-weight: 400; }
.water-bar-bg { height: 6px; background: var(--surface2); border-radius: 999px; overflow: hidden; margin-bottom: 0.65rem; }
.water-bar-fill { height: 100%; background: linear-gradient(90deg, #3A7AAA, #6BBBF5); border-radius: 999px; transition: width 0.5s ease; }
.water-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.water-btn {
  background: rgba(58,122,170,0.12); border: 1px solid rgba(58,122,170,0.3);
  border-radius: 6px; color: #6BBBF5; font-size: 12px; padding: 4px 10px;
  cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.2s;
}
.water-btn:hover { background: rgba(58,122,170,0.22); border-color: rgba(58,122,170,0.5); }
.water-btn.reset { border-color: rgba(90,85,80,0.4); color: var(--text-dim); background: transparent; margin-left: auto; }
.water-goal-done { color: #6BBBF5; font-size: 12px; font-weight: 500; }

.water-done-wrap {
  display: flex; align-items: center; gap: 0.75rem;
  animation: waterDoneIn 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
}
.water-done-icon {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: rgba(107,187,245,0.15); border: 1px solid rgba(107,187,245,0.35);
  color: #6BBBF5; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.water-done-info { display: flex; flex-direction: column; gap: 2px; }
.water-done-title { font-size: 13px; font-weight: 600; color: #6BBBF5; }
.water-done-sub   { font-size: 11px; color: var(--text-muted); }

@keyframes waterDoneIn {
  from { opacity: 0; transform: scale(0.85) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes wconfetti {
  0%   { transform: translate(0,0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--tx),var(--ty)) rotate(var(--rot)); opacity: 0; }
}

/* ── WEIGHIN BANNER ── */
.weighin-banner {
  background: linear-gradient(135deg, rgba(201,148,61,0.08), rgba(201,148,61,0.04));
  border: 1px solid rgba(201,148,61,0.35); border-radius: var(--radius-sm);
  padding: 0.75rem 1rem; display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.weighin-banner-text { flex: 1; font-size: 13px; color: var(--text-muted); }
.weighin-banner-text strong { color: var(--gold-light); display: block; margin-bottom: 1px; }
.weighin-banner-btn {
  background: var(--gold); color: #1a1000; border: none; border-radius: 6px;
  padding: 5px 12px; font-size: 12px; font-weight: 500; cursor: pointer;
  font-family: 'DM Sans', sans-serif; flex-shrink: 0; transition: opacity 0.2s;
}
.weighin-banner-btn:hover { opacity: 0.85; }
.weighin-banner-dismiss {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 18px; cursor: pointer; padding: 0; flex-shrink: 0; line-height: 1;
}

/* ── WEIGHT BADGE ── */
.weight-badge-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; flex-shrink: 0; }
.weight-badge {
  font-size: 11px; background: rgba(201,148,61,0.1); border: 1px solid rgba(201,148,61,0.25);
  border-radius: 5px; color: var(--gold-light); padding: 2px 7px;
  cursor: pointer; transition: all 0.2s; white-space: nowrap; font-weight: 500;
}
.weight-badge:hover { background: rgba(201,148,61,0.2); border-color: var(--gold); }
.weight-badge.empty { color: var(--text-dim); border-style: dashed; background: transparent; }
.weight-edit-row { display: flex; align-items: stretch; gap: 4px; flex: 1; min-width: 0; }
.weight-inline-input {
  flex: 1; min-width: 0; background: var(--surface2); border: 1px solid var(--gold);
  border-radius: 5px; color: var(--gold-light); font-family: 'DM Sans', sans-serif;
  font-size: 16px; padding: 2px 6px; outline: none; text-align: center;
}


/* ── PROFILE HEADER ── */
.profile-header { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1.4rem; }
.profile-photo { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; object-position: center; border: 2px solid var(--gold); flex-shrink: 0; box-shadow: 0 0 0 4px rgba(201,148,61,0.15); }
.profile-avatar-initial {
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--gold-dim); border: 2px solid var(--gold);
  flex-shrink: 0; box-shadow: 0 0 0 4px rgba(201,148,61,0.15);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Inter', sans-serif; font-size: 1.8rem;
  font-weight: 700; color: var(--gold-light);
}
.avatar-upload-wrap {
  position: relative; cursor: pointer; flex-shrink: 0;
  width: 68px; height: 68px; border-radius: 50%;
}
.avatar-upload-wrap .profile-photo,
.avatar-upload-wrap .profile-avatar-initial { flex-shrink: 0; }
.avatar-upload-overlay {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(0,0,0,0.52); display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s ease; color: #fff; font-size: 1.2rem; pointer-events: none;
}
.avatar-upload-wrap:hover .avatar-upload-overlay,
.avatar-upload-wrap:active .avatar-upload-overlay { opacity: 1; }
.profile-name-block { flex: 1; }
.profile-name { font-family: 'Inter', sans-serif; font-size: clamp(1.8rem, 6vw, 2.8rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; color: var(--text); }
.profile-name span { color: var(--gold); }
.profile-subtitle { font-size: 13px; color: var(--text-muted); font-weight: 300; margin-top: 0.25rem; }

.name-level-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.level-badge {
  font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 700;
  background: var(--gold-dim); color: var(--gold);
  border: 1px solid var(--gold); border-radius: 999px;
  padding: 2px 8px; letter-spacing: 0.03em; white-space: nowrap; flex-shrink: 0;
}
.level-xp-track {
  height: 4px; background: var(--surface2); border-radius: 999px;
  overflow: hidden; margin-top: 0.5rem;
}
.level-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #e8c56d);
  border-radius: 999px; transition: width 0.6s ease;
}
.level-xp-text {
  font-size: 10px; color: var(--text-dim); margin-top: 3px;
  font-family: 'DM Sans', sans-serif;
}

/* ── PROGRESS RINGS ── */
.rings-row { display: none; }
.ring-widget { display: none; }
.ring-mini-svg-wrap {
  position: relative; width: 68px; height: 68px; flex-shrink: 0;
}
.ring-mini-svg {
  width: 68px; height: 68px;
  transform: rotate(-90deg);
  display: block; overflow: visible;
}
.ring-track {
  fill: none;
  stroke: rgba(255,255,255,0.07);
  stroke-width: 10;
}
.ring-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.4,0,0.2,1);
}
.ring-fill-gold  { stroke: #C9943D; }
.ring-fill-green { stroke: #30D158; }
.ring-fill-blue  { stroke: #4A9EFF; }
.ring-center-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem; font-weight: 700;
  color: var(--text); letter-spacing: -0.02em; line-height: 1;
}
.ring-widget-label {
  font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); font-family: 'DM Sans', sans-serif;
  text-align: center; width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px;
}

/* ── WEEKEND EDIT CARD ── */
.weekend-edit-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.weekend-edit-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.weekend-edit-title { font-size: 13px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 8px; }
.weekend-notes-text { font-size: 13px; color: var(--text-muted); line-height: 1.6; white-space: pre-wrap; }
.weekend-notes-empty { font-size: 13px; color: var(--text-dim); font-style: italic; }

/* ── WEIGHT SAVE BUTTON ── */
.weight-save-btn { flex-shrink: 0; background: var(--gold); color: #1a1000; border: none; border-radius: 5px; padding: 0 12px; font-size: 13px; cursor: pointer; font-family: 'DM Sans', sans-serif; font-weight: 700; transition: opacity 0.2s; align-self: stretch; }
.weight-save-btn:hover { opacity: 0.85; }

/* ── WEEKEND SECTION ── */
.weekend-section { display: none; animation: fadeUp 0.35s ease; }
.weekend-section.active { display: block; }
.supplement-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.2rem; margin-bottom: 1rem;
}
.supplement-card-title { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 0.75rem; display: flex; align-items: center; gap: 8px; }
.supplement-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.supplement-item:last-child { border-bottom: none; }
.supplement-name { flex: 1; color: var(--text-muted); }
.supplement-dose { font-size: 12px; color: var(--gold); font-weight: 500; }
.water-reminder-card {
  background: rgba(58,122,170,0.06); border: 1px solid rgba(58,122,170,0.25);
  border-radius: var(--radius-sm); padding: 0.875rem 1rem; display: flex; align-items: center; gap: 0.75rem;
}
.water-reminder-icon { font-size: 1.5rem; flex-shrink: 0; }
.water-reminder-text { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.water-reminder-text strong { color: #6BBBF5; }

/* ── HAMBURGER BUTTON ── */
/* ── BOTTOM NAV ── */
#bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 500;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
body.modal-open #bottom-nav { display: none; }

.bnav-inner {
  display: flex; align-items: stretch;
  max-width: 720px; margin: 0 auto; width: 100%;
}

.bnav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  padding: 0.6rem 0;
  background: none; border: none;
  color: var(--text-dim);
  font-size: 20px; cursor: pointer;
  transition: color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.bnav-btn span {
  font-size: 10px; font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  line-height: 1;
}
.bnav-btn:active { transform: scale(0.85); color: var(--gold-light); }
.bnav-btn.active { color: #ffffff; }
.bnav-btn.bnav-soon { opacity: 0.35; }
@media (hover: hover) {
  .bnav-btn:hover { color: var(--gold-light); }
}

/* ── BTN DANGER ── */
.btn-danger {
  background: var(--red-dim); border: 1px solid var(--red); color: #E88A8A;
  padding: 0.65rem 1.2rem; border-radius: var(--radius-sm); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; gap: 0.4rem; transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.btn-danger:hover { background: var(--red); color: #fff; }

/* ── THEME CARDS ── */
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.theme-card {
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.75rem; cursor: pointer; transition: border-color 0.2s;
  background: var(--surface2);
}
.theme-card.active { border-color: var(--gold); }
.theme-card:hover { border-color: var(--border2); }
.theme-preview { display: flex; gap: 4px; margin-bottom: 0.4rem; }
.theme-swatch { width: 20px; height: 20px; border-radius: 50%; }
.theme-name { font-size: 12px; color: var(--text-muted); }
.theme-card.active .theme-name { color: var(--gold); }

/* ── PROFILE AVATAR ── */
#profile-avatar-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ── SELECT styles ── */
select {
  width: 100%; padding: 0.6rem 0.75rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 16px;
  font-family: 'DM Sans', sans-serif; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238A8177' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center;
  cursor: pointer;
}
select:focus { outline: none; border-color: var(--gold); }
select option { background: var(--surface2); }

/* ── ONBOARDING ── */
/* ── ONBOARDING v2 (dark premium style) ── */
#onboarding {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; flex-direction: column; overflow: hidden; z-index: 100;
  align-items: center;
}
.onb-top-bar, #onb-inner, .onb-bottom {
  width: 100%; max-width: 480px; box-sizing: border-box;
}
.onb-top-bar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: max(2rem, env(safe-area-inset-top, 1rem) + 1rem) 1.25rem 0.75rem; flex-shrink: 0;
}
.onb-back-circle {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); cursor: pointer; flex-shrink: 0; transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.onb-back-circle:hover { background: rgba(255,255,255,0.14); }
.onb-back-circle.hidden { visibility: hidden; pointer-events: none; }
.onb-track { flex: 1; height: 3px; background: rgba(255,255,255,0.1); border-radius: 999px; overflow: hidden; }
#onb-progress-fill { height: 100%; background: var(--gold); border-radius: 999px; transition: width 0.4s ease; }
#onb-inner { flex: 1; overflow: hidden; position: relative; }
.onb-step {
  display: none; flex-direction: column; justify-content: center;
  padding: 1.5rem 1.5rem 1rem; height: 100%; overflow-y: auto;
  box-sizing: border-box;
}
.onb-step.active { display: flex; animation: onbSlideIn 0.28s ease; }
@keyframes onbSlideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
.onb-step-title {
  font-family: 'Inter', sans-serif; font-size: clamp(1.9rem, 8vw, 2.4rem);
  font-weight: 800; color: var(--text); line-height: 1.15;
  letter-spacing: -0.03em; margin-bottom: 0.45rem;
}
.onb-step-sub { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 1.75rem; }
/* Pill options */
.onb-pill-list { display: flex; flex-direction: column; gap: 0.7rem; padding-bottom: 1rem; }
.onb-pill {
  width: 100%; padding: 1rem 1.35rem; background: transparent;
  border: 1.5px solid rgba(255,255,255,0.18); border-radius: 999px;
  color: var(--text); text-align: left; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex; flex-direction: column; gap: 0.15rem;
  -webkit-tap-highlight-color: transparent;
}
.onb-pill:active { opacity: 0.8; }
.onb-pill .pill-main { font-weight: 600; font-size: 1rem; line-height: 1.2; }
.onb-pill .pill-sub { font-size: 0.78rem; color: var(--text-muted); }
.onb-pill.selected { border-color: var(--gold); background: var(--gold-dim); }
.onb-pill.selected .pill-main { color: var(--gold-light); }
.onb-pill.selected .pill-sub { color: rgba(201,148,61,0.65); }
/* Day circles */
.onb-days-count {
  font-size: 1.5rem; font-weight: 800; color: var(--text);
  text-align: center; margin-bottom: 1.5rem; min-height: 2.2rem;
  font-family: 'Inter', sans-serif; letter-spacing: -0.02em;
}
.onb-days-row { display: flex; gap: 0.5rem; justify-content: center; padding-bottom: 1rem; }
.onb-day-circle {
  width: 42px; height: 42px; border-radius: 50%;
  background: transparent; border: 1.5px solid rgba(255,255,255,0.18);
  color: var(--text-muted); font-size: 14px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.18s; -webkit-tap-highlight-color: transparent;
  font-family: 'DM Sans', sans-serif; flex-shrink: 0;
}
.onb-day-circle.selected { background: var(--gold); border-color: var(--gold); color: #1a1000; }
/* Muscle grid — step 12 */
.onb-muscles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-bottom: 16px; max-height: 58vh; overflow-y: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.onb-muscles-grid::-webkit-scrollbar { display: none; }
.onb-muscle-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; background: var(--surface2); border: 2px solid var(--border); border-radius: 12px; cursor: pointer; transition: border-color 0.15s, background 0.15s; -webkit-tap-highlight-color: transparent; width: 100%; box-sizing: border-box; }
.onb-muscle-card img { width: 62px; height: 62px; object-fit: contain; display: block; }
.onb-muscle-card span { font-size: 11px; font-weight: 600; color: var(--text-dim); text-align: center; line-height: 1.2; }
.onb-muscle-card.selected { border-color: var(--gold); background: var(--gold-dim); }
.onb-muscle-card.selected span { color: var(--gold-light); }
/* Input fields */
.onb-field-wrap { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.onb-lbl { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.onb-inp {
  width: 100%; padding: 0.85rem 1rem; background: var(--surface);
  border: 1.5px solid var(--border2); border-radius: var(--radius-sm);
  color: var(--text); font-size: 16px; font-family: 'DM Sans', sans-serif;
  outline: none; box-sizing: border-box; transition: border-color 0.2s;
}
.onb-inp:focus { border-color: var(--gold); }
.onb-inp::placeholder { color: var(--text-dim); }
.onb-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; align-items: start; }
/* Bottom CTA */
.onb-bottom {
  padding: 0.85rem 1.5rem env(safe-area-inset-bottom, 0.75rem);
  background: var(--bg); flex-shrink: 0; border-top: 1px solid var(--border);
}
.onb-cta {
  width: 100%; padding: 1rem; border-radius: 999px;
  background: var(--gold); color: #1a1000;
  font-size: 1.05rem; font-weight: 700; border: none;
  cursor: pointer; transition: opacity 0.2s, transform 0.15s;
  letter-spacing: -0.01em; font-family: 'Inter', sans-serif;
}
.onb-cta:disabled { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.25); cursor: not-allowed; }
.onb-cta:not(:disabled):active { transform: scale(0.97); }
/* Old compat selectors kept for existing js refs */
.onb-field { display: flex; flex-direction: column; gap: 0.3rem; }
.onb-field label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); }
.onb-field input { width: 100%; padding: 0.65rem 0.85rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 16px; font-family: 'DM Sans', sans-serif; }
.onb-field input:focus { outline: none; border-color: var(--gold); }
.onb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.onb-fields { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 1rem; }
.onb-cards { display: flex; flex-direction: column; gap: 0.6rem; width: 100%; text-align: left; }
.onb-choice-card {
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 0.9rem 1.1rem; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s;
}
.onb-choice-card.selected { border-color: var(--gold); background: var(--gold-dim); }
/* ── PLAN GENERATION SCREEN ── */
#gen-screen {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; flex-direction: column; padding: 2rem 1.5rem;
  animation: onbSlideIn 0.3s ease;
}
.gen-title {
  font-family: 'Inter', sans-serif; font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 800; color: var(--text); text-align: center;
  letter-spacing: -0.03em; margin-bottom: 2rem; line-height: 1.2;
}
.gen-bar-bg {
  width: 100%; max-width: 340px; height: 6px; background: rgba(255,255,255,0.1);
  border-radius: 999px; overflow: hidden; margin-bottom: 0.6rem;
}
.gen-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  border-radius: 999px; transition: width 0.4s ease;
}
.gen-pct {
  font-size: 2rem; font-weight: 800; color: var(--text);
  font-family: 'Inter', sans-serif; letter-spacing: -0.03em;
  text-align: center; margin-bottom: 2rem;
}
.gen-checklist { display: flex; flex-direction: column; gap: 0.9rem; width: 100%; max-width: 340px; }
.gen-item {
  display: flex; align-items: center; gap: 0.9rem;
  font-size: 1rem; color: rgba(255,255,255,0.35);
  font-family: 'DM Sans', sans-serif; transition: color 0.3s;
}
.gen-item.done { color: var(--text); }
.gen-check {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.3s; font-size: 12px;
  color: transparent;
}
.gen-item.done .gen-check {
  background: var(--green); border-color: var(--green);
  color: white;
}

/* ── DRUM PICKER ── */
.drum-card {
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius);
  padding: 1rem 1rem 0.5rem;
  overflow: hidden;
}
.drum-picker {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin: 0 0 0.25rem; position: relative;
}
.drum-col {
  position: relative; width: 80px; height: 240px; overflow: hidden; flex-shrink: 0;
}
.drum-col::before, .drum-col::after {
  content: ''; position: absolute; left: 0; right: 0; z-index: 2; pointer-events: none;
}
.drum-col::before {
  top: 0; height: 96px;
  background: linear-gradient(to bottom, var(--bg) 30%, transparent);
}
.drum-col::after {
  bottom: 0; height: 96px;
  background: linear-gradient(to top, var(--bg) 30%, transparent);
}
.drum-highlight {
  position: absolute; top: 50%; left: 6px; right: 6px; height: 48px;
  transform: translateY(-50%); border-radius: 10px;
  background: rgba(255,255,255,0.07); z-index: 1; pointer-events: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.drum-list {
  overflow-y: scroll; height: 100%;
  scroll-snap-type: y mandatory; scrollbar-width: none;
  padding: 96px 0; box-sizing: border-box;
}
.drum-list::-webkit-scrollbar { display: none; }
.drum-item {
  height: 48px; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; color: rgba(255,255,255,0.18);
  scroll-snap-align: center; font-family: 'Inter', sans-serif;
  letter-spacing: -0.02em; user-select: none;
  transition: color 0.15s, font-size 0.15s;
}
.drum-item.active { color: var(--text); font-size: 1.85rem; }
.drum-item.near { color: rgba(255,255,255,0.45); font-size: 1.3rem; }
.drum-sep-label {
  font-size: 0.9rem; color: var(--text-dim); padding: 0 6px;
  font-family: 'DM Sans', sans-serif; margin-top: 4px; flex-shrink: 0;
}

/* ── METRICS COLLAPSIBLE ── */
.metrics-collapsible {
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.4,0,0.2,1);
}
.metrics-collapsible.open { max-height: none; }
.metrics-toggle {
  width: 100%; background: transparent; border: none; border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: 12px; cursor: pointer; padding: 0.5rem 0 0;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-family: 'DM Sans', sans-serif; transition: color 0.2s; margin-top: 0.75rem;
}
.metrics-toggle:hover { color: var(--gold); }

/* ── EXERCISE GALLERY ── */
.gallery-cat-tab {
  padding: 0.35rem 0.9rem; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 12px; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: all 0.2s; white-space: nowrap;
}
.gallery-cat-tab:hover { border-color: var(--border2); color: var(--text); }
.gallery-cat-tab.active { background: var(--gold-dim); border-color: var(--gold); color: var(--gold-light); font-weight: 500; }

.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem;
}
.gallery-item {
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
  display: flex; flex-direction: column; overflow: hidden;
}
@media (hover: hover) { .gallery-item:hover { border-color: var(--gold); } }
.gallery-item-video-wrap {
  position: relative; width: 100%; aspect-ratio: 4/3; overflow: hidden; flex-shrink: 0;
}
.gallery-item-gif {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.gallery-play-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35); transition: background 0.15s;
  color: #fff; font-size: 18px; pointer-events: none;
}
.gallery-play-overlay.playing { background: rgba(0,0,0,0.05); }
.gallery-play-overlay.playing i { opacity: 0; }
.gallery-item-video-wrap:hover .gallery-play-overlay:not(.playing) { background: rgba(0,0,0,0.5); }
.gallery-item-gif-placeholder {
  width: 100%; aspect-ratio: 4/3; background: var(--surface3);
  border-bottom: 1px dashed var(--border); display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 1.8rem;
}
.gallery-item-info {
  padding: 0.45rem 0.5rem 0.5rem; display: flex; flex-direction: column; gap: 0.25rem;
}
.gallery-item-name {
  font-size: 11.5px; color: var(--text); line-height: 1.3; word-break: break-word;
}
.gallery-item-series { font-size: 10px; color: var(--gold); font-weight: 500; }

/* ── FAV BUTTON (GIF modal + preview modal) ── */
.fav-btn {
  background: none; border: none; cursor: pointer; padding: 4px 6px;
  color: var(--text-dim); font-size: 16px; line-height: 1;
  transition: color 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.fav-btn:active { transform: scale(1.25); }
.fav-btn.fav-active { color: #e05c5c; }
@media (hover: hover) { .fav-btn:hover { color: #e05c5c; } }

/* ── GALLERY FAV BUTTON (card corner) ── */
.gallery-item { position: relative; }
.gallery-fav-btn {
  position: absolute; top: 5px; right: 5px; z-index: 2;
  background: rgba(0,0,0,0.45); border: none; border-radius: 50%;
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: rgba(255,255,255,0.6); font-size: 11px;
  transition: color 0.2s, background 0.2s, transform 0.15s;
}
.gallery-fav-btn:active { transform: scale(1.2); }
.gallery-fav-btn.fav-active { color: #e05c5c; background: rgba(0,0,0,0.55); }
@media (hover: hover) { .gallery-fav-btn:hover { color: #e05c5c; background: rgba(0,0,0,0.6); } }

/* ── GALLERY FAVORITOS TAB ── */
.gallery-cat-fav.active { background: rgba(224,92,92,0.15); border-color: #e05c5c; color: #e05c5c; }

/* ── FOOD SEARCH ── */
.food-search-results {
  background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-sm);
  overflow: hidden; margin-top: 4px; max-height: 220px; overflow-y: auto;
}
.food-result-item {
  padding: 0.7rem 0.875rem; cursor: pointer; transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.food-result-item:last-child { border-bottom: none; }
.food-result-item:hover { background: var(--surface2); }
.food-result-name { font-size: 13px; color: var(--text); margin-bottom: 2px; }
.food-result-macros { font-size: 11px; color: var(--text-dim); }
.food-result-macros strong { color: var(--gold); font-weight: 500; }
.food-result-empty { padding: 0.75rem; font-size: 13px; color: var(--text-dim); text-align: center; }

.food-day-counter {
  display: flex; align-items: center; gap: 6px; margin-top: 0.5rem;
  background: var(--gold-dim); border: 1px solid var(--border2); border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem; font-size: 12px; color: var(--gold-light);
}

/* ── TOGGLE DESCANSO / ENTRENO ── */
.btn-regen {
  flex-shrink: 0; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 999px; color: var(--text-muted); font-size: 12px;
  width: 30px; height: 30px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; -webkit-tap-highlight-color: transparent;
}
.btn-regen:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.btn-regen:active { transform: rotate(180deg); }

.btn-rest-toggle {
  flex-shrink: 0; margin-top: 6px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  padding: 0.35rem 0.85rem; cursor: pointer; display: flex; align-items: center; gap: 5px;
  font-family: 'DM Sans', sans-serif; transition: all 0.2s; white-space: nowrap; border: 1px solid;
}
/* Día de entrenamiento → botón "Cambiar a Descanso" (morado) */
.btn-rest-toggle.to-rest {
  background: rgba(139,92,246,0.12); border-color: rgba(139,92,246,0.35); color: #a78bfa;
}
.btn-rest-toggle.to-rest:hover { background: rgba(139,92,246,0.22); border-color: #a78bfa; }
/* Día de descanso → botón "Cambiar a Entrenar" (verde) */
.btn-rest-toggle.to-train {
  background: rgba(48,209,88,0.1); border-color: rgba(48,209,88,0.3); color: var(--green);
}
.btn-rest-toggle.to-train:hover { background: rgba(48,209,88,0.2); border-color: var(--green); }

/* ── REST DAY CARD ── */
.rest-day-card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--gold); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem; margin-bottom: 1rem; display: flex; align-items: flex-start; gap: 1rem;
}
.rest-day-icon { font-size: 1.6rem; color: var(--gold); flex-shrink: 0; margin-top: 2px; }
.rest-day-text { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ── COPY DAY ROW ── */
.copy-day-row {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}
.copy-day-select-wrap { flex: 1; position: relative; display: flex; align-items: center; background: var(--surface3); border: 1px solid var(--border2); border-radius: 6px; padding: 0 0.5rem; cursor: pointer; }
.copy-day-select-wrap:hover { border-color: var(--gold); }
.copy-day-select { flex: 1; background: transparent; border: none; color: var(--text); font-size: 13px; font-family: 'DM Sans', sans-serif; outline: none; padding: 0.35rem 1.2rem 0.35rem 0.1rem; cursor: pointer; appearance: none; -webkit-appearance: none; }
.copy-day-chevron { position: absolute; right: 6px; font-size: 9px; color: var(--text-dim); pointer-events: none; }
.copy-day-btn {
  flex-shrink: 0; background: var(--gold); border: none; border-radius: 4px;
  color: #1a1000; font-size: 12px; font-weight: 600; padding: 4px 12px;
  cursor: pointer; font-family: 'DM Sans', sans-serif; white-space: nowrap;
  transition: opacity 0.2s;
}
.copy-day-btn:hover { opacity: 0.82; }


/* ── IMC RESULT ── */
.imc-result {
  margin-top: 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  animation: fadeIn 0.25s ease;
}
.imc-row {
  display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.35rem;
}
.imc-value {
  font-size: 22px; font-weight: 700; font-family: 'Inter', sans-serif;
  color: var(--text);
}
.imc-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.03em;
}
.imc-explain {
  font-size: 11px; color: var(--text-muted); line-height: 1.45;
  margin: 0 0 0.4rem; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem;
}
.imc-nota {
  font-size: 10.5px; color: var(--text-dim); line-height: 1.45; margin: 0;
}
.imc-nota i { margin-right: 3px; }

/* ── ALTURA UNIT TOGGLE ── */
.altura-wrap { display: flex; gap: 0.4rem; align-items: stretch; }
.altura-wrap input { flex: 1; min-width: 0; }
.unit-toggle {
  display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; flex-shrink: 0;
}
.unit-toggle button {
  background: transparent; border: none; padding: 0 10px;
  font-size: 11px; font-weight: 600; color: var(--text-dim);
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: background 0.15s, color 0.15s;
}
.unit-toggle button.active {
  background: var(--gold); color: #1a1000;
}

/* ── FT+IN WRAP ── */
#onb-ft-wrap, #profile-ft-wrap {
  display: none; align-items: center; gap: 4px; flex: 1;
}
#onb-ft-wrap input, #profile-ft-wrap input {
  width: 48px !important; flex: none; min-width: 0; text-align: center;
}
#onb-ft-wrap span, #profile-ft-wrap span {
  color: var(--text-dim); font-size: 12px; flex-shrink: 0;
}

/* ── PREFERENCE SELECTOR ─────────────────────────────────────────── */
#pref-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto;
  animation: wlcBgIn 0.45s ease both;
}
.pref-bg {
  position: fixed; inset: 0; pointer-events: none; overflow: hidden;
}
.pref-orb {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,148,61,0.12), transparent 70%);
}
.pref-orb.orb1 { width: 320px; height: 320px; top: -80px; right: -80px; }
.pref-orb.orb2 { width: 240px; height: 240px; bottom: 40px; left: -60px; }

.pref-inner {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px;
  padding: 3rem 1.5rem 2.5rem;
  animation: wlcSlideUp 0.5s ease both 0.05s; opacity: 0;
}
.pref-top { text-align: center; margin-bottom: 2rem; }
.pref-step-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); margin: 0 auto 1rem;
  box-shadow: 0 0 10px rgba(201,148,61,0.5);
}
.pref-eyebrow {
  font-size: 10px; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 0.5rem;
}
.pref-title {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.9rem, 7vw, 2.6rem); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.08; margin-bottom: 0.6rem;
}
.pref-title span { color: var(--gold); }
.pref-sub {
  font-size: 13.5px; color: var(--text-dim); line-height: 1.6;
}

.pref-section { margin-bottom: 1.75rem; }
.pref-section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 0.85rem; display: flex; align-items: center; gap: 0.4rem;
}
.pref-section-label i { color: var(--gold); }

.pref-pills {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.pref-pill {
  display: flex; align-items: center; gap: 0.35rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.45rem 0.9rem;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; transition: all 0.18s ease;
  font-family: 'DM Sans', sans-serif;
}
.pref-pill:active { transform: scale(0.95); }
.pref-pill.selected {
  background: var(--gold-dim); border-color: var(--gold);
  color: var(--gold-light);
}
.pref-pill-emoji { font-size: 15px; line-height: 1; }

.pref-actions {
  display: flex; flex-direction: column; gap: 0.75rem;
  margin-top: 2rem;
}
.pref-btn-confirm {
  background: linear-gradient(135deg, #8c2240, var(--gold));
  color: #0f0800; border: none; border-radius: 999px;
  padding: 0.95rem 2rem; font-size: 1rem; font-weight: 700;
  font-family: 'DM Sans', sans-serif; cursor: pointer;
  box-shadow: 0 4px 24px rgba(201,148,61,0.3);
  transition: transform 0.15s, box-shadow 0.2s;
}
.pref-btn-confirm:active { transform: scale(0.97); }
.pref-btn-confirm:disabled { opacity: 0.75; cursor: default; transform: none; }
.pref-btn-skip {
  background: transparent; border: 1px solid var(--border);
  border-radius: 999px; padding: 0.8rem 2rem;
  font-size: 13px; font-weight: 500; color: var(--text-dim);
  font-family: 'DM Sans', sans-serif; cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.pref-btn-skip:hover { border-color: var(--border2); color: var(--text-muted); }

/* ── WELCOME SCREEN ─────────────────────────────────────────────── */
#welcome-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  animation: wlcBgIn 0.5s ease both;
}
@keyframes wlcBgIn { from { opacity: 0; } to { opacity: 1; } }

/* Particles */
.wlc-bg { position: absolute; inset: 0; pointer-events: none; }
.wlc-particle {
  position: absolute; border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  animation: wlcFloat linear infinite;
}
.wlc-particle.p1  { width:4px;  height:4px;  top:75%; left:12%;  animation-duration:6.5s; animation-delay:0s;   }
.wlc-particle.p2  { width:5px;  height:5px;  top:55%; left:82%;  animation-duration:5.5s; animation-delay:1.2s; }
.wlc-particle.p3  { width:3px;  height:3px;  top:30%; left:88%;  animation-duration:7s;   animation-delay:0.5s; }
.wlc-particle.p4  { width:6px;  height:6px;  top:85%; left:60%;  animation-duration:5s;   animation-delay:2s;   }
.wlc-particle.p5  { width:3px;  height:3px;  top:15%; left:22%;  animation-duration:8s;   animation-delay:0.8s; }
.wlc-particle.p6  { width:4px;  height:4px;  top:40%; left:5%;   animation-duration:6s;   animation-delay:3s;   }
.wlc-particle.p7  { width:3px;  height:3px;  top:20%; left:55%;  animation-duration:7.5s; animation-delay:1.5s; }
.wlc-particle.p8  { width:5px;  height:5px;  top:65%; left:35%;  animation-duration:5.8s; animation-delay:2.5s; }
@keyframes wlcFloat {
  0%   { opacity: 0;   transform: translateY(0)   scale(0.6); }
  15%  { opacity: 0.9; }
  85%  { opacity: 0.6; }
  100% { opacity: 0;   transform: translateY(-80px) scale(1.3); }
}

/* Radial glow behind content */
.wlc-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 55% 45% at 50% 52%, rgba(201,148,61,0.08) 0%, transparent 70%);
}

/* Content stack */
.wlc-content {
  position: relative; z-index: 1;
  text-align: center; padding: 2rem 1.5rem;
  max-width: 380px; width: 100%;
}

/* Badge + ring */
.wlc-badge-wrap {
  position: relative; width: 110px; height: 110px;
  margin: 0 auto 1.6rem;
  animation: wlcSlideUp 0.6s ease both 0.2s; opacity: 0;
}
.wlc-badge {
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(201,148,61,0.22), rgba(201,148,61,0.06));
  border: 1px solid rgba(201,148,61,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; position: relative; z-index: 1;
  animation: wlcPulse 2.4s ease-in-out infinite 1.2s;
}
@keyframes wlcPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,148,61,0.35); }
  50%       { box-shadow: 0 0 0 20px rgba(201,148,61,0); }
}
.wlc-ring-svg {
  position: absolute; inset: -10px;
  width: calc(100% + 20px); height: calc(100% + 20px);
  transform: rotate(-90deg);
}
.wlc-ring-track { fill: none; stroke: rgba(201,148,61,0.12); stroke-width: 3; }
.wlc-ring-arc {
  fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 408; stroke-dashoffset: 408;
  animation: wlcRingFill 1.4s cubic-bezier(0.4,0,0.2,1) forwards 0.6s;
}
@keyframes wlcRingFill { to { stroke-dashoffset: 0; } }

/* Text elements — staggered */
@keyframes wlcSlideUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wlc-eyebrow {
  font-size: 10px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 0.5rem;
  animation: wlcSlideUp 0.6s ease both 0.55s; opacity: 0;
}
.wlc-name {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.9rem, 7.5vw, 2.8rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
  margin-bottom: 0.2rem;
  animation: wlcSlideUp 0.6s ease both 0.7s; opacity: 0;
}
.wlc-name span { color: var(--gold); }
.wlc-divider {
  width: 40px; height: 1px; background: var(--border2);
  margin: 0.9rem auto;
  animation: wlcSlideUp 0.6s ease both 0.82s; opacity: 0;
}
.wlc-heading {
  font-family: 'Inter', sans-serif;
  font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text);
  margin-bottom: 0.5rem;
  animation: wlcSlideUp 0.6s ease both 0.9s; opacity: 0;
}
.wlc-sub {
  font-size: 13.5px; color: var(--text-dim); line-height: 1.65;
  margin-bottom: 1.6rem; max-width: 300px; margin-left: auto; margin-right: auto;
  animation: wlcSlideUp 0.6s ease both 1s; opacity: 0;
}
.wlc-pills {
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center;
  margin-bottom: 2rem;
  animation: wlcSlideUp 0.6s ease both 1.1s; opacity: 0;
}
.wlc-pill {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.4rem 0.95rem;
  font-size: 12.5px; color: var(--text-muted);
  display: flex; align-items: center; gap: 0.4rem;
}
.wlc-cta {
  background: linear-gradient(135deg, #8c2240 0%, var(--gold) 100%);
  color: #0f0800; border: none; border-radius: 999px;
  padding: 0.95rem 2.4rem; font-size: 1rem; font-weight: 700;
  font-family: 'DM Sans', sans-serif; cursor: pointer; letter-spacing: 0.01em;
  transition: transform 0.15s, box-shadow 0.3s;
  box-shadow: 0 4px 28px rgba(201,148,61,0.28);
  animation: wlcSlideUp 0.6s ease both 1.3s, wlcGlow 2.5s ease-in-out infinite 2s;
  opacity: 0;
}
.wlc-cta:active { transform: scale(0.96); }
@keyframes wlcGlow {
  0%, 100% { box-shadow: 0 4px 28px rgba(201,148,61,0.28); }
  50%       { box-shadow: 0 6px 40px rgba(201,148,61,0.55); }
}

/* Exit animation */
#welcome-screen.wlc-out {
  animation: wlcFadeOut 0.5s ease forwards;
}
@keyframes wlcFadeOut {
  to { opacity: 0; transform: scale(1.04); }
}

/* ═══════════════════════════════════════════════════════════════════
   ONBOARDING EXERCISE REVEAL
   ═══════════════════════════════════════════════════════════════════ */
#onb-reveal-screen {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top,20px) 1.5rem env(safe-area-inset-bottom,32px);
  overflow: hidden;
  position: relative;
}
#onb-rv-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  will-change: contents;
  transform: translateZ(0);
}
.onb-rv-content {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  position: relative;
  z-index: 2;
}

/* ── Header ─────────────────────────────────────── */
.onb-rv-header { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.onb-rv-icon {
  font-size: 3.2rem;
  line-height: 1;
  display: block;
  animation: rvIconPop 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.1s both;
}
@keyframes rvIconPop {
  from { transform: scale(0) rotate(-25deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);  opacity: 1; }
}
.onb-rv-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold); margin: 0;
  opacity: 0; animation: rvFadeUp 0.45s ease 0.3s both;
}
.onb-rv-title {
  font-family: 'Inter', sans-serif; font-size: 1.6rem;
  font-weight: 800; letter-spacing: -0.03em;
  color: var(--text); margin: 0.25rem 0 0; line-height: 1.2;
  opacity: 0; animation: rvFadeUp 0.45s ease 0.4s both;
}
.onb-rv-title span { color: var(--gold-light); }
.onb-rv-sub {
  font-size: 13px; color: var(--text-muted); margin: 0.3rem 0 0;
  opacity: 0; animation: rvFadeUp 0.45s ease 0.5s both;
}
@keyframes rvFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Fan layout ─────────────────────────────────── */
.onb-rv-fan {
  position: relative;
  width: 300px;
  height: 360px;
  margin: 0 auto;
}

/* All cards share the same anchor: centered horizontally */
.onb-rv-card {
  position: absolute;
  width: 128px;
  left: 86px; /* (300-128)/2 = 86 */
  top: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
  opacity: 0;
  transition:
    opacity 0.42s ease,
    transform 0.56s cubic-bezier(0.34, 1.4, 0.64, 1),
    box-shadow 0.3s,
    border-color 0.3s;
}

/* Starting states (before .card-in) */
.onb-rv-card[data-i="0"] { transform: translateY(-18px) scale(0.82); z-index: 3; }
.onb-rv-card[data-i="1"] { transform: translateY(30px) scale(0.78); z-index: 2; }
.onb-rv-card[data-i="2"] { transform: translateY(30px) scale(0.78); z-index: 2; }

/* Final positions on .card-in */
.onb-rv-card[data-i="0"].card-in {
  opacity: 1;
  transform: translateY(0) scale(1);
  border-color: var(--gold);
  box-shadow: 0 8px 32px rgba(201,148,61,0.28);
}
/* Left card: slide down-left + rotate */
.onb-rv-card[data-i="1"].card-in {
  opacity: 1;
  transform: translate(-78px, 140px) rotate(-9deg);
  border-color: rgba(201,148,61,0.5);
  box-shadow: 0 6px 22px rgba(0,0,0,0.55);
}
/* Right card: slide down-right + rotate */
.onb-rv-card[data-i="2"].card-in {
  opacity: 1;
  transform: translate(78px, 140px) rotate(9deg);
  border-color: rgba(201,148,61,0.5);
  box-shadow: 0 6px 22px rgba(0,0,0,0.55);
}

/* ── Card internals ─────────────────────────────── */
.onb-rv-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface2);
  overflow: hidden;
}
.onb-rv-video {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.onb-rv-noimg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--gold); opacity: 0.35;
}
/* Sweep light */
.onb-rv-sweep {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,0.4) 50%, transparent 75%);
  transform: translateX(-160%);
}
.onb-rv-card.card-sweep .onb-rv-sweep {
  animation: rvSweep 0.65s ease-in-out forwards;
}
@keyframes rvSweep {
  from { transform: translateX(-160%); }
  to   { transform: translateX(260%); }
}
.onb-rv-body {
  padding: 0.55rem 0.5rem 0.7rem;
  text-align: center;
}
.onb-rv-name {
  font-size: 10.5px; font-weight: 600; color: var(--text);
  margin: 0 0 0.2rem; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.onb-rv-series { font-size: 10px; color: var(--text-dim); margin: 0 0 0.3rem; }
.onb-rv-badge {
  display: inline-block; font-size: 8px; font-weight: 700;
  letter-spacing: 0.05em; padding: 2px 5px; border-radius: 4px;
  text-transform: uppercase;
}

/* ── CTA ────────────────────────────────────────── */
.onb-rv-cta {
  background: var(--gold);
  color: #1a1000;
  border: none;
  border-radius: 50px;
  padding: 0.9rem 2.8rem;
  font-size: 15px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 10;
}
.onb-rv-cta.btn-in { opacity: 1; transform: translateY(0); }
.onb-rv-cta:active { filter: brightness(1.1); transform: translateY(0) scale(0.97); }


/* ═══════════════════════════════════════════════════════════════════
   TIENDA
   ═══════════════════════════════════════════════════════════════════ */

#store-screen {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 24px);
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ── Topbar ─────────────────────────────────────────────────────── */
.store-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(env(safe-area-inset-top, 16px), 16px) 1rem 0.75rem;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
}
.store-back {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); cursor: pointer; font-size: 14px;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.store-back:active { background: var(--surface2); border-color: var(--gold); }
.store-topbar-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; font-weight: 700;
  color: var(--text); letter-spacing: 0.02em;
}
.store-topbar-title i { color: var(--gold); margin-right: 5px; }

/* ── Hero ───────────────────────────────────────────────────────── */
.store-hero {
  padding: 1.4rem 1.25rem 1rem;
  background: linear-gradient(160deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.store-hero-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold);
  margin: 0 0 0.35rem;
}
.store-hero-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.55rem; font-weight: 800;
  color: var(--text); margin: 0 0 0.3rem; line-height: 1.15;
  letter-spacing: -0.025em;
}
.store-hero-sub {
  font-size: 13px; color: var(--text-muted); margin: 0;
}

/* ── Categorías ─────────────────────────────────────────────────── */
.store-cats-wrap {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 57px;
  z-index: 19;
}
.store-cats {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.store-cats::-webkit-scrollbar { display: none; }
.store-cat-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.38rem 0.85rem;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap; cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: 'DM Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.store-cat-pill i { font-size: 10px; color: var(--gold); }
.cat-pill--water i { color: #6BBBF5; }
.cat-pill--water { border-color: rgba(107,187,245,0.3); }
.cat-pill--water.active { background: #6BBBF5; border-color: #6BBBF5; color: #0a1f2e; }
.cat-pill--water.active i { color: #0a1f2e; }
.store-cat-pill.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a0f00;
}
.store-cat-pill.active i { color: #1a0f00; }
.store-cat-count {
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 0 5px;
  font-size: 10px;
}
.store-cat-pill.active .store-cat-count { background: rgba(0,0,0,0.15); }

/* ── Grid ───────────────────────────────────────────────────────── */
.store-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  padding: 1rem;
  align-items: start;
  align-content: start;
}

/* ── Tarjeta ────────────────────────────────────────────────────── */
.store-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.store-card:active { border-color: var(--gold); box-shadow: 0 4px 20px rgba(201,148,61,0.15); }

/* Imagen */
.store-card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface2);
  overflow: hidden;
}
.store-card-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.store-card-placeholder {
  width: 100%; height: 100%;
  align-items: center; justify-content: center;
  font-size: 2.2rem; color: var(--gold); opacity: 0.3;
}

/* Badges */
.store-badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 9px; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 6px;
  display: flex; align-items: center; gap: 4px;
}
.store-badge.destacado {
  background: rgba(201,148,61,0.92);
  color: #0f0800;
}
.store-badge.nuevo {
  background: rgba(124,90,220,0.92);
  color: #fff;
}

/* Cuerpo de la tarjeta */
.store-card-body {
  padding: 0.7rem 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}
.store-card-cat-label {
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold); display: flex; align-items: center; gap: 4px;
}
.store-card-cat-label i { font-size: 9px; }
.store-card-marca {
  font-size: 10px; color: var(--text-muted);
  margin: 0; font-weight: 500;
}
.store-card-nombre {
  font-size: 12.5px; font-weight: 700;
  color: var(--text); margin: 0;
  line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.store-card-desc {
  font-size: 11px; color: var(--text-muted);
  margin: 0.15rem 0 0.5rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
  flex: 1;
}
.store-card-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.store-card-precio {
  font-size: 14px; font-weight: 800;
  color: var(--gold); letter-spacing: -0.02em;
}
.store-card-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  background: var(--gold);
  color: #1a0f00;
  border: none; border-radius: 8px;
  padding: 0.55rem 0.5rem;
  font-size: 11px; font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer; text-decoration: none;
  text-align: center;
  transition: filter 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.store-card-btn i { font-size: 10px; }
.store-card-btn:active { filter: brightness(1.1); transform: scale(0.97); }
.store-card-btn.disabled {
  background: var(--surface2);
  color: var(--text-dim);
  cursor: default;
  opacity: 0.7;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .store-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: 1.25rem; }
  .store-card-nombre { font-size: 13px; }
  .store-card-desc { font-size: 11.5px; }
}
@media (min-width: 860px) {
  .store-grid { grid-template-columns: repeat(4, 1fr); gap: 1.1rem; padding: 1.5rem; }
  .store-hero { padding: 2rem 2rem 1.25rem; }
  .store-hero-title { font-size: 1.8rem; }
  .store-topbar { padding: 0 1.5rem; }
  .store-cats { padding: 0.75rem 1.5rem; }
}

/* ── Empty state ─────────────────────────────────────────────────── */
.store-empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: var(--text-dim);
}
.store-empty i { font-size: 2.5rem; opacity: 0.3; }
.store-empty p { font-size: 14px; margin: 0; text-align: center; }

/* ─── PROGRESO FILTROS ───────────────────────────────────────────── */
.progreso-filtro-btn {
  flex: 1;
  padding: 0.4rem 0.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.progreso-filtro-btn.active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold-light);
}

/* ─── CENTRO DE NOTIFICACIONES ───────────────────────────────────── */
.header-top-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.6rem;
}
.header-top-row .eyebrow { margin-bottom: 0; }
.notif-bell-btn {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: color 0.15s, border-color 0.15s;
}
.notif-bell-btn:hover { color: var(--gold); border-color: var(--gold); }
#notif-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 17px; height: 17px; border-radius: 999px;
  background: #e05c5c; color: #fff;
  font-size: 10px; font-weight: 700; font-family: 'DM Sans', sans-serif;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; pointer-events: none;
}

.notif-section-label {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 0.5rem;
  display: flex; align-items: center;
}
.notif-empty {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 13px; color: var(--text-dim);
  padding: 0.75rem 0;
}
.notif-swipe-wrap { border-radius: 10px; margin-bottom: 0.5rem; overflow: visible !important; }
.notif-swipe-wrap .swipe-del-bg { border-radius: 0 10px 10px 0; }
.notif-item {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.75rem; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 10px;
  position: relative;
}
.notif-del-desktop {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 13px; padding: 4px;
  flex-shrink: 0; align-self: center;
  transition: color 0.15s;
}
.notif-del-desktop:hover { color: #e05c5c; }
@media (hover: hover) {
  .notif-del-desktop { display: flex; align-items: center; justify-content: center; }
}
.notif-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.notif-content { flex: 1; min-width: 0; }
.notif-titulo { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.notif-mensaje {
  font-size: 12px; color: var(--text-muted); line-height: 1.5;
  white-space: normal; word-break: break-word; overflow-wrap: break-word;
}
.notif-accion-btn {
  margin-top: 0.5rem; padding: 0.3rem 0.75rem;
  background: var(--gold-dim); border: 1px solid var(--gold);
  color: var(--gold-light); border-radius: 6px;
  font-size: 12px; font-family: 'DM Sans', sans-serif; cursor: pointer;
}
.notif-del-btn {
  background: none; border: none; color: var(--text-dim);
  font-size: 14px; cursor: pointer; padding: 2px 4px; flex-shrink: 0;
  transition: color 0.15s;
}
.notif-del-btn:hover { color: var(--red); }

/* ─── AI CHAT ──────────────────────────────────────────────────────────────── */
.ai-messages {
  flex: 1; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.ai-msg {
  max-width: 82%; padding: 0.75rem 1rem; border-radius: 16px;
  font-size: 14px; line-height: 1.55; word-break: break-word;
}
.ai-msg-user {
  align-self: flex-end; background: var(--gold-dim);
  border: 1px solid var(--gold); color: var(--gold-light);
  border-bottom-right-radius: 4px;
}
.ai-msg-bot {
  align-self: flex-start; background: var(--surface2);
  border: 1px solid var(--border); color: var(--text);
  border-bottom-left-radius: 4px;
}
.ai-typing {
  display: flex; align-items: center; gap: 5px; padding: 0.9rem 1rem;
}
.ai-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); display: inline-block;
  animation: ai-bounce 1.2s infinite ease-in-out;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}
.ai-input-wrap {
  display: flex; align-items: flex-end; gap: 0.5rem;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); flex-shrink: 0;
}
.ai-input {
  flex: 1; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 12px; padding: 0.65rem 0.9rem; color: var(--text);
  font-size: 14px; font-family: 'DM Sans', sans-serif; resize: none;
  max-height: 100px; overflow-y: auto; line-height: 1.4;
  transition: border-color 0.2s;
}
.ai-input:focus { outline: none; border-color: var(--gold); }
.ai-send-btn {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--gold-dim); border: 1px solid var(--gold);
  color: var(--gold-light); font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.ai-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ai-send-btn:not(:disabled):hover { background: var(--gold); color: var(--bg); }

/* ── Update banner ── */
#update-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: var(--gold); color: var(--bg);
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(0.65rem + env(safe-area-inset-top)) 1rem 0.65rem; font-size: 14px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
#update-banner button {
  background: var(--bg); color: var(--gold); border: none;
  border-radius: 8px; padding: 0.35rem 0.85rem;
  font-size: 13px; font-weight: 700; cursor: pointer;
}

/* ── Social — búsqueda y perfiles ── */
.search-result-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: opacity 0.15s;
}
.search-result-item:active { opacity: 0.6; }
.search-result-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gold-dim); border: 1.5px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--gold-light); flex-shrink: 0;
}
.search-result-username { font-size: 14px; font-weight: 600; margin: 0; }
.btn-copy-day {
  background: var(--gold-dim); border: 1px solid var(--gold);
  color: var(--gold-light); border-radius: 8px;
  padding: 0.2rem 0.6rem; font-size: 11px; cursor: pointer;
  display: flex; align-items: center; gap: 0.3rem; white-space: nowrap;
  transition: all 0.2s;
}
.btn-copy-day:hover { background: var(--gold); color: var(--bg); }

/* ── Modal búsqueda — centrado en móvil ── */
#modal-search { align-items: center; }
#modal-search .modal { border-radius: var(--radius); width: calc(100% - 2rem); }

/* ── Profile day tabs ── */
.profile-tab-btn {
  padding: 0.25rem 0.7rem; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border2); background: transparent; color: var(--text-dim);
  cursor: pointer; transition: all 0.18s; display: inline-flex; align-items: center; gap: 0.3rem;
}
.profile-tab-btn.active {
  background: var(--gold-dim); border-color: var(--gold); color: var(--gold-light);
}

/* ── Follow buttons ── */
.btn-follow {
  flex-shrink: 0; padding: 0.4rem 0.9rem; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: none; background: var(--gold); color: #000; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; transition: opacity 0.18s;
}
.btn-follow:active { opacity: 0.7; }
.btn-following {
  flex-shrink: 0; padding: 0.4rem 0.9rem; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border2); background: transparent; color: var(--text-dim); cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; transition: all 0.18s;
}
.btn-following:active { opacity: 0.7; }
.btn-unfollow-confirm {
  flex-shrink: 0; padding: 0.4rem 0.9rem; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid #e55; background: rgba(229,85,85,0.1); color: #e55; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; transition: all 0.18s;
  animation: pulse-warn 0.3s ease;
}
@keyframes pulse-warn { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* ── Leaderboard modal centrado ── */
#modal-leaderboard,
#modal-settings,
#modal-notif,
#modal-profile { align-items: center; }

#modal-leaderboard .modal,
#modal-settings .modal,
#modal-notif .modal,
#modal-profile .modal {
  border-radius: var(--radius); width: calc(100% - 2rem);
  transform: scale(0.96) translateY(10px);
}

#modal-leaderboard.open .modal,
#modal-settings.open .modal,
#modal-notif.open .modal,
#modal-profile.open .modal { transform: scale(1) translateY(0); }

/* ── Leaderboard ── */
.lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.lb-row:last-child { border-bottom: none; }
.lb-row:not(.lb-row-me):active { background: var(--surface2); }
.lb-row-me {
  background: var(--gold-dim); border-left: 3px solid var(--gold);
  padding-left: 13px;
}
.lb-rank-col { width: 32px; text-align: center; flex-shrink: 0; }
.lb-medal { font-size: 1.4rem; line-height: 1; }
.lb-rank-num { font-size: 12px; font-weight: 700; color: var(--text-dim); }
.lb-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--surface2);
  border: 1.5px solid var(--border2); display: flex; align-items: center;
  justify-content: center; overflow: hidden; flex-shrink: 0;
}
.lb-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.lb-avatar-initial { font-size: 1rem; font-weight: 700; color: var(--text-dim); }
.lb-avatar-me { color: var(--gold-light); }
.lb-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lb-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.lb-username { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-you-tag {
  font-size: 9px; font-weight: 800; letter-spacing: 0.05em;
  background: var(--gold); color: #000; border-radius: 4px; padding: 1px 5px;
}
.lb-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.lb-level { font-size: 12px; font-weight: 700; color: var(--gold-light); }
.lb-xp { font-size: 10px; color: var(--text-dim); }
.lb-chevron { color: var(--text-dim); font-size: 11px; flex-shrink: 0; }

/* ─── RECIPE PICKER ─────────────────────────────────────────────────────── */
#modal-recipe-picker .modal { border-radius: var(--radius); }
.modal-recipe-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 1rem 1.1rem 0.85rem; border-bottom: 1px solid var(--border); flex-shrink: 0; gap: 8px; }
.modal-recipe-title { font-size: 1rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.modal-recipe-title i { color: var(--gold); }
.modal-recipe-hint { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.rp-tabs { display: flex; gap: 6px; padding: 0.75rem 1rem 0.5rem; overflow-x: auto; flex-shrink: 0; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.rp-tabs::-webkit-scrollbar { display: none; }
.rp-tab { flex-shrink: 0; padding: 7px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1.5px solid var(--border); background: var(--surface2); color: var(--text-dim); cursor: pointer; transition: all 0.18s; }
.rp-tab--active { background: var(--gold); border-color: var(--gold); color: #000; font-weight: 700; }
.rp-cards { flex: 1; overflow-y: auto; padding: 0.7rem 0.9rem 1rem; display: flex; flex-direction: column; gap: 10px; }
/* Card */
.rp-card { border-radius: 12px; border: 1px solid var(--border); background: var(--surface2); overflow: hidden; transition: transform 0.12s; }
.rp-card:active { transform: scale(0.985); }
.rp-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 6px; }
.rp-card-top-left { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; overflow: hidden; }
.rp-card-icon-wrap { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rp-card-icon-wrap i { font-size: 0.9rem; }
.rp-card-text { flex: 1; min-width: 0; overflow: hidden; }
.rp-card-name { font-size: 13px; font-weight: 800; color: var(--text); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-card-sub { font-size: 10px; color: var(--text-dim); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-badge { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 5px; white-space: nowrap; flex-shrink: 0; letter-spacing: 0.03em; text-transform: uppercase; }
.rp-card-science { display: flex; align-items: center; gap: 4px; padding: 0 12px 6px; font-size: 9.5px; color: var(--text-dim); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-card-macros-row { display: flex; gap: 5px; padding: 0 12px 8px; flex-wrap: wrap; }
.rp-total-macro { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; display: flex; align-items: center; gap: 3px; }
.rp-total-macro i { font-size: 8px; }
.rp-total-kcal  { background: rgba(255,120,50,0.1);  color: #FF9A3C; border: 1px solid rgba(255,120,50,0.2); }
.rp-total-prot  { background: rgba(201,148,61,0.1);  color: var(--gold-light); border: 1px solid rgba(201,148,61,0.2); }
.rp-total-carbs { background: rgba(74,158,255,0.1);  color: var(--blue);       border: 1px solid rgba(74,158,255,0.2); }
.rp-total-fat   { background: rgba(255,180,80,0.08); color: rgba(255,175,70,0.9); border: 1px solid rgba(255,180,80,0.18); }
.rp-meals { display: flex; flex-direction: column; border-top: 1px solid var(--border); margin: 0 12px; padding: 6px 0 4px; }
.rp-meal-row { display: grid; grid-template-columns: 68px 1fr; gap: 4px; padding: 3px 0; align-items: center; }
.rp-meal-tiempo { font-size: 10px; font-weight: 700; color: var(--text-dim); white-space: nowrap; }
.rp-meal-desc { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-meal-tag { display: none; }
.rp-select-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: calc(100% - 24px); margin: 8px 12px 10px; padding: 10px; border-radius: 9px; color: #000; font-size: 13px; font-weight: 700; border: none; cursor: pointer; transition: opacity 0.15s; }
.rp-select-btn:hover { opacity: 0.88; }
/* Botón plan en card de comida */
.btn-recipe-plan { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--gold-dim); border: 1px solid rgba(201,148,61,0.3); color: var(--gold-light); font-size: 13px; cursor: pointer; transition: all 0.18s; flex-shrink: 0; }
.btn-recipe-plan:hover { background: rgba(201,148,61,0.22); }

/* ═══════════════════════════════════════════════════════════════════
   PROGRESO MODAL — Level bar, status badges, achievements
   ═══════════════════════════════════════════════════════════════════ */
.progreso-lvl-track {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progreso-lvl-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 0.75s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}
.progreso-achievement {
  background: linear-gradient(135deg, rgba(201,148,61,0.1), rgba(201,148,61,0.04));
  border: 1px solid rgba(201,148,61,0.3);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.7rem;
  animation: progreso-glow 2s ease-in-out;
}
@keyframes progreso-glow {
  0%   { box-shadow: 0 0 0 rgba(201,148,61,0); }
  40%  { box-shadow: 0 0 16px rgba(201,148,61,0.3); }
  100% { box-shadow: 0 0 0 rgba(201,148,61,0); }
}
.progreso-summary-card {
  background: linear-gradient(135deg, rgba(201,148,61,0.07), rgba(201,148,61,0.02));
  border: 1px solid rgba(201,148,61,0.2);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}
.progreso-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.progreso-summary-cell {
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
}
.progreso-summary-cell-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.progreso-summary-cell-value {
  font-size: 13px;
  font-weight: 700;
}
.progreso-summary-cell-sub {
  font-size: 10px;
  color: var(--text-dim);
}
