@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo.woff2') format('woff2-variations'), url('/fonts/archivo.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --bg: #000;
  --s1: #0d0d0d;
  --s2: #171717;
  --s3: #222;
  --line: #2a2a2a;
  --ink: #f4f3f1;
  --ink2: #b4b3b1;
  --ink3: #8c8b89;
  --o: #ff5a1f;
  --o-hi: #ff7a47;
  --o-dim: rgba(255, 90, 31, 0.14);
  --on-o: #000;

  --r-pill: 999px;
  --r-s: 6px;
  --gut: 16px;
  --tabh: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--s3) var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1rem/1.5 var(--font); font-stretch: 100%;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
::selection { background: var(--o); color: var(--on-o); }
::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--s3); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: var(--bg); }
a { color: inherit; }
p a, .note a { color: var(--o); text-underline-offset: 3px; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--o); outline-offset: 3px; border-radius: 4px; }
input, textarea { caret-color: var(--o); }
.ic { width: 24px; height: 24px; flex: none; }
.chev { width: 18px; height: 18px; color: var(--ink3); }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.shell { min-height: 100dvh; }
.view {
  max-width: 720px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--gut) calc(var(--tabh) + var(--safe-b) + 40px);
  font-variant-numeric: tabular-nums;
}
.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  height: calc(var(--tabh) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--ink3); font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  transition: color 150ms;
}
.tab[aria-current="page"] { color: var(--o); }
.tab:active .ic { transform: scale(0.9); }
.tab .ic { transition: transform 120ms var(--ease); }

@media (min-width: 960px) {
  .tabs { inset: 0 auto 0 0; width: 104px; height: auto; grid-template-columns: 1fr; grid-auto-rows: 84px; align-content: center; border-top: 0; border-right: 1px solid var(--line); padding: 0; }
  .view { max-width: 1080px; padding: 40px 48px 80px 152px; }
}

/* ---------- Tipo ---------- */
.display, .display-s, .display-m, .wordmark, .bignum, .clock, .rest-clock, .kphase {
  font-family: var(--font); font-stretch: 62%; font-weight: 800; text-transform: uppercase; letter-spacing: -0.005em;
}
.display { font-size: 4rem; line-height: 0.86; margin: 0; text-wrap: balance; }
.display-m { font-size: 2.6rem; line-height: 0.9; margin: 4px 0 12px; text-wrap: balance; }
.display-s { font-size: 1.9rem; line-height: 0.92; margin: 0; }
@media (min-width: 960px) { .display { font-size: 6rem; } .display-m { font-size: 3.5rem; } .display-s { font-size: 2.2rem; } }
.h2 { font-size: 1.125rem; font-weight: 700; margin: 0; letter-spacing: -0.005em; }
.h3 { font-size: 0.95rem; font-weight: 700; margin: 16px 0 6px; }
.mt { margin-top: 28px; }
.meta { color: var(--ink2); margin: 10px 0 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.meta .ic { width: 18px; height: 18px; color: var(--o); }
.meta.tight { margin: 0 0 12px; }
.small { color: var(--ink2); font-size: 0.875rem; margin: 8px 0; }
.lead { font-size: 1.125rem; color: var(--ink2); }
.sub { color: var(--ink3); font-size: 0.875rem; margin-left: auto; }
.plain { margin: 8px 0; padding-left: 1.1em; color: var(--ink2); }
.plain li { margin: 6px 0; padding-left: 4px; }
.plain li::marker { color: var(--o); content: '— '; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 1rem; text-decoration: none; white-space: nowrap;
  transition: transform 120ms var(--ease), background-color 150ms, opacity 150ms;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--o); color: var(--on-o); }
.btn.primary:hover { background: var(--o-hi); }
.btn.ghost { background: var(--s2); color: var(--ink); }
.btn.ghost:hover { background: var(--s3); }
.btn.done { background: transparent; color: var(--o); box-shadow: inset 0 0 0 2px var(--o); }
.btn.danger { background: var(--o); color: var(--on-o); width: 100%; margin: 20px 0 8px; }
.btn.xl { min-height: 64px; font-size: 1.125rem; font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.04em; width: 100%; }
.btn .ic { width: 22px; height: 22px; }
.btn:disabled { opacity: 0.4; }
.iconbtn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-pill); background: var(--s2); transition: transform 120ms var(--ease), background-color 150ms; flex: none; }
.iconbtn:active { transform: scale(0.92); background: var(--s3); }
.iconbtn.lg { width: 56px; height: 56px; }
.iconbtn.accent { background: var(--o); color: var(--on-o); }
.iconbtn:disabled { opacity: 0.4; }
.linkbtn { color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; padding: 10px 0; font-size: 0.875rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink2); text-decoration: none; padding: 8px 8px 8px 0; margin-bottom: 4px; font-weight: 600; min-height: 44px; }
.back .ic { width: 20px; height: 20px; }

/* ---------- Bloques ---------- */
.top { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.wordmark { font-size: 1.35rem; letter-spacing: 0.01em; }
.wordmark b { color: var(--o); font-weight: 800; }
.sync { width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink3); border-radius: var(--r-pill); }
.sync .ic { width: 20px; height: 20px; }
.sync[data-state="ok"] { color: var(--o); }
.sync[data-state="syncing"] .ic { animation: spin 1s linear infinite; }
.sync[data-state="error"] { color: #ff8f6b; }
@keyframes spin { to { transform: rotate(360deg); } }

.pagehead { margin: 8px 0 20px; }
.pagehead .meta { margin: 0 0 8px; }
.block { border-top: 1px solid var(--line); padding: 20px 0 22px; }
.rowhead, .rowlink { display: flex; align-items: baseline; gap: 12px; text-decoration: none; }
.rowlink { min-height: 32px; align-items: center; }
.rowlink .chev { margin-left: 4px; }
.grid2 { display: grid; gap: 0 32px; }
@media (min-width: 960px) { .grid2 { grid-template-columns: 1fr 1fr; } }

.note { display: flex; gap: 10px; align-items: flex-start; background: var(--s1); border-radius: var(--r-s); padding: 14px 16px; color: var(--ink2); font-size: 0.9375rem; margin: 12px 0 20px; }
.note .ic { color: var(--o); width: 20px; height: 20px; margin-top: 2px; }
.callout { background: var(--s1); border-radius: var(--r-s); padding: 14px 16px; color: var(--ink2); margin: 16px 0 0; }
.callout b { display: block; color: var(--ink); margin-bottom: 4px; }
.empty { color: var(--ink3); padding: 24px 0; margin: 0; }

/* ---------- Hoy ---------- */
.hero { padding: 8px 0 28px; }
.daynav { display: flex; align-items: center; gap: 8px; margin: 4px 0 18px; }
.daylabel { flex: 1; text-align: center; font-weight: 600; color: var(--ink2); min-height: 44px; border-radius: var(--r-pill); }
.hero .display { margin-bottom: 4px; }
.hero .btn.xl { margin-top: 24px; }
.kicker-date { color: var(--ink2); margin: 0 0 8px; font-weight: 600; }
.hero.gym .display { color: var(--ink); }

.kegel-dots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.kdot { height: 64px; border-radius: var(--r-pill); background: var(--s2); display: grid; place-items: center; text-decoration: none; font-weight: 700; color: var(--ink3); transition: background-color 200ms, color 200ms, transform 120ms var(--ease); }
.kdot:active { transform: scale(0.96); }
.kdot.on { background: var(--o); color: var(--on-o); }

.water { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.drops { flex: 1; display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.drops i { height: 28px; border-radius: 3px; background: var(--s2); transition: background-color 200ms; }
.drops i.on { background: var(--o); }

.meals { list-style: none; margin: 10px 0 0; padding: 0; }
.meals li > a, .meals li > div { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--s2); text-decoration: none; min-height: 52px; }
.meals li:last-child > * { border-bottom: 0; }
.mlabel { color: var(--ink3); font-size: 0.8125rem; font-weight: 600; }
.mtext { font-weight: 500; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: calc(var(--gut) * -1); padding-right: var(--gut); }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); background: var(--s2); font-weight: 600; font-size: 0.9375rem; white-space: nowrap; transition: background-color 150ms, color 150ms, transform 120ms var(--ease); }
.chip:active { transform: scale(0.96); }
.chip .ic { width: 18px; height: 18px; }
.chip.on { background: var(--o); color: var(--on-o); }

.checks { list-style: none; padding: 0; margin: 8px 0 0; }
.check { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; min-height: 52px; padding: 8px 0; }
.check .box { width: 28px; height: 28px; border-radius: 8px; box-shadow: inset 0 0 0 2px var(--s3); display: grid; place-items: center; flex: none; transition: background-color 150ms, box-shadow 150ms; }
.check .box .ic { width: 18px; height: 18px; color: var(--on-o); opacity: 0; transform: scale(0.6); transition: opacity 150ms, transform 200ms var(--ease); }
.check.on .box { background: var(--o); box-shadow: none; }
.check.on .box .ic { opacity: 1; transform: none; }
.check.on > span:not(.box):not(.qty) { color: var(--ink3); }
.check .qty { margin-left: auto; color: var(--ink3); font-size: 0.875rem; white-space: nowrap; padding-left: 12px; }
.check.big { align-items: flex-start; }
.check.big b { display: block; font-size: 1.0625rem; }
.check.big small { color: var(--ink3); font-size: 0.8125rem; }

/* ---------- Detalle ---------- */
.det { margin: 4px 0 12px; }
.det summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; color: var(--ink2); font-weight: 600; font-size: 0.9375rem; min-height: 44px; cursor: pointer; }
.det summary::-webkit-details-marker { display: none; }
.det summary .chev { transition: transform 200ms var(--ease); }
.det[open] summary .chev { transform: rotate(90deg); }
.det-body { color: var(--ink2); padding-bottom: 4px; }
.det-body p { margin: 4px 0 8px; max-width: 65ch; }

/* ---------- Ejercicios ---------- */
.exlist { display: grid; gap: 28px; margin: 8px 0 28px; }
@media (min-width: 960px) { .exlist { grid-template-columns: 1fr 1fr; gap: 40px 32px; } }
.ex-img { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #000; margin: 0 calc(var(--gut) * -1); }
@media (min-width: 600px) { .ex-img { margin: 0; border-radius: var(--r-s); } }
.ex-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 400ms var(--ease); }
.ex-img:active img { transform: scale(0.98); }
.play { position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, 0.82); color: var(--ink); border-radius: var(--r-pill); padding: 8px 14px 8px 10px; font-weight: 700; font-size: 0.875rem; }
.play .ic { width: 18px; height: 18px; color: var(--o); }
.ex-body { padding-top: 14px; }
.ex-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.spec { margin: 0; color: var(--ink2); }
.spec b { color: var(--ink); }
.hint { display: flex; gap: 8px; align-items: center; color: var(--o); font-weight: 600; margin: 10px 0 0; font-size: 0.9375rem; }
.hint .ic { width: 18px; height: 18px; }

.sets { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.set { display: grid; grid-template-columns: 22px 1fr auto 60px; align-items: center; gap: 10px; padding: 6px 0; transition: opacity 200ms; }
.set .n { color: var(--ink3); font-weight: 700; text-align: center; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper .iconbtn { width: 48px; height: 48px; }
.val { flex: 1; display: flex; align-items: baseline; justify-content: center; gap: 4px; min-width: 0; }
.val input { width: 100%; max-width: 92px; background: transparent; border: 0; text-align: right; font-size: 1.75rem; font-weight: 800; font-stretch: 75%; padding: 0; outline: none; font-variant-numeric: tabular-nums; }
.val input::placeholder { color: var(--ink3); }
.val span { color: var(--ink3); font-size: 0.8125rem; font-weight: 600; width: 22px; }
.reps { min-width: 44px; height: 44px; border-radius: var(--r-pill); color: var(--ink2); font-weight: 700; font-size: 0.9375rem; }
.reps:active { background: var(--s2); }
.setcheck { width: 60px; height: 52px; border-radius: var(--r-pill); background: var(--s2); color: var(--ink3); display: grid; place-items: center; transition: background-color 150ms, color 150ms, transform 120ms var(--ease); }
.setcheck:active { transform: scale(0.94); }
.set.done .setcheck { background: var(--o); color: var(--on-o); }
.set.done .val input, .set.done .n { color: var(--ink2); }

.finish { margin: 12px 0 24px; }
.alarm-link { display: flex; gap: 10px; align-items: flex-start; color: var(--ink3); font-size: 0.875rem; text-decoration: none; padding: 12px 0; }
.alarm-link .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* ---------- Caminadora ---------- */
.tread { border-top: 1px solid var(--line); padding: 20px 0; }
.tread-now { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 14px 0 12px; }
.tread-label { margin: 0; font-weight: 700; font-size: 1.25rem; }
.tread-detail { margin: 2px 0 0; color: var(--ink2); font-size: 0.9375rem; max-width: 40ch; }
.clock { font-size: 4.5rem; line-height: 0.85; margin: 0; font-variant-numeric: tabular-nums; }
.tread.hard .clock, .tread.hard .tread-label { color: var(--o); }
.tread-bar { display: flex; gap: 3px; height: 10px; }
.tread-bar i { background: var(--s2); border-radius: 2px; overflow: hidden; }
.tread-bar i.hard { background: var(--s3); }
.tread-bar b { display: block; height: 100%; background: var(--o); transform-origin: left; transform: scaleX(0); }

/* ---------- Descanso (hoja inferior) ---------- */
.rest {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(13, 13, 13, 0.92); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: calc(var(--safe-b) + 12px);
  transform: translateY(100%); transition: transform 320ms var(--ease);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6);
}
.rest.open { transform: none; }
.rest-bar { height: 4px; background: var(--s2); }
.rest-bar i { display: block; height: 100%; background: var(--o); transform-origin: left; }
.rest-inner { max-width: 720px; margin: 0 auto; padding: 14px var(--gut) 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 16px; }
.rest-label { margin: 0; color: var(--ink2); font-weight: 600; grid-column: 1; }
.rest-clock { margin: 0; font-size: 4.5rem; line-height: 0.85; grid-column: 1; font-variant-numeric: tabular-nums; }
.rest.over .rest-clock { color: var(--o); }
.rest-btns { grid-column: 2; grid-row: 1 / span 2; display: grid; gap: 8px; }
@media (min-width: 960px) { .rest { left: 104px; } }

/* ---------- Kegel ---------- */
.kegel-stage { position: relative; margin: 0 calc(var(--gut) * -1); background: radial-gradient(ellipse at 50% 60%, #1a0d07 0%, #000 65%); }
@media (min-width: 600px) { .kegel-stage { margin: 0; border-radius: var(--r-s); } }
#kcanvas { display: block; width: 100%; height: min(46vh, 420px); }
.kegel-panel { text-align: center; padding: 18px 0 8px; }
.kphase { font-size: 3.5rem; line-height: 0.9; margin: 0; color: var(--ink2); transition: color 150ms; }
.kphase.squeeze { color: var(--o); }
.kcount { color: var(--ink2); margin: 8px 0 16px; font-weight: 600; }
.kprog { height: 4px; background: var(--s2); border-radius: 2px; overflow: hidden; margin-bottom: 20px; }
.kprog i { display: block; height: 100%; background: var(--o); transform-origin: left; transform: scaleX(0); }

/* ---------- Comida ---------- */
.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gut) * -1) 20px; padding: 0 var(--gut); }
.seg::-webkit-scrollbar { display: none; }
.seg button { min-height: 44px; padding: 0 18px; border-radius: var(--r-pill); background: var(--s2); font-weight: 600; white-space: nowrap; transition: background-color 150ms, color 150ms; }
.seg button[aria-selected="true"] { background: var(--ink); color: #000; }
.plate-wrap { display: grid; gap: 24px; align-items: center; margin-bottom: 16px; }
@media (min-width: 720px) { .plate-wrap { grid-template-columns: 320px 1fr; } }
.plate { width: 100%; max-width: 320px; margin: 0 auto; display: block; }
.plate .rim { fill: var(--s1); stroke: var(--s3); stroke-width: 1; }
.plate .slices path { stroke: #000; stroke-width: 2; transform-origin: 100px 100px; animation: slice 700ms var(--ease) both; }
.plate .s1 { fill: var(--o); }
.plate .s2 { fill: #c44517; animation-delay: 120ms; }
.plate .s3 { fill: #6e2a10; animation-delay: 240ms; }
.plate .pl { fill: #000; font: 800 18px var(--font); font-stretch: 62%; text-anchor: middle; }
.plate .pls { fill: #000; font: 700 9px var(--font); text-anchor: middle; }
.plate .lt { fill: var(--ink); }
@keyframes slice { from { transform: scale(0.6) rotate(-30deg); opacity: 0; } }
.targets { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; margin: 0; }
.targets dt { color: var(--ink3); font-size: 0.8125rem; font-weight: 600; }
.targets dd { margin: 2px 0 0; font-size: 2.25rem; font-weight: 800; font-stretch: 62%; line-height: 1; }
.targets p { margin: 4px 0 0; color: var(--ink2); font-size: 0.8125rem; }
.week { display: grid; gap: 4px; }
.wday { border-top: 1px solid var(--line); padding: 8px 0; }
.wday.now .h3 { color: var(--o); }
.recipes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 12px; }
@media (min-width: 960px) { .recipes { grid-template-columns: repeat(3, 1fr); gap: 32px 20px; } }
.rcard { text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.rcard img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-s); background: var(--s1); margin-bottom: 6px; transition: transform 300ms var(--ease); }
.rcard:active img { transform: scale(0.98); }
.rtag { color: var(--ink3); font-size: 0.75rem; font-weight: 600; }
.rname { font-weight: 700; line-height: 1.25; }
.rnum { color: var(--o); font-size: 0.8125rem; font-weight: 600; }
.recipe .rhero { height: auto; width: calc(100% + var(--gut) * 2); margin: 0 calc(var(--gut) * -1); aspect-ratio: 4 / 3; object-fit: cover; display: block; }
@media (min-width: 600px) { .recipe .rhero { width: 100%; margin: 0; border-radius: var(--r-s); max-height: 460px; } }
.rbody { padding-top: 16px; }
.rnums { display: flex; gap: 6px 16px; align-items: baseline; color: var(--ink2); margin: 0 0 8px; flex-wrap: wrap; }
.rnums b { color: var(--o); font-size: 1.5rem; font-weight: 800; font-stretch: 75%; }
.rcols { display: grid; gap: 8px 40px; }
@media (min-width: 720px) { .rcols { grid-template-columns: 1fr 1.2fr; } }
.steps { padding-left: 1.4em; color: var(--ink2); }
.steps li { margin: 8px 0; padding-left: 4px; }
.steps li::marker { color: var(--o); font-weight: 800; }
.allies { display: grid; gap: 0; }
@media (min-width: 960px) { .allies { grid-template-columns: repeat(3, 1fr); gap: 32px; } }
.ally { border-top: 1px solid var(--line); padding: 20px 0; }
.ally-ic { width: 56px; height: 56px; border-radius: var(--r-pill); background: var(--o-dim); color: var(--o); display: grid; place-items: center; margin-bottom: 12px; }
.ally-ic .ic { width: 28px; height: 28px; }
.ally-ic.heart .ic { animation: beat 1.4s var(--ease) infinite; }
.ally-ic.bolt .ic { animation: flick 2.4s ease-in-out infinite; }
.ally-ic.liver .ic { animation: breathe-s 3.2s ease-in-out infinite; }
@keyframes beat { 0%, 60%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1.04); } 45% { transform: scale(1.12); } }
@keyframes flick { 0%, 100% { opacity: 1; } 48% { opacity: 1; } 50% { opacity: 0.35; } 52% { opacity: 1; } }
@keyframes breathe-s { 50% { transform: scale(1.08); } }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tags span { background: var(--s2); border-radius: var(--r-pill); padding: 6px 12px; font-size: 0.875rem; }

/* ---------- Progreso ---------- */
.bignum { display: flex; align-items: baseline; gap: 8px; }
.bignum .num { font-size: 5.5rem; line-height: 0.85; }
.bignum .unit { font-size: 1.5rem; color: var(--ink3); }
.goalbar { position: relative; height: 10px; background: var(--s2); border-radius: 5px; margin: 18px 0 26px; }
.goalbar i { position: absolute; inset: 0; background: var(--o); border-radius: 5px; transform-origin: left; transition: transform 600ms var(--ease); }
.goalbar span { position: absolute; top: 14px; font-size: 0.75rem; color: var(--ink3); }
.goalbar span:last-child { right: 0; }
.goalbar.thin { height: 6px; margin: 0; flex: 1; }
.logrow { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 8px 0 16px; }
.logrow label, .wk-form label { display: grid; gap: 4px; color: var(--ink3); font-size: 0.8125rem; font-weight: 600; flex: 1; min-width: 110px; position: relative; }
.logrow input, .wk-form input, .wk-form textarea {
  background: var(--s1); border: 1px solid var(--line); border-radius: 10px; min-height: 52px; padding: 0 40px 0 14px; font-size: 1.25rem; font-weight: 700; color: var(--ink); width: 100%; outline: none; transition: border-color 150ms;
}
.wk-form input, .wk-form textarea { padding: 0 14px; font-size: 1.05rem; }
.wk-form textarea { padding: 12px 14px; font-weight: 400; resize: vertical; }
.logrow input:focus, .wk-form input:focus, .wk-form textarea:focus { border-color: var(--o); }
.logrow label > span { position: absolute; right: 14px; bottom: 16px; color: var(--ink3); }
.chart { width: 100%; height: auto; display: block; margin-top: 8px; overflow: visible; }
.chart .line { fill: none; stroke: var(--o); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart .goal { stroke: var(--ink3); stroke-dasharray: 4 6; }
.chart .gl, .chart .ax { fill: var(--ink3); font: 600 12px var(--font); }
.chart .lv { fill: var(--ink); font: 800 16px var(--font); font-stretch: 75%; }
.chart .pt { fill: var(--o); }
.chart .last { fill: var(--o); stroke: #000; stroke-width: 3; }
.weeks { display: grid; margin-top: 8px; }
.wk { border-top: 1px solid var(--s2); }
.wk-row { display: grid; grid-template-columns: 36px repeat(4, 1fr); width: 100%; align-items: baseline; padding: 14px 0; text-align: left; font-weight: 700; font-size: 1.0625rem; }
.wk-row small { color: var(--ink3); font-size: 0.6875rem; font-weight: 600; margin-left: 4px; }
.wk-n { color: var(--ink3); }
.wk.cur .wk-n { color: var(--o); }
.wk.future .wk-row { color: var(--ink3); }
.wk-form { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; padding: 4px 0 18px; }
.wk-form .full, .wk-form .rate, .wk-form .btn { grid-column: 1 / -1; }
.rate { border: 0; padding: 0; margin: 0; display: flex; gap: 8px; }
.rate legend { color: var(--ink3); font-size: 0.8125rem; font-weight: 600; margin-bottom: 6px; padding: 0; }
.rate button { flex: 1; height: 48px; border-radius: var(--r-pill); background: var(--s2); font-weight: 800; }
.rate button.on { background: var(--o); color: var(--on-o); }

/* ---------- Coach ---------- */
.chat { display: grid; gap: 12px; padding-bottom: 12px; min-height: 30vh; align-content: start; }
.msg { max-width: 88%; padding: 12px 16px; border-radius: 18px; line-height: 1.45; }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin: 0; }
.msg ul { margin: 4px 0 8px; padding-left: 1.2em; } .msg li { margin: 4px 0; }
.msg.user { justify-self: end; background: var(--o); color: var(--on-o); border-bottom-right-radius: 6px; font-weight: 500; }
.msg.assistant { background: var(--s2); border-bottom-left-radius: 6px; }
.msg b { font-weight: 700; }
.typing { display: flex; gap: 5px; padding: 16px; width: fit-content; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink3); animation: dot 1s infinite; }
.typing i:nth-child(2) { animation-delay: 150ms; } .typing i:nth-child(3) { animation-delay: 300ms; }
@keyframes dot { 50% { opacity: 0.25; transform: translateY(-3px); } }
.ideas { flex-direction: column; align-items: flex-start; }
.ideas .chip { white-space: normal; text-align: left; padding: 10px 16px; }
.composer { position: sticky; bottom: calc(var(--tabh) + var(--safe-b) + 8px); display: flex; gap: 8px; align-items: flex-end; background: var(--bg); padding: 8px 0; }
@media (min-width: 960px) { .composer { bottom: 16px; } }
.composer textarea { flex: 1; background: var(--s1); border: 1px solid var(--line); border-radius: 26px; padding: 15px 18px; min-height: 56px; resize: none; outline: none; line-height: 1.4; }
.composer textarea:focus { border-color: var(--o); }

/* ---------- Más ---------- */
.menu { display: grid; }
.menu a { display: flex; align-items: center; gap: 16px; min-height: 64px; border-top: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 1.0625rem; }
.menu a .ic:first-child { color: var(--o); }
.menu a .chev { margin-left: auto; }
.supl { list-style: none; padding: 0; margin: 0; }
.supl li { border-top: 1px solid var(--line); padding: 12px 0 8px; }
.supl li .small { margin: 0 0 4px 42px; }
.supl li.opt { opacity: 0.85; }
.shopbar { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.shopbar b { font-size: 1.5rem; font-weight: 800; font-stretch: 75%; }
.timeline { list-style: none; margin: 0 0 12px; padding: 0; }
.timeline li { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--s2); color: var(--ink2); }
.timeline .hh { font-weight: 800; font-stretch: 75%; color: var(--ink); font-size: 1.0625rem; }
.timeline li.next .hh { color: var(--o); }
.timeline li.next { color: var(--ink); }
.breathe { position: relative; height: 220px; display: grid; place-items: center; margin: 12px 0 16px; }
.breathe i { position: absolute; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, var(--o) 0%, rgba(255, 90, 31, 0.35) 70%); }
.breathe.run i { animation: breath 10s infinite; }
@keyframes breath { 0% { transform: scale(1); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); } 40% { transform: scale(2.2); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); } 100% { transform: scale(1); } }
.breathe span { position: relative; font-weight: 800; font-stretch: 75%; font-size: 1.25rem; text-transform: uppercase; color: #000; mix-blend-mode: normal; }
.breathe:not(.run) span { color: var(--ink); }
.phases { list-style: none; margin: 0 0 8px; padding: 0; }
.phases li { border-top: 1px solid var(--line); padding: 16px 0; color: var(--ink2); }
.phases li b { display: block; color: var(--ink); font-size: 1.125rem; }
.phases li p { margin: 4px 0 0; max-width: 65ch; }
.phases li.now b, .phases li.now .wk-range { color: var(--o); }
.wk-range { font-size: 0.8125rem; font-weight: 700; color: var(--ink3); }
.alarm { list-style: none; padding: 0; margin: 0; }
.alarm li { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-top: 1px solid var(--line); font-size: 1.125rem; font-weight: 600; }
.alarm .ic { color: var(--o); margin-top: 2px; }
.status { color: var(--ink2); font-size: 0.875rem; }
.status[data-state="ok"] { color: var(--o); }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabh) + var(--safe-b) + 16px); transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #000; font-weight: 700; padding: 12px 20px; border-radius: var(--r-pill); transition: opacity 200ms, transform 300ms var(--ease); pointer-events: none; z-index: 40; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .rest { transition: opacity 150ms; }
  .breathe.run i { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .tabs, .rest { background: #0d0d0d; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
