/* ===================== TEMPLE — estilos ===================== */
:root {
  --bg: #0a0e14;
  --bg-grad: radial-gradient(1200px 600px at 50% -10%, #141c2b 0%, #0a0e14 55%);
  --surface: #12161f;
  --surface-2: #171d29;
  --surface-3: #1e2634;
  --border: #232c3c;
  --text: #f3f6fb;
  --muted: #7c8aa0;
  --muted-2: #55637a;
  --accent: #a3e635;
  --accent-ink: #0a0e14;
  --accent-dim: rgba(163, 230, 53, 0.14);
  --danger: #f87171;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }

.app { max-width: 620px; margin: 0 auto; min-height: 100%; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
/* mientras corre el cronómetro (barra flotante abajo), reservar espacio para no tapar el último botón */
body.temple-resting .app { padding-bottom: calc(190px + env(safe-area-inset-bottom)); }

/* ---------- animaciones base ---------- */
@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes barbellFloat { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-6px) rotate(1.5deg); } }
@keyframes plateSpin { to { transform: rotate(360deg); } }
@keyframes glowPulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes lift { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-7px); } 60% { transform: translateY(-7px); } }
@keyframes shimmer { to { background-position: 200% 0; } }
@keyframes ringDash { from { stroke-dashoffset: var(--dash-start); } to { stroke-dashoffset: var(--dash-end); } }

/* Sin animación de entrada en las vistas: como cada acción re-renderiza el HTML,
   animar desde opacity:0 hacía "parpadear" toda la pantalla en cada click.
   .rise y .stagger quedan como no-ops para no tocar el markup. */

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 2px 12px;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(10, 14, 20, 0));
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { width: 30px; height: 30px; }
.brand h1 { font-size: 20px; font-weight: 900; letter-spacing: 4px; }
.brand .accent { color: var(--accent); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); transition: 0.2s var(--ease);
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 20px; height: 20px; stroke: var(--text); }

/* ---------- hero (home) ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius); padding: 22px 20px;
  background: linear-gradient(135deg, #151d2b, #0e131d);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(400px 160px at 88% -20%, var(--accent-dim), transparent 70%);
}
.hero .kicker { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--accent); text-transform: uppercase; }
.hero h2 { font-size: 24px; font-weight: 900; margin: 6px 0 4px; letter-spacing: -0.3px; }
.hero p { font-size: 13px; color: var(--muted); max-width: 90%; }
.hero .barbell { position: absolute; right: -8px; bottom: -6px; width: 120px; opacity: 0.9; animation: barbellFloat 5s ease-in-out infinite; }

/* ---------- selector de semana ---------- */
.week-label { font-size: 12px; font-weight: 800; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; margin: 4px 2px 10px; }
.weeks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.week-chip {
  border-radius: 14px; padding: 12px 4px; text-align: center;
  background: var(--surface-2); border: 1px solid var(--border); transition: 0.22s var(--ease);
}
.week-chip .wn { font-size: 20px; font-weight: 900; line-height: 1; }
.week-chip .wl { font-size: 9px; font-weight: 800; letter-spacing: 0.5px; color: var(--muted); margin-top: 4px; text-transform: uppercase; }
.week-chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(163, 230, 53, 0.25); }
.week-chip.active .wl { color: rgba(10, 14, 20, 0.7); }
.week-note {
  font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 12px; margin-bottom: 20px;
}

/* ---------- day cards ---------- */
.section-title { font-size: 12px; font-weight: 800; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; margin: 4px 2px 12px; }
.day-cards { display: flex; flex-direction: column; gap: 12px; }
.day-card {
  position: relative; overflow: hidden; display: block;
  border-radius: var(--radius); padding: 18px; background: var(--surface);
  border: 1px solid var(--border); transition: 0.22s var(--ease);
}
.day-card:active { transform: scale(0.985); }
.day-card .accent-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.day-card .dc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.day-card .dc-day { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.day-card .dc-code { font-size: 22px; font-weight: 900; letter-spacing: 1px; margin-top: 2px; }
.day-card .dc-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.day-card .dc-glyph { width: 40px; height: 40px; opacity: 0.85; }
.day-card .dc-prota { display: flex; align-items: baseline; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.day-card .dc-prota .lab { font-size: 12px; color: var(--muted); }
.day-card .dc-prota .val { font-size: 26px; font-weight: 900; letter-spacing: -0.5px; }
.day-card .dc-prota .unit { font-size: 13px; color: var(--muted); font-weight: 700; }
.day-card .dc-prota .done { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--accent); display: flex; align-items: center; gap: 4px; }

/* ---------- day detail ---------- */
.back-row { display: flex; align-items: center; gap: 8px; padding: 6px 0 10px; color: var(--muted); font-weight: 700; font-size: 14px; }
.back-row svg { width: 18px; height: 18px; stroke: var(--muted); }
.day-hero { position: relative; overflow: hidden; border-radius: var(--radius); padding: 20px; margin-bottom: 16px; border: 1px solid var(--border); }
.day-hero .kicker { font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.day-hero h2 { font-size: 30px; font-weight: 900; letter-spacing: 2px; margin: 4px 0; }
.day-hero .lema { font-size: 13px; opacity: 0.85; font-style: italic; }
.day-hero .pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pill { font-size: 11px; font-weight: 800; padding: 5px 10px; border-radius: 20px; background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(4px); }

/* protagonista destacado */
.prota-box { border-radius: var(--radius); padding: 18px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--border); position: relative; overflow: hidden; }
.prota-box .plabel { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.prota-box .pname { font-size: 17px; font-weight: 800; margin: 2px 0 8px; }
.prota-box .big { display: flex; align-items: baseline; gap: 8px; }
.prota-box .big .n { font-size: 54px; font-weight: 900; line-height: 1; letter-spacing: -2px; }
.prota-box .big .u { font-size: 18px; font-weight: 800; color: var(--muted); }
.prota-box .scheme { font-size: 13px; color: var(--muted); margin-top: 6px; }
.prota-box .scheme b { color: var(--text); }
.approach { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.approach .ap { flex: 1; min-width: 60px; text-align: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 4px; }
.approach .ap .apk { font-size: 9px; font-weight: 800; letter-spacing: 0.5px; color: var(--muted-2); text-transform: uppercase; }
.approach .ap .apv { font-size: 15px; font-weight: 800; margin-top: 2px; }
.approach .ap.work { background: var(--accent-dim); border-color: var(--accent); }
.approach .ap.work .apv { color: var(--accent); }

/* bloques y ejercicios */
.block { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); margin-bottom: 12px; overflow: hidden; }
.block-head { padding: 12px 16px; font-size: 12px; font-weight: 800; letter-spacing: 0.5px; color: var(--muted); text-transform: uppercase; background: var(--surface-2); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.ss-tag { font-size: 10px; font-weight: 900; color: var(--accent-ink); background: var(--accent); border-radius: 6px; padding: 2px 6px; letter-spacing: 0.5px; }
.ex { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.ex:last-child { border-bottom: none; }
.ex-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ex-name { font-size: 15px; font-weight: 700; }
.ex-name .ss-badge { font-size: 10px; font-weight: 900; color: var(--accent); margin-right: 6px; }
.ex-srx { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ex-load { text-align: right; white-space: nowrap; }
.ex-load .l-n { font-size: 22px; font-weight: 900; letter-spacing: -0.5px; }
.ex-load .l-u { font-size: 11px; color: var(--muted); font-weight: 700; }
.ex-load .l-rpe { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-dim); padding: 4px 8px; border-radius: 8px; display: inline-block; }
.ex-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.ex-meta .m { font-size: 11px; color: var(--muted-2); }
.ex-video { font-size: 11px; font-weight: 800; color: #ff5a5f; display: inline-flex; align-items: center; gap: 4px; }
.ex-tip { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; border-left: 2px solid var(--border); padding-left: 10px; }
.rest-line { font-size: 11px; color: var(--muted-2); margin-top: 6px; }

/* cardio */
.cardio { border-radius: var(--radius); padding: 16px; margin-bottom: 14px; background: linear-gradient(135deg, #0f1a17, #101722); border: 1px solid #1e3a2a; }
.cardio .ct { font-size: 13px; font-weight: 800; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.cardio .cd { font-size: 12px; color: var(--muted); margin-top: 4px; }
.calent { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--border); }
.calent h4 { font-size: 12px; font-weight: 800; letter-spacing: 0.5px; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.calent li { font-size: 12px; color: var(--muted); list-style: none; padding: 3px 0 3px 16px; position: relative; }
.calent li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }

/* ---------- botones ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 16px; border-radius: 14px; font-size: 15px; font-weight: 800; letter-spacing: 0.3px; transition: 0.18s var(--ease); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px rgba(163, 230, 53, 0.25); }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.btn-danger { background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.4); color: var(--danger); }
.btn-sm { padding: 11px 14px; font-size: 13px; width: auto; }

/* ---------- bottom nav ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(15, 19, 28, 0.9); backdrop-filter: blur(14px); border-top: 1px solid var(--border);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 16px; border-radius: 12px; color: var(--muted-2); transition: 0.2s var(--ease); }
.tab svg { width: 22px; height: 22px; stroke: currentColor; }
.tab.active { color: var(--accent); }
.tab span { font-size: 10px; font-weight: 700; }

/* ---------- PRs / forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.pr-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.pr-row .emoji { font-size: 22px; }
.pr-row .pr-lab { flex: 1; }
.pr-row .pr-lab .n { font-size: 15px; font-weight: 700; }
.pr-row .pr-lab .s { font-size: 11px; color: var(--muted-2); }
.pr-input { width: 92px; }
input.num { width: 100%; background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 20px; font-weight: 800; text-align: center; padding: 10px 6px; }
input.num:focus { outline: none; border-color: var(--accent); }
input.pin { width: 100%; background: var(--surface-3); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 28px; font-weight: 900; letter-spacing: 12px; text-align: center; padding: 16px; }
input.pin:focus { outline: none; border-color: var(--accent); }
input.text { width: 100%; background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 15px; padding: 12px 14px; }
input.text:focus, textarea.text:focus { outline: none; border-color: var(--accent); }
textarea.text { width: 100%; background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 14px; padding: 12px 14px; resize: vertical; min-height: 70px; }

/* ---------- login / setup ---------- */
.gate { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 24px; }
.gate .logo-big { width: 88px; height: 88px; margin-bottom: 10px; animation: pop 0.6s var(--ease) both; }
.gate h1 { font-size: 30px; font-weight: 900; letter-spacing: 8px; margin-bottom: 4px; }
.gate .tag { font-size: 12px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 28px; }
.gate .gate-box { width: 100%; max-width: 320px; }
.gate .err { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------- history ---------- */
.hist-empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.hist-empty svg { width: 56px; height: 56px; stroke: var(--muted-2); margin-bottom: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 10px; text-align: center; }
.stat .v { font-size: 24px; font-weight: 900; }
.stat .k { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.hist-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.hist-item .hi-top { display: flex; justify-content: space-between; align-items: center; }
.hist-item .hi-code { font-size: 15px; font-weight: 800; letter-spacing: 1px; }
.hist-item .hi-date { font-size: 11px; color: var(--muted); }
.hist-item .hi-meta { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }
.hist-item .hi-meta b { color: var(--accent); }
.hist-item .hi-note { font-size: 12px; color: var(--muted); margin-top: 6px; font-style: italic; }

/* rpe slider */
.rpe-wrap { margin: 14px 0; }
.rpe-val { font-size: 40px; font-weight: 900; text-align: center; color: var(--accent); }
input[type="range"] { width: 100%; -webkit-appearance: none; appearance: none; height: 8px; border-radius: 8px; background: var(--surface-3); margin-top: 8px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); box-shadow: 0 2px 10px rgba(163, 230, 53, 0.5); }

/* modal / sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 85; animation: fadeIn 0.2s; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 620px; background: var(--surface); border-radius: 22px 22px 0 0; border: 1px solid var(--border); padding: 20px 18px calc(24px + env(safe-area-inset-bottom)); animation: riseIn 0.3s var(--ease); max-height: 88vh; overflow-y: auto; }
.sheet h3 { font-size: 18px; font-weight: 900; margin-bottom: 4px; }
.sheet .sub { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.grabber { width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 0 auto 14px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 13px; padding: 12px 20px; border-radius: 30px; z-index: 80; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); animation: pop 0.3s var(--ease); }

.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: plateSpin 0.8s linear infinite; margin: 40px auto; }

/* ---------- HOY + progreso de adherencia ---------- */
.wprog { border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; gap: 16px; }
.wprog .ring { position: relative; width: 58px; height: 58px; flex-shrink: 0; }
.wprog .ring svg { transform: rotate(-90deg); }
.wprog .ring .rt { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-weight: 900; }
.wprog .wp-txt .t1 { font-size: 15px; font-weight: 800; }
.wprog .wp-txt .t2 { font-size: 12px; color: var(--muted); margin-top: 2px; }
.today-badge { font-size: 10px; font-weight: 900; letter-spacing: 0.5px; color: var(--accent-ink); background: var(--accent); padding: 3px 8px; border-radius: 20px; margin-left: 8px; vertical-align: middle; }
.day-card.is-today { box-shadow: 0 0 0 1.5px var(--accent), 0 8px 28px rgba(163, 230, 53, 0.16); }

/* ---------- botón y barra de descanso ---------- */
.rest-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; color: var(--accent); background: var(--accent-dim); border: 1px solid transparent; padding: 5px 10px; border-radius: 8px; margin-top: 6px; }
.rest-btn:active { transform: scale(0.95); }
.rest-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(78px + env(safe-area-inset-bottom)); width: calc(100% - 32px); max-width: 588px; z-index: 75;
  background: var(--accent); color: var(--accent-ink); border-radius: 16px; padding: 12px 16px;
  display: flex; align-items: center; gap: 14px; box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5); animation: riseIn 0.3s var(--ease);
}
.rest-bar .rb-time { font-size: 30px; font-weight: 900; letter-spacing: -1px; font-variant-numeric: tabular-nums; min-width: 82px; }
.rest-bar .rb-lab { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; opacity: 0.75; }
.rest-bar .rb-actions { margin-left: auto; display: flex; gap: 8px; }
.rest-bar .rb-btn { font-size: 13px; font-weight: 900; background: rgba(10, 14, 20, 0.16); border-radius: 10px; padding: 8px 12px; }
.rest-bar.done { animation: glowPulse 0.5s ease-in-out 3; }

/* ---------- frase del hero ---------- */
.hero .quote { font-size: 12px; font-style: italic; color: var(--accent); margin-top: 10px; opacity: 0.92; max-width: 82%; position: relative; z-index: 1; }

/* ---------- hint de instalación ---------- */
.install-hint {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(78px + env(safe-area-inset-bottom)); width: calc(100% - 32px); max-width: 588px; z-index: 54;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}
.install-hint .ih-txt { display: flex; flex-direction: column; gap: 2px; }
.install-hint .ih-txt b { font-size: 13px; }
.install-hint .ih-txt span { font-size: 11px; color: var(--muted); }
.install-hint .ih-x { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--accent); background: var(--accent-dim); border-radius: 8px; padding: 8px 12px; flex-shrink: 0; }

/* ---------- confeti ---------- */
.confetti-canvas { position: fixed; inset: 0; z-index: 90; pointer-events: none; }

/* ---------- celebración ---------- */
.sheet.celebrate { text-align: center; }
.sheet.celebrate .cele-emoji { font-size: 56px; animation: pop 0.5s var(--ease) both, barbellFloat 2.5s ease-in-out 0.5s infinite; }
.sheet.celebrate h3 { font-size: 26px; letter-spacing: 2px; margin: 6px 0; background: linear-gradient(90deg, #a3e635, #c6f65e); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.sheet.celebrate .sub { font-size: 14px; }

/* ---------- gráficos de progresión ---------- */
.spark-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.spark-card .sc-top { display: flex; justify-content: space-between; align-items: baseline; }
.spark-card .sc-lab { font-size: 13px; font-weight: 800; }
.spark-card .sc-val { font-size: 22px; font-weight: 900; letter-spacing: -0.5px; }
.spark-card .sc-val span { font-size: 11px; color: var(--muted); font-weight: 700; }
.spark-card .spark { width: 100%; height: 62px; margin: 8px 0 6px; display: block; }
.spark-card .sc-foot { font-size: 11px; color: var(--muted); }

/* ---------- nota del coach ---------- */
.coach-msg { background: linear-gradient(135deg, #14201a, #101722); border: 1px solid #24402e; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; font-size: 13px; color: #cbe8b8; line-height: 1.55; }
.coach-msg b { display: block; color: var(--accent); font-size: 12px; letter-spacing: 0.5px; margin-bottom: 4px; }

/* ---------- botón empezar ---------- */
.start-btn { margin-bottom: 8px; font-size: 16px; }
[data-finday] { margin-bottom: 14px; }

/* ---------- día completo de un toque ---------- */
.fd-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 14px; max-height: 38vh; overflow-y: auto; }
.fd-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); border-radius: 10px; }
.fd-n { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.3; }
.fd-n small { display: block; font-weight: 500; opacity: 0.6; font-size: 11px; }
.fd-row input.fd-w { width: 84px; flex: none; font-size: 17px; padding: 8px 6px; }
.hoy-btn { margin: 2px 0 18px; font-size: 16px; }

/* ---------- calculadora de discos ---------- */
.plate-line { font-size: 12px; color: var(--muted); margin-top: 8px; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.plate-line.sm { margin-top: 6px; padding: 6px 9px; font-size: 11px; }
.plate-line b { color: var(--text); }

/* ---------- última vez ---------- */
.last-perf { font-size: 11px; color: #7c8aa0; margin-top: 6px; }
.last-perf b { color: #cbd5e1; }

/* ---------- hint RPE ---------- */
.rpe-hint { font-size: 12px; border-radius: 10px; padding: 9px 12px; margin-top: 12px; line-height: 1.45; }
.rpe-hint.up { background: rgba(163,230,53,.12); color: #a3e635; }
.rpe-hint.down { background: rgba(248,113,113,.12); color: #f8a4a4; }
.rpe-hint.ok { background: var(--surface-2); color: var(--muted); }

/* ---------- mesociclo completo ---------- */
.meso-done { background: linear-gradient(135deg, #1a2410, #24200a); border: 1px solid #4d6b1f; border-radius: var(--radius); padding: 16px 18px; margin: 2px 0 18px; font-size: 14px; color: #d9f7a8; line-height: 1.5; }
.meso-done b { color: var(--accent); }

/* ---------- streak chip ---------- */
.streak-chip { background: linear-gradient(135deg, #2a1e0e, #1a1206); border: 1px solid #52340f; border-radius: 12px; padding: 10px 14px; font-size: 12px; font-weight: 700; color: #fbbf24; margin-bottom: 16px; }

/* ---------- paneles (progreso) ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.panel-h { font-size: 13px; font-weight: 800; margin-bottom: 12px; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.badge-i { text-align: center; padding: 10px 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); opacity: 0.4; filter: grayscale(1); transition: 0.2s; }
.badge-i.got { opacity: 1; filter: none; border-color: var(--accent); }
.badge-i .be { font-size: 26px; }
.badge-i .bn { font-size: 11px; font-weight: 800; margin-top: 4px; }
.badge-i .bd { font-size: 9px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.proj-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; padding: 7px 0; border-top: 1px solid var(--border); }
.proj-row:first-of-type { border-top: none; }
.proj-row span:first-child { font-weight: 800; }
.proj-row b { color: var(--accent); }

/* ---------- mapa muscular ---------- */
.mb-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.mb-lab { font-size: 12px; font-weight: 600; min-width: 68px; }
.mb-bar { flex: 1; height: 10px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.mb-fill { height: 100%; background: linear-gradient(90deg, #a3e635, #38bdf8); border-radius: 6px; }
.mb-n { font-size: 12px; font-weight: 800; color: var(--muted); min-width: 20px; text-align: right; }

/* ---------- peso corporal ---------- */
.bw-input { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.bw-input .num { flex: 1; }

/* ---------- acciones historial ---------- */
.hist-actions { display: flex; gap: 8px; margin: 6px 0 4px; }
.hist-actions .btn { flex: 1; }

/* ---------- check-in sliders ---------- */
.ck-row { margin: 12px 0; }
.ck-lab { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.ck-v { color: var(--accent); font-weight: 900; }

/* ---------- celebración título ---------- */
.cele-emoji { font-size: 56px; text-align: center; animation: pop 0.5s var(--ease) both, barbellFloat 2.5s ease-in-out 0.5s infinite; }
.cele-h { text-align: center; font-size: 26px; letter-spacing: 2px; margin: 6px 0; background: linear-gradient(90deg, #a3e635, #c6f65e); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.sheet.celebrate { text-align: center; }
.sheet.celebrate .sub { font-size: 14px; }

/* ---------- MODO ENTRENAMIENTO GUIADO ---------- */
.wm-screen { position: fixed; inset: 0; z-index: 70; background: var(--bg); background-image: var(--bg-grad); display: flex; flex-direction: column; }
.wm-top { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
.wm-x { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 16px; font-weight: 700; flex-shrink: 0; }
.wm-prog { flex: 1; height: 8px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.wm-prog-bar { height: 100%; background: var(--accent); border-radius: 6px; transition: width 0.3s var(--ease); }
.wm-count { font-size: 13px; font-weight: 800; color: var(--muted); }
.wm-body { flex: 1; overflow-y: auto; padding: 0 16px 20px; max-width: 620px; width: 100%; margin: 0 auto; }
.wm-ex-head { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.wm-adj { font-size: 11px; font-weight: 700; color: #fbbf24; background: rgba(251,191,36,.12); border-radius: 8px; padding: 6px 10px; margin-bottom: 10px; }
.wm-ex-name { font-size: 20px; font-weight: 800; }
.wm-ex-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.wm-target { font-size: 15px; margin-top: 10px; }
.wm-target b { font-size: 26px; font-weight: 900; color: var(--accent); }
.wm-target.rpe { font-size: 13px; color: var(--accent); }
.wsets { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.wset { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; transition: 0.2s; }
.wset.done { border-color: var(--accent); background: var(--accent-dim); }
.wset .ws-n { font-size: 12px; font-weight: 800; color: var(--muted); width: 18px; }
.wset .num { flex: 1; font-size: 17px; padding: 8px 6px; }
.wset .ws-x { color: var(--muted); font-weight: 700; }
.ws-check { width: 42px; height: 42px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border); flex-shrink: 0; display: grid; place-items: center; }
.ws-check svg { width: 20px; height: 20px; stroke: var(--muted); }
.ws-check.on { background: var(--accent); border-color: var(--accent); }
.ws-check.on svg { stroke: var(--accent-ink); }
.wm-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.wm-tip { font-size: 12px; color: var(--muted); line-height: 1.5; border-left: 2px solid var(--border); padding-left: 10px; }
.wm-nav { display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
.wm-nav .btn { flex: 1; }
.wm-nav .btn[disabled] { opacity: 0.4; }
/* Circuito / superserie en el modo guiado: se recorre por rondas */
.wm-circ { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.wm-circ-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 11px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted); }
.wm-circ-h b { font-size: 14px; letter-spacing: 0; color: var(--accent); }
.wm-circ-st { display: flex; gap: 8px; margin-top: 10px; }
.wc-st { flex: 1; min-height: 40px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border); color: var(--muted); font-size: 13px; font-weight: 800; }
.wc-st.ok { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.wc-st.now { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.wc-st[disabled] { opacity: 0.35; }
.wm-circ-next { font-size: 12px; color: var(--muted); margin-top: 10px; }
.wm-circ-next b { color: var(--text); }
.wset.now { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.wm-ex-name .ss-badge { font-size: 13px; font-weight: 900; color: var(--accent); margin-right: 8px; vertical-align: 2px; }

.muted { color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ── Objetivo de peso + reglas de constancia (mesociclo de recomposición) ── */
.goal-bar { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 4px 0 12px; }
.goal-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #38bdf8, var(--accent)); transition: width 0.6s var(--ease); }
.goal-txt { font-size: 13px; color: #cbd5e1; line-height: 1.5; }
.goal-txt b { color: var(--text); }
.goal-sub { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
ul.reglas { margin: 0; padding-left: 18px; }
ul.reglas li { font-size: 12.5px; color: #cbd5e1; line-height: 1.55; margin-bottom: 9px; }
ul.reglas li:last-child { margin-bottom: 0; }

/* ── Multiusuario: selector de usuario, chip del usuario activo y vista de equipo ── */
.user-grid { display: grid; gap: 12px; }
.user-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; transition: border-color 0.2s var(--ease), transform 0.2s var(--ease); }
.user-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.uc-emoji { font-size: 30px; line-height: 1; }
.uc-name { font-size: 17px; font-weight: 800; }
.uc-state { font-size: 11.5px; color: var(--muted); }
.topbar { position: relative; }
.who { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: var(--surface-2); border: 1px solid var(--border); color: #cbd5e1; font-size: 11.5px; font-weight: 700; padding: 6px 10px; border-radius: 99px; cursor: pointer; }
.who:hover { border-color: var(--accent); color: var(--text); }
.kv-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); padding: 6px 0; border-bottom: 1px solid var(--border); }
.kv-row:last-child { border-bottom: 0; }
.kv-row b { color: var(--text); text-align: right; font-weight: 700; }
.offline-bar { background: #3b2a12; border: 1px solid #7c5a1e; color: #fbbf24; font-size: 11.5px; font-weight: 600; text-align: center; padding: 8px 12px; border-radius: var(--radius-sm); margin: 0 0 12px; }
.offline-bar b { color: #fde68a; }
