/* ===== FitnessFeed · diseño mobile-first ===== */
:root {
  --bg: #090b0a;
  --s1: #121513;
  --s2: #1a1f1c;
  --s3: #242a26;
  --line: #2a312c;
  --text: #f3f6f1;
  --mute: #8d988f;
  --lime: #c8ff3d;
  --lime-d: #a9dc27;
  --lime-ink: #0b1102;
  --prot: #c8ff3d;
  --carb: #5ee0ff;
  --fat: #ffa24d;
  --red: #ff5d62;
  --ok: #4ade80;
  --r: 18px;
  --r-sm: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tab-h: 64px;
  --kb: 0px;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .9, .2, 1);
}

* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
a { color: inherit; text-decoration: none; }
.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body {
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text); background: var(--bg);
  overscroll-behavior-y: none; touch-action: manipulation;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button, .tap { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--lime); color: var(--lime-ink); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.hide { display: none !important; }
.num { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; }

/* ---------- shell ---------- */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; background: var(--bg); }
@media (min-width: 600px) { body { background: #050605; } #app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
#view { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: calc(var(--safe-t) + 14px) 16px calc(var(--tab-h) + var(--safe-b) + 28px); scroll-behavior: smooth; }
#view > * + * { margin-top: 14px; }

.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: stretch;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(14, 17, 15, .92); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-top: 1px solid var(--line);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--mute);
  font-size: 11px; font-weight: 600; letter-spacing: .02em; transition: color .2s; position: relative; }
.tab svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.tab.on { color: var(--lime); }
.tab.on svg { transform: translateY(-1px) scale(1.08); }
.tab.on::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--lime); }
.tab .dot { position: absolute; top: 9px; margin-left: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.tab-plus { flex: 0 0 74px; }
.tab-plus span { width: 52px; height: 52px; border-radius: 18px; margin-top: -18px; display: grid; place-items: center;
  background: var(--lime); color: var(--lime-ink); box-shadow: 0 8px 24px rgba(200, 255, 61, .3), 0 0 0 5px var(--bg); transition: transform .2s var(--ease); }
.tab-plus:active span { transform: scale(.9) rotate(45deg); }
.tab-plus svg { stroke-width: 2.6; width: 26px; height: 26px; }

/* ---------- tipografia ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .02em; line-height: 1; }
h1 { font-size: 34px; } h2 { font-size: 22px; } h3 { font-size: 17px; letter-spacing: .05em; color: var(--mute); font-weight: 700; }
.mute { color: var(--mute); } .small { font-size: 13px; } .xs { font-size: 12px; } .lime { color: var(--lime); } .red { color: var(--red); }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pagehead .sub { color: var(--mute); font-size: 13px; margin-bottom: 2px; }
.iconbtn { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--s1); border: 1px solid var(--line); color: var(--text); flex: none; transition: transform .15s; }
.iconbtn:active { transform: scale(.92); }
.iconbtn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 22px; background: var(--lime); color: var(--lime-ink); }

/* ---------- tarjetas ---------- */
.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card.pad0 { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.card-h h3 { margin: 0; }
.link { color: var(--lime); font-weight: 600; font-size: 14px; padding: 8px 0 8px 8px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.sp { height: 8px; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- botones ---------- */
.btn { min-height: 52px; padding: 0 20px; border-radius: 16px; font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--s2); border: 1px solid var(--line); transition: transform .12s var(--ease), background .2s; width: 100%; }
.btn:active { transform: scale(.97); }
.btn.pri { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); box-shadow: 0 6px 22px rgba(200, 255, 61, .18); }
.btn.dng { color: var(--red); border-color: rgba(255, 93, 98, .35); background: rgba(255, 93, 98, .07); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: 15px; border-radius: 14px; width: auto; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btnrow { display: flex; gap: 10px; } .btnrow > * { flex: 1; }

/* ---------- formularios ---------- */
.field { display: block; } .field > span { display: block; font-size: 13px; color: var(--mute); font-weight: 600; margin: 0 0 6px 2px; }
input.in, select.in, textarea.in { width: 100%; height: 52px; padding: 0 14px; font-size: 16px; /* 16px evita el zoom de iOS */
  background: var(--s2); border: 1px solid var(--line); border-radius: 14px; outline: none; appearance: none; -webkit-appearance: none; transition: border-color .2s, box-shadow .2s; }
input.in:focus, select.in:focus, textarea.in:focus { border-color: var(--lime); box-shadow: 0 0 0 4px rgba(200, 255, 61, .12); }
textarea.in { height: auto; min-height: 84px; padding: 12px 14px; resize: none; }
select.in { background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%);
  background-position: calc(100% - 22px) 22px, calc(100% - 16px) 22px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; } .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stack > * + * { margin-top: 12px; } .stack-s > * + * { margin-top: 8px; }
.unit { position: relative; } .unit .in { padding-right: 46px; } .unit i { position: absolute; right: 14px; top: 0; height: 52px; display: grid; place-items: center; color: var(--mute); font-style: normal; font-size: 14px; pointer-events: none; }

.seg { display: flex; padding: 4px; gap: 4px; background: var(--s1); border: 1px solid var(--line); border-radius: 16px; }
.seg button { flex: 1; white-space: nowrap; padding: 0 6px; min-height: 44px; border-radius: 12px; font-weight: 700; font-size: 14px; color: var(--mute); transition: background .2s, color .2s; }
.seg button.on { background: var(--lime); color: var(--lime-ink); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 0 16px; border-radius: 20px; background: var(--s1); border: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--mute); white-space: nowrap; }
.chip.on { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }

.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 52px; height: 52px; border-radius: 16px; background: var(--s2); border: 1px solid var(--line); font-size: 26px; font-weight: 600; line-height: 1; }
.stepper button:active { background: var(--s3); transform: scale(.94); }
.stepper .in { text-align: center; font-family: var(--display); font-size: 26px; font-weight: 700; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; }
.switch input { appearance: none; -webkit-appearance: none; width: 54px; height: 32px; flex: none; border-radius: 16px; background: var(--s3); position: relative; transition: background .2s; border: 1px solid var(--line); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .22s var(--ease); }
.switch input:checked { background: var(--lime); } .switch input:checked::after { transform: translateX(22px); background: var(--lime-ink); }

/* ---------- listas ---------- */
.list > * { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.list > *:last-child { border-bottom: 0; }
.list > button:active, .list > a:active { background: var(--s2); }
.li-main { flex: 1; min-width: 0; } .li-title { font-weight: 600; } .li-sub { color: var(--mute); font-size: 13px; }
.li-end { text-align: right; flex: none; }
.chev { width: 18px; height: 18px; stroke: var(--mute); fill: none; stroke-width: 2; flex: none; }
.empty { text-align: center; padding: 34px 20px; color: var(--mute); }
.empty .big { font-family: var(--display); font-size: 26px; font-weight: 800; text-transform: uppercase; color: var(--text); margin-bottom: 6px; }

/* ---------- anillo y barras ---------- */
.ringwrap { position: relative; display: grid; place-items: center; }
.ringwrap .mid { position: absolute; text-align: center; }
.ring-bg { stroke: var(--s3); } .ring-fg { transition: stroke-dashoffset .9s var(--ease), stroke .3s; }
.mid .v { font-family: var(--display); font-weight: 800; font-size: 50px; line-height: .95; font-variant-numeric: tabular-nums; }
.mid .l { font-size: 12px; color: var(--mute); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.eq { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; text-align: center; gap: 4px; }
.eq .op { color: var(--mute); font-family: var(--display); font-size: 22px; font-weight: 700; }
.eq .n { font-family: var(--display); font-weight: 700; font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.eq .t { font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.macro { display: block; } .macro + .macro { margin-top: 14px; }
.macro .top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.macro .name { font-weight: 700; font-size: 14px; } .macro .val { font-family: var(--display); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.macro .val small { font-family: system-ui; font-size: 12px; color: var(--mute); font-weight: 500; }
.bar { height: 10px; border-radius: 6px; background: var(--s3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; width: 0; transition: width .8s var(--ease); }
.macro .rem { font-size: 12px; margin-top: 5px; color: var(--mute); } .macro .rem.over { color: var(--red); font-weight: 600; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wd .d { font-size: 11px; color: var(--mute); font-weight: 700; text-transform: uppercase; }
.wd .col { width: 100%; height: 56px; border-radius: 10px; background: var(--s2); position: relative; overflow: hidden; }
.wd .col i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--s3); border-radius: 0 0 10px 10px; transition: height .8s var(--ease); }
.wd .col i.over { background: rgba(255, 93, 98, .55); }
.wd .tr { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--s3); }
.wd .tr.on { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.wd .tr svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 3.4; }
.wd.today .d { color: var(--lime); } .wd.today .col { box-shadow: inset 0 0 0 1.5px var(--lime); }

/* ---------- hojas inferiores (bottom sheets) ---------- */
#overlay { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.backdrop { position: fixed; z-index: 95; inset: 0; background: rgba(0, 0, 0, .62); opacity: 0; transition: opacity .25s; pointer-events: auto; }
.backdrop.in { opacity: 1; }
.sheet { position: fixed; z-index: 96; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; max-height: calc(100dvh - var(--safe-t) - 24px);
  display: flex; flex-direction: column; background: var(--s1); border-radius: 26px 26px 0 0; border: 1px solid var(--line); border-bottom: 0;
  transform: translateY(100%); transition: transform .34s var(--ease); pointer-events: auto; padding-bottom: calc(var(--safe-b) + var(--kb)); will-change: transform; }
.sheet.in { transform: translateY(0); } .sheet.drag { transition: none; }
.sheet.full { height: calc(100dvh - var(--safe-t) - 10px); }
.sheet .grab { padding: 10px 0 4px; display: grid; place-items: center; touch-action: none; flex: none; }
.sheet .grab i { width: 44px; height: 5px; border-radius: 3px; background: var(--s3); }
.sheet .sh-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 16px 12px; flex: none; }
.sheet .sh-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 16px 18px; }
.sheet .sh-foot { padding: 12px 16px 14px; border-top: 1px solid var(--line); flex: none; background: var(--s1); }
.page { position: fixed; inset: 0; z-index: 90; max-width: 560px; margin: 0 auto; background: var(--bg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .32s var(--ease); pointer-events: auto; }
.page.in { transform: none; }

.toast { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); max-width: 536px; margin: 0 auto; z-index: 200;
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: #f3f6f1; color: #0b0f0a; font-weight: 600;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5); animation: toastin .3s var(--ease); pointer-events: auto; }
.toast.err { background: var(--red); color: #fff; } .toast b { margin-left: auto; color: #3c6b00; padding: 4px 6px; font-weight: 800; }
@keyframes toastin { from { transform: translateY(20px); opacity: 0; } }
.toast.out { opacity: 0; transform: translateY(10px); transition: .25s; }

/* ---------- entrenamiento activo ---------- */
.wo-head { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 10px) 14px 10px; border-bottom: 1px solid var(--line); background: var(--s1); }
.wo-time { font-family: var(--display); font-weight: 800; font-size: 28px; font-variant-numeric: tabular-nums; color: var(--lime); }
.wo-body { flex: 1; overflow-y: auto; padding: 14px 14px calc(110px + var(--safe-b)); overscroll-behavior: contain; }
.wo-body > * + * { margin-top: 14px; }
.ex { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ex-h { display: flex; align-items: center; gap: 10px; padding: 14px 14px 8px; }
.ex-h h2 { font-size: 21px; flex: 1; min-width: 0; line-height: 1.05; }
.ex-h .musc { font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.setgrid { display: grid; grid-template-columns: 34px 1fr 1fr 1fr 56px; gap: 8px; align-items: center; padding: 0 14px; }
.setgrid.hd { font-size: 11px; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; text-align: center; padding-top: 4px; }
.setrow { padding-top: 8px; padding-bottom: 0; position: relative; transition: background .3s; }
.setrow .n { font-family: var(--display); font-weight: 700; font-size: 20px; text-align: center; color: var(--mute); }
.setrow .prev { font-size: 13px; text-align: center; color: var(--mute); font-variant-numeric: tabular-nums; }
.setrow .in { height: 52px; text-align: center; font-family: var(--display); font-size: 24px; font-weight: 700; padding: 0 4px; border-radius: 12px; }
.setrow .ok { height: 52px; width: 56px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--s2); display: grid; place-items: center; transition: all .2s var(--ease); }
.setrow .ok svg { width: 26px; height: 26px; stroke: var(--mute); fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.setrow.done { background: rgba(200, 255, 61, .06); } .setrow.done .in { color: var(--lime); border-color: rgba(200, 255, 61, .3); }
.setrow.done .ok { background: var(--lime); border-color: var(--lime); transform: scale(1.04); } .setrow.done .ok svg { stroke: var(--lime-ink); }
.setrow.flash { animation: flash .7s var(--ease); } @keyframes flash { 0% { background: rgba(200, 255, 61, .55); } 100% { background: rgba(200, 255, 61, .06); } }
.pr-tag { position: absolute; right: 78px; top: -4px; background: var(--lime); color: var(--lime-ink); font-family: var(--display); font-weight: 800; font-size: 13px; padding: 1px 8px; border-radius: 8px; letter-spacing: .06em; animation: pop .5s var(--ease); z-index: 2; }
@keyframes pop { 0% { transform: scale(0) rotate(-12deg); } 60% { transform: scale(1.3) rotate(4deg); } 100% { transform: scale(1); } }
.ex-f { display: flex; gap: 8px; padding: 10px 14px 14px; }
.ex-f button { flex: 1; min-height: 44px; border-radius: 12px; background: var(--s2); font-weight: 600; font-size: 14px; color: var(--mute); }
.ex-f button:active { background: var(--s3); }

.rest { position: absolute; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 12px); z-index: 5; border-radius: 20px; padding: 12px 14px; display: flex; align-items: center; gap: 12px;
  background: #f3f6f1; color: #0b0f0a; box-shadow: 0 14px 44px rgba(0, 0, 0, .6); overflow: hidden; }
.rest .tm { font-family: var(--display); font-weight: 800; font-size: 34px; font-variant-numeric: tabular-nums; line-height: 1; }
.rest .pg { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--lime-d); transition: width .25s linear; }
.rest button { min-height: 44px; padding: 0 13px; flex: none; border-radius: 12px; background: rgba(0, 0, 0, .08); font-weight: 800; font-size: 15px; }
.rest.end { animation: restend .6s 3; background: var(--lime); } @keyframes restend { 50% { transform: scale(1.03); } }
.finbar { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px calc(var(--safe-b) + 12px); background: linear-gradient(transparent, var(--bg) 35%); }

.bigstat { text-align: center; } .bigstat .n { font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.bigstat .t { font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-top: 4px; }

/* ---------- comida ---------- */
.datenav { display: flex; align-items: center; gap: 8px; }
.datenav .d { flex: 1; text-align: center; min-height: 48px; border-radius: 14px; background: var(--s1); border: 1px solid var(--line); font-family: var(--display); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: .03em; position: relative; display: grid; place-items: center; }
.datenav .d input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; }
.meal-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.meal-h h2 { font-size: 20px; }
.entry { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); width: 100%; text-align: left; min-height: 60px; }
.entry:active { background: var(--s2); }
.entry .k { font-family: var(--display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.addbtn { width: 100%; min-height: 52px; border-top: 1px solid var(--line); color: var(--lime); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.addbtn:active { background: var(--s2); }
.pm { display: inline-flex; gap: 10px; font-size: 12px; color: var(--mute); } .pm b { font-weight: 700; }
.pm .p { color: var(--prot); } .pm .c { color: var(--carb); } .pm .f { color: var(--fat); }
.searchbar { position: relative; } .searchbar .in { padding-left: 44px; } .searchbar svg { position: absolute; left: 14px; top: 15px; width: 22px; height: 22px; stroke: var(--mute); fill: none; stroke-width: 2; pointer-events: none; }
.foodrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 64px; }
.foodrow .main { flex: 1; min-width: 0; text-align: left; }
.foodrow .plus { width: 48px; height: 48px; border-radius: 14px; background: var(--s2); border: 1px solid var(--line); display: grid; place-items: center; flex: none; color: var(--lime); }
.foodrow .plus:active { background: var(--lime); color: var(--lime-ink); }
.foodrow .plus svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.6; stroke-linecap: round; }
.macroprev { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; padding: 14px; background: var(--s2); border-radius: 16px; }
.macroprev .n { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; } .macroprev .t { font-size: 11px; color: var(--mute); text-transform: uppercase; font-weight: 700; margin-top: 3px; }
.scanner { position: relative; border-radius: 18px; overflow: hidden; background: #000; aspect-ratio: 4/3; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner::after { content: ""; position: absolute; left: 12%; right: 12%; top: 38%; bottom: 38%; border: 2px solid var(--lime); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .45); }

/* ---------- cuerpo / fotos / charts ---------- */
.chart { width: 100%; touch-action: pan-y; } .chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.tip { font-size: 13px; color: var(--mute); min-height: 20px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.photos button { aspect-ratio: 3/4; background: var(--s2); border-radius: 10px; overflow: hidden; position: relative; }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos .dt { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; font-size: 11px; font-weight: 700; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); text-align: left; }
.photos .sel { box-shadow: 0 0 0 3px var(--lime) inset; }
.viewer { position: fixed; inset: 0; z-index: 110; background: #000; display: flex; flex-direction: column; }
.viewer img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.viewer .vb { display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-t) + 8px) 12px 8px; }
.viewer .vf { padding: 10px 14px calc(var(--safe-b) + 14px); display: flex; gap: 10px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .compare img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; }

/* ---------- auth ---------- */
.auth { position: fixed; inset: 0; z-index: 150; background: var(--bg); overflow-y: auto; padding: calc(var(--safe-t) + 22px) 22px calc(var(--safe-b) + 28px); display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.auth .brand { font-family: var(--display); font-weight: 800; font-size: 54px; text-transform: uppercase; line-height: .85; letter-spacing: .01em; }
.auth .brand em { color: var(--lime); font-style: normal; }
.auth .tag { color: var(--mute); margin-top: 10px; font-size: 15px; }
.pulse { width: 100%; height: 64px; margin: 18px 0 8px; overflow: visible; }
.pulse path { fill: none; stroke: var(--lime); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 420; stroke-dashoffset: 420; animation: beat 2.6s linear infinite; filter: drop-shadow(0 0 6px rgba(200, 255, 61, .7)); }
@keyframes beat { to { stroke-dashoffset: -420; } }
.auth form { margin-top: auto; padding-top: 20px; }
.err { color: var(--red); font-size: 14px; font-weight: 600; min-height: 20px; }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kpi { background: var(--s2); border-radius: 14px; padding: 12px 6px; min-width: 0; text-align: center; }
.kpi .n { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; } .kpi .t { font-size: 11px; color: var(--mute); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin-top: 4px; overflow-wrap: anywhere; }
.tbl { width: 100%; border-collapse: collapse; } .tbl td, .tbl th { padding: 12px 6px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
.tbl th { color: var(--mute); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; } .tbl tr:last-child td { border-bottom: 0; }
.goalrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--s2); width: 100%; text-align: left; min-height: 60px; transition: border-color .2s; }
.goalrow.on { border-color: var(--lime); background: rgba(200, 255, 61, .07); }
.goalrow + .goalrow { margin-top: 8px; }
.note { font-size: 13px; color: var(--mute); background: var(--s2); border-radius: 12px; padding: 10px 12px; }
.note b { color: var(--text); }

@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- barra "entrenamiento en curso" y filas de acciones ---------- */
.resume { position: absolute; left: 12px; right: 12px; bottom: calc(var(--tab-h) + var(--safe-b) + 10px); z-index: 25; display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-radius: 16px; background: var(--lime); color: var(--lime-ink); font-size: 14px; text-align: left; box-shadow: 0 10px 32px rgba(200, 255, 61, .28); animation: toastin .3s var(--ease); }
.resume svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.resume .num { font-size: 22px; font-weight: 800; } .resume .go { background: var(--lime-ink); color: var(--lime); padding: 6px 12px; border-radius: 10px; font-weight: 800; font-size: 13px; }
.iconrow { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 66px; padding: 10px 14px; border-radius: 16px; background: var(--s2); text-align: left; }
.iconrow:active { background: var(--s3); }
.iconrow .ib { width: 44px; height: 44px; border-radius: 14px; background: var(--s3); color: var(--lime); display: grid; place-items: center; flex: none; }
.iconrow .ib svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btnrow .btn { white-space: nowrap; padding-left: 10px; padding-right: 10px; }
.lime .chev, .chev.lime { stroke: var(--lime); stroke-width: 3; }

.prow .ib { width: 40px; height: 40px; border-radius: 12px; background: var(--s2); color: var(--lime); display: grid; place-items: center; flex: none; }
.btnrow { flex-wrap: wrap; } .btnrow .btn { flex: 1 1 auto; }

/* anillos del Home */
.rings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 6px; }
.rt { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 4px 0; border-radius: 16px; min-width: 0; }
.rt:active { background: var(--s2); }
.rt .ringwrap svg { max-width: 100%; height: auto; }
.rt-name { font-weight: 700; font-size: 13px; margin-top: 4px; }
.rt-left { font-size: 12px; color: var(--mute); line-height: 1.2; }
.rt-left.ok { color: var(--ok); font-weight: 600; }

.tbadge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.rbar { height: 8px; border-radius: 4px; background: var(--s3); overflow: hidden; } .rbar i { display: block; height: 100%; border-radius: 4px; background: var(--lime); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: var(--s3); color: var(--mute); }
.badge.god { background: rgba(255, 93, 98, .18); color: var(--red); } .badge.trainer { background: rgba(200, 255, 61, .16); color: var(--lime); } .badge.off { background: rgba(255, 162, 77, .18); color: var(--fat); }
