/* Layout: móvil primero (una columna, barra inferior); en escritorio, barra lateral fija + contenido centrado.
   Dirección: casi negro, tarjetas de bajo contraste, rojo solo para acción y progreso, serif para títulos. */
:root {
  --bg: #0A0A0C;
  --surface: #111114;
  --surface-2: #17171B;
  --line: #24242A;
  --line-strong: #33333B;
  --ink: #F1F1F3;
  --ink-2: #C9C9CF;
  --muted: #85858F;
  --accent: #E32636;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(227, 38, 54, .12);
  --ok: #3CC48B;
  --ok-soft: rgba(60, 196, 139, .12);
  --warn: #E7A64A;
  --warn-soft: rgba(231, 166, 74, .12);
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --tabbar-h: 64px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -18px rgba(0,0,0,.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, input { font-variant-numeric: tabular-nums; }

/* ---------- Estructura ---------- */
.shell { min-height: 100vh; }
.main { max-width: 640px; margin: 0 auto; padding-inline: 16px; padding-block: 0 calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom, 0px)); }
.main.has-timer { padding-bottom: calc(var(--tabbar-h) + 150px + env(safe-area-inset-bottom, 0px)); }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: rgba(10,10,12,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); margin-inline: -16px; padding: 12px 16px; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; }
.wordmark { text-align: center; font-family: var(--font-display); font-size: 17px; letter-spacing: .32em; font-weight: 500; text-transform: uppercase; white-space: nowrap; }
.wordmark span { color: var(--accent); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.top .right { justify-self: end; }

.page { display: flex; flex-direction: column; gap: 16px; padding-top: 22px; }
.crumb { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.crumb b { color: var(--accent); font-weight: 600; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-family: var(--font-display); font-weight: 500; font-size: 32px; line-height: 1.1; letter-spacing: -.01em; }
h2 { font-family: var(--font-display); font-weight: 500; font-size: 24px; line-height: 1.15; }
h3 { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sub { color: var(--muted); font-size: 14px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Superficies ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; box-shadow: var(--shadow); }
.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row > .grow { flex: 1; min-width: 0; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.metric .l { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.metric .v { font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.metric .d { font-size: 12px; color: var(--muted); }
.metric .d.up { color: var(--ok); } .metric .d.down { color: var(--accent); }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; border: 1px solid var(--line); color: var(--muted); }
.pill.ok { color: var(--ok); border-color: transparent; background: var(--ok-soft); }
.pill.live { color: var(--accent); border-color: transparent; background: var(--accent-soft); }
.pill.warn { color: var(--warn); border-color: transparent; background: var(--warn-soft); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.btn { border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 600; letter-spacing: .02em; border-radius: var(--radius-sm); padding: 13px 18px; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .12s ease, filter .12s ease; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.btn.small { padding: 8px 12px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.link { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.link:hover { color: var(--ink); }

/* ---------- Selector de semana ---------- */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 8px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--muted); }
.seg button b { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg button small { font-size: 11px; }
.seg button[aria-pressed="true"] { background: var(--surface-2); box-shadow: 0 0 0 1px var(--line-strong) inset; }
.seg button[aria-pressed="true"] b { color: var(--ink); }

/* ---------- Días ---------- */
.day { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; text-align: left; width: 100%; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; transition: border-color .15s ease, background .15s ease; }
.day:hover { border-color: var(--line-strong); background: var(--surface-2); }
.day .n { font-family: var(--font-display); font-size: 30px; color: var(--ink-2); text-align: center; }
.day .t b { display: block; font-size: 16px; font-weight: 600; text-transform: capitalize; }
.day .t span { font-size: 13px; color: var(--muted); }
.track { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.track i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.track.ok i { background: var(--ok); }

/* ---------- Sesión ---------- */
.session-head { display: flex; flex-direction: column; gap: 10px; }
.session-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.session-progress .track { flex: 1; margin: 0; }

.ex { padding: 0; gap: 0; overflow: hidden; }
.ex-top { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ex-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ex-label .idx { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.ex h2 { text-transform: none; }
.ex .meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.video { position: relative; display: flex; align-items: center; gap: 12px; text-decoration: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; overflow: hidden; }
.video .thumb { width: 96px; aspect-ratio: 16/9; max-width: 100%; border-radius: 8px; background: #000 center/cover no-repeat; display: grid; place-items: center; flex: none; position: relative; }
.video .thumb::after { content: ""; position: absolute; inset: 0; border-radius: 8px; background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.45)); }
.video .play { position: relative; z-index: 1; width: 30px; height: 22px; border-radius: 6px; background: var(--accent); display: grid; place-items: center; }
.video .play::before { content: ""; border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-left: 2px; }
.video b { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.video span { font-size: 12px; color: var(--muted); }
.key { display: grid; grid-template-columns: 18px 1fr; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 14px; color: var(--ink-2); }
.key svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 1.8; margin-top: 1px; }
.key b { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 2px; }

.set { border-top: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: background .2s ease; }
.set.active { background: linear-gradient(180deg, rgba(227,38,54,.05), transparent 70%); }
.set-head { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: start; }
.badge { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink-2); }
.set.active .badge { background: var(--accent); border-color: var(--accent); color: #fff; }
.set.done .badge { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.presc b { display: block; font-size: 15px; font-weight: 600; }
.presc details summary { list-style: none; cursor: pointer; font-size: 13px; color: var(--muted); margin-top: 2px; }
.presc details summary::-webkit-details-marker { display: none; }
.presc details summary::after { content: " · ver cómo"; color: var(--ink-2); }
.presc details[open] summary::after { content: " · ocultar"; }
.presc details p { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.verdict { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.verdict.up { color: var(--ok); } .verdict.same { color: var(--muted); } .verdict.down { color: var(--warn); }

.last { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; }
.last svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; stroke-width: 1.8; flex: none; }
.last b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.last.none { background: var(--surface-2); }
.last.none svg { stroke: var(--muted); }

.inputs { display: grid; grid-template-columns: 1.25fr 1fr .8fr; gap: 8px; }
.stepper { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 6px; display: flex; flex-direction: column; gap: 2px; min-width: 0; transition: border-color .15s ease; }
.stepper:focus-within { border-color: var(--line-strong); box-shadow: 0 0 0 3px var(--accent-soft); }
.stepper label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding-left: 4px; }
.stepper .ctl { display: flex; align-items: center; gap: 4px; }
.stepper input { width: 100%; min-width: 0; border: 0; background: transparent; font-size: 26px; font-weight: 600; letter-spacing: -.02em; padding: 2px 4px; outline: none; text-align: left; }
.stepper input::placeholder { color: #3C3C44; }
.stepper .pm { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: var(--ink-2); cursor: pointer; font-size: 16px; line-height: 1; display: grid; place-items: center; }
.stepper .pm:active { background: var(--line); }
.note-in { width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 11px 12px; font-size: 14px; outline: none; }
.note-in:focus { border-color: var(--line-strong); }
.set-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.saved { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.saved.ok { color: var(--ok); }

.rest-line { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); background: var(--surface); }

.qgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qgrid .wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 11px 12px; font-size: 15px; outline: none; min-width: 0; }
.field input:focus, .field textarea:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { resize: vertical; min-height: 44px; }
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
details.fold > summary h3 { flex: 1; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "+"; color: var(--muted); font-size: 20px; line-height: 1; }
details.fold[open] > summary::after { content: "–"; }

/* ---------- Temporizador de descanso ---------- */
.timer { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom, 0px)); width: min(608px, calc(100% - 24px)); background: rgba(17,17,20,.96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line-strong); border-radius: 18px; padding: 12px 14px 10px; display: grid; grid-template-columns: 1fr; gap: 10px; align-items: center; box-shadow: 0 24px 48px -20px rgba(0,0,0,.9); }
.timer .lbl { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.timer .clock { font-size: 44px; font-weight: 600; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.timer.done .clock { color: var(--ok); }
.timer .next { font-size: 12px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer .acts { display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 8px; }
.timer .acts button { height: 46px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); cursor: pointer; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.timer .head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.timer .head .next { margin: 0; flex: 1; min-width: 0; text-align: right; }
.timer .acts button.primary { border-color: var(--accent); color: var(--accent); }
.timer .acts svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.timer .track { grid-column: 1 / -1; margin: 0; height: 4px; }
.timer .track i { transition: width 1s linear; }

/* ---------- Dieta ---------- */
.kcal { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kcal .big { font-size: 40px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kcal .u { color: var(--muted); font-size: 14px; }
.notice { display: grid; grid-template-columns: 18px 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); background: var(--surface); }
.notice svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 1.8; }
.meal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.formula { display: flex; flex-wrap: wrap; gap: 6px; }
.formula span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
.cat { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.cat h4 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--ink-2); }
.cat h4 i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.cat h4 small { margin-left: auto; color: var(--muted); font-weight: 500; letter-spacing: .04em; }
.opts { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.opts li { display: grid; grid-template-columns: 74px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; color: var(--ink-2); }
.opts li:last-child { border-bottom: 0; }
.opts .q { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.opts li.free { grid-template-columns: 1fr; }
.kv { display: grid; grid-template-columns: minmax(96px, 32%) 1fr; gap: 10px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; padding-top: 2px; }
.kv dd { margin: 0; color: var(--ink-2); }

/* ---------- Progreso ---------- */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { fill: var(--muted); font-size: 10px; font-family: var(--font-body); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .goal { stroke: var(--ok); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .goal-l { fill: var(--ok); font-size: 10px; font-family: var(--font-body); font-weight: 600; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { fill: var(--bg); stroke: var(--accent); stroke-width: 1.6; }
.chart .pt.end { fill: var(--accent); }
.chart .hit { fill: transparent; cursor: pointer; }
.tip { font-size: 13px; color: var(--muted); min-height: 20px; }
.tip b { color: var(--ink); }
.table-wrap { overflow-x: auto; margin-inline: -4px; }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
table.t th, table.t td { padding: 9px 6px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.t th { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
table.t td:first-child { white-space: normal; min-width: 130px; color: var(--ink-2); }
table.t .up { color: var(--ok); font-weight: 600; }
table.t tr:last-child td { border-bottom: 0; }

/* ---------- Coach ---------- */
.client { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.client:hover { border-color: var(--line-strong); background: var(--surface-2); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink-2); }
.client b { display: block; font-size: 15px; font-weight: 600; }
.client span.s { font-size: 13px; color: var(--muted); }
.activity { display: flex; flex-direction: column; }
.activity .it { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.activity .it:last-child { border-bottom: 0; }
.activity .ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); }
.activity .ic svg { width: 16px; height: 16px; stroke: var(--ink-2); fill: none; stroke-width: 1.8; }
.activity .ic.alert { background: var(--accent-soft); border-color: transparent; }
.activity .ic.alert svg { stroke: var(--accent); }
.activity b { display: block; font-size: 14px; font-weight: 600; }
.activity span { font-size: 12px; color: var(--muted); }
.activity time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.banner { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--muted); margin-top: 14px; }
.banner b { color: var(--ink); }
.banner .btn { margin-left: auto; }

/* ---------- Hoja de instrucciones ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; display: flex; justify-content: center; align-items: flex-end; }
.sheet { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 20px 20px 0 0; width: min(640px, 100%); max-height: 86vh; overflow-y: auto; padding: 20px 18px calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); align-self: center; }
.sheet details { border-top: 1px solid var(--line); padding-top: 12px; }
.sheet details summary { font-weight: 600; font-size: 15px; }
.sheet .qa { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--ink-2); }
.sheet .qa b { color: var(--ink); display: block; margin-bottom: 2px; }
.sheet .qa p { margin: 0; white-space: pre-line; }

/* ---------- Barra de navegación ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: rgba(10,10,12,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar nav { max-width: 640px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: var(--tabbar-h); }
.tabbar button { border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 500; color: var(--muted); }
.tabbar button svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.tabbar button[aria-current="page"] { color: var(--ink); }
.tabbar button[aria-current="page"] svg { stroke: var(--accent); }
.side-brand { display: none; }

/* ---------- Login ---------- */
.login { min-height: 92vh; display: flex; flex-direction: column; justify-content: center; gap: 28px; max-width: 420px; margin: 0 auto; }
.login .wordmark { font-size: 22px; }
.login .tag { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .3em; text-transform: uppercase; margin-top: 8px; }
.msg { font-size: 13px; color: var(--muted); min-height: 18px; }

.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 70px); background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink); padding: 9px 16px; border-radius: 999px; font-size: 13px; z-index: 50; }
.demo-bar { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); padding: 8px 0 0; }
.demo-bar select { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 12px; }

/* ---------- Escritorio ---------- */
@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: 240px 1fr; }
  .tabbar { position: sticky; top: 0; height: 100vh; border-top: 0; border-right: 1px solid var(--line); background: var(--surface); padding: 24px 14px; }
  .tabbar nav { height: auto; grid-auto-flow: row; grid-auto-columns: auto; gap: 4px; }
  .tabbar button { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 12px; border-radius: 10px; font-size: 14px; }
  .tabbar button[aria-current="page"] { background: var(--accent-soft); }
  .side-brand { display: block; font-family: var(--font-display); letter-spacing: .3em; font-size: 15px; text-transform: uppercase; padding: 4px 12px 28px; }
  .side-brand span { color: var(--accent); }
  .side-brand small { display: block; font-family: var(--font-body); letter-spacing: .2em; font-size: 10px; color: var(--muted); margin-top: 6px; }
  .main { max-width: 760px; padding-bottom: 48px; }
  .main.has-timer { padding-bottom: 150px; }
  .top { grid-template-columns: 44px 1fr 44px; }
  .top .wordmark { visibility: hidden; }
  .timer { bottom: 20px; left: calc(50% + 120px); }
  .page { padding-top: 32px; }
  h1 { font-size: 40px; }
}
@media (max-width: 380px) {
  h1 { font-size: 28px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .stepper input { font-size: 22px; }
  .timer .clock { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Hoy ---------- */
.weigh { border-color: var(--line-strong); background: linear-gradient(180deg, rgba(227,38,54,.07), var(--surface) 60%); }
.weigh.done { background: var(--surface); border-color: var(--line); }
.weigh-in { display: flex; align-items: baseline; gap: 10px; border-bottom: 2px solid var(--line-strong); padding-bottom: 6px; }
.weigh-in:focus-within { border-color: var(--accent); }
.weigh-in input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 56px; font-weight: 600; letter-spacing: -.03em; padding: 0; }
.weigh-in input::placeholder { color: #3A3A42; }
.weigh-in span { font-size: 18px; color: var(--muted); }
.ic-inline { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 1.7; }
.cardio { display: flex; flex-direction: column; gap: 8px; }
.client .avatar svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 1.7; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.day-sep { align-self: center; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 8px 0 2px; }
.msg { max-width: 82%; padding: 10px 12px 6px; border-radius: 16px; display: flex; flex-direction: column; gap: 2px; }
.msg p { margin: 0; font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }
.msg time { align-self: flex-end; font-size: 10px; color: var(--muted); }
.msg.them { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; background: #2A1114; border: 1px solid rgba(227,38,54,.35); border-bottom-right-radius: 4px; }
.msg.adj { border-color: rgba(227,38,54,.5); }
.msg .tag { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.composer { position: sticky; bottom: calc(var(--tabbar-h) + 8px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 8px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; padding: 8px; }
.composer textarea { flex: 1; min-width: 0; border: 0; background: transparent; resize: none; outline: none; font-size: 15px; padding: 8px; max-height: 140px; }
.composer .btn { padding: 10px 14px; }
@media (min-width: 1024px) { .composer { bottom: 16px; } }
.prop-wrap { border-color: rgba(231,166,74,.4); }
.prop { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.prop:first-of-type { border-top: 0; padding-top: 0; }

/* ---------- Objetivo ---------- */
.objective h2 { font-size: 22px; }
.goal-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.goal-row .track { margin: 0; height: 6px; }
.track.goal i { background: var(--ok); }

/* ---------- Cierre de semana ---------- */
.weekclose { border-color: rgba(60,196,139,.35); }
.scale { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.scale button { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); border-radius: 8px; padding: 9px 0; font-size: 13px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.scale button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.dots { display: inline-flex; gap: 2px; margin: 0 6px 0 2px; vertical-align: middle; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.dots i.on { background: var(--ink-2); }

/* ---------- Dieta desplegable ---------- */
details.meal { padding: 0; }
details.meal > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 30px 1fr 20px; gap: 12px; align-items: center; padding: 14px 16px; }
details.meal > summary::-webkit-details-marker { display: none; }
details.meal > summary h2 { font-size: 20px; }
details.meal > summary .sub { font-size: 12px; }
details.meal .chev { color: var(--muted); font-size: 20px; transition: transform .2s ease; }
details.meal[open] .chev { transform: rotate(90deg); }
details.meal.next { border-color: rgba(227,38,54,.45); }
details.meal.next > summary .sub { color: var(--accent); font-weight: 600; }
details.meal.done > summary h2 { color: var(--muted); }
details.meal.done .badge { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
details.meal.next .badge { background: var(--accent); border-color: var(--accent); color: #fff; }
.meal-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); }
.meal-body .formula { padding-top: 12px; }
.meal-progress { display: flex; align-items: center; gap: 10px; }
.meal-progress .track { flex: 1; margin: 0; }

/* ---------- Vídeo ---------- */
.video .thumb { background: linear-gradient(135deg, #1C1C21, #0E0E11); overflow: hidden; }
.video .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rest-line { gap: 12px; flex-wrap: wrap; }
.private { border-color: rgba(231,166,74,.35); }

/* ---------- Accesos rápidos en la ficha ---------- */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.qbtn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; cursor: pointer; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.qbtn:hover { border-color: var(--line-strong); color: var(--ink); }
.qbtn svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 1.7; }
.activity .it .ic svg { width: 16px; height: 16px; }

/* ---------- Registro en un toque ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.chips.quick .chip { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; border-radius: 12px; min-width: 0; }
.chips.quick .chip b { font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.chips.quick .chip span { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.chips.quick .chip.main { background: var(--accent); border-color: var(--accent); }
.chips.quick .chip.main b, .chips.quick .chip.main span { color: #fff; }
.chips.quick .chip.main span { opacity: .85; }
.or { text-align: center; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: -2px; }
.chips.wide { display: grid; grid-template-columns: repeat(4, 1fr); }
.chip { border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 9px 12px; font-size: 13px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip:active { transform: scale(.97); }
.chip.main { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip:hover { border-color: var(--ink-2); color: var(--ink); }

/* ---------- Navegación por ejercicio ---------- */
.exnav { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 2px 0; }
.dot-nav { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; cursor: pointer; padding: 0; display: grid; place-items: center; color: var(--muted); }
.dot-nav::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.dot-nav.ok::before { background: var(--ok); }
.dot-nav.on { border-color: var(--accent); background: var(--accent-soft); }
.dot-nav.on::before { background: var(--accent); width: 8px; height: 8px; }
.dot-nav.flag::before { content: none; }
.dot-nav.flag svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; }
.dot-nav.flag.on { color: var(--accent); }
.exbar { position: sticky; bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: auto 1fr; gap: 8px; z-index: 15; }
.exbar .btn { width: 100%; box-shadow: 0 10px 24px -12px rgba(0,0,0,.9); }
.exbar .btn.ghost { background: var(--surface); }
@media (min-width: 1024px) { .exbar { bottom: 16px; } }

/* ---------- Final de sesión ---------- */
.finish-top { display: flex; align-items: center; gap: 12px; }
.finish-top svg { width: 28px; height: 28px; stroke: var(--muted); fill: none; stroke-width: 1.6; flex: none; }
.finish.ok { border-color: rgba(60,196,139,.4); background: linear-gradient(180deg, rgba(60,196,139,.07), var(--surface) 60%); }
.finish.ok .finish-top svg { stroke: var(--ok); }

/* ---------- Sin conexión / instalar ---------- */
.syncbar { display: flex; align-items: center; gap: 10px; background: var(--warn-soft); border: 1px solid rgba(231,166,74,.35); color: var(--ink-2); border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-top: 12px; }
.syncbar svg { width: 18px; height: 18px; stroke: var(--warn); fill: none; stroke-width: 1.8; flex: none; }
.install { border-style: dashed; }

.scale.ten { grid-auto-columns: 1fr; gap: 3px; }
.scale.ten button { padding: 10px 0; font-size: 12px; }

/* ---------- Arranque ---------- */
.splash { min-height: 90vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.splash .wordmark { font-size: 20px; }
.spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: sp .7s linear infinite; }
.spin.big { width: 22px; height: 22px; margin-top: 18px; }
@keyframes sp { to { transform: rotate(360deg) } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s } }

/* ---------- Esqueleto de carga ---------- */
.sk { background: linear-gradient(90deg, var(--surface-2) 25%, #1E1E23 37%, var(--surface-2) 63%); background-size: 400% 100%; border-radius: 6px; animation: shimmer 1.4s ease infinite; }
.card .sk + .sk { margin-top: 10px; }
.session-head .sk + .sk { margin-top: 10px; }
@keyframes shimmer { 0% { background-position: 100% 0 } 100% { background-position: 0 0 } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none } }

/* ---------- Estado de guardado ---------- */
.savechip { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 12px); display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink-2); box-shadow: 0 10px 24px -14px #000; transition: opacity .25s ease, transform .25s ease; }
.savechip svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.savechip.ok { color: var(--ok); border-color: rgba(60,196,139,.4); }
.savechip.err { color: var(--warn); border-color: rgba(231,166,74,.45); }
.savechip.out { opacity: 0; transform: translateX(-50%) translateY(-6px); pointer-events: none; }

/* ---------- Error ---------- */
.errbox { border-color: rgba(231,166,74,.4); }
.errhead { display: flex; align-items: center; gap: 12px; }
.errhead svg { width: 26px; height: 26px; stroke: var(--warn); fill: none; stroke-width: 1.7; flex: none; }

/* ---------- Estados vacíos ---------- */
.empty-state { align-items: center; text-align: center; padding: 30px 20px; }
.empty-art { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); }
.empty-art svg { width: 24px; height: 24px; stroke: var(--muted); fill: none; stroke-width: 1.6; }
.empty-state h2 { font-size: 20px; }
.empty-state .sub { max-width: 34ch; }

/* ---------- Login ---------- */
.login-brand { text-align: center; }
.pw { position: relative; }
.pw input { padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.pw-eye svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.msg.err { color: var(--warn); }
.login .link { align-self: center; }

/* ---------- Onboarding ---------- */
.onb { min-height: 88vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.onb h1 { font-size: 30px; }
.onb .sub { max-width: 32ch; }
.onb-dots { display: flex; gap: 6px; }
.onb-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.onb-dots i.on { background: var(--accent); width: 20px; border-radius: 4px; }
.onb-art { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid rgba(227,38,54,.3); margin: 8px 0; }
.onb-art svg { width: 38px; height: 38px; stroke: var(--accent); fill: none; stroke-width: 1.5; }
.onb-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 340px; margin-top: 18px; }
.onb-bar .btn.ghost:empty { visibility: hidden; }

/* ---------- Fotos ---------- */
.ph-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ph { margin: 0; display: flex; flex-direction: column; gap: 6px; cursor: pointer; min-width: 0; }
.ph img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); display: block; }
.ph figcaption { font-size: 11px; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph figcaption b { color: var(--ink); display: block; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmp .ph img { aspect-ratio: 3/4; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 200px; border: 1px dashed var(--line-strong); border-radius: 14px; background: var(--surface-2); cursor: pointer; padding: 16px; text-align: center; overflow: hidden; }
.dropzone.has { padding: 0; border-style: solid; min-height: 0; }
.dropzone img { width: 100%; max-height: 420px; object-fit: contain; display: block; border-radius: 13px; }
.dz-art { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); }
.dz-art svg { width: 24px; height: 24px; stroke: var(--accent); fill: none; stroke-width: 1.6; }
.dropzone b { font-size: 15px; }
.chips.wide3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.chips.wide3 .chip { justify-content: center; text-align: center; padding: 10px 6px; }

/* ---------- Gráficas ---------- */
.chart .raw { fill: var(--muted); opacity: .55; }
.chart .val { fill: var(--ink); font-size: 11px; font-weight: 600; font-family: var(--font-body); }
.chart .bar { fill: var(--line-strong); }
.chart .bar.now { fill: var(--accent); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 2px; background: var(--accent); border-radius: 2px; }
.lg.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.lg.goal { background: repeating-linear-gradient(90deg, var(--ok) 0 4px, transparent 4px 8px); height: 2px; }
.meter { display: flex; flex-direction: column; gap: 5px; }
.meter + .meter { padding-top: 12px; border-top: 1px solid var(--line); }
.meter-top { display: flex; align-items: baseline; justify-content: space-between; font-size: 14px; }
.meter-top b { font-size: 16px; }
.meter .track { margin: 0; height: 6px; }
.meter .sub { font-size: 12px; }

/* ---------- Dieta: qué comer ahora ---------- */
.plate { background: var(--accent-soft); border: 1px solid rgba(227,38,54,.25); border-radius: 12px; padding: 12px 14px; }
.plate-h { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.plate-l { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.plate-l li { font-size: 15px; color: var(--ink); padding-left: 14px; position: relative; }
.plate-l li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.plate-l b { font-variant-numeric: tabular-nums; }
.opts.pick li { grid-template-columns: 74px 1fr 20px; cursor: pointer; border-radius: 8px; padding: 8px 6px; margin-inline: -6px; border-bottom: 1px dashed var(--line); }
.opts.pick li.free { grid-template-columns: 1fr 20px; }
.opts.pick li.on { background: var(--surface-2); border-bottom-color: transparent; }
.opts.pick li.on .q, .opts.pick li.on span { color: var(--ink); }
.opts.pick li:hover { background: var(--surface-2); }
.tick-o { color: var(--ok); font-weight: 700; text-align: right; }
.exname { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; width: 100%; }
.exname h2 { color: var(--ink); }
