/* Mesa · sistema visual.
   Lenguaje de registro de entrenamiento: tipografía técnica (IBM Plex), números grandes en mono, etiquetas chicas en mayúscula,
   líneas finas. El bloque «Ahora» va en alto contraste. La paleta cambia fuerte con el momento del día en Buenos Aires:
   mañana fría y nítida, tarde dorada, noche oscura. Elegido: T4 · C1 · D1 · M2 · M3 · A2 (las otras opciones quedan en /catalogo/). */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Sans+Condensed:wght@600;700&family=IBM+Plex+Mono:wght@400;500;600&family=EB+Garamond:ital,wght@1,600&family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=Fraunces:opsz,wght@9..144,700&family=Inter:wght@400;500;600;700&display=swap");

:root {
  /* Mañana y mediodía: luz fría y nítida */
  --bg: #f2f3f0; --surface: #ffffff; --surface-2: #eaebe7; --ink: #111312; --muted: #5d645f; --line: #d9dcd6;
  --accent: #9a6327; --accent-ink: #ffffff; --accent-soft: #e7e5df;
  --hero-bg: #111312; --hero-ink: #f2f3f0; --hero-muted: #9aa19c; --hero-line: #2b2f2c;
  --ok: #2f7a4f; --ok-soft: #dfeee4; --warn: #9a5410; --warn-soft: #f6e6d2; --anillo2: #3c6e9e;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --cond: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;
  --display: var(--sans); --display-style: normal; --display-weight: 700; --titulo: var(--sans); --nums: var(--mono);
  --r: 6px; --r-s: 4px;
  color-scheme: light;
}
:root[data-momento="mediodia"] { --bg: #f6f6f3; --accent: #a5651f; }
/* Tarde: hora dorada */
:root[data-momento="tarde"] {
  --bg: #e9dbc1; --surface: #faf3e6; --surface-2: #efe2c8; --ink: #22170c; --muted: #6b5940; --line: #d6c3a0;
  --accent: #b4561b; --accent-soft: #ead7b4;
  --hero-bg: #2a190b; --hero-ink: #f8ead0; --hero-muted: #c4a97f; --hero-line: #4a321d;
  --ok: #3b6e3f; --ok-soft: #dfe6cc; --warn: #a2470f; --warn-soft: #f2d9bd; --anillo2: #5a6f8c;
}
/* Noche */
:root[data-momento="noche"] {
  --bg: #121110; --surface: #1b1a18; --surface-2: #24221f; --ink: #eee8dd; --muted: #a39b8f; --line: #2f2c28;
  --accent: #cda876; --accent-ink: #1c1a17; --accent-soft: #2c261f;
  --hero-bg: #24211d; --hero-ink: #f4eee4; --hero-muted: #a39b8f; --hero-line: #3a3631;
  --ok: #8fc29b; --ok-soft: #1e2b21; --warn: #e3a35a; --warn-soft: #33261a; --anillo2: #8fb4dc;
  color-scheme: dark;
}

/* ------------------------------------------------------------------ catálogo (opciones no elegidas) */
:root[data-tipo="t1"] { --sans: "Inter", system-ui, sans-serif; --display: "EB Garamond", Georgia, serif; --display-style: italic; --display-weight: 600; --titulo: var(--sans); --cond: var(--sans); --nums: var(--sans); }
:root[data-tipo="t2"] { --sans: "Inter", system-ui, sans-serif; --display: "Bricolage Grotesque", sans-serif; --display-weight: 800; --titulo: "Bricolage Grotesque", sans-serif; --cond: "Bricolage Grotesque", sans-serif; --nums: var(--sans); }
:root[data-tipo="t3"] { --sans: "Inter", system-ui, sans-serif; --display: "Fraunces", Georgia, serif; --titulo: "Fraunces", Georgia, serif; --cond: "Fraunces", Georgia, serif; --nums: var(--sans); }
:root[data-tema="c2"] { --accent: #2e6b48; } :root[data-tema="c3"] { --accent: #2f5d8a; } :root[data-tema="c4"] { --accent: #d4520f; }
:root[data-momento="noche"][data-tema="c2"] { --accent: #79c495; } :root[data-momento="noche"][data-tema="c3"] { --accent: #8bb8e3; } :root[data-momento="noche"][data-tema="c4"] { --accent: #ff8a4c; }
:root[data-forma="d2"] { --r: 14px; --r-s: 10px; }
:root[data-forma="d2"] .card:not(.hero) { border-color: transparent; box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 22px rgba(0,0,0,.06); }
:root[data-forma="d3"] { --r: 2px; --r-s: 2px; }
:root[data-forma="d3"] .card { border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
@keyframes entrar { from { transform: translateY(8px); } to { transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.05); } 100% { transform: scale(1); } }
:root[data-anim="a2"] .card, :root[data-anim="a3"] .card { animation: entrar .3s ease-out; }
:root[data-anim="a3"] .festejo { animation: pop .5s ease; }

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { color: var(--ink); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; transition: background .6s ease, color .6s ease; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
p { margin: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h2 { font-family: var(--titulo); font-size: 16px; font-weight: 700; letter-spacing: -.005em; }

.marca { font-family: var(--display); font-style: var(--display-style); font-weight: var(--display-weight); font-size: 24px; letter-spacing: -.02em; line-height: 1; }
.etq { font-family: var(--mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.nota { font-size: 13px; color: var(--muted); }
.num { font-family: var(--nums); font-variant-numeric: tabular-nums; }
.grande { font-family: var(--nums); font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.grande small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grupo { display: flex; flex-direction: column; gap: 14px; }
.aviso { font-size: 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-s); padding: 6px 10px; }
.ok { color: var(--ok); }

.cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.contexto { display: flex; gap: 6px; flex-wrap: wrap; }
.dato { display: inline-flex; align-items: baseline; gap: 6px; font-size: 13px; font-weight: 600; padding: 5px 10px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); white-space: nowrap; }
.dato .etq { font-size: 10px; }
.dato.acento { border-color: var(--accent); }

/* Botones */
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 10px 14px; font-weight: 600; font-size: 14px; }
.btn:hover { border-color: var(--ink); }
.btn.principal { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.link { background: none; border: none; padding: 4px 0; color: var(--accent); font-weight: 600; }
.btn.grande { padding: 15px 18px; font-size: 16px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; flex: 0 0 auto; }
.seg button { border: none; background: var(--surface); padding: 7px 11px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg.chico button { padding: 6px 9px; font-size: 12.5px; }
.seg.chico button.hay[aria-pressed="true"] { background: var(--ok); color: var(--surface); }
.seg.chico button.poco[aria-pressed="true"] { background: var(--warn); color: var(--surface); }
.campo { width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r); padding: 10px 12px; }

/* Tarjetas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* «Ahora»: alto contraste */
.hero { background: var(--hero-bg); color: var(--hero-ink); border-color: var(--hero-bg); padding: 18px; gap: 14px; }
:root[data-momento="noche"] .hero { border-color: var(--hero-line); box-shadow: inset 0 2px 0 var(--accent); }
.hero .etq, .hero .nota { color: var(--hero-muted); }
.hero-top { display: flex; justify-content: space-between; }
.hero .momento { font-family: var(--cond); font-weight: 700; font-size: 44px; line-height: .95; text-transform: uppercase; letter-spacing: -.01em; }
.hero .sugerencia { font-size: 18px; line-height: 1.38; font-weight: 500; }
.hero .falta { font-size: 12.5px; font-weight: 600; color: var(--hero-bg); background: var(--warn-soft); border-radius: var(--r-s); padding: 3px 8px; }
.hero .acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.hero .btn { background: transparent; border-color: var(--hero-line); color: var(--hero-ink); }
.hero .btn:hover { border-color: var(--hero-muted); }
.hero .btn.principal { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.consejo { font-size: 14px; border-radius: var(--r-s); padding: 9px 11px; background: var(--surface-2); }
.hero .consejo { background: rgba(255,255,255,.07); }
.consejo.fuerte { border-left: 3px solid var(--warn); font-weight: 600; }
.hero .consejo.fuerte { background: rgba(227,163,90,.16); }

/* Línea del día: columna de horarios + línea con estados */
.linea { list-style: none; margin: 0; padding: 0; }
.paso { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; }
.paso .h { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; padding-top: 9px; font-variant-numeric: tabular-nums; }
.paso .cuerpo { position: relative; border-left: 2px solid var(--line); padding: 7px 0 16px 18px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.paso:last-child .cuerpo { border-left-color: transparent; }
.paso .cuerpo::before { content: ""; position: absolute; left: -7px; top: 11px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--muted); }
.paso .n { font-weight: 600; }
.paso .btn.link { align-self: flex-start; }
.paso.pasado:not(.hecho) .n { color: var(--muted); }
.paso.hecho .cuerpo::before { background: var(--ok); border-color: var(--ok); }
.paso.actual .cuerpo::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.paso.actual .h { color: var(--ink); font-weight: 600; }
.paso.entreno .cuerpo::before { border-radius: 3px; border-color: var(--ink); background: var(--ink); }
.paso.entreno .n { font-family: var(--cond); text-transform: uppercase; letter-spacing: .02em; }

/* Motivación */
.motiva { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .motiva { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.frase-card { gap: 8px; }
.frase { font-family: var(--titulo); font-size: 18px; line-height: 1.32; font-weight: 600; letter-spacing: -.005em; }
.objetivos { flex-direction: row; align-items: center; gap: 16px; }
.anillos-svg { width: 96px; height: 96px; flex: 0 0 auto; transform: rotate(-90deg); }
.anillos-svg circle { fill: none; stroke-width: 11; }
.anillos-svg .fondo { stroke: var(--surface-2); }
.anillos-svg .valor { stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.anillos-svg .v0 { stroke: var(--accent); } .anillos-svg .v1 { stroke: var(--ok); } .anillos-svg .v2 { stroke: var(--anillo2); }
.leyenda { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.leyenda .l { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding-left: 12px; position: relative; }
.leyenda .l::before { content: ""; position: absolute; left: 0; top: 5px; width: 6px; height: 6px; border-radius: 50%; }
.leyenda .l0::before { background: var(--accent); } .leyenda .l1::before { background: var(--ok); } .leyenda .l2::before { background: var(--anillo2); }
.leyenda b { font-size: 14px; }
.festejo { background: var(--ok-soft); color: var(--ok); border-radius: var(--r); padding: 10px 12px; font-weight: 600; }

/* Medidas (peso y pasos) */
.medidas { flex-direction: row; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.medida { display: flex; flex-direction: column; gap: 4px; flex: 1 1 120px; min-width: 0; }
.medida input { width: 100%; font-family: var(--mono); font-size: 22px; font-weight: 600; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r); padding: 6px 10px; font-variant-numeric: tabular-nums; }

/* Listas */
.filtros { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filtros::-webkit-scrollbar { display: none; }
.lista { display: flex; flex-direction: column; }
.item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.item:first-child { border-top: none; }
.item .tick { width: 26px; height: 26px; border-radius: var(--r-s); border: 2px solid var(--ink); background: none; flex: 0 0 auto; }
.item.hecho { opacity: .45; text-decoration: line-through; }
.item.hecho .tick { background: var(--ink); }
.prio { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-top: 2px; }
.prio.p1 { color: var(--accent); }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 6px; }
.check { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--r); padding: 9px 10px; background: var(--surface); text-align: left; font-size: 14px; }
.check .caja { width: 18px; height: 18px; border: 2px solid var(--muted); border-radius: 4px; flex: 0 0 auto; display: grid; place-items: center; }
.check[aria-pressed="true"] { border-color: var(--ok); }
.check[aria-pressed="true"] .caja { border-color: var(--ok); background: var(--ok); }
.check[aria-pressed="true"] .caja::after { content: ""; width: 8px; height: 4px; border: 2px solid var(--surface); border-top: none; border-right: none; transform: rotate(-45deg) translate(1px, -1px); }

/* Entreno */
.semana { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.sem-dia { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-s); padding: 8px 2px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.sem-dia b { font-family: var(--cond); font-size: 13px; text-transform: uppercase; }
.sem-dia.t-gym { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.sem-dia.t-gym .etq { color: inherit; opacity: .7; }
.sem-dia.t-running { border-color: var(--accent); color: var(--accent); }
.sem-dia.t-descanso b, .sem-dia.t-libre b { color: var(--muted); }
.sem-dia.hoy { outline: 2px solid var(--accent); outline-offset: 1px; }
.ejercicio { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 11px 0; border: none; border-top: 1px solid var(--line); background: none; text-align: left; width: 100%; }
.ejercicio:first-child { border-top: none; }
.ejercicio .n { font-weight: 600; }
.cuenta { font-size: 13px; font-weight: 600; padding: 3px 8px; border-radius: var(--r-s); background: var(--surface-2); }
.cuenta.ok { background: var(--ok-soft); color: var(--ok); }
.serie { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.contador { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; background: var(--surface-2); }
.contador .valor { font-size: 34px; font-weight: 600; line-height: 1; }
.contador .ctrl { display: flex; gap: 8px; }
.contador .ctrl button { width: 48px; height: 42px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); font-size: 20px; font-weight: 600; }
.rir { display: flex; gap: 6px; flex-wrap: wrap; }
.hechas { display: flex; gap: 6px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stats .grande { font-size: 24px; }

/* Calendario de actividad con emojis (en el iPhone se ven los de Apple) */
.emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; line-height: 1; }
.semana-ini, .mes { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.semana-ini span { text-align: center; }
.dia { aspect-ratio: 1 / 1; max-width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-s); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 4px 2px; min-width: 0; }
.dia .n { font-size: 11px; color: var(--muted); }
.dia .emoji { font-size: clamp(13px, 3.6vw, 20px); white-space: nowrap; overflow: hidden; max-width: 100%; }
.dia.hoy { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.dia.futuro { opacity: .45; }
.dia.vacio { border: none; background: none; }
.emojis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.emoji-btn { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.emoji-btn .emoji { font-size: 28px; }
.emoji-btn[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.spark { width: 100%; height: 56px; display: block; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; }

/* Hoja inferior (restaurante, serie, día) */
.velo { position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.hoja { width: 100%; max-width: 560px; background: var(--surface); border-radius: 14px 14px 0 0; padding: 18px max(16px, env(safe-area-inset-left)) calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; max-height: 90vh; overflow: auto; }
@media (min-width: 900px) { .velo { align-items: center; } .hoja { border-radius: 12px; } }
.pasos-lista { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.sub { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--r); font-size: 14px; z-index: 30; max-width: 92vw; display: flex; gap: 14px; align-items: center; }
.toast button { border: none; background: none; color: var(--bg); font-weight: 700; text-decoration: underline; padding: 0; }
@media (min-width: 900px) { .toast { bottom: 24px; } }

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