@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-700.woff2") format("woff2"); }

/* Paleta «acero y brasa»: gris acero neutro y un único acento de metal al rojo. */
:root {
  --bg: #eef0f2;
  --surface: #ffffff;
  --surface-2: #e4e7ea;
  --text: #1a1e23;
  --muted: #5e656d;
  --border: #d5d9de;
  --accent: #c2410c;
  --accent-strong: #9a3412;
  --accent-soft: #fbe3d6;
  --on-accent: #ffffff;
  --warn: #9a5b00;
  --warn-soft: #fdf0d8;
  --danger: #b42318;
  --ok: #15803d;
  --chart-2: #7a8591;
  --accent-inverse: #ff8a3d;
  --shadow: none;
  --radius: 14px;
  color-scheme: light;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: "Barlow Condensed", "Barlow", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171a;
    --surface: #1d2125;
    --surface-2: #262b30;
    --text: #e9e7e4;
    --muted: #949aa1;
    --border: #2e3338;
    --accent: #ff8a3d;
    --accent-strong: #ffa866;
    --accent-soft: #3a2416;
    --on-accent: #1a0d04;
    --warn: #f5b84d;
    --warn-soft: #3a2a0d;
    --danger: #f87171;
    --ok: #4ade80;
    --chart-2: #8a929b;
    --accent-inverse: #c2410c;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14171a;
  --surface: #1d2125;
  --surface-2: #262b30;
  --text: #e9e7e4;
  --muted: #949aa1;
  --border: #2e3338;
  --accent: #ff8a3d;
  --accent-strong: #ffa866;
  --accent-soft: #3a2416;
  --on-accent: #1a0d04;
  --warn: #f5b84d;
  --warn-soft: #3a2a0d;
  --danger: #f87171;
  --ok: #4ade80;
  --chart-2: #8a929b;
  --accent-inverse: #c2410c;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; font-weight: 600; }
h1 { font-size: 1.7rem; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
/* Cifras: condensada y gruesa, como un marcador de gimnasio. */
.num, .stat b, .timer, .rest strong, .day-num, .tab strong, .medal-count, .sets input, .reco-val {
  font-family: var(--font-num); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em;
}
p { margin: 0 0 .75rem; }
a { color: var(--accent); }
small, .muted { color: var(--muted); }
button, input, select { font: inherit; color: inherit; }

.container { max-width: 680px; margin: 0 auto; padding: 16px; }

/* Barra superior */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { font-family: var(--font-num); font-weight: 700; font-size: 1.35rem; letter-spacing: .06em; line-height: 1; text-decoration: none; color: var(--accent); }
#topbar-title { color: var(--muted); font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Barra de navegación inferior */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px 10px; font-size: .75rem; text-decoration: none; color: var(--muted);
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--accent); font-weight: 600; }

/* Tarjetas */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card.accent { background: var(--accent-soft); border-color: transparent; }
.card.warn { background: var(--warn-soft); border-color: transparent; }
.card > :last-child { margin-bottom: 0; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.section-title { font-size: .95rem; color: var(--text); margin: 20px 0 8px; font-weight: 600; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px;
  border-radius: 12px; border: 1px solid transparent;
  background: var(--accent); color: var(--on-accent);
  font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent-strong); }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: .88rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; margin-top: 16px; }
.btn-row > .btn { flex: 1; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; font-size: inherit; }

/* Opciones seleccionables */
.options { display: grid; gap: 8px; }
.options.cols-2 { grid-template-columns: repeat(2, 1fr); }
.options.cols-3 { grid-template-columns: repeat(3, 1fr); }
.options.cols-5 { grid-template-columns: repeat(5, 1fr); }
.option {
  text-align: left; padding: 12px 14px; min-height: 48px;
  border-radius: 12px; border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer;
}
.option strong { display: block; }
.option span { display: block; font-size: .86rem; color: var(--muted); }
.option.center { text-align: center; }
.option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.option[aria-pressed="true"] strong { color: var(--accent-strong); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-size: .82rem; white-space: nowrap;
}
.chip.accent { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.chip.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); font-weight: 600; }

/* Formularios */
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .88rem; color: var(--muted); margin-bottom: 4px; }
input[type="number"], input[type="text"], select {
  width: 100%; min-height: 44px; padding: 8px 12px;
  border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface);
}
input:focus-visible, select:focus-visible, .option:focus-visible, .btn:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* Progreso */
.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .3s; }
.steps-head { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }

/* Pestañas de semanas */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.tab {
  padding: 8px 4px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface);
  text-align: center; cursor: pointer; text-decoration: none; color: var(--text); font-size: .85rem; line-height: 1.25;
}
.tab strong { display: block; font-size: .95rem; }
.tab.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }

/* Día y ejercicios */
.day-card { display: block; text-decoration: none; color: inherit; }
.day-card:hover { border-color: var(--accent); }
.day-num {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); font-weight: 700;
}
.day-card.done .day-num { background: var(--accent); color: var(--on-accent); }
.ex-card h3 a { color: inherit; text-decoration: none; }
.ex-card h3 a:hover { color: var(--accent); }
.group-tag { font-size: .8rem; font-weight: 600; color: var(--accent); }
.note { font-size: .88rem; color: var(--warn); margin-top: 6px; }
.reco { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .88rem; }
.reco strong { font-size: 1.05rem; color: var(--accent-strong); }
/* Peso sugerido: la cifra que se mira con la barra en la mano. */
.reco.big { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; background: var(--accent-soft); padding: 12px 14px; border-radius: 12px; }
.reco-label { display: block; font-size: .8rem; color: var(--muted); }
.reco-val { display: block; font-size: 3rem; line-height: .95; color: var(--accent-strong); }
.reco-val small { font-size: 1.2rem; margin-left: 4px; }
.reco-side { text-align: right; font-size: .82rem; color: var(--muted); }
.reco-side b { display: block; font-family: var(--font-num); font-size: 1.35rem; color: var(--text); line-height: 1.1; }
.reco-last { margin-top: 6px; font-size: .85rem; color: var(--muted); }
.sets { width: 100%; border-collapse: collapse; margin-top: 10px; }
.sets th { font-size: .75rem; font-weight: 600; color: var(--muted); text-align: left; padding: 0 4px 4px; }
.sets td { padding: 3px 4px; }
.sets td:first-child { width: 44px; color: var(--muted); font-size: .88rem; }
.sets input { min-height: 40px; padding: 6px 8px; text-align: center; font-size: 1.15rem; }
.sets input::placeholder { font-family: var(--font); font-weight: 400; font-size: .95rem; }
.sets td:last-child { width: 48px; text-align: right; }
.set-check {
  width: 40px; height: 40px; border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer; display: grid; place-items: center;
}
.set-check svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.5; opacity: .25; }
.set-check[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.set-check[aria-pressed="true"] svg { opacity: 1; }
tr.done td input { background: var(--accent-soft); border-color: transparent; }
details summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
details ol { margin: 8px 0 0; padding-left: 20px; }
details li { margin-bottom: 4px; }

/* Tablas */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Estadísticas */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 10px; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; }
.stat span { font-size: .78rem; color: var(--muted); }

/* Gráficas */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--accent); }
.chart .barv { fill: var(--chart-2); opacity: .85; }
.chart .val { fill: var(--text); font-size: 12px; font-family: var(--font-num); font-weight: 700; }

/* Héroe de bienvenida */
.hero { padding: 28px 20px; }
.hero h1 { font-size: 1.9rem; }
.hero ul { padding-left: 20px; margin: 12px 0 0; }
.hero li { margin-bottom: 4px; }

/* Temporizador y avisos */
.rest, .toast {
  position: fixed; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 20; transition: .2s;
}
.rest.show, .toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.rest {
  display: flex; align-items: center; gap: 10px;
  background: var(--text); color: var(--bg); padding: 8px 10px 8px 16px; border-radius: 14px;
  box-shadow: 0 6px 24px rgb(0 0 0 / .25);
}
.rest strong { font-size: 1.6rem; min-width: 52px; }
.rest .btn.ghost { color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); }
.rest .btn.ghost:hover { background: transparent; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; max-width: calc(100% - 32px); text-align: center; }


.timer { font-size: 3.2rem; text-align: center; margin: 8px 0; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.compare { font-variant-numeric: tabular-nums; }
.up { color: var(--ok); font-weight: 600; }
.down { color: var(--danger); font-weight: 600; }

@media (max-width: 420px) {
  .options.cols-3, .options.cols-5 { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat b { font-size: 1.4rem; }
  .tab { font-size: .75rem; }
}

/* Figura animada de ejercicios */
.anim { display: grid; place-items: center; background: var(--surface-2); border-radius: 12px; margin: 8px 0 10px; padding: 4px; }
.anim.pair { grid-template-columns: 1fr 1fr; gap: 4px; }
.figure { width: 100%; max-width: 200px; height: auto; display: block; }
.fg-limb, .fg-torso { fill: none; stroke: var(--text); stroke-linecap: round; stroke-linejoin: round; }
.fg-limb { stroke-width: 6; }
.fg-limb.far { opacity: .35; }
.fg-torso { stroke-width: 8; }
.fg-head { fill: var(--text); }
.fg-floor { stroke: var(--border); stroke-width: 2; }
.fg-furn { fill: var(--border); }
.fg-furn-line { stroke: var(--border); stroke-width: 3; stroke-linecap: round; }
.fg-furn-line.thick { stroke-width: 4; }
.fg-bar { stroke: var(--muted); stroke-width: 4; stroke-linecap: round; }
.fg-weight { fill: var(--accent); }
.fg-plate { fill: none; stroke: var(--accent); stroke-width: 4; }
.fg-band { stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 5 3; }
.fg-cable { stroke: var(--muted); stroke-width: 1.5; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gallery figure { margin: 0; padding: 8px; }
.gallery .anim { margin: 0 0 4px; }
.gallery.poses { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.anim.frames { grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }

/* Medallas */
.medal {
  flex: none; display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%; font-size: 20px; line-height: 1;
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / .15), 0 1px 3px rgb(0 0 0 / .2);
}
.medal.gold { background: radial-gradient(circle at 35% 30%, #fff6c9, #f2c230 55%, #b8860b); }
.medal.silver { background: radial-gradient(circle at 35% 30%, #ffffff, #c9d1d8 55%, #8a96a0); }
.medal.bronze { background: radial-gradient(circle at 35% 30%, #ffe1c4, #d08a4f 55%, #8c5225); }
.medal.small { width: 16px; height: 16px; font-size: 0; margin: 0 4px 0 10px; vertical-align: -3px; box-shadow: none; }
.medal-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.medal-row:last-child { border-bottom: 0; }
.medal-count { font-weight: 600; font-variant-numeric: tabular-nums; }
.pr-banner {
  display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  background: linear-gradient(90deg, color-mix(in srgb, #f2c230 22%, transparent), transparent);
  animation: pr-pop .5s ease-out;
}
@keyframes pr-pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pr-banner { animation: none; } }
.option:disabled { opacity: .5; cursor: not-allowed; }
.toast { z-index: 21; }

/* Pop-ups explicativos */
button.chip { border: 0; font: inherit; font-size: .82rem; cursor: pointer; }
.chip.info, .info-link { text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.info-link { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.info-link.strong { font-weight: 700; }
.group-tag.info-link { font-size: .8rem; font-weight: 600; color: var(--accent); }
.pop {
  position: fixed; z-index: 30; width: min(300px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px; box-shadow: 0 10px 30px rgb(0 0 0 / .18);
  font-size: .9rem; opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .15s, transform .15s;
}
.pop.show { opacity: 1; pointer-events: auto; transform: none; }
.pop p { margin: 8px 0 0; }
.pop .pop-scale { color: var(--muted); font-size: .84rem; }
.pop-close { background: none; border: 0; color: var(--muted); font-size: 1rem; cursor: pointer; padding: 2px 4px; min-width: 32px; min-height: 32px; }
@media (prefers-reduced-motion: reduce) { .pop { transition: none; } }

/* Hoy: bloque del siguiente entrenamiento y mes en segmentos */
.today { display: block; text-decoration: none; color: inherit; padding: 18px; }
.today:hover { border-color: var(--accent); }
.today h2 { font-size: 1.5rem; margin: 2px 0 12px; }
.today-nums { display: flex; gap: 24px; }
.today-nums b { display: block; font-size: 2.4rem; line-height: 1; }
.today-nums span { font-size: .8rem; color: var(--muted); }
.month-head { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 8px; }
.month-head b { font-size: 1.5rem; }
.month-head b small { font-size: 1rem; color: var(--muted); }
.segs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.segs > div { display: flex; gap: 3px; }
.segs i { flex: 1; height: 8px; border-radius: 2px; background: var(--border); }
.segs i.on { background: var(--accent); }
.segs-label { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 4px; font-size: .75rem; color: var(--muted); }

/* Listas en filas sencillas */
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { color: var(--accent); }
.list-row .chev { color: var(--muted); }

/* Aviso con acción (Deshacer) */
.toast { display: flex; align-items: center; gap: 12px; width: max-content; }
.toast-act { background: none; border: 0; color: var(--accent-inverse); font-weight: 700; cursor: pointer; padding: 6px 4px; min-height: 36px; }

/* Modo entreno: pantalla completa, una mano, acción principal en la zona del pulgar */
body.focus-mode { padding-bottom: 0; }
body.focus-mode .tabbar { display: none; }
body.focus-mode .rest, body.focus-mode .toast { bottom: calc(108px + env(safe-area-inset-bottom)); }
body.focus-mode:has(.focus.is-rest) .rest { display: none; }
.focus { display: flex; flex-direction: column; min-height: calc(100dvh - 54px - 32px); }
.focus-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.focus-arrows { display: flex; gap: 6px; }
.focus-arrows .btn { min-width: 44px; min-height: 44px; font-size: 1.2rem; }
.focus-dots { display: flex; gap: 4px; flex: 1; justify-content: center; }
.focus-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.focus-dots i.part { background: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.focus-dots i.on { background: var(--accent); }
.focus-dots i.cur { outline: 2px solid var(--text); outline-offset: 2px; }
.focus-body { flex: 1; display: flex; flex-direction: column; padding-top: 14px; }
.focus-ex h1 { font-size: 1.6rem; margin: 2px 0 8px; }
.focus-how { margin-top: 8px; }
.focus-center { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 16px 0; }
.focus-setno { font-size: 1.05rem; margin: 0 0 6px; }
.focus-setno b { font-size: 1.6rem; color: var(--accent-strong); }
.pips { display: flex; gap: 6px; margin-bottom: 18px; }
.pips i { width: 26px; height: 6px; border-radius: 3px; background: var(--border); }
.pips i.on { background: var(--accent); }
.pips i.cur { background: var(--text); }
.stepper { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 10px; width: 100%; max-width: 360px; }
.step-btn {
  height: 64px; border-radius: 16px; border: 1.5px solid var(--border); background: var(--surface);
  font-size: 2rem; line-height: 1; cursor: pointer; touch-action: manipulation; user-select: none;
}
.step-btn:active { background: var(--surface-2); }
.step-val { display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.step-val input {
  width: 100%; max-width: 150px; min-height: 64px; border: 0; background: transparent; text-align: center; padding: 0;
  font-family: var(--font-num); font-weight: 700; font-size: 3.4rem; line-height: 1; color: var(--accent-strong);
  -moz-appearance: textfield;
}
.step-val input::-webkit-outer-spin-button, .step-val input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step-val span { font-size: 1.1rem; color: var(--muted); }
.step-label { font-size: .85rem; color: var(--muted); margin: 2px 0 16px; }
.step-hint { font-size: .85rem; color: var(--muted); max-width: 340px; margin: 0; }
.focus-actions {
  position: sticky; bottom: 0; z-index: 5;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: var(--bg);
}
.focus-main { min-height: 60px; font-size: 1.15rem; border-radius: 16px; }
.focus-sub { display: block; margin: 10px auto 0; font-size: .9rem; min-height: 32px; }
.focus-timer { font-size: 5.5rem; line-height: 1; margin: 6px 0 16px; }
.rest-full .bar { width: 100%; max-width: 320px; }
.focus-next { margin-top: 22px; color: var(--muted); line-height: 1.5; }
.focus-next strong { color: var(--text); }
.focus-complete { font-size: 1.2rem; font-weight: 600; color: var(--ok); }
.focus-big { font-size: 3rem; margin: 0; }
.today-nums b small { font-size: 1.1rem; color: var(--muted); }

/* Hoja inferior */
.sheet-wrap { position: fixed; inset: 0; z-index: 25; background: rgb(0 0 0 / 0); transition: background .2s; display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap.show { background: rgb(0 0 0 / .4); }
.sheet {
  width: 100%; max-width: 680px; max-height: 85dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 20px 20px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .2s ease-out;
}
.sheet-wrap.show .sheet { transform: none; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 12px; }
.sheet h3 { margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-wrap { transition: none; } }

/* Cambiar ejercicio */
.swap-scope { margin-bottom: 8px; }
.swap-row { display: flex; align-items: stretch; gap: 8px; border-bottom: 1px solid var(--border); }
.swap-pick { flex: 1; text-align: left; background: none; border: 0; padding: 12px 0; min-height: 56px; cursor: pointer; }
.swap-pick strong { display: block; }
.swap-pick span { font-size: .84rem; color: var(--muted); }
.swap-pick .chip { vertical-align: 1px; margin-left: 4px; }
.swap-pick:hover strong { color: var(--accent); }
.swap-see { flex: none; width: 48px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .9rem; }
.swap-anim { margin: 8px 0; }
.swap-anim[hidden], .swap-row[hidden] { display: none; }
.swap-more { display: block; margin: 12px auto 0; }
.swap-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 16px; }
.muted-link { color: var(--muted); }
.ex-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ex-head h3 { margin: 0 0 .25rem; }
.icon-btn {
  flex: none; width: 44px; height: 44px; margin: -8px -8px 0 0; border: 0; border-radius: 12px;
  background: none; color: var(--muted); font-size: 1.15rem; cursor: pointer;
}
.icon-btn:hover { color: var(--accent); background: var(--surface-2); }
.focus-tools { display: flex; gap: 18px; margin-top: 8px; }
.focus-tools .link { text-decoration: none; font-size: .92rem; min-height: 32px; }
.focus-how summary { font-size: .92rem; }

/* Biblioteca */
.lib-search { margin-bottom: 10px; }
.lib-chips { margin-bottom: 10px; }
.lib-chips .chip { min-height: 34px; padding: 4px 12px; }
.lib-mine { font-size: .92rem; margin-bottom: 4px; }
.lib-count { font-size: .85rem; margin: 6px 0; }
.lib-row[hidden] { display: none; }

/* Notas y discos */
.ex-icons { display: flex; flex: none; }
.ex-icons .icon-btn { margin-right: 0; }
.ex-icons .icon-btn:last-child { margin-right: -8px; }
.note-last { font-size: .86rem; color: var(--muted); margin: 6px 0 0; }
.note-last::before { content: "✎ "; }
.note-input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); font: inherit; resize: vertical; }
.note-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.plates-table td, .plates-table th { padding: 8px 4px; }
.plates-note { font-size: .84rem; margin: 8px 0 0; }

/* Progreso: calendario, peso corporal y series por grupo */
.cal-nav { display: flex; }
.cal-nav .icon-btn { margin: 0; font-size: 1.3rem; }
.cal-nav .icon-btn:disabled { opacity: .3; cursor: default; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 10px; text-align: center; }
.cal b { font-size: .75rem; font-weight: 600; color: var(--muted); padding-bottom: 2px; }
.cal span { height: 38px; display: grid; place-items: center; border-radius: 10px; font-size: .88rem; font-variant-numeric: tabular-nums; }
.cal span.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.cal span.today { outline: 2px solid var(--text); outline-offset: -2px; }
.cal-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: .9rem; color: var(--muted); }
.cal-foot b { font-size: 1.3rem; color: var(--text); }
.bw-now { font-size: 2.2rem; line-height: 1; }
.grp-row { display: grid; grid-template-columns: 70px 1fr 52px; align-items: center; gap: 10px; padding: 6px 0; font-size: .9rem; }
.grp-row b { text-align: right; font-size: 1.15rem; }
.grp-row b small { font-size: .85rem; color: var(--muted); }
.today-note { margin: 0 0 10px; font-weight: 600; }
.options.cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.options.cols-7 .option { padding: 10px 0; }

/* Alimentación */
.tabs.cols-5 { grid-template-columns: repeat(5, 1fr); }
.tab small { display: block; font-size: .75rem; color: var(--muted); }
.tab.active small { color: inherit; }
.food-days { margin-bottom: 14px; }
.food-days .option { text-decoration: none; color: inherit; padding-inline: 0; }
.food-days .option.is-today strong { text-decoration: underline; text-underline-offset: 3px; }
.food-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 10px; }
.food-head .chip { flex-shrink: 0; }
.meal-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px;
  width: 100%; min-height: 56px; padding: 10px 0; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--border); cursor: pointer;
}
.meal-row:last-child { border-bottom: 0; }
.meal-row small { grid-column: 1; font-size: .8rem; }
.meal-row strong { grid-column: 1; font-weight: 500; }
.meal-row .chev { grid-column: 2; grid-row: 1 / span 3; color: var(--muted); }
.meal-row.static { cursor: default; }
.meal-row:not(.static):hover strong { color: var(--accent); }
.meal-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ingr, .how { margin: 0; padding-left: 20px; }
.ingr li, .how li { margin-bottom: 4px; }
.buy-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 0;
  background: none; border: 0; border-bottom: 1px solid var(--border); text-align: left; cursor: pointer;
}
.buy-row:last-child { border-bottom: 0; }
.buy-check { width: 26px; height: 26px; flex-shrink: 0; border-radius: 8px; border: 1.5px solid var(--border); display: grid; place-items: center; }
.buy-check svg { width: 18px; height: 18px; fill: none; stroke: var(--on-accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.buy-qty { color: var(--muted); font-size: .9rem; text-align: right; }
.buy-row[aria-pressed="true"] .buy-check { background: var(--accent); border-color: var(--accent); }
.buy-row[aria-pressed="true"] .buy-check svg { opacity: 1; }
.buy-row[aria-pressed="true"] .grow, .buy-row[aria-pressed="true"] .buy-qty { color: var(--muted); text-decoration: line-through; }
.sticky-actions {
  position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 5;
  padding: 12px 0; background: var(--bg);
}
body:has(.sticky-actions) .toast { bottom: calc(150px + env(safe-area-inset-bottom)); }
.food-stepper { margin: 0 auto; }
.food-stepper .step-btn { height: 56px; }
.food-stepper .step-val input { font-size: 2.6rem; min-height: 56px; }
.dislikes .option { padding-inline: 6px; }
.dislikes .option strong { font-size: .9rem; font-weight: 500; }
