:root {
  --mamey: #F57C00;
  --mamey-2: #FF9A2E;
  --mamey-rgb: 245, 124, 0;
  --on-mamey: #111;
  --mamey-bg: rgba(245, 124, 0, 0.14);
  --negro: #0B0B0B;
  --card: #1C1C1C;
  --card-2: #242424;
  --borde: #2B2B2B;
  --blanco: #FFFFFF;
  --gris: #A3A3A3;
  --gris-2: #6E6E6E;
  --verde: #22C55E;
  --verde-bg: rgba(34, 197, 94, 0.14);
  --amarillo: #FACC15;
  --amarillo-bg: rgba(250, 204, 21, 0.14);
  --rojo: #EF4444;
  --rojo-bg: rgba(239, 68, 68, 0.14);
  --radio: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--negro); color: var(--blanco); }
body { font-family: 'Montserrat', system-ui, sans-serif; font-size: 15px; line-height: 1.5; min-height: 100vh; }
h1, h2, h3, .titulo { font-family: 'Bebas Neue', 'Oswald', sans-serif; font-weight: 400; letter-spacing: 1px; text-transform: uppercase; margin: 0; }
h1 { font-size: 34px; line-height: 1.05; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }
a { color: var(--mamey); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--gris); }
.small { font-size: 13px; }
.center { text-align: center; }
.hidden { display: none !important; }

.splash { min-height: 100vh; display: grid; place-items: center; padding: 40px; }
.splash img { width: min(280px, 70vw); animation: pulso 1.4s ease-in-out infinite; }
@keyframes pulso { 50% { opacity: 0.55; } }

/* Estructura */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(11, 11, 11, 0.94); backdrop-filter: blur(10px);
  padding: calc(10px + var(--safe-t)) 18px 10px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--borde); }
.topbar img { height: 34px; }
.topbar .back { background: none; border: 0; color: var(--blanco); font-size: 15px; display: flex; align-items: center; gap: 6px; padding: 6px 0; cursor: pointer; }
.page { padding: 18px 16px calc(100px + var(--safe-b)); max-width: 640px; margin: 0 auto; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: #111; border-top: 1px solid var(--borde); padding-bottom: var(--safe-b); }
.nav button { flex: 1; background: none; border: 0; color: var(--gris-2); padding: 10px 2px 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; cursor: pointer; }
.nav button svg { width: 24px; height: 24px; }
.nav button.on { color: var(--mamey); }

/* Tarjetas */
.card { background: var(--card); border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px; }
.card.mamey { border-color: var(--mamey); background: linear-gradient(180deg, rgba(var(--mamey-rgb),0.16), rgba(var(--mamey-rgb),0.04)); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.hola { margin: 4px 0 2px; }
.hola .fecha { color: var(--gris); font-size: 14px; }
.big-num { font-family: 'Bebas Neue', sans-serif; font-size: 44px; line-height: 1; color: var(--mamey); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 14px 18px; font-weight: 700;
  font-size: 15px; cursor: pointer; background: var(--mamey); color: var(--on-mamey); min-height: 50px; text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--blanco); border: 1px solid var(--borde); }
.btn.dark { background: var(--card-2); color: var(--blanco); }
.btn.danger { background: transparent; color: var(--rojo); border: 1px solid rgba(239,68,68,0.45); }
.btn.sm { padding: 8px 12px; min-height: 38px; font-size: 13px; border-radius: 10px; }
.btn.wa { background: #25D366; color: #06210f; }
.btn[disabled] { opacity: 0.5; }
.icon-btn { background: var(--card-2); border: 1px solid var(--borde); color: var(--blanco); width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }

/* Formularios */
label.f { display: block; }
label.f > span { display: block; font-size: 13px; color: var(--gris); margin-bottom: 6px; font-weight: 600; }
input.i, select.i, textarea.i { width: 100%; background: #141414; border: 1px solid var(--borde); border-radius: 12px; padding: 13px 14px; font-size: 16px; color: var(--blanco); outline: none; }
input.i:focus, select.i:focus, textarea.i:focus { border-color: var(--mamey); }
textarea.i { min-height: 80px; resize: vertical; }
select.i { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gris) 50%), linear-gradient(135deg, var(--gris) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.error { color: var(--rojo); font-size: 14px; min-height: 0; }

/* Login */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 30px 22px calc(30px + var(--safe-b)); max-width: 440px; margin: 0 auto; }
.login .logo { width: min(300px, 78vw); margin: 0 auto 30px; display: block; }

/* Pills de estado */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.al_dia { background: var(--verde-bg); color: var(--verde); }
.pill.por_vencer { background: var(--amarillo-bg); color: var(--amarillo); }
.pill.atrasado { background: var(--rojo-bg); color: var(--rojo); }
.pill.sin_fecha, .pill.gris { background: var(--card-2); color: var(--gris); }
.pill.mamey { background: var(--mamey-bg); color: var(--mamey); }

.banner { border-radius: var(--radio); padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
.banner.por_vencer { background: var(--amarillo-bg); color: #FDE68A; border: 1px solid rgba(250,204,21,0.35); }
.banner.atrasado { background: var(--rojo-bg); color: #FECACA; border: 1px solid rgba(239,68,68,0.4); }
.banner.info { background: var(--mamey-bg); color: #FFD7AE; border: 1px solid rgba(var(--mamey-rgb),0.4); }

/* Ejercicios */
.ex { background: var(--card); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; }
.ex.done { border-color: rgba(34,197,94,0.5); }
.ex-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.ex-num { width: 30px; height: 30px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.ex.done .ex-num { background: var(--verde); color: #04260f; }
.ex-name { font-weight: 700; flex: 1; }
.ex-note { padding: 0 16px 12px; color: #D4D4D4; font-size: 14px; white-space: pre-line; }
.ex-note b { color: var(--mamey); font-weight: 700; }
.video { position: relative; aspect-ratio: 16/9; background: #000; cursor: pointer; }
.video img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; display: block; }
.video .play { position: absolute; inset: 0; display: grid; place-items: center; }
.video .play span { width: 62px; height: 62px; border-radius: 50%; background: var(--mamey); display: grid; place-items: center; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.check { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 0; border-top: 1px solid var(--borde); background: transparent;
  color: var(--blanco); padding: 13px; font-weight: 700; cursor: pointer; }
.ex.done .check { color: var(--verde); }

.progress { height: 10px; background: var(--card-2); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--mamey); border-radius: 999px; transition: width 0.3s; }

/* Semana */
.day { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border: 1px solid var(--borde); border-radius: var(--radio); cursor: pointer; }
.day.hoy { border-color: var(--mamey); }
.day-date { width: 48px; text-align: center; flex: none; }
.day-date .d { font-family: 'Bebas Neue', sans-serif; font-size: 30px; line-height: 1; }
.day-date .w { font-size: 11px; color: var(--gris); text-transform: uppercase; font-weight: 700; }
.day.hoy .day-date .d { color: var(--mamey); }
.day-info { flex: 1; min-width: 0; }
.day-info .r { font-weight: 700; }

/* Tabs segmentados */
.seg { display: flex; background: var(--card); border: 1px solid var(--borde); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--gris); padding: 10px 6px; border-radius: 9px; font-weight: 700; font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--mamey); color: var(--on-mamey); }

/* Mediciones */
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.metric { background: var(--card-2); border-radius: 12px; padding: 12px; }
.metric .lbl { font-size: 12px; color: var(--gris); font-weight: 600; }
.metric .val { font-family: 'Bebas Neue', sans-serif; font-size: 28px; line-height: 1.1; }
.metric .val small { font-family: 'Montserrat', sans-serif; font-size: 12px; color: var(--gris); margin-left: 3px; }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp th { text-align: right; font-size: 11px; color: var(--gris); font-weight: 700; padding: 8px 6px; text-transform: uppercase; }
.cmp th:first-child, .cmp td:first-child { text-align: left; }
.cmp td { padding: 11px 6px; border-top: 1px solid var(--borde); text-align: right; white-space: nowrap; }
.cmp td:first-child { white-space: normal; color: #E5E5E5; }
.delta { font-weight: 700; }
.delta.bien { color: var(--verde); }
.delta.mal { color: var(--rojo); }
.delta.neutro { color: var(--mamey); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--borde); background: var(--card); color: var(--gris); padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--mamey); border-color: var(--mamey); color: var(--on-mamey); }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { fill: var(--gris); font-size: 11px; font-family: 'Montserrat', sans-serif; }
.chart .lbl-val { fill: var(--blanco); font-size: 12px; font-weight: 700; font-family: 'Montserrat', sans-serif; }

/* Listas coach */
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); border: 1px solid var(--borde); border-radius: var(--radio); cursor: pointer; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--mamey-bg); color: var(--mamey); display: grid; place-items: center; font-weight: 700; flex: none; }
.li-main { flex: 1; min-width: 0; }
.li-main .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-main .s { font-size: 13px; color: var(--gris); }
.search { position: relative; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--borde); border-radius: 12px; padding: 12px; text-align: center; }
.stat .n { font-family: 'Bebas Neue', sans-serif; font-size: 30px; line-height: 1; }
.stat .l { font-size: 11px; color: var(--gris); font-weight: 700; text-transform: uppercase; }
.sched-row { display: grid; grid-template-columns: 46px 1fr 128px; gap: 8px; align-items: center; }
.sched-row .w { font-weight: 700; font-size: 14px; }
.sched-row select.i, .sched-row input.i { padding: 10px; font-size: 15px; }
.routine-ex { display: flex; gap: 8px; align-items: flex-start; background: var(--card-2); border-radius: 12px; padding: 10px; }
.routine-ex .grow { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.routine-ex .ord { display: flex; flex-direction: column; gap: 4px; }
.routine-ex .ord button { width: 34px; height: 30px; }
.cred { background: #141414; border: 1px dashed var(--mamey); border-radius: 12px; padding: 14px; font-size: 16px; }
.cred b { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 26px; letter-spacing: 2px; color: var(--mamey); font-weight: 700; text-transform: none; }

/* Modal */
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.7); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #151515; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; border-top: 2px solid var(--mamey);
  padding: 20px 18px calc(24px + var(--safe-b)); animation: sube 0.22s ease-out; }
@keyframes sube { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 20px; } }

.toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--blanco); color: #111;
  padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 60; max-width: 90vw; text-align: center; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { text-align: center; padding: 30px 16px; color: var(--gris); }
.empty svg { width: 46px; height: 46px; color: var(--gris-2); margin-bottom: 8px; }
hr.sep { border: 0; border-top: 1px solid var(--borde); margin: 18px 0; }

/* ===== v2 ===== */
.rel { position: relative; }
.badge { position: absolute; top: -5px; right: -5px; background: var(--mamey); color: var(--on-mamey); font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
img.avatar { display: block; }
.seg.sm button { padding: 8px 6px; font-size: 12px; }
.streak { display: flex; flex-direction: column; align-items: center; background: var(--mamey-bg); border: 1px solid rgba(var(--mamey-rgb),.4); border-radius: 12px; padding: 6px 10px; line-height: 1.1; }
.streak b { font-family: 'Bebas Neue', sans-serif; font-size: 26px; color: var(--mamey); font-weight: 400; }
.streak span { font-size: 10px; color: var(--gris); font-weight: 700; text-transform: uppercase; }
.video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-h { text-align: center; font-size: 11px; color: var(--gris-2); font-weight: 700; }
.cal-d { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--card-2); color: var(--gris-2); }
.cal-d.hecho { background: var(--verde); color: #04260f; }
.cal-d.falto { background: var(--rojo-bg); color: var(--rojo); border: 1px solid rgba(239,68,68,.45); }
.cal-d.descanso { background: #161616; color: #4a4a4a; }
.cal-d.pendiente { border: 2px solid var(--mamey); color: var(--mamey); background: transparent; }
.cal-d.futuro, .cal-d.antes { background: transparent; color: #3d3d3d; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.cal-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.dot.hecho { background: var(--verde); } .dot.falto { background: var(--rojo); } .dot.descanso { background: #2e2e2e; }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--card-2); border: 1px solid var(--borde); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: var(--gris); border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--mamey); border-color: var(--mamey); }
.switch input:checked + span::after { transform: translateX(22px); background: #111; }
.dots { display: flex; justify-content: center; gap: 8px; margin: 22px 0 16px; }
.dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--card-2); transition: .2s; }
.dots i.on { width: 24px; background: var(--mamey); }
.products { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 520px) { .products { grid-template-columns: 1fr 1fr; } }
.product { padding: 0; overflow: hidden; cursor: default; }
.product[data-edit-prod] { cursor: pointer; }
.product.off { opacity: .55; }
.product > img, .product > .noimg { width: 100%; aspect-ratio: 4/3; object-fit: contain; padding: 8px; display: block; background: #fff; }
.noimg { display: grid; place-items: center; background: var(--card-2) !important; color: var(--gris-2); }
.noimg svg { width: 42px; height: 42px; }
.prod-prev { width: 100%; max-height: 260px; object-fit: contain; border-radius: 12px; background: #fff; }
.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ex-tile { background: var(--card); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; cursor: pointer; }
.ex-tile video, .ex-tile .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #000; }
.ex-tile-t { padding: 10px 12px; display: flex; flex-direction: column; }
.ex-tile-t b { font-size: 14px; line-height: 1.25; }
.ex-tile-t span { font-size: 12px; color: var(--gris); }
.picker { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--borde); border-radius: 12px; padding: 8px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; }
.pick:has(input:checked) { background: var(--mamey-bg); }
.pick input { width: 20px; height: 20px; accent-color: var(--mamey); }
.daypick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.daypick label { cursor: pointer; }
.daypick input { display: none; }
.daypick span { display: block; text-align: center; padding: 10px 0; border-radius: 10px; background: var(--card-2); font-weight: 700; font-size: 13px; color: var(--gris); }
.daypick input:checked + span { background: var(--mamey); color: var(--on-mamey); }
.agenda-h { display: flex; gap: 12px; padding-top: 10px; border-top: 1px solid var(--borde); }
.agenda-h .hr { width: 64px; flex: none; font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: var(--mamey); }
.cmp tr.sec td { color: var(--mamey); font-weight: 700; font-size: 12px; text-transform: uppercase; padding-top: 16px; border-top: 0; }
.btn svg, .banner svg { width: 20px; height: 20px; flex: none; }
.avatar svg { width: 22px; height: 22px; }
.product > .noimg { display: grid; width: 100%; aspect-ratio: 4/3; }

/* ===== v3 ===== */
.att-sm { min-height: 34px !important; padding: 6px 12px !important; font-size: 13px !important; }
.att-yes { background: var(--verde) !important; color: #04260f !important; }
.cal-d.marked { box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--borde); border-radius: 12px; cursor: pointer; }
.opt.on { border-color: var(--mamey); background: rgba(var(--mamey-rgb),.1); }
.opt .r { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--gris-2); flex: none; margin-top: 2px; }
.opt.on .r { border: 6px solid var(--mamey); }
.money-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.money-row.tot { border-top: 1px solid var(--borde); padding-top: 10px; font-weight: 700; font-size: 16px; align-items: center; }
.tot-n { color: var(--verde); font-family: 'Bebas Neue', sans-serif; font-size: 26px; font-weight: 400; }
.legend-h { display: flex; gap: 14px; font-size: 12px; color: var(--gris); }
.legend-h i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.dayed { padding: 12px 0; border-top: 1px solid var(--borde); }
.dayed:first-child { border-top: 0; }
.sh-l { font-size: 11px; color: var(--gris); font-weight: 700; margin: 8px 0 4px; text-transform: uppercase; }
.shift { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.hb { padding: 9px 0; text-align: center; border-radius: 8px; font-size: 12px; font-weight: 700; background: rgba(34,197,94,.16); color: var(--verde); border: 1px solid rgba(34,197,94,.35); cursor: pointer; }
.hb.off { background: rgba(239,68,68,.16); color: #F87171; border-color: rgba(239,68,68,.5); }
.off-card { border-color: rgba(239,68,68,.5) !important; background: rgba(239,68,68,.08) !important; }
.off-row { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.45); }
.coach-off { display: flex; gap: 6px; color: #FCA5A5; font-size: 13px; font-weight: 600; margin-top: 4px; }
.list-item.own { border-color: var(--mamey); }
.ex-name-in { padding: 8px 10px !important; font-size: 14px !important; font-weight: 700; }
.site { display: flex; gap: 10px; align-items: center; padding: 10px; background: var(--card); border: 1px solid var(--borde); border-radius: 14px; }
.site .ill svg { width: 74px; height: 155px; display: block; background: #151515; border-radius: 10px; }
.tomas { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tomas .i { padding: 10px; font-size: 15px; }
.prom { font-size: 12px; color: var(--gris); }
.prom b { color: #fff; }
@keyframes ring { 0% { r: 4; opacity: .9 } 80% { r: 15; opacity: 0 } 100% { r: 15; opacity: 0 } }
@keyframes ja { 0%, 100% { transform: translate(0, 0) } 50% { transform: translate(var(--dx), var(--dy)) } }
.ring { animation: ring 1.6s ease-out infinite; }
.jaw { animation: ja 1.6s ease-in-out infinite; }
.banner.small { font-size: 13px; font-weight: 500; }
/* v4 */
.mdesc { background: rgba(var(--mamey-rgb),.10); border: 1px solid rgba(var(--mamey-rgb),.35); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45; color: #e9e9e9; }
.metric.tap { cursor: pointer; }
.metric.sel { outline: 2px solid var(--mamey); }
.metric .qm { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: #2a2a2a; color: var(--mamey); font-size: 10px; font-weight: 800; vertical-align: 1px; }
.imc-box { display: flex; justify-content: space-between; align-items: center; background: #151515; border: 1px solid #2a2a2a; border-radius: 14px; padding: 10px 14px; }
/* v4.1: barra de abajo fija (no se despega al deslizar) */
html, body { overscroll-behavior: none; }
#app.shell { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
#app.shell .topbar { position: relative; flex-shrink: 0; }
#app.shell .scroller { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
#app.shell .nav { position: relative; flex-shrink: 0; }
#app.shell .page { padding-bottom: 28px; }

/* v5: marca del entrenador, planes, términos */
.logo-box { height: 120px; display: grid; place-items: center; background: var(--negro); border: 1px dashed var(--borde); border-radius: 14px; }
.logo-box img { max-height: 100px; max-width: 80%; object-fit: contain; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; position: relative; }
.sw.on { outline: 3px solid #fff; outline-offset: 2px; }
.sw-custom { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); overflow: hidden; display: inline-block; }
.sw-custom input { opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.preview-chip { border-radius: 12px; padding: 14px; color: #fff; border: 1px solid var(--borde); }
.preview-chip b { display: inline-block; padding: 6px 14px; border-radius: 10px; color: var(--on-mamey); margin-left: 6px; }
.terms p { color: #d4d4d4; font-size: 14px; line-height: 1.55; margin: 0 0 10px; }
.terms h3 { margin: 0 0 8px; }
.topbar img { max-width: 160px; object-fit: contain; }
.login .logo { max-height: 150px; object-fit: contain; }
/* panel del administrador */
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.adm-kpis .card { margin: 0 !important; }
.adm-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 4px 12px; color: var(--gris); }
.adm-row b { color: var(--blanco); }
.adm-t:hover { border-color: var(--mamey); }
.stchip { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.fpill { background: var(--card); border: 1px solid var(--borde); color: var(--blanco); border-radius: 999px; padding: 7px 12px; font-size: 13px; cursor: pointer; font-family: inherit; }
.fpill.on { border-color: var(--mamey); background: var(--mamey-bg); }
.fpill b { color: var(--mamey); margin-left: 4px; }
/* biblioteca de ejercicios */
.libimg { position: relative; width: 100%; aspect-ratio: 1 / 1; background: #fff; overflow: hidden; }
.libimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.libimg.anim img.b { animation: libflip 1.6s steps(1, end) infinite; }
@keyframes libflip { 0% { opacity: 0; } 50% { opacity: 1; } }
.video .libimg { border-radius: 14px; max-height: 360px; aspect-ratio: auto; height: 300px; }
.lib-tile { position: relative; cursor: pointer; }
.lib-tile .lib-check { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.45); border: 2px solid #fff; color: transparent; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.lib-tile.sel { outline: 3px solid var(--mamey); }
.lib-tile.sel .lib-check { background: var(--mamey); border-color: var(--mamey); color: var(--on-mamey); }
.lib-tile.mine { opacity: .55; }
.lib-tile.mine .lib-check { background: #22C55E; border-color: #22C55E; color: #fff; }
.lib-info { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-weight: 800; font-style: italic; font-family: Georgia, serif; cursor: pointer; }
.lib-bar { position: sticky; bottom: 10px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--mamey); border-radius: 14px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.lib-steps { margin: 0; padding-left: 20px; color: #d4d4d4; font-size: 14px; line-height: 1.5; }
.lib-steps li { margin-bottom: 4px; }
.wk { padding: 9px 0; text-align: center; border-radius: 8px; font-size: 12px; font-weight: 700; background: transparent; color: var(--gris); border: 1px solid var(--borde); cursor: pointer; }
.wk.on { background: rgba(var(--mamey-rgb),.18); color: var(--mamey); border-color: var(--mamey); }
