/* Serie — estilos. Móvil primero. Oscuro por defecto. */
/* Tipografías propias (Barlow / Barlow Condensed, licencia OFL), servidas desde la app para funcionar sin conexión */
@font-face { font-family: 'Barlow'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/barlow-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/barlow-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/barlow-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/barlow-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-style: normal; font-display: swap; src: url('../fonts/barlow-condensed-latin-800-normal.woff2') format('woff2'); }


:root {
  --sat: env(safe-area-inset-top, 0px); /* hueco de la muesca; 0 cuando la app va dentro de otro visor (Claude) */
  color-scheme: dark;
  --bg: #0f1210;
  --surface: #171b18;
  --surface-2: #1f2521;
  --surface-3: #283029;
  --line: #2f3731;
  --text: #edf1ec;
  --muted: #a3aea5;
  --accent: #b8e04a;
  --accent-strong: #c8ef5c;
  --accent-ink: #10140c;
  --accent-text: #c9ec6a;
  --accent-soft: rgba(184, 224, 74, 0.12);
  --warn: #f0b64a;
  --warn-soft: rgba(240, 182, 74, 0.12);
  --danger: #ff8d7e;
  --danger-soft: rgba(255, 141, 126, 0.12);
  --ok: #82dba3;
  --focus: #eaff9e;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.25);
  --radius: 16px;
  --radius-sm: 10px;
  --gutter: 16px;
  --nav-h: calc(64px + env(safe-area-inset-bottom));
  --bar-h: 88px;
  --kb: 0px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f1;
  --surface: #ffffff;
  --surface-2: #eef0ea;
  --surface-3: #e2e6dd;
  --line: #d3d9cf;
  --text: #141814;
  --muted: #4c564e;
  --accent: #a3cf2c;
  --accent-strong: #93bd22;
  --accent-ink: #10140c;
  --accent-text: #3b5b00;
  --accent-soft: rgba(120, 160, 20, 0.12);
  --warn: #8a5600;
  --warn-soft: rgba(200, 140, 20, 0.14);
  --danger: #b3261e;
  --danger-soft: rgba(179, 38, 30, 0.1);
  --ok: #1d7a44;
  --focus: #3b5b00;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 18px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f4f5f1; --surface: #ffffff; --surface-2: #eef0ea; --surface-3: #e2e6dd; --line: #d3d9cf;
    --text: #141814; --muted: #4c564e; --accent: #a3cf2c; --accent-strong: #93bd22; --accent-text: #3b5b00;
    --accent-soft: rgba(120, 160, 20, 0.12); --warn: #8a5600; --warn-soft: rgba(200, 140, 20, 0.14);
    --danger: #b3261e; --danger-soft: rgba(179, 38, 30, 0.1); --ok: #1d7a44; --focus: #3b5b00;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 18px rgba(0, 0, 0, 0.05);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.45 var(--font);
  overflow-x: hidden;
  min-height: 100dvh;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; overflow-wrap: anywhere; }
h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; }
.h3, h3 { font-size: 1.05rem; display: flex; align-items: center; gap: .4rem; }
p { margin: 0 0 .75rem; }
a { color: var(--accent-text); }
button, input, select, textarea { font: inherit; color: inherit; }
svg { flex: none; }
.num, .stat-num, .bigclock-num, .step-input, .set-pos-num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.block { display: block; }
.center { text-align: center; justify-content: center; }
.grow { flex: 1; }
.pre { white-space: pre-wrap; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; border-radius: 8px; }
.skip:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* ---------- estructura ---------- */
#app { min-height: 100dvh; }
.main { min-width: 0; padding-bottom: calc(var(--nav-h) + 24px); }
#view:focus { outline: none; }
.page { width: 100%; max-width: 760px; margin: 0 auto; padding: calc(16px + var(--sat)) max(var(--gutter), env(safe-area-inset-right)) 24px max(var(--gutter), env(safe-area-inset-left)); }
.page-wide { max-width: 1280px; }
.page-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; flex: 1; min-width: 0; }
.section-title { margin: 1.5rem 0 .75rem; display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }

/* navegación: inferior en móvil */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav ul { list-style: none; margin: 0; padding: 0 max(4px, env(safe-area-inset-left)); display: grid; grid-template-columns: repeat(5, 1fr); }
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 64px; padding: 6px 2px; color: var(--muted); text-decoration: none; font-size: .75rem; font-weight: 600;
}
.nav a svg { width: 24px; height: 24px; }
.nav a[aria-current="page"] { color: var(--accent-text); }
.nav a[aria-current="page"] svg { stroke-width: 2.4; }
.nav-brand, .nav-foot { display: none; }
body.immersive .nav { display: none; }
body.immersive { --nav-h: 0px; }
body.immersive .main { padding-bottom: 24px; }

/* aviso de guardado */
.savebar {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  position: fixed; top: calc(8px + var(--sat)); left: 50%; transform: translateX(-50%) translateY(-200%);
  z-index: 60; background: var(--surface-3); color: var(--text); border: 1px solid var(--line);
  padding: .4rem .9rem; border-radius: 999px; font-size: .85rem; font-weight: 600; box-shadow: var(--shadow);
  transition: transform .2s ease, opacity .2s ease; max-width: calc(100vw - 32px); text-align: center; pointer-events: none; opacity: 0;
}
.savebar[data-status="saving"], .savebar[data-status="saved"], .savebar[data-status="error"] { opacity: 1; }
.savebar[data-status="saving"], .savebar[data-status="saved"], .savebar[data-status="error"] { transform: translateX(-50%) translateY(0); }
.savebar[data-status="saved"]::before { content: "✓ "; color: var(--ok); }
.savebar[data-status="error"] { background: var(--danger); color: #fff; }

/* ---------- componentes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); min-width: 0;
}
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; font-weight: 700; color: var(--muted); margin-bottom: .35rem; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.hero-title { font-size: 1.5rem; }
.hero .btn-xl { margin-top: .5rem; }
.empty { text-align: center; padding: 28px 16px; }
.empty-icon { display: inline-flex; width: 56px; height: 56px; border-radius: 50%; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: .75rem; }
.empty.error h1 { color: var(--danger); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .55rem 1rem; border-radius: 12px; border: 1px solid transparent;
  font-weight: 650; cursor: pointer; text-decoration: none; line-height: 1.15; text-align: center;
  background: var(--surface-2); color: var(--text); touch-action: manipulation;
}
.btn svg { width: 20px; height: 20px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:not(:disabled):hover { background: var(--accent-strong); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:not(:disabled):hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
:root:not([data-theme="light"]) .btn-danger { color: #1a0b08; }
.btn-danger-text { color: var(--danger); }
.btn-sm { min-height: 44px; padding: .4rem .75rem; font-size: .9rem; }
.btn-xl { width: 100%; min-height: 56px; font-size: 1.1rem; border-radius: 14px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; flex: none;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); }
.icon-btn:disabled { opacity: .35; }
.icon-btn.sm { width: 44px; height: 44px; }
.row-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }

.chip {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 26px; padding: .15rem .6rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: .8rem; font-weight: 600; color: var(--text); white-space: nowrap;
}
.chip svg { width: 16px; height: 16px; }
.chip-btn { min-height: 44px; padding: .35rem .85rem; cursor: pointer; font-size: .9rem; }
.chip-btn.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip-ok, .chip-hecha { color: var(--ok); }
.chip-warn, .chip-en_curso { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.chip-pend { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.chip-group { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
.chip-today { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip-live { color: var(--accent-ink); background: var(--accent); }
.chip-type { color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.badge { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .05em; padding: .1rem .4rem; border-radius: 6px; background: var(--surface-3); color: var(--muted); vertical-align: middle; }
.badge-demo { background: var(--warn-soft); color: var(--warn); }

.notice { padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--surface-2); border-left: 4px solid var(--accent); }
.notice-warn { border-left: 4px solid var(--warn); }
.card.notice-warn { background: color-mix(in srgb, var(--surface) 88%, var(--warn) 6%); }

/* formularios */
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; margin-bottom: .75rem; }
.field > span { font-size: .85rem; font-weight: 650; color: var(--muted); }
input:not([type="checkbox"]):not([type="file"]), select, textarea {
  width: 100%; min-height: 48px; padding: .6rem .75rem; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface-2); color: var(--text); min-width: 0;
}
textarea { min-height: 80px; resize: vertical; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.check { display: flex; gap: .65rem; align-items: flex-start; min-height: 44px; padding: .35rem 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: .1rem; accent-color: var(--accent); flex: none; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 .75rem; }
@media (min-width: 480px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span2, .form-grid .span-all { grid-column: 1 / -1; }
}
.toolbar { display: flex; gap: .5rem; align-items: flex-start; }
.toolbar .field { margin: 0; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; scrollbar-width: none; }
.tab { flex: 1; text-align: center; padding: .75rem .5rem; min-height: 44px; color: var(--muted); text-decoration: none; font-weight: 700; border: 0; background: none; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tab[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .75rem; display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.s-card .stat { background: var(--surface-2); }
.stat-num { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stat-num small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.stat-label { font-size: .75rem; color: var(--muted); overflow-wrap: break-word; hyphens: auto; }

/* diálogos */
.dlg { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.dlg::backdrop { background: rgba(0, 0, 0, .55); }
.dlg-form { display: flex; flex-direction: column; max-height: calc(100dvh - 26px); }
.dlg-head { display: flex; align-items: center; gap: .5rem; padding: 12px 12px 0 16px; }
.dlg-head h2 { flex: 1; margin: 0; font-size: 1.1rem; }
.dlg-body { padding: 12px 16px; overflow-y: auto; }
.dlg-actions { display: flex; gap: .5rem; justify-content: flex-end; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); flex-wrap: wrap; }
.dlg-actions .btn { flex: 1 1 auto; }
.dlg-error { color: var(--danger); font-weight: 600; }

.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(max(var(--nav-h), var(--kb)) + var(--bar-h) + 8px); z-index: 70; display: flex; flex-direction: column; gap: .4rem; width: min(480px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--surface-3); border: 1px solid var(--line); color: var(--text); padding: .65rem .9rem; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; transition: opacity .4s, transform .4s; }
.toast-error { border-color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* barra de acción principal fija */
.primary-bar {
  position: fixed; left: 0; right: 0; z-index: 45;
  bottom: max(var(--nav-h), var(--kb));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  padding: 12px max(var(--gutter), env(safe-area-inset-right)) 12px max(var(--gutter), env(safe-area-inset-left));
}
body.immersive .primary-bar { padding-bottom: calc(12px + env(safe-area-inset-bottom)); bottom: var(--kb); }
.primary-bar-inner { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: .35rem; }
.primary-bar-inner .muted { margin: 0; text-align: center; }
.page:has(.primary-bar), .session { padding-bottom: calc(var(--bar-h) + 40px); }

/* ---------- Plan ---------- */
.week-nav { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; flex-wrap: wrap; }
.week-nav span { font-weight: 700; flex: 1; min-width: 0; text-align: center; }
.week, .sched-list, .routine-list, .ex-list, .hist-list, .marks, .item-edit-list, .set-edit-list, .detail-items, .plain { list-style: none; margin: 0; padding: 0; }
.day { border-bottom: 1px solid var(--line); padding: .75rem 0; }
.day.is-today .day-name { color: var(--accent-text); }
.day-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.day-name { font-weight: 700; text-transform: capitalize; flex: 1; min-width: 0; }
.day-empty { margin: .25rem 0 0; }
.sched { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .75rem; margin-top: .5rem; }
.sched-main { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .4rem; }
.sched-name { font-weight: 700; overflow-wrap: anywhere; }
.sched-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.routine-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.routine-head h3 { margin: 0; flex: 1; min-width: 0; }
.routine-items { margin: .25rem 0 .5rem 1.1rem; padding: 0; font-size: .9rem; color: var(--muted); }
.ex-row { width: 100%; display: flex; flex-direction: column; gap: .15rem; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .65rem .85rem; margin-bottom: .4rem; cursor: pointer; min-height: 44px; }
.ex-row:hover { background: var(--surface-2); }
.ex-name { font-weight: 650; overflow-wrap: anywhere; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

/* ---------- Importador / editor ---------- */
.review { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 960px) {
  .review { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .orig-card { position: sticky; top: 16px; max-height: calc(100dvh - 140px); overflow: auto; }
}
.orig-card summary, .help summary, .s-list-details summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; gap: .4rem; }
.orig { list-style: none; margin: .5rem 0 0; padding: 0; font: .85rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.orig li { display: flex; gap: .6rem; padding: .1rem .35rem; border-radius: 6px; }
.orig .ln { color: var(--muted); min-width: 2ch; text-align: right; user-select: none; flex: none; }
.orig .lt { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.orig .l-ok { background: var(--accent-soft); }
.orig .l-warn { background: var(--warn-soft); }
.warn-card { border-color: var(--warn); }
.warn-card ul { margin: 0; padding-left: 1.1rem; }
.item-edit.has-pending { border-color: var(--danger); }
.item-edit-head { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.item-num { display: inline-flex; min-width: 32px; height: 32px; padding: 0 .4rem; align-items: center; justify-content: center; border-radius: 8px; background: var(--surface-3); font-weight: 800; font-size: .9rem; }
.flags { margin: .25rem 0 .5rem; }
.flag { margin: 0 0 .3rem; font-size: .88rem; padding: .35rem .6rem; border-radius: 8px; }
.flag-aviso { background: var(--warn-soft); color: var(--warn); }
.flag-pendiente { background: var(--danger-soft); color: var(--danger); }
.flag-ok { color: var(--ok); padding-left: 0; }
.proposal { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .6rem .75rem; background: var(--accent-soft); border-radius: var(--radius-sm); margin-bottom: .5rem; }
.proposal p { margin: 0; flex: 1 1 200px; }
.set-edit { background: var(--surface-2); border-radius: var(--radius-sm); padding: .6rem .7rem .1rem; margin-bottom: .5rem; border: 1px solid transparent; }
.set-edit.is-pending { border-color: var(--danger); }
.set-edit-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.set-edit-head select { flex: 1; min-height: 44px; }
.set-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .5rem; }
@media (min-width: 560px) { .set-edit-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.set-edit-grid .field { margin-bottom: .5rem; }
.set-edit-grid input, .set-edit-grid select { min-height: 44px; padding: .45rem .55rem; background: var(--surface); }
.fill-all { display: inline-flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.fill-all .field { margin: 0; width: 170px; }

/* ---------- Sesión ---------- */
.session { padding: calc(8px + var(--sat)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); max-width: 1600px; margin: 0 auto; }
.s-head { display: flex; align-items: center; gap: .5rem; padding: 4px 0 10px; position: sticky; top: 0; z-index: 30; background: var(--bg); }
.s-title { flex: 1; min-width: 0; }
.s-routine { font-size: 1.05rem; margin: 0; overflow-wrap: anywhere; }
.s-meta { color: var(--muted); font-size: .82rem; }
.s-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.s-list .card, .s-list-details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px; }
.s-list-details[open] { padding-bottom: 10px; }
.is-resting .s-side { order: -1; }
.s-card { padding: 16px; }
.ex-head { margin-bottom: .6rem; }
.ex-title { display: flex; gap: .5rem; align-items: flex-start; }
.ex-name-full { font-size: 1.35rem; margin: 0 0 .4rem; overflow-wrap: anywhere; hyphens: auto; }
.ficha { margin-top: .6rem; background: var(--surface-2); border-radius: var(--radius-sm); padding: .6rem .8rem; }
.ficha dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; font-size: .9rem; }
.ficha dt { color: var(--muted); font-weight: 650; }
.ficha dd { margin: 0; overflow-wrap: anywhere; }
.set-pos { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .25rem 0 .5rem; }
.set-pos-num { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.set-pos-num small { font-size: 1.1rem; color: var(--muted); font-weight: 650; }
.target { margin: 0 0 .35rem; overflow-wrap: anywhere; }
.target-label, .last-label { display: inline-block; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: .35rem; }
.last { margin: 0 0 .75rem; padding: .5rem .7rem; border-left: 3px solid var(--line); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: .92rem; }
.last-list { margin: .25rem 0 0; padding-left: 1.2rem; }
.measured { font-size: 1.05rem; }
.inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: .75rem 0 .25rem; }
.stepper { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.stepper label { font-weight: 700; font-size: .9rem; }
.stepper-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 4px; align-items: stretch; }
.step-btn { min-height: 56px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; touch-action: manipulation; }
.step-btn:active { background: var(--surface-3); }
.step-input { text-align: center; font-size: 1.6rem !important; font-weight: 800; min-height: 56px !important; padding: .2rem !important; }
.is-draft .step-input { color: var(--muted); font-style: italic; }
.stepper-unit { font-size: .8rem; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.draft-note { margin: .2rem 0 .5rem; }
.add-load { align-self: end; }
.sec-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .75rem 0; }
.set-rows { list-style: none; margin: 0; padding: 0; }
.sr { margin-bottom: 4px; }
.sr-btn { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; background: var(--surface-2); border: 1px solid transparent; border-radius: 10px; padding: .5rem .6rem; min-height: 48px; color: var(--text); }
button.sr-btn { cursor: pointer; }
button.sr-btn > svg { width: 18px; height: 18px; color: var(--muted); }
.sr.is-current .sr-btn { border-color: var(--accent); background: var(--accent-soft); }
.sr-n { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); font-weight: 800; font-size: .8rem; flex: none; }
.sr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sr-plan { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.sr-done { font-weight: 650; overflow-wrap: anywhere; }
.sr-status { width: 24px; height: 24px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.sr-status svg { width: 16px; height: 16px; }
.st-completada .sr-status { background: var(--accent); color: var(--accent-ink); }
.st-omitida .sr-done, .st-no_realizada .sr-done { color: var(--warn); }

.bigclock { display: flex; flex-direction: column; align-items: center; padding: .5rem 0 .75rem; }
.bigclock-num { font-size: clamp(4rem, 22vw, 7.5rem); font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.bigclock-label { color: var(--muted); font-weight: 650; margin-top: .35rem; text-align: center; }
.rest { border-color: var(--accent); }
.rest.is-over { border-color: var(--warn); background: color-mix(in srgb, var(--surface) 90%, var(--warn) 8%); }
.rest.is-over .bigclock-num { color: var(--warn); }
.rest.is-over .bigclock-label { color: var(--warn); font-weight: 800; }
.rest.is-up .bigclock-num { color: var(--muted); }
.rest-ctrl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-bottom: .75rem; }
.rest-ctrl:has(> :only-child) { grid-template-columns: 1fr; }
.rest-ctrl .btn { min-height: 52px; font-size: 1rem; }
.prev { border-top: 1px solid var(--line); padding-top: .75rem; display: flex; flex-direction: column; gap: .5rem; }
.prev-title { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.side-rest { font-size: 2rem; font-weight: 800; margin: 0; }
.pause-card { text-align: center; border-color: var(--warn); }
.ex-progress { list-style: none; margin: .25rem 0 0; padding: 0; }
.ex-progress li { display: flex; flex-direction: column; gap: .25rem; padding: .5rem .25rem; border-bottom: 1px solid var(--line); }
.ex-progress li:last-child { border-bottom: 0; }
.ex-progress li.is-current .ep-name { color: var(--accent-text); font-weight: 750; }
.ex-progress li.is-done .ep-name { color: var(--muted); }
.ep-name { overflow-wrap: anywhere; font-size: .92rem; }
.dots { display: flex; gap: 4px; flex-wrap: wrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--line); }
.dot.st-completada { background: var(--accent); border-color: var(--accent); }
.dot.st-omitida, .dot.st-no_realizada { background: var(--warn); border-color: var(--warn); }
.dot.is-current { outline: 2px solid var(--text); outline-offset: 1px; }

/* ---------- Historial ---------- */
.hist { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; color: var(--text); }
.hist:hover { background: var(--surface-2); }
.hist-date { font-size: .8rem; color: var(--muted); font-weight: 700; text-transform: capitalize; }
.hist-name { font-weight: 750; font-size: 1.05rem; overflow-wrap: anywhere; }
.hist-match { overflow-wrap: anywhere; }
.pvr { list-style: none; margin: .5rem 0 0; padding: 0; }
.pvr-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 44px; grid-template-areas: "n plan edit" "n done edit"; gap: .2rem .6rem; align-items: center; padding: .5rem 0; border-top: 1px solid var(--line); }
.pvr-row .sr-n { grid-area: n; align-self: start; }
.pvr-row .pvr-col:nth-of-type(2) { grid-area: plan; }
.pvr-row .pvr-col:nth-of-type(3) { grid-area: done; }
.pvr-row .icon-btn { grid-area: edit; }
.pvr-col { display: flex; flex-direction: column; overflow-wrap: anywhere; min-width: 0; }
.pvr-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; }
.pvr-row.st-omitida .pvr-col:nth-of-type(3), .pvr-row.st-no_realizada .pvr-col:nth-of-type(3) { color: var(--warn); }
@media (min-width: 640px) {
  .pvr-row { grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr) 44px; grid-template-areas: "n plan done edit"; }
}
.mark h3 { flex-wrap: wrap; }
.mark-dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; margin: 0; }
.mark-dl dt { color: var(--muted); }
.mark-dl dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Perfil ---------- */
.settings .h3 { margin-top: 1rem; }
.settings .h3:first-child { margin-top: 0; }
.settings small.muted { font-size: .8rem; }
.danger-zone { border-color: var(--danger); }

/* ---------- tablet: sesión a dos columnas ---------- */
@media (min-width: 768px) {
  :root { --gutter: 24px; }
  .s-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); grid-template-areas: "list list" "main side"; }
  .s-list { grid-area: list; }
  .s-main { grid-area: main; }
  .s-side { grid-area: side; position: sticky; top: 64px; }
  .is-resting .s-side { order: 0; }
  .bigclock-num { font-size: clamp(4rem, 9vw, 6.5rem); }
}

/* ---------- escritorio: barra lateral ---------- */
@media (min-width: 1024px) {
  :root { --nav-h: 0px; }
  #app { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
  .nav { position: sticky; top: 0; height: 100dvh; border-top: 0; border-right: 1px solid var(--line); padding: 20px 12px; display: flex; flex-direction: column; background: var(--surface); }
  .nav ul { display: flex; flex-direction: column; gap: 4px; padding: 0; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: .75rem; min-height: 48px; padding: 0 .9rem; font-size: .95rem; border-radius: 12px; }
  .nav a:hover { background: var(--surface-2); }
  .nav a[aria-current="page"] { background: var(--accent-soft); }
  .nav-brand { display: flex; align-items: center; gap: .6rem; padding: 0 .6rem 1.25rem; font-weight: 800; font-size: 1.2rem; }
  .brand-mark { width: 30px; height: 30px; flex: 0 0 auto; color: var(--accent); display: block; }
  body.immersive .nav { display: flex; }
  .main { padding-bottom: 32px; }
  .primary-bar { left: 220px; }
  .page { padding-top: 32px; }
  h1 { font-size: 1.9rem; }
}

/* ---------- escritorio ancho: sesión a tres columnas ---------- */
@media (min-width: 1200px) {
  .s-grid { grid-template-columns: minmax(220px, 1fr) minmax(0, 2.2fr) minmax(300px, 1.4fr); grid-template-areas: "list main side"; }
  .s-list { position: sticky; top: 64px; max-height: calc(100dvh - 180px); overflow: auto; }
  .primary-bar-inner { max-width: 640px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .btn-primary, .chip-btn.is-on { border: 2px solid ButtonText; }
}

.set-summary { list-style: none; margin: .25rem 0 0; padding: 0; }
.set-summary li { display: flex; gap: .55rem; align-items: flex-start; padding: .35rem 0; border-top: 1px solid var(--line); font-size: .92rem; overflow-wrap: anywhere; }
.set-summary li > span:last-child { min-width: 0; padding-top: .1rem; }
.proposal-pend { background: var(--danger-soft); }
h1[tabindex="-1"]:focus { outline: none; }

.item-num { white-space: nowrap; }
.next-strip { margin: 0 0 .75rem; padding: .55rem .7rem; background: var(--surface-2); border-radius: 10px; overflow-wrap: anywhere; font-size: .95rem; }
.qrow { display: grid; grid-template-columns: auto repeat(5, minmax(0, 1fr)); gap: 6px; align-items: center; }
.qrow-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qlabel { font-size: .8rem; font-weight: 800; color: var(--muted); padding-right: 2px; }
.qchip { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 750; cursor: pointer; padding: .25rem .3rem; line-height: 1.1; min-width: 0; }
.qchip-text { font-size: .8rem; font-weight: 650; }
.qchip.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.s-list { order: 2; }
body.immersive .savebar { top: auto; bottom: calc(var(--kb) + var(--bar-h) + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(8px); }
body.immersive .savebar[data-status="saving"], body.immersive .savebar[data-status="saved"], body.immersive .savebar[data-status="error"] { transform: translateX(-50%) translateY(0); }
body.immersive .toasts { bottom: calc(var(--kb) + var(--bar-h) + 52px + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { .s-list { order: 0; } }
@media (min-width: 1024px) { body.immersive .savebar { left: calc(50% + 110px); } }

.s-routine { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.s-list-wide { display: none; }
@media (min-width: 1200px) {
  .s-list-details { display: none; }
  .s-list-wide { display: block; }
}
@media (max-width: 359px) { .stat { padding: .55rem; } .stat-num { font-size: 1.35rem; } }
@media (max-width: 399px) {
  .inputs { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .stepper-row { grid-template-columns: 56px minmax(0, 1fr) 56px; }
}
@media (max-width: 359px) {
  .stat-label { font-size: .7rem; overflow-wrap: normal; }
  .stats { gap: .35rem; }
}

/* ---------- ilustraciones de ejercicios ---------- */
:root { --ill-fig: #edf1ec; --ill-eq: #7c877f; --ill-eq-2: #9aa59c; --ill-pad: #4a534c; --ill-mat: #3a423c; --ill-bg: #1f2521; }
:root[data-theme="light"] { --ill-fig: #1b211c; --ill-eq: #8a948c; --ill-eq-2: #6f7a72; --ill-pad: #c3cabd; --ill-mat: #d6dbd0; --ill-bg: #eef0ea; }
.ill { display: block; width: 100%; height: auto; max-width: 100%; }
.ill line, .ill polyline, .ill path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ill-fig { stroke: var(--ill-fig); stroke-width: 6.5; }
.ill-torso { stroke-width: 10; }
.ill-far { opacity: .45; }
.ill-head { fill: var(--ill-fig); }
.ill .ill-trunk { fill: var(--ill-fig); stroke: var(--ill-fig); stroke-width: 4; }
.ill-ghost { opacity: .22; }
.ill-eq, .ill-frame, .ill-back { stroke: var(--ill-eq); stroke-width: 4; }
.ill-frame { stroke-width: 3.5; }
.ill-back { stroke-width: 7; }
.ill-eq-thin { stroke: var(--ill-pad); stroke-width: 1.5; }
.ill-eq-bar { stroke: var(--ill-eq-2); stroke-width: 4.5; }
.ill-pad { fill: var(--ill-pad); }
.ill-mat { fill: var(--ill-mat); }
.ill-stack { fill: var(--ill-mat); stroke: var(--ill-eq); stroke-width: 1.5; }
.ill-floor { stroke: var(--ill-mat); stroke-width: 2; }
.ill-load { fill: var(--accent); }
.ill-hub { fill: var(--ill-bg); }
.ill-bar { stroke: var(--accent); stroke-width: 3; }
.ill-plate { stroke: var(--accent); stroke-width: 5; }
.ill-cable { stroke: var(--ill-eq-2); stroke-width: 1.5; stroke-dasharray: 3 3; }
.ill-pulley { fill: var(--ill-bg); stroke: var(--ill-eq-2); stroke-width: 2; }
.ill-arrow { stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 5 4; }
.ill .ill-ahead { fill: var(--accent); }
.ill-timer circle, .ill-timer path { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.thumb { width: 72px; flex: none; border-radius: 10px; overflow: hidden; background: var(--ill-bg); aspect-ratio: 10 / 7; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Sesión a pantalla completa (deslizable) ---------- */
.stage {
  --text: #f2f5f0; --muted: #c2cbc3; --surface: #171b18; --surface-2: rgba(255,255,255,.1); --surface-3: rgba(255,255,255,.16); --line: rgba(255,255,255,.18);
  --ill-fig: #edf1ec; --ill-eq: #7c877f; --ill-eq-2: #9aa59c; --ill-pad: #4a534c; --ill-mat: #3a423c; --ill-bg: #1a1f1b; --accent-text: #c9ec6a;
  --glass: rgba(10, 13, 11, .55);
  color: var(--text);
  position: fixed; top: 0; left: 0; right: 0; bottom: var(--kb, 0px); z-index: 20; overflow: hidden; background: var(--ill-bg);
}
.track { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.track::-webkit-scrollbar { display: none; }
.track:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.slide { flex: 0 0 100%; width: 100%; scroll-snap-align: center; scroll-snap-stop: always; position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: calc(var(--sat) + 84px) 16px calc(var(--hud-h, 300px) + 8px); background: var(--ill-bg); }
.slide-media { position: absolute; inset: 0; z-index: 0; }
.slide-media img, .slide-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-media.media-art { position: relative; inset: auto; order: 2; flex: 1 1 auto; min-height: 90px; display: flex; align-items: center; justify-content: center; }
.slide-media.media-art .ill { height: 100%; width: auto; max-height: 100%; max-width: 100%; }
.slide-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.62) 0%, rgba(0,0,0,.15) 32%, rgba(0,0,0,.1) 50%, rgba(0,0,0,.8) 72%, rgba(0,0,0,.92) 100%); }
.slide:has(.media-art) .slide-shade { background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,.55) 100%); }
.slide-shade.is-rest { background: rgba(0, 0, 0, .55); }
.slide:has(.media-art) .slide-shade.is-rest { background: rgba(0, 0, 0, .35); }
.slide-info { position: relative; z-index: 2; order: 1; display: flex; flex-direction: column; gap: .35rem; min-width: 0; text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.slide-eyebrow { margin: 0; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.slide-pos { margin: 0; font-weight: 700; color: var(--muted); }
.slide-pos .num { font-size: 1.6rem; color: var(--text); font-weight: 800; margin-right: .2rem; }
.slide-name { margin: 0; font-size: clamp(1.3rem, 5.5vw, 1.9rem); line-height: 1.12; overflow-wrap: anywhere; text-wrap: balance; }
.slide-target { margin: 0; font-size: .98rem; overflow-wrap: anywhere; }
.slide-result { font-size: 1.6rem; font-weight: 800; margin: .25rem 0; }
.slide-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .2rem; }
.slide-info .last { background: var(--glass); border-left-color: var(--accent); margin: .2rem 0 0; text-shadow: none; }
.slide-empty { position: relative; z-index: 2; margin: auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.slide-scroll { position: relative; z-index: 2; overflow-y: auto; flex: 1; min-height: 0; }
.slide-scroll .card { background: rgba(23, 27, 24, .92); }
.swipe-hint { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .9rem; border-radius: 999px; background: var(--glass); color: var(--accent-text); font-weight: 750; margin: 0 0 .5rem; align-self: flex-start; }
.slide-empty .swipe-hint { align-self: center; }
.chip-glass { background: var(--glass); border-color: rgba(255,255,255,.2); color: var(--text); backdrop-filter: blur(6px); }
.btn-glass { background: var(--glass); border: 1px solid rgba(255,255,255,.22); color: var(--text); }
.icon-btn.glass { background: var(--glass); border-color: rgba(255,255,255,.2); color: var(--text); backdrop-filter: blur(6px); }

.hud-top { position: absolute; top: 0; left: 0; right: 0; z-index: 5; padding: calc(var(--sat) + 8px) 12px 8px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.5), transparent); }
.hud-top > * { pointer-events: auto; }
.segs { display: flex; gap: 3px; margin-bottom: 8px; }
.seg { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); }
.seg.st-completada { background: var(--accent); }
.seg.st-omitida, .seg.st-no_realizada { background: var(--warn); }
.seg.is-current { background: #fff; }
.hud-bar { display: flex; align-items: center; gap: .5rem; }
.hud-title { flex: 1; min-width: 0; }
.hud-title .s-routine { font-size: 1rem; }
.hud-title .s-meta { color: var(--muted); }

.hud-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; padding: 18px 14px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(10,13,11,0), rgba(10,13,11,.88) 22%, rgba(10,13,11,.96)); display: flex; flex-direction: column; gap: 10px; }
.hud-metrics { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: 8px; align-items: end; }
.metric { display: flex; flex-direction: column; align-items: center; min-width: 0; gap: 2px; }
.metric-label { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.metric-input { width: 100%; background: transparent !important; border: 0 !important; border-bottom: 2px solid rgba(255,255,255,.18) !important; border-radius: 0 !important;
  text-align: center; font-size: 2rem !important; font-weight: 800; color: var(--text) !important; min-height: 48px !important; padding: 0 !important; box-shadow: none !important; }
.metric-input:focus { border-bottom-color: var(--accent) !important; }
.metric.is-draft .metric-input { color: var(--muted) !important; font-style: italic; }
.metric-static { display: flex; align-items: center; justify-content: center; }
.metric-unit { font-size: .72rem; color: var(--muted); text-align: center; overflow-wrap: anywhere; line-height: 1.2; min-height: 1.2em; }
.metric-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 100%; margin-top: 4px; }
.metric-steps .step-btn { min-height: 44px; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); }
.metric-steps .step-btn.wide { grid-column: 1 / -1; gap: .3rem; }
.metric-center { align-self: center; padding-bottom: 6px; }
.clock { font-size: clamp(2.3rem, 11vw, 3.4rem); font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.clock-label { font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.clock.is-over, .clock-label.is-over { color: var(--warn); }
.state-rest .metric-center .clock { color: var(--accent-text); }
.state-rest .metric-center .clock.is-over { color: var(--warn); }
.hud-extras { display: flex; flex-direction: column; gap: 6px; }
.hud-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.hud-row .qchip svg { width: 18px; height: 18px; vertical-align: middle; }
.stage .qchip { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); }
.stage .qchip.is-on { background: var(--accent); color: var(--accent-ink); }
.stage .stage-wrap .btn-xl { min-height: 56px; }
.menu-list { display: flex; flex-direction: column; gap: 6px; margin-top: .75rem; }
.menu-btn { justify-content: flex-start; text-align: left; }
.ficha-media { border-radius: 12px; overflow: hidden; background: var(--ill-bg); margin-bottom: .75rem; }
.ficha-media .media-big img, .ficha-media .media-big video { width: 100%; max-height: 60vh; object-fit: contain; display: block; background: #000; }
.ficha-dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; margin: 0 0 .5rem; }
.ficha-dl dt { color: var(--muted); font-weight: 650; }
.ficha-dl dd { margin: 0; overflow-wrap: anywhere; }
.s-col { display: none; }
body.immersive .toasts { bottom: calc(var(--hud-h, 300px) + 8px); z-index: 80; }
body.immersive .savebar { bottom: calc(var(--hud-h, 300px) + 4px); z-index: 80; }
body.immersive .main { padding: 0; }
@media (max-width: 359px) {
  .metric-input { font-size: 1.6rem !important; }
  .slide { padding-top: calc(var(--sat) + 76px); }
}
@media (max-height: 600px) {
  .slide-info .last { display: none; }
}
/* Tablet: escenario + columna derecha */
@media (min-width: 768px) {
  .stage-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; padding: 12px; height: 100dvh; }
  .stage { position: relative; top: auto; left: auto; right: auto; bottom: auto; height: calc(100dvh - 24px); border-radius: 22px; }
  .s-col-right { display: block; overflow-y: auto; max-height: calc(100dvh - 24px); }
  .slide { padding-top: 92px; }
  body.immersive .toasts, body.immersive .savebar { bottom: 24px; }
}
@media (min-width: 1200px) {
  .stage-wrap { grid-template-columns: 280px minmax(0, 560px) minmax(300px, 1fr); }
  .s-col-left { display: block; overflow-y: auto; max-height: calc(100dvh - 24px); }
}
@media (prefers-reduced-motion: reduce) { .track { scroll-behavior: auto; } }

.ex-row-media { flex-direction: row; align-items: center; gap: .75rem; }
.ex-row-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1; }
@media (prefers-color-scheme: light) { :root:not([data-theme]) { --ill-fig: #1b211c; --ill-eq: #8a948c; --ill-eq-2: #6f7a72; --ill-pad: #c3cabd; --ill-mat: #d6dbd0; --ill-bg: #eef0ea; } }
@media (max-height: 760px) {
  .slide-info .last, .slide-chips .chip:not(.chip-btn) { display: none; }
  .slide-target { font-size: .9rem; }
  .state-rest .qrow-3 { display: none; }
  .slide-pos .num { font-size: 1.35rem; }
}
@media (max-height: 680px) {
  .slide-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 1.2rem; }
  .state-rest .slide-target, .state-rest .slide-chips { display: none; }
  .metric-steps .step-btn { min-height: 44px; }
  .hud-bottom { gap: 6px; padding-top: 10px; }
}
body.kb-open .slide-info, body.kb-open .hud-extras, body.kb-open .slide-media { display: none; }


/* =====================================================================
   Capa premium (v1.2): tipografía condensada deportiva, superficies con
   volumen, portadas de entrenamiento y pantalla de sesión tipo «feed».
   ===================================================================== */
:root {
  --font: 'Barlow', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  --bg: #0a0c0b;
  --surface: #131714;
  --surface-2: #1a1f1c;
  --surface-3: #242b26;
  --line: rgba(255, 255, 255, .08);
  --text: #f3f6f1;
  --muted: #9ba69e;
  --accent: #c6f06a;
  --accent-strong: #d8ff84;
  --accent-text: #d2f57f;
  --accent-soft: rgba(198, 240, 106, .12);
  --radius: 20px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 18px 40px -18px rgba(0, 0, 0, .7);
  --card-bg: linear-gradient(180deg, #171c18 0%, #121613 100%);
}
:root[data-theme="light"] {
  --bg: #f2f3ef; --surface: #ffffff; --surface-2: #eceee8; --surface-3: #dfe3da; --line: rgba(0,0,0,.08);
  --text: #111511; --muted: #555f57; --accent: #b4e34f; --accent-strong: #a2d43a; --accent-text: #3a5a00; --accent-soft: rgba(120,170,20,.14);
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 14px 34px -18px rgba(0,0,0,.25);
  --card-bg: linear-gradient(180deg, #ffffff 0%, #f7f8f4 100%);
}
body { font-family: var(--font); letter-spacing: .005em; }
h1, .hero-title, .wh-title, .pv-title, .slide-name, .stat-num, .clock, .metric-input, .set-pos-num, .section-title {
  font-family: var(--font-display);
}
h1 { font-size: 2.2rem; font-weight: 800; text-transform: uppercase; letter-spacing: .01em; line-height: 1; }
.section-title { font-size: 1.15rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.6rem 0 .7rem; }
.section-title .muted { font-family: var(--font); text-transform: none; letter-spacing: 0; font-weight: 500; }
.card { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); }
.btn { font-weight: 700; border-radius: 14px; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-strong) 0%, var(--accent) 55%, #a9d94a 100%);
  color: #0b0f08; box-shadow: 0 1px 0 rgba(255,255,255,.45) inset, 0 10px 24px -10px rgba(198, 240, 106, .55);
}
.btn-primary:not(:disabled):hover { filter: brightness(1.05); background: linear-gradient(180deg, var(--accent-strong) 0%, var(--accent) 55%, #a9d94a 100%); }
.btn-xl { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; min-height: 58px; border-radius: 16px; }
.btn-ghost { border-color: var(--line); background: rgba(255,255,255,.03); }
.stat { background: var(--card-bg); border: 1px solid var(--line); border-radius: 16px; }
.stat-num { font-size: 2.1rem; font-weight: 800; }
.chip { font-weight: 600; }
.eyebrow { letter-spacing: .1em; }

/* navegación inferior con cristal y pastilla activa */
.nav { background: rgba(10, 12, 11, .78); backdrop-filter: saturate(140%) blur(18px); -webkit-backdrop-filter: saturate(140%) blur(18px); border-top-color: rgba(255,255,255,.06); }
:root[data-theme="light"] .nav { background: rgba(255,255,255,.82); }
.nav a { font-weight: 700; letter-spacing: .02em; }
.nav a[aria-current="page"] svg { background: var(--accent-soft); border-radius: 999px; padding: 3px 14px; width: 52px; height: 30px; box-sizing: border-box; }
@media (min-width: 1024px) {
  .nav { background: #0d100e; }
  .nav a[aria-current="page"] svg { background: none; padding: 0; width: 24px; height: 24px; }
  .brand-name { font-family: var(--font-display); font-size: 1.5rem; text-transform: uppercase; letter-spacing: .04em; }
}

/* ---------- Hoy ---------- */
.today-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.today-head h1 { margin: 0; font-size: 2.6rem; }
.today-date { margin: 0 0 4px; color: var(--accent-text); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 0 0 6px; }
.ws-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); text-decoration: none; min-height: 64px; font: inherit; cursor: pointer; }
.ws-day b { font-family: var(--font-display); font-size: 1.35rem; color: var(--text); font-weight: 700; line-height: 1; }
.ws-day span { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.ws-day i { width: 6px; height: 6px; border-radius: 50%; background: transparent; margin-top: 2px; }
.ws-day.has-workout i { background: var(--accent); box-shadow: 0 0 8px rgba(198,240,106,.6); }
.ws-day.is-done i { background: var(--muted); box-shadow: none; }
.ws-day.is-today { border-color: var(--accent); background: linear-gradient(180deg, rgba(198,240,106,.14), rgba(198,240,106,.03)); }
.ws-day.is-today span { color: var(--accent-text); }

.workout-hero { position: relative; overflow: hidden; border-radius: 26px; background: #0e110f; border: 1px solid rgba(255,255,255,.07); box-shadow: 0 30px 60px -30px rgba(0,0,0,.85); color: #f3f6f1; display: block; text-align: left; width: 100%; padding: 0; cursor: pointer; font: inherit; }
.wh-art { position: relative; aspect-ratio: 16 / 10; max-height: 340px; width: 100%; overflow: hidden; }
.wh-art .ill, .wh-art img, .wh-art video { width: 100%; height: 100%; object-fit: cover; display: block; }
.wh-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(8,10,9,.92) 100%); }
.wh-body { position: relative; margin-top: -86px; padding: 0 18px 18px; z-index: 1; display: flex; flex-direction: column; gap: 6px; }
.wh-when { align-self: flex-start; background: var(--accent); color: #0b0f08; font-weight: 800; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.wh-title { margin: 2px 0 0; font-size: 2.3rem; font-weight: 800; text-transform: uppercase; line-height: .95; letter-spacing: .005em; overflow-wrap: anywhere; text-wrap: balance; }
.wh-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: #c3ccc5; font-weight: 600; font-size: .92rem; margin: 2px 0 6px; }
.wh-meta span { display: inline-flex; align-items: center; gap: 5px; }
.wh-meta svg { width: 16px; height: 16px; color: var(--accent); }
.wh-muscles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.wh-muscles .chip { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); color: #e6ece7; }
.wh-strip { display: flex; gap: 6px; margin: 0 0 12px; overflow: hidden; }
.wh-strip .thumb { width: 56px; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); }
.wh-strip .more { width: 56px; aspect-ratio: 10/7; border-radius: 10px; background: rgba(255,255,255,.06); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #c3ccc5; font-size: .85rem; }
.workout-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px; border-radius: 18px; background: var(--card-bg); border: 1px solid var(--line); color: var(--text); font: inherit; cursor: pointer; margin-bottom: 8px; min-height: 76px; }
.workout-row .thumb { width: 88px; border-radius: 12px; }
.wr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wr-when { font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.wr-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; text-transform: uppercase; line-height: 1.05; overflow-wrap: anywhere; }
.wr-meta { font-size: .85rem; color: var(--muted); }
.workout-row > svg { color: var(--muted); }
.start-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.start-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: var(--card-bg); border: 1px solid var(--line); }
.start-steps b.n { font-family: var(--font-display); font-size: 1.4rem; color: var(--accent-text); line-height: 1; min-width: 1.2ch; }
.today-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------- Vista previa del entrenamiento ---------- */
.preview { padding-bottom: calc(var(--bar-h) + 60px); }
.pv-cover { position: relative; margin: 0 calc(-1 * max(var(--gutter), env(safe-area-inset-left))) 0; height: min(52vh, 420px); overflow: hidden; background: #0e110f; }
.pv-cover .media, .pv-cover .ill, .pv-cover img, .pv-cover video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 30%, rgba(10,12,11,.2) 55%, var(--bg) 100%); }
.pv-back { position: absolute; top: calc(var(--sat) + 12px); left: 16px; z-index: 2; }
.pv-head { position: relative; z-index: 1; margin-top: -120px; display: flex; flex-direction: column; gap: 8px; }
.pv-title { margin: 0; font-size: clamp(2.4rem, 11vw, 3.6rem); font-weight: 800; text-transform: uppercase; line-height: .92; text-wrap: balance; overflow-wrap: anywhere; color: var(--text); }
.pv-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 4px; }
.pv-kpi { background: var(--card-bg); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; }
.pv-kpi b { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; line-height: 1; }
.pv-kpi span { font-size: .75rem; color: var(--muted); font-weight: 600; }
.pv-note { font-size: .88rem; color: var(--muted); border-left: 3px solid var(--accent); padding: 6px 10px; background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.pv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pv-group { border-radius: 20px; border: 1px solid var(--line); background: var(--card-bg); padding: 6px; }
.pv-group-label { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); padding: 6px 8px 2px; }
.pv-ex { display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: 14px; width: 100%; text-align: left; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; }
.pv-ex:hover { background: rgba(255,255,255,.03); }
.pv-ex .thumb { width: 96px; border-radius: 12px; }
.pv-ex-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pv-ex-name { font-weight: 700; font-size: 1.02rem; overflow-wrap: anywhere; line-height: 1.2; }
.pv-ex-rx { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--accent-text); letter-spacing: .02em; }
.pv-ex-sub { font-size: .82rem; color: var(--muted); }

/* ---------- Sesión: feed vertical (deslizar arriba / abajo) ---------- */
.track { flex-direction: column; overflow-x: hidden; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; }
.slide { flex: 0 0 100%; height: 100%; min-height: 100%; scroll-snap-align: start; }
.hud-bottom { pointer-events: none; background: linear-gradient(to bottom, rgba(8,10,9,0), rgba(8,10,9,.86) 24%, rgba(8,10,9,.97)); }
.hud-bottom button, .hud-bottom input, .hud-bottom label, .hud-bottom .qrow, .hud-bottom .hud-row, .hud-bottom .metric-steps { pointer-events: auto; }
.hud-bottom .hud-metrics, .hud-bottom .metric { pointer-events: none; }
.hud-bottom .metric input, .hud-bottom .metric button { pointer-events: auto; }
.metric-input { font-family: var(--font-display) !important; font-size: 2.6rem !important; letter-spacing: .01em; }
.clock { font-size: clamp(2.8rem, 13vw, 4rem); font-weight: 800; }
.slide-name { font-family: var(--font-display); font-size: clamp(1.9rem, 8.5vw, 2.8rem); font-weight: 800; text-transform: uppercase; line-height: .95; }
.slide-pos { font-family: var(--font-display); font-size: 1.1rem; text-transform: uppercase; letter-spacing: .04em; }
.slide-pos .num { font-size: 1.9rem; }
.slide-rest-title { font-family: var(--font-display); font-size: clamp(3rem, 16vw, 5rem); font-weight: 800; text-transform: uppercase; line-height: .9; margin: 0; color: var(--accent-text); letter-spacing: .01em; }
.swipe-cue { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--hud-h, 300px) + 6px); z-index: 4; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: rgba(8,10,9,.55); border: 1px solid rgba(255,255,255,.14); color: #e9efe9; font-weight: 700; font-size: .8rem; letter-spacing: .02em; pointer-events: none; white-space: nowrap; backdrop-filter: blur(8px); }
.swipe-cue svg { width: 16px; height: 16px; color: var(--accent); transform: rotate(90deg); animation: cue 1.6s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: rotate(90deg) translateX(0); } 50% { transform: rotate(90deg) translateX(-4px); } }
.slide-top-cue { position: absolute; top: calc(var(--sat) + 76px); left: 50%; transform: translateX(-50%); z-index: 3; font-size: .75rem; color: #c3ccc5; display: none; }
.hud-top .segs .seg { height: 3px; }
.hud-top .seg.is-current { box-shadow: 0 0 8px rgba(255,255,255,.6); }
.hud-bottom { gap: 12px; }
.stage .qchip { border-radius: 12px; font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; }
.stage .qchip-text { font-family: var(--font); font-size: .8rem; }
@media (min-width: 768px) {
  .slide { padding-top: 96px; }
  .swipe-cue { bottom: calc(var(--hud-h, 300px) + 10px); }
}
@media (prefers-reduced-motion: reduce) { .swipe-cue svg { animation: none; } }
.wh-strip .thumb, .wh-strip .more { flex: 1 1 0; min-width: 0; max-width: 56px; width: auto; }
@media (min-width: 768px) {
  .workout-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: stretch; }
  .wh-art { aspect-ratio: auto; height: 100%; min-height: 340px; max-height: none; }
  .wh-art::after { background: linear-gradient(90deg, rgba(8,10,9,0) 45%, rgba(8,10,9,.95) 100%); }
  .wh-body { margin-top: 0; padding: 26px 26px 26px 8px; justify-content: center; }
  .pv-cover { height: 340px; border-radius: 0 0 28px 28px; margin-inline: 0; }
}

/* Esfuerzo integrado (sin jerga) y controles del descanso discretos */
.effort { display: flex; flex-direction: column; gap: 6px; }
.effort-q { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: center; }
.effort-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.effort-btn { min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: #dfe6e0; font: 700 .9rem/1.1 var(--font); cursor: pointer; padding: 0 4px; }
.effort-btn.is-on { background: var(--accent); color: #0b0f08; box-shadow: 0 6px 16px -8px rgba(198,240,106,.7); }
.hud-row.slim .qchip { min-height: 44px; background: transparent; border: 1px solid rgba(255,255,255,.12); font-size: .95rem; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.hud-row.slim .qchip span { font-family: var(--font); font-size: .8rem; }
.hud-bottom { background: linear-gradient(to bottom, rgba(8,10,9,0), rgba(8,10,9,.78) 30%, rgba(8,10,9,.95)); }

/* Explicaciones en llano */
.tech { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.tech p { margin: 0; font-size: .9rem; color: #e6ece7; }
.tech-main b { color: var(--accent-text); text-transform: uppercase; letter-spacing: .04em; font-size: .78rem; }
.tech-btn { display: inline-flex; align-items: center; min-height: 32px; margin: 2px 6px 0 0; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(198,240,106,.45); background: rgba(198,240,106,.08); color: var(--accent-text); font: 700 .78rem/1 var(--font); cursor: pointer; text-shadow: none; }
.pv-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pv-tag { font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); background: var(--accent-soft); padding: 3px 8px; border-radius: 999px; }
.pv-tech { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pv-tech-btn { text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--card-bg); color: var(--text); font: inherit; cursor: pointer; min-height: 44px; }
.pv-tech-btn b { font-family: var(--font-display); text-transform: uppercase; font-size: 1.05rem; color: var(--accent-text); letter-spacing: .03em; }
.pv-tech-btn span { font-size: .82rem; color: var(--muted); }
.gl-entry { padding: 6px 0 10px; border-bottom: 1px solid var(--line); }
.gl-entry:last-child { border-bottom: 0; }
.gl-entry p { margin: 0 0 .4rem; }
.swim-block { padding: 12px 14px; }
.swim-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.swim-details { margin: 6px 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .92rem; }
.pv-kpis, .pv-head + * { position: relative; z-index: 1; }

/* Indicador de guardado: discreto, siempre visible */
.savechip { position: fixed; z-index: 65; top: calc(var(--sat) + 10px); right: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  background: rgba(19, 23, 20, .82); border: 1px solid var(--line); color: var(--muted); font: 600 .75rem/1 var(--font); backdrop-filter: blur(8px); pointer-events: none; transition: opacity .3s, max-width .3s; max-width: 70vw; white-space: nowrap; overflow: hidden; }
:root[data-theme="light"] .savechip { background: rgba(255,255,255,.88); }
.savechip i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.savechip[data-state="saving"] i { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.savechip[data-state="pending"] { color: var(--warn); border-color: var(--warn); }
.savechip[data-state="pending"] i { background: var(--warn); }
.savechip.is-calm { opacity: .55; }
.savechip.is-calm span { display: none; }
@keyframes pulse { 50% { opacity: .35; } }
body.immersive .savechip { top: auto; bottom: calc(var(--hud-h, 300px) + 6px); right: 12px; }
.savebar { display: none !important; }
.activebar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(var(--sat) + 8px) 16px 8px; background: linear-gradient(90deg, rgba(198,240,106,.18), rgba(198,240,106,.06)); border-bottom: 1px solid rgba(198,240,106,.35); font-size: .9rem; }
.activebar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .savechip[data-state="saving"] i { animation: none; } }
.swim-cover { height: min(34vh, 260px); }
.swim-toggle { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--card-bg); color: var(--text); font: inherit; cursor: pointer; min-height: 60px; }
.swim-toggle.is-done { border-color: var(--accent); background: linear-gradient(180deg, rgba(198,240,106,.14), rgba(198,240,106,.04)); }
.swim-check { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.swim-toggle.is-done .swim-check { background: var(--accent); border-color: var(--accent); color: #0b0f08; }
.swim-check svg { width: 18px; height: 18px; }
.swim-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.swim-sub { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.swim-form { margin-top: 12px; }
.swim-auto { margin: 0; font-weight: 700; min-height: 48px; display: flex; align-items: center; gap: 8px; }
.save-inline { color: var(--muted); }
.save-inline[data-state="pending"] { color: var(--warn); }
.seg-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 12px; }
.seg-opt { min-height: 48px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); font: 700 1rem/1 var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.seg-opt svg { width: 20px; height: 20px; }
.seg-opt.is-on { background: var(--accent); color: #0b0f08; }
.sw-edit { padding: 12px; }
.ev-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ev-head .h3 { margin: 0; }
.ev-big b { font-family: var(--font-display); font-size: 2.4rem; }
.ev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ev-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 8px; align-items: end; padding: 8px; border-radius: 14px; background: var(--surface-2); }
.ev-row .field { margin: 0; }
.ev-row-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ev-row-wide .icon-btn { justify-self: end; }
@media (min-width: 640px) { .ev-row-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 479px) { .ev-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .ev-row .icon-btn { justify-self: end; } }
.ev-goal { display: flex; align-items: center; gap: 8px; }
.ev-goal .check { min-height: 44px; padding: 0; }
.goal-text { flex: 1; }
.prog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.prog-grid > div { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 14px; background: var(--surface-2); }
.prog-grid b { font-family: var(--font-display); font-size: 1.7rem; }
.prog-grid span { font-size: .8rem; color: var(--muted); }
.up { color: var(--ok); font-weight: 700; } .down { color: var(--warn); font-weight: 700; }
.swim-sum { display: flex; flex-direction: column; gap: 2px; } .swim-sum b { font-family: var(--font-display); font-size: 2rem; } .swim-sum span { color: var(--muted); font-size: .85rem; }
.activebar[hidden] { display: none !important; }
body.has-activebar .savechip { top: calc(var(--sat) + 62px); }
body.immersive .savechip:not([data-state="pending"]) { display: none; }
body.immersive .savechip { bottom: auto; top: calc(var(--sat) + 70px); left: 50%; right: auto; transform: translateX(-50%); }
@media (min-width: 1024px) { .activebar { padding-left: 24px; padding-right: 220px; } }

/* =====================================================================
   v1.5 · Modo foco: una cosa por pantalla.
   Serie: imagen + nombre + objetivo + REPS · tiempo · PESO + «Serie hecha».
   Descanso: cuenta atrás grande con anillo + siguiente serie + esfuerzo opcional.
   ===================================================================== */
.focus-info { gap: .3rem; }
.focus-info .slide-pos { font-size: 1rem; color: #c9d2cb; }
.focus-info .slide-pos .num { font-size: 1.15rem; color: var(--accent-text); }
.focus-info .slide-target { font-size: 1.05rem; color: #e9efe9; font-weight: 600; }
.how-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(8,10,9,.45); color: #e9efe9; font: 700 .82rem/1 var(--font); cursor: pointer; backdrop-filter: blur(8px); text-shadow: none; }
.how-btn svg { width: 16px; height: 16px; color: var(--accent); }

/* Números grandes sin botones: se tocan y se escriben. +/− solo al editar (teclado abierto). */
.hud-metrics .metric-steps { display: none; }
body.kb-open .hud-metrics .metric-steps { display: grid; }
.hud-metrics .metric:has(.metric-static) .metric-steps { display: grid; }
.metric-input { border-bottom: 0 !important; background: rgba(255,255,255,.06) !important; border-radius: 16px !important; min-height: 64px !important; }
.metric-input:focus { background: rgba(198,240,106,.12) !important; outline: 2px solid var(--accent); outline-offset: 0; }
.metric.is-draft .metric-input { font-style: normal; color: #cfd8d1 !important; }
.metric-hint { font-size: .7rem; color: var(--muted); min-height: 1em; }
.metric-center .clock { font-size: clamp(2rem, 9vw, 2.6rem); color: #e9efe9; }
.metric-center { padding-bottom: 18px; }
.hud-bottom { gap: 10px; }
#primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
#primary svg { width: 22px; height: 22px; }

/* Descanso */
.slide-shade.is-deep { background: rgba(6, 8, 7, .78) !important; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.rest-stage { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding-bottom: calc(var(--hud-h, 300px) - 40px); }
.ring { position: relative; width: min(64vw, 260px); aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset .25s linear; filter: drop-shadow(0 0 8px rgba(198,240,106,.5)); }
.ring.is-over .ring-fg { stroke: var(--warn); filter: none; }
.ring .clock { font-size: clamp(3.4rem, 17vw, 4.8rem); color: #fff; position: relative; }
.ring .clock-label { position: relative; margin-top: 2px; }
.rest-adj { display: flex; gap: 8px; }
.rest-adj .qchip { min-width: 84px; min-height: 44px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; }
.next-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 18px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); pointer-events: auto; }
.next-head { margin: 0; display: flex; align-items: baseline; gap: 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--muted); }
.next-label { color: var(--accent-text); }
.next-pos .num { color: #e9efe9; }
.next-name { margin: 0; font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; text-transform: uppercase; line-height: 1; overflow-wrap: anywhere; }
.hud-metrics.is-mini { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.hud-metrics.is-mini .metric { flex-direction: row; align-items: center; gap: 8px; }
.hud-metrics.is-mini .metric-label { display: none; }
.hud-metrics.is-mini .metric-input { font-size: 1.7rem !important; min-height: 48px !important; flex: 1; }
.hud-metrics.is-mini .metric-unit { flex: 0 0 auto; min-height: 0; max-width: 64px; text-align: left; }
.effort-q { text-transform: none; letter-spacing: 0; font-size: .8rem; font-weight: 700; color: #c9d2cb; }
.effort-q .muted { font-weight: 500; }
.effort-opts:has(.undo-btn) { grid-template-columns: repeat(4, minmax(0, 1fr)) 44px; }
.effort-btn.undo-btn { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.effort-btn.undo-btn svg { width: 18px; height: 18px; }
.state-rest .swipe-cue { display: none; }
.ficha-target { margin: 0 0 .6rem; }
.ficha-words { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .6rem; padding: .6rem .75rem; border-radius: 12px; background: var(--accent-soft); }
.ficha-words .h3 { margin: 0; font-size: .95rem; color: var(--accent-text); }
.ficha-words p { margin: 0; font-size: .9rem; }
@media (max-height: 700px) {
  .ring { width: min(48vw, 190px); }
  .ring .clock { font-size: 3rem; }
  .how-btn { display: none; }
}
.rest-next { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 6px; padding: 0 16px; }
.rest-next .slide-name { font-size: clamp(1.5rem, 7vw, 2.1rem); text-wrap: balance; }
.rest-next .slide-pos { font-size: .95rem; color: #c9d2cb; }
.rest-next .slide-pos .num { font-size: 1.05rem; color: var(--accent-text); }
.next-card { padding: 6px; }

/* v1.6 · Gestos: derecha = serie/descanso del mismo ejercicio · arriba = siguiente ejercicio · izquierda = serie anterior */
.track { overflow: hidden !important; scroll-snap-type: none !important; touch-action: none; }
.stage { touch-action: none; }
.stage input, .stage textarea, .stage select { touch-action: manipulation; }
.state-summary .stage, .state-summary .track { touch-action: pan-y; }
.state-summary .track { overflow-y: auto !important; }
.slide-cur { transition: transform .17s ease-in, opacity .17s ease-in; }
.slide-cur.leave-right { transform: translateX(105%); opacity: .2; }
.slide-cur.leave-up { transform: translateY(-105%); opacity: .2; }
.slide-cur.enter-from-left { animation: enterLeft .22s ease-out; }
.slide-cur.enter-from-bottom { animation: enterBottom .26s ease-out; }
@keyframes enterLeft { from { transform: translateX(-40%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes enterBottom { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }
.swipe-cue .cue-right svg { transform: none; animation: cueR 1.4s ease-in-out infinite; }
.swipe-cue .cue-up svg { transform: none; animation: cueU 1.4s ease-in-out infinite; }
.swipe-cue > svg { transform: none; animation: none; }
@keyframes cueR { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
@keyframes cueU { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .slide-cur, .slide-cur.enter-from-left, .slide-cur.enter-from-bottom { animation: none; transition: none; } }
.state-rest .swipe-cue { display: inline-flex; }

/* v1.6.1 · Páginas del ejercicio (1 · descanso · 2 · descanso · 3) y vista previa al arrastrar */
.pager { display: flex; align-items: center; justify-content: center; gap: 0; margin-top: 8px; pointer-events: none; }
.pg { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px;
  font: 800 .95rem/1 var(--font-display); color: #c3ccc5; background: rgba(8,10,9,.5); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px); }
.pg-rest { min-width: 26px; height: 26px; padding: 0; }
.pg-rest svg { width: 14px; height: 14px; }
.pg.is-done { background: rgba(198,240,106,.18); border-color: rgba(198,240,106,.35); color: var(--accent-text); }
.pg.is-current { background: var(--accent); border-color: var(--accent); color: #0b0f08; box-shadow: 0 0 12px rgba(198,240,106,.55); }
.pg-line { width: 10px; height: 2px; background: rgba(255,255,255,.2); }
.pg-sub { display: inline-flex; gap: 2px; margin-left: 2px; }
.pg-sub i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .35; }
.pg-sub i.is-done, .pg-sub i.is-current { opacity: 1; }
.peek { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.peek > div { position: absolute; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--accent-text); }
.peek-right { inset: 0 auto 0 0; width: 50%; }
.peek-up { inset: auto 0 0 0; height: 40%; }
.peeking-right .peek-right, .peeking-up .peek-up { display: flex; }
.peek-label { font: 800 1.4rem/1 var(--font-display); text-transform: uppercase; text-align: center; padding: 0 12px; }
.peek-sub { font-size: .9rem; color: #c3ccc5; }
.track { background: #070908; }
.slide-cur { position: relative; z-index: 1; background: #0a0c0b; }
.slide-cur .slide-shade + .slide-info, .slide-cur { will-change: transform; }
@media (max-height: 700px) { .pager { margin-top: 4px; } .pg { height: 26px; min-width: 26px; font-size: .85rem; } }
.stage .slide { padding-top: calc(var(--sat) + 116px) !important; }
@media (max-height: 700px) { .stage .slide { padding-top: calc(var(--sat) + 104px) !important; } }
.rest-stage { justify-content: flex-start; padding-top: 2vh; }
.state-rest .swipe-cue { display: none !important; }
.ring { width: min(56vw, 230px); }

/* =====================================================================
   v1.7 · Planificación real: rutinas → entrenamientos → sesiones, natación fija, competiciones
   ===================================================================== */
.dash { display: flex; flex-direction: column; gap: 10px; padding: 16px; margin-bottom: 12px; text-decoration: none; color: var(--text); }
.dash-head { display: flex; align-items: center; gap: 10px; }
.dash-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.45rem; text-transform: uppercase; letter-spacing: .02em; }
.dash-ico { font-size: 1.4rem; line-height: 1; }
.dash-goal { margin-left: auto; color: var(--muted); font-size: .82rem; font-weight: 700; text-align: right; }
.goal-row { display: flex; align-items: center; gap: 10px; }
.goal-n { font-family: var(--font-display); font-size: 3rem; font-weight: 800; line-height: .9; color: var(--accent-text); }
.goal-of { color: var(--muted); font-weight: 700; }
.goal-bar { margin-left: auto; display: flex; gap: 5px; }
.goal-bar i { width: 26px; height: 10px; border-radius: 5px; background: rgba(255,255,255,.12); }
.goal-bar i.opt { background: transparent; border: 1px dashed rgba(255,255,255,.25); }
.goal-bar i.on { background: var(--accent); border: 0; box-shadow: 0 0 10px rgba(198,240,106,.45); }
.goal-msg { margin: 0; font-weight: 800; }
.goal-msg.is-ok { color: var(--accent-text); }
.dash-line { margin: 0; color: #c9d2cb; }
.dash-rec { margin: -2px 0 0; }
.wk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wk-chip { padding: 5px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--muted); }
.wk-chip.is-on { color: var(--accent-text); border-color: rgba(198,240,106,.35); background: var(--accent-soft); }
.dash-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dash-kpis > div { display: flex; flex-direction: column; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; }
.dash-kpis b { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; }
.dash-kpis b small { font-size: 1rem; color: var(--muted); }
.dash-kpis span { font-size: .75rem; color: var(--muted); font-weight: 600; }
.dash-comp { border-color: rgba(255, 196, 0, .35); background: linear-gradient(180deg, rgba(255,196,0,.10), rgba(255,196,0,.02)), var(--card-bg); }
.comp-left { margin-left: auto; font-weight: 800; color: #ffd36a; font-size: .9rem; }
.comp-name { margin: 0; font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; text-transform: uppercase; line-height: 1; }
.ws-icons { display: flex; gap: 1px; min-height: 16px; font-style: normal; }
.ws-ic { font-style: normal; font-size: .72rem; line-height: 1; }
.ws-ic.st-prevista, .ws-ic.st-hoy { opacity: .45; }
.ws-ic.st-no_hecha { opacity: .25; filter: grayscale(1); }
.week-strip .ws-day { text-decoration: none; }
/* selector */
.pick-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 6px 0 10px; }
.pick-prog { margin: 0; font-family: var(--font-display); font-size: 1.9rem; text-transform: uppercase; }
.pick-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 20px; background: var(--card-bg); border: 1px solid var(--line); }
.pick.is-rec { border-color: rgba(198,240,106,.5); box-shadow: 0 0 0 1px rgba(198,240,106,.25) inset; }
.pick-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; color: var(--text); text-align: left; font: inherit; cursor: pointer; padding: 0; }
.pick-main .thumb { width: 84px; flex: 0 0 84px; border-radius: 12px; }
.pick-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pick-rec { align-self: flex-start; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #0b0f08; background: var(--accent); padding: 2px 8px; border-radius: 999px; }
.pick-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; text-transform: uppercase; line-height: 1; }
.pick-sub { font-weight: 600; color: #dfe6e0; overflow-wrap: anywhere; }
.pick-ago { color: var(--accent-text); font-weight: 700; font-size: .88rem; }
.pick-go { flex: 0 0 auto; min-height: 52px; padding: 0 16px; font-family: var(--font-display); text-transform: uppercase; font-size: 1.05rem; letter-spacing: .04em; }
/* rutinas */
.prog { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.prog-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.prog-name { margin: 0 auto 0 0; font-family: var(--font-display); font-size: 1.6rem; text-transform: uppercase; }
.wo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.card.wo-list { padding: 10px; }
.wo-row { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.wo-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wo-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; text-transform: uppercase; }
.wo-sub { font-weight: 600; overflow-wrap: anywhere; }
.wo-actions { flex-wrap: wrap; gap: 6px; }
.icon-btn.sm { min-width: 36px; min-height: 36px; }
/* calendario */
.cal-sum { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); margin: 8px 0; font-size: .92rem; }
.act-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.act { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.act-ic { font-size: 1.2rem; line-height: 1; }
.act-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.act-txt span { font-size: .88rem; color: #c9d2cb; overflow-wrap: anywhere; }
.act.is-plan { border-style: dashed; }
.act.st-no_hecha { opacity: .75; }
.act-comp { border-color: rgba(255,196,0,.35); background: rgba(255,196,0,.06); }
.chip-hecha { background: var(--accent-soft); color: var(--accent-text); border-color: rgba(198,240,106,.35); }
/* natación */
.dow-pick { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 8px 0; }
.dow { min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 800 1.1rem/1 var(--font-display); cursor: pointer; }
.dow.is-on { background: var(--accent); color: #0b0f08; border-color: var(--accent); }
.comp-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.comp-row { display: flex; align-items: center; gap: 10px; padding: 12px; text-decoration: none; color: var(--text); }
.ev-list-comp { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ev-card { padding: 12px; }
.hist-prog { color: var(--accent-text); }
.pick-title { font-size: 1.15rem; } .pick-go { padding: 0 12px; }

/* v1.7.1 · Izquierda = siguiente ejercicio · derecha = anterior · arriba = serie hecha */
.slide-cur.leave-left { transform: translateX(-105%); opacity: .2; }
.slide-cur.enter-from-right { animation: enterRight .22s ease-out; }
@keyframes enterRight { from { transform: translateX(40%); opacity: 0; } to { transform: none; opacity: 1; } }
.peek-prev { inset: 0 auto 0 0; width: 55%; }
.peek-next { inset: 0 0 0 auto; width: 55%; }
.peeking-prev .peek-prev, .peeking-next .peek-next, .peeking-up .peek-up { display: flex; }
.peek-right { display: none !important; }
.slide-review { gap: .5rem; overflow-y: auto; max-height: calc(100% - var(--hud-h, 300px)); padding-bottom: 12px; }
.slide-review .set-rows { margin: 0; }
.slide-review .sr-btn { background: rgba(8,10,9,.55); }
.swipe-cue .cue-left svg { transform: none; animation: cueL 1.4s ease-in-out infinite; }
.swipe-cue .cue-sep { opacity: .5; }
@keyframes cueL { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-4px); } }
.is-reviewing .hud-bottom, .is-reviewing .pager { display: none; } .is-reviewing .slide-review { max-height: none; }
.peek-next { align-items: flex-end !important; padding-right: 14px; } .peek-next .peek-label { text-align: right; padding: 0; max-width: 60vw; } .peek-prev { align-items: flex-start !important; padding-left: 14px; } .peek-prev .peek-label { text-align: left; padding: 0; max-width: 60vw; }

/* v1.7.2 · horizontal = series y descansos · vertical = ejercicios */
.slide-cur.leave-down { transform: translateY(105%); opacity: .2; }
.slide-cur.enter-from-top { animation: enterTop .26s ease-out; }
@keyframes enterTop { from { transform: translateY(-40%); opacity: 0; } to { transform: none; opacity: 1; } }
.peek-down { inset: 0 0 auto 0; height: 40%; padding-top: 120px; }
.peeking-down .peek-down { display: flex; }
.peek-up, .peek-down { align-items: center; }
/* v1.7.3 · hacia atrás: una serie hecha cada vez, como una tarjeta */
.slide-done { margin: 4px 0 0; font-family: var(--font-display); font-size: clamp(2rem, 9vw, 2.6rem); font-weight: 800; color: var(--accent-text); line-height: 1; }
.review-bar { position: absolute; left: 14px; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 6; }
.review-bar .btn { width: 100%; }
.is-reviewing .swipe-cue { bottom: calc(90px + env(safe-area-inset-bottom)); }
.is-reviewing .pager { display: flex; }

/* =====================================================================
   v1.8 · Sesión al estilo de las mejores apps (adaptado): imagen a pantalla completa,
   tiempo · % arriba, barra por ejercicios, reps · cronómetro con arco · peso, píldora «Serie hecha»,
   descanso con cuenta atrás enorme y diario que sube desde abajo.
   ===================================================================== */
.lad-top { padding-top: calc(var(--sat) + 10px); background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent); }
.lad-bar { display: flex; align-items: center; gap: 10px; }
.lad-time { font-family: var(--font-display); font-size: 2rem; font-weight: 800; line-height: 1; color: #fff; letter-spacing: -.01em; }
.lad-btns { margin-left: auto; display: flex; gap: 8px; }
.icon-btn.round { border-radius: 999px; width: 46px; height: 46px; }
.lad-top .save-inline { font-size: .75rem; }
.bsegs { display: flex; gap: 6px; margin: 12px 0 4px; }
.bseg { position: relative; height: 4px; border-radius: 3px; background: rgba(255,255,255,.22); min-width: 10px; }
.bseg b { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: #fff; }
.bseg.is-done b { background: rgba(255,255,255,.9); }
.bseg em { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(198,240,106,.8); }
.lad-top .segs { display: none; }
.lad-top .pager { margin-top: 10px; }
.lad-info { gap: 8px; }
.lad-info .slide-name { font-size: clamp(2rem, 9vw, 2.8rem); }
.lad-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lad-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 8px; background: rgba(40,44,41,.85); color: #e9efe9; font: 600 .9rem/1 var(--font); border: 0; text-transform: capitalize; }
.lad-how { cursor: pointer; padding: 5px 8px; }
.lad-how svg { width: 16px; height: 16px; color: var(--accent); }
.lad-info .slide-pos { font-size: .95rem; }
.intro-list { list-style: none; margin: 6px -16px 0; padding: 0; display: flex; flex-direction: column; }
.intro-row { display: flex; flex-direction: column; padding: 10px 16px; font-weight: 700; font-size: 1.1rem; color: #fff; }
.intro-row:first-child { background: linear-gradient(90deg, rgba(198,240,106,.22), rgba(198,240,106,.06)); border-left: 5px solid var(--accent); padding-left: 11px; }
.intro-row b { color: var(--accent-text); }
.intro-row span { font-weight: 500; font-size: .95rem; color: #c9d2cb; }
/* abajo */
.lad-bottom { background: linear-gradient(to bottom, rgba(6,8,7,0), rgba(6,8,7,.75) 30%, rgba(6,8,7,.92)); gap: 12px; }
.lad-metrics { align-items: end; }
.lad-metrics .metric-input { background: transparent !important; font-size: 3.2rem !important; min-height: 60px !important; color: #fff !important; }
.lad-metrics .metric-input:focus { background: rgba(198,240,106,.12) !important; }
.lad-metrics .metric-label { order: 3; font-size: .85rem; text-transform: none; letter-spacing: 0; font-weight: 600; color: #c9d2cb; }
/* v1.12: las flechas del gesto van encima y debajo del valor (.m-chev) */
.lad-metrics .metric-unit { order: 2; }
.metric-center { position: relative; padding-bottom: 6px; }
.arc { width: 100%; max-width: 170px; display: block; margin: 0 auto -38px; }
.arc line { stroke: rgba(255,255,255,.28); stroke-width: 4; stroke-linecap: round; }
.arc line.on { stroke: var(--accent); }
.lad-metrics .metric-center .clock { font-size: clamp(2.6rem, 12vw, 3.4rem); color: #fff; position: relative; }
.lad-pill { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 0 18px; border-radius: 24px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(28,31,29,.92); color: #fff; font: 700 1.05rem/1.1 var(--font); cursor: pointer; backdrop-filter: blur(10px); text-align: left; }
.lad-pill:active { transform: scale(.99); }
.lad-check { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; border: 2px solid #fff; display: inline-flex; align-items: center; justify-content: center; }
.lad-check svg { width: 18px; height: 18px; }
.lad-pill:hover .lad-check, .lad-pill:focus-visible .lad-check { background: var(--accent); border-color: var(--accent); color: #0b0f08; }
.lad-pill-txt { flex: 1; min-width: 0; }
.lad-pill-of { color: var(--accent-text); font-weight: 800; white-space: nowrap; }
.lad-pill.is-rest { min-height: 52px; }
.lad-journal { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 0 18px; border-radius: 18px; border: 0; background: transparent; color: #e9efe9; font: 700 1rem/1 var(--font); cursor: pointer; }
.lad-journal-r { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); font-weight: 600; font-size: .9rem; }
.lad-journal-r svg { width: 16px; height: 16px; }
.state-prep .lad-journal, .state-log .lad-journal, .state-running .lad-journal { display: none; }
/* descanso */
.lad-rest { justify-content: center; padding-top: 0; gap: 8px; }
.lad-rest-title { margin: 0; font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; text-transform: uppercase; color: #fff; }
.lad-rest-clock { font-size: clamp(5rem, 30vw, 8rem) !important; line-height: .9; color: #fff; }
.lad-rest .rest-next { margin-top: 18px; opacity: .9; }
.state-rest .next-card { padding: 4px 6px; }
/* hoja del diario */
.sheet { position: absolute; inset: auto 0 0 0; top: calc(var(--sat) + 40px); z-index: 20; display: flex; flex-direction: column; border-radius: 28px 28px 0 0;
  background: #1b1e1c; border-top: 1px solid rgba(255,255,255,.08); box-shadow: 0 -20px 60px rgba(0,0,0,.6); animation: sheetUp .25s ease-out; touch-action: pan-y; }
@keyframes sheetUp { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.sheet-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.8rem; text-transform: none; }
.sheet-body { flex: 1; overflow-y: auto; padding: 6px 14px 20px; -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; align-items: center; gap: 14px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.08); color: #c9d2cb; }
.sheet-foot .btn { margin-left: auto; }
.j-card { background: #252926; border-radius: 22px; padding: 14px; margin-bottom: 12px; }
.j-head { display: flex; gap: 12px; align-items: center; }
.j-head .thumb { width: 72px; flex: 0 0 72px; border-radius: 12px; }
.j-head h3 { margin: 0 0 4px; font-size: 1.15rem; }
.j-sub { margin: 0; color: #c9d2cb; font-size: .9rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.j-sub b { color: var(--accent-text); }
.j-actions { display: flex; gap: 8px; overflow-x: auto; margin: 12px -14px 6px; padding: 0 14px; scrollbar-width: none; }
.j-actions .qchip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,.08); border: 0; color: #e9efe9; font: 600 .9rem/1 var(--font); }
.j-actions .qchip svg { width: 16px; height: 16px; }
.j-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.j-table th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.j-table td { padding: 0 4px; }
.j-table tr.is-cur td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.j-table tr.is-cur { background: rgba(198,240,106,.12); }
.j-table input, .j-table select { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: transparent; color: #fff; font: 700 1.05rem/1 var(--font-display); text-align: center; padding: 0 6px; }
.j-table td small { display: none; }
.jn { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); align-items: center; justify-content: center; font-weight: 700; }
.jn.is-done { background: var(--accent); color: #0b0f08; border-color: var(--accent); }
.j-sec { margin: 16px 4px 8px; font-family: var(--font-display); font-size: 1.3rem; text-transform: uppercase; }
.j-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.j-next { display: flex; gap: 12px; align-items: center; width: 100%; padding: 8px; border-radius: 16px; background: rgba(255,255,255,.04); border: 0; color: #fff; text-align: left; font: inherit; cursor: pointer; }
.j-next .thumb { width: 64px; flex: 0 0 64px; border-radius: 10px; }
.j-next-txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.j-dots { display: flex; gap: 6px; }
.j-dots i { font-style: normal; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.4); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; color: #c9d2cb; }
.j-dots i.is-done { background: var(--accent); color: #0b0f08; border-color: var(--accent); }
/* historial del ejercicio */
.h-top { display: flex; justify-content: space-between; gap: 10px; margin: 6px 4px 14px; }
.h-top > div { display: flex; flex-direction: column; }
.h-right { text-align: right; }
.h-big { font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; line-height: 1; }
.h-big small { font-size: 1.1rem; }
.h-top span { color: #c9d2cb; font-size: .9rem; }
.h-bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding: 10px 4px 0; border-bottom: 1px dashed rgba(255,255,255,.15); margin-bottom: 26px; }
.h-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.h-bar i { width: 100%; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--accent-strong), var(--accent)); min-height: 4px; }
.h-bar span { position: absolute; bottom: -22px; font-size: .78rem; color: var(--muted); }
.h-bar b { position: absolute; top: -2px; font-size: .78rem; color: #0b0f08; }
.h-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.h-kpis > div { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12); text-align: center; }
.h-kpis b { font-family: var(--font-display); font-size: 1.4rem; }
.h-kpis span { font-size: .72rem; color: var(--muted); }
.h-table td { padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,.06); }
.arc { max-width: 190px; margin-bottom: -26px; }
.lad-metrics .metric-center .clock { font-size: clamp(2.3rem, 10.5vw, 3rem); }
.lad-rest .rest-next .slide-target { display: none; } .lad-rest .rest-next { margin-top: 8px; } .lad-rest { padding-bottom: calc(var(--hud-h, 300px) - 20px); }
/* v1.8.1 · descanso limpio */
.undo-chip { align-self: center; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #c9d2cb; font: 600 .85rem/1 var(--font); }
.undo-chip svg { width: 16px; height: 16px; }
.lad-rest { padding-bottom: 0; justify-content: center; }
.lad-rest .rest-next .slide-target { display: block; }
.review-bar { display: flex; flex-direction: column; gap: 8px; }
/* v1.8.2 · resumen del ejercicio más compacto para que no pise la imagen */
.intro-row { padding: 7px 16px; font-size: 1rem; flex-direction: row; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
.intro-row span { flex-basis: 100%; font-size: .88rem; }
.lad-info .slide-name { font-size: clamp(1.8rem, 8vw, 2.4rem); }
.slide:has(.intro-list) .slide-media.media-art { min-height: 60px; opacity: .55; }

/* v1.9 · Evolución: panel con datos importantes */
.ev-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ev-kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 16px; background: var(--card-bg); border: 1px solid var(--line); min-width: 0; }
.ev-kpi > span { font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ev-kpi b { font-family: var(--font-display); font-size: 2rem; line-height: 1; }
.ev-kpi b small { font-size: .95rem; color: var(--muted); }
.ev-kpi em { font-style: normal; font-size: .8rem; color: #c9d2cb; overflow-wrap: anywhere; }
.up { color: var(--accent-text); } .down { color: #ffb36b; }
.ev-chart .chart { width: 100%; height: auto; display: block; overflow: visible; margin-top: 6px; }
.cb-bar { fill: var(--accent); }
.cb-hit { fill: transparent; }
.cb:hover .cb-bar { fill: var(--accent-strong); }
.cb-x { fill: var(--muted); font: 600 9px var(--font); text-anchor: middle; }
.cb-v { fill: var(--text); font: 700 10px var(--font); text-anchor: middle; }
.cb-base { stroke: rgba(255,255,255,.18); stroke-width: 1; }
.cb-goal { stroke: rgba(255,255,255,.45); stroke-width: 1; stroke-dasharray: 4 4; }
.cb-goal-t { fill: var(--muted); font: 600 9px var(--font); text-anchor: end; }
.cl-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.cl-dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.ev-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .88rem; }
.ev-table th, .ev-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; }
.ev-table th:first-child, .ev-table td:first-child { text-align: left; color: #c9d2cb; }
.ev-meas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ev-meas > div { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.04); }
.ev-meas span { font-size: .8rem; color: var(--muted); }
.ev-meas b { font-family: var(--font-display); font-size: 1.5rem; }
.ev-meas em { font-style: normal; font-size: .8rem; }
.ev-lifts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ev-lifts li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ev-lift-n { font-weight: 700; }
.ev-lifts b { grid-row: 1; grid-column: 2; font-family: var(--font-display); font-size: 1.3rem; text-align: right; }
.ev-lifts em { grid-column: 2; font-style: normal; font-size: .8rem; text-align: right; }
.ev-pending { flex-basis: 100%; margin: 0; color: #ffd36a; }
@media (min-width: 700px) { .ev-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .ev-meas { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* formularios: la fecha no se sale (iPhone) */
input[type="date"], input[type="time"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.field { min-width: 0; }
.lad-metrics .metric-hint { order: 4; margin-top: 2px; padding: 2px 8px; border-radius: 999px; background: rgba(198,240,106,.14); color: var(--accent-text); font-size: .72rem; font-weight: 700; white-space: nowrap; }
.ev-kpi .up, .ev-kpi .down, .ev-meas .up, .ev-meas .down, .ev-lifts .up, .ev-lifts .down { color: var(--text); font-weight: 700; }

/* v1.10 · Ritmos por zona */
.zones .zone-ref { margin: 4px 0 10px; }
.zone-ref b { font-family: var(--font-display); font-size: 1.5rem; color: var(--accent-text); }
.zone-level { text-transform: capitalize; }
.lv-provisional { color: #ffd36a; border-color: rgba(255,211,106,.4); }
.lv-fiable { color: var(--accent-text); border-color: rgba(198,240,106,.4); }
.zone-wrap { margin: 0 -4px; }
.zone-table { width: 100%; border-collapse: collapse; font-size: .82rem; table-layout: fixed; }
.zone-table th { font-size: .7rem; color: var(--muted); font-weight: 700; text-align: right; padding: 4px 3px; }
.zone-table th:first-child { text-align: left; width: 32%; }
.zone-table td { padding: 8px 3px; border-top: 1px solid var(--line); text-align: right; vertical-align: top; font-variant-numeric: tabular-nums; }
.zone-table td:first-child { text-align: left; }
.zone-table td b { display: block; font-size: .85rem; }
.zone-table td small { display: block; font-size: .7rem; color: var(--muted); line-height: 1.25; margin-top: 2px; }
.zone-table tr td:first-child { border-left: 4px solid transparent; padding-left: 6px; }
.zone-table .z-rec td:first-child { border-left-color: rgba(255,255,255,.25); }
.zone-table .z-a1 td:first-child { border-left-color: rgba(198,240,106,.35); }
.zone-table .z-a2 td:first-child { border-left-color: rgba(198,240,106,.6); }
.zone-table .z-a3 td:first-child { border-left-color: rgba(198,240,106,.85); }
.zone-table .z-css td:first-child { border-left-color: var(--accent); }
.zone-table .z-css { background: rgba(198,240,106,.08); }
.zone-table .z-vo2 td:first-child { border-left-color: #ffb36b; }
.zone-table .z-vel td:first-child { border-left-color: #ff7a6b; }
@media (max-width: 400px) { .zone-table th:nth-child(6), .zone-table td:nth-child(6) { display: none; } }
.ev-zones { margin: 10px 0 0; font-size: .9rem; } .ev-zones b { color: var(--accent-text); } .ev-zones a { color: var(--accent-text); margin-left: 4px; }

/* v1.11 · copia de seguridad por texto */
.bk-text { width: 100%; font: 12px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2, rgba(255,255,255,.04)); color: inherit; border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 12px; padding: 10px; resize: vertical; word-break: break-all; }
.ok-text { color: var(--ok); font-weight: 600; }
.warn-text { color: var(--warn); font-weight: 600; }
.more-opts { margin-top: 10px; }
.more-opts summary { cursor: pointer; color: var(--muted, #9aa); font-size: 14px; padding: 6px 0; min-height: 44px; display: flex; align-items: center; }
.sum-extra { margin: 8px 0 12px; }
.sum-line { font-size: 16px; margin: 0 0 4px; }
.sum-prs { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); }
.sum-prs .h3 { margin: 0 0 6px; }
.dash-next { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.dash-next-k { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dash-next-t { font-size: 20px; }
.dash-next-s { color: var(--muted); font-size: 14px; }
.dash-gym .btn-ghost { width: 100%; margin-top: 8px; }
.pb-tag { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); font-size: 11px; letter-spacing: .04em; }
.ev-mark { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.ev-mark.is-pb { color: var(--warn); font-weight: 600; }
.ev-table small { display: block; font-size: 11px; }
.hist-more { width: 100%; margin-top: 8px; }
.ev-range { display: flex; gap: 4px; padding: 4px; margin: 0 0 12px; border-radius: 12px; background: var(--surface-2); overflow-x: auto; }
.rg-btn { flex: 1; min-height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; white-space: nowrap; padding: 0 8px; cursor: pointer; }
.rg-btn[aria-pressed="true"] { background: var(--surface); color: var(--text, inherit); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.2); }

/* v1.12 · reps y peso: deslizar para ajustar */
.m-chev { display: none; }
.lad-metrics .metric[data-field] { position: relative; touch-action: none; cursor: ns-resize; }
.lad-metrics .metric[data-field] .metric-input[readonly] { caret-color: transparent; user-select: none; -webkit-user-select: none; cursor: ns-resize; }
.lad-metrics .m-chev { display: block; width: 14px; height: 8px; opacity: .55; background: var(--accent); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 8'%3E%3Cpath d='M1 7l6-6 6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 8'%3E%3Cpath d='M1 7l6-6 6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }
.lad-metrics .m-up { order: -1; margin-bottom: 2px; }
.lad-metrics .m-dn { order: 1; transform: rotate(180deg); margin-top: -2px; }
.lad-metrics .metric.m-pop .metric-input { animation: mpop .18s ease-out; }
.lad-metrics .metric.m-pop-up .m-up, .lad-metrics .metric.m-pop-dn .m-dn { opacity: 1; }
@keyframes mpop { 0% { transform: scale(1.12); color: var(--accent-strong); } 100% { transform: scale(1); } }
.lad-metrics .metric-input:not([readonly]) { background: rgba(198,240,106,.12) !important; border-radius: 12px !important; }
.lad-metrics { position: relative; }
.swipe-hint { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(15,18,16,.88); border: 1px solid rgba(184,224,74,.35); color: var(--accent-text); font-size: .8rem; font-weight: 600; white-space: nowrap; pointer-events: none; animation: hintIn .4s ease-out .6s both; }
@keyframes hintIn { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .lad-metrics .metric.m-pop .metric-input, .swipe-hint { animation: none; } }

/* v1.12 · ficha del ejercicio (Técnica · Historial · Progreso) */
.slide-cur .slide-media { cursor: pointer; }
.hub .sheet-head { align-items: flex-start; gap: 10px; }
.hub-title { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.hub-title h2 { font-size: 1.6rem !important; line-height: 1.05; }
.hub-tabs { display: flex; gap: 4px; margin: 6px 14px 4px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.06); }
.hub-tab { flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; }
.hub-tab[aria-selected="true"] { background: var(--surface-3); color: var(--text); }
.hub-anim { position: relative; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; background: #0f1210; margin: 6px 0 4px; }
.hub-anim img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hub-anim-b { animation: hubLoop 3.2s ease-in-out infinite; }
@keyframes hubLoop { 0%, 18% { opacity: 0; } 42%, 62% { opacity: 1; } 86%, 100% { opacity: 0; } }
.hub-anim-tag { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; }
.hub-anim-tag i { font-style: normal; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgba(15,18,16,.8); color: var(--muted); }
.hub-anim-tag i:first-child { animation: tagA 3.2s infinite; } .hub-anim-tag i:last-child { animation: tagB 3.2s infinite; }
@keyframes tagA { 0%, 30% { color: var(--accent-text); } 31%, 86% { color: var(--muted); } 87%, 100% { color: var(--accent-text); } }
@keyframes tagB { 0%, 30% { color: var(--muted); } 31%, 86% { color: var(--accent-text); } 87%, 100% { color: var(--muted); } }
@media (prefers-reduced-motion: reduce) { .hub-anim-b, .hub-anim-tag i { animation: none; } .hub-anim-b { opacity: 0; } }
.hub-prov { margin: 4px 2px 0; }
.hub-today { margin: 10px 2px; }
.hub-sec { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.hub-sec h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 1.15rem; text-transform: uppercase; letter-spacing: .02em; }
.hub-sec p { margin: 4px 0; }
.hub-mm { max-width: 340px; margin: 0 auto; }
.musclemap { width: 100%; height: auto; display: block; }
.mm-body { fill: #222924; }
.mm-o { fill: #333b35; stroke: var(--surface); stroke-width: .6; }
.mm-p { fill: var(--accent); stroke: var(--surface); stroke-width: .6; }
.mm-s { fill: #5f7a2a; stroke: var(--surface); stroke-width: .6; }
.mm-cap { fill: var(--muted); font: 600 9px var(--font); }
.mchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mchip { padding: 4px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.mchip.is-p { background: var(--accent); color: var(--accent-ink); }
.mchip.is-s { background: rgba(95,122,42,.35); color: #d6ebb0; }
.mm-legend { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .78rem; }
.mm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; } .lg-p { background: var(--accent); margin-left: 0; } .lg-s { background: #5f7a2a; margin-left: 8px; }
.grip-type { font-weight: 700; color: var(--accent-text); }
.hub-close { margin: 0 0 8px; } .hub-close img { width: 100%; border-radius: 14px; display: block; } .hub-close figcaption { color: var(--muted); font-size: .78rem; margin-top: 4px; }
.hub-contact, .hub-keys { margin: 6px 0 0; padding-left: 20px; } .hub-contact li, .hub-keys li { margin: 4px 0; }
.hub-path { color: var(--accent-text); }
.hub-err { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.04); margin-bottom: 6px; }
.hub-err p { margin: 0; } .hub-err .ok { color: var(--ok); } .hub-err .bad { color: var(--danger); }
.hub-actions { margin-top: 16px; }
.hub-empty { padding: 20px 4px; }
.hub-log { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.hub-log li { padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.04); }
.hub-log-h { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; } .hub-log-h span { color: var(--muted); text-align: right; }
.hub-sets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.hub-set { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 9px; background: var(--surface-3); font-variant-numeric: tabular-nums; font-size: .9rem; }
.hub-set i { font-style: normal; color: var(--muted); font-size: .75rem; } .hub-set small { color: var(--muted); }
.hub-kpis { margin-top: 6px; } .hub-kpis b { font-size: 1.05rem; }
.hub-chart { width: 100%; height: auto; display: block; }
.hc-line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.hc-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; } .hc-dot.is-last { fill: var(--accent); }
.hc-t { fill: var(--text); font: 700 11px var(--font); } .hc-x { fill: var(--muted); font: 500 9px var(--font); }
.hub-prs { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }

/* v1.13 · en el entreno los avisos salen arriba: nunca tapan «Serie hecha» ni «Volver» */
body.immersive .toasts { top: auto; bottom: calc(env(safe-area-inset-bottom) + 190px); width: auto; max-width: calc(100vw - 48px); align-items: center; }
body.immersive .toast { white-space: nowrap; border-radius: 999px; padding: .55rem 1rem; background: rgba(23,27,24,.94); border-color: rgba(184,224,74,.3); font-size: .9rem; }
/* La tarjeta de «Serie hecha ✓» al revisar no queda bajo la barra de series */
.slide-cur .focus-info .slide-eyebrow:first-child { margin-top: 14px; }
/* v1.13 · editor preciso de reps/peso (− 15 +) */
.m-editor { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 8; display: grid; grid-template-columns: 1fr 1.3fr 1fr auto; gap: 6px; padding: 6px; border-radius: 18px; background: rgba(23,27,24,.96); border: 1px solid rgba(184,224,74,.35); box-shadow: 0 10px 30px rgba(0,0,0,.45); animation: hintIn .18s ease-out both; }
.m-ed-btn, .m-ed-val, .m-ed-ok { min-height: 52px; border: 0; border-radius: 13px; font: inherit; color: var(--text); cursor: pointer; }
.m-ed-btn { background: var(--surface-3); font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.m-ed-btn:active { background: var(--accent); color: var(--accent-ink); }
.m-ed-val { background: rgba(184,224,74,.1); display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.m-ed-val b { font-family: var(--font-display); font-size: 1.7rem; } .m-ed-val small { color: var(--muted); font-size: .8rem; }
.m-ed-ok { width: 52px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 1.2rem; }
.lad-metrics .metric.is-editing .metric-input { color: var(--accent-text) !important; }
.inc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.inc-chip { min-width: 52px; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.inc-chip[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
/* Foto del ejercicio en el entreno */
.slide-media.media-photo { position: relative; inset: auto; order: 2; flex: 1 1 auto; min-height: 120px; border-radius: 22px; overflow: hidden; }
.slide-media.media-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
/* Progreso de la ficha */
.hub-first { border-top: 0; padding-top: 4px; margin-top: 8px; }
.hub-marks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.hub-marks > div { padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.04); }
.hub-marks dt { color: var(--muted); font-size: .78rem; } .hub-marks dd { margin: 2px 0 0; display: flex; flex-direction: column; }
.hub-marks dd b { font-size: 1.1rem; font-variant-numeric: tabular-nums; } .hub-marks dd small { color: var(--muted); font-size: .75rem; }
.hub-lastline { display: flex; flex-direction: column; gap: 2px; margin-top: 10px !important; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(184,224,74,.25); }
.hub-lastline span { color: var(--muted); font-size: .8rem; }
.hub-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.hub-chart-head h3 { margin: 0 !important; }
.seg-mini { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.06); }
.seg-metric { margin: 8px 0 4px; }
.sm-btn { min-height: 32px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.sm-btn[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.hc-area { fill: rgba(184,224,74,.1); } .hc-b { fill: var(--muted); font: 600 10px var(--font); }
/* v1.13.1 · al revisar un ejercicio anterior queda claro que el actual sigue intacto */
.rev-banner { margin: 10px 0 2px; padding: 6px 12px; align-self: flex-start; border-radius: 999px; background: rgba(240,182,74,.14); border: 1px solid rgba(240,182,74,.35); color: #f5cf86; font-size: .82rem; font-weight: 600; text-shadow: none; }
.rev-banner b { color: #fff; }
.rev-sets { color: #c9d2cb; font-size: .9rem; margin: 2px 0 0; }
.slide-cur .focus-info .rev-banner + .slide-eyebrow { margin-top: 4px; }
/* v1.13.2 · botón visible para terminar el entreno */
.lad-end { pointer-events: auto; align-self: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255,141,126,.45); background: rgba(255,141,126,.12); color: #ffb3a8; font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer; }
.lad-end:active { background: rgba(255,141,126,.25); }
/* v1.14 · navegación con botones (los gestos nunca son obligatorios) */
.nav-row { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; pointer-events: none; }
.nav-row .pager { margin-top: 0; }
.nav-arr { pointer-events: auto; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); background: rgba(15,18,16,.55); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.nav-arr svg { width: 18px; height: 18px; } .nav-next svg { transform: rotate(180deg); }
.nav-arr:active { background: var(--surface-3); }
.lad-exn { pointer-events: auto; margin-left: 8px; min-height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: rgba(15,18,16,.55); color: #dfe7e0; font: inherit; font-weight: 700; font-size: .82rem; cursor: pointer; white-space: nowrap; }
#primary.nudge { animation: nudge .5s ease; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.rest-done { margin: 6px 0 0; color: var(--ok); font-weight: 600; font-size: .95rem; text-align: center; }
.rest-next-vals { margin: 2px 0; font-family: var(--font-display); font-size: 1.6rem; color: var(--accent-text); }
@media (prefers-reduced-motion: reduce) { #primary.nudge { animation: none; } }
.lad-time { white-space: nowrap; }
.lad-rest { justify-content: flex-start !important; padding-top: 22px !important; }
.lad-rest .lad-rest-clock { font-size: clamp(4.4rem, 21vw, 5.6rem) !important; line-height: 1; }
.rest-next-vals small { font-size: .9rem; color: var(--muted); font-family: var(--font); }
/* v1.14 · evolución: ¿voy hacia mi objetivo? */
.ev-goal { display: block !important; margin-bottom: 12px; border-color: rgba(184,224,74,.25); }
.ev-goal > * { width: auto; }
.ev-goal.lv-insuficiente { border-color: var(--line); }
.ev-goal-k { margin: 0; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.ev-goal-v { margin: 6px 0 10px; font-size: 1.1rem; font-weight: 700; }
.ev-sig { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ev-sig li { display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.04); }
.ev-sig li span { font-weight: 600; } .ev-sig li b { font-size: 1.3rem; line-height: 1; } .ev-sig li small { grid-column: 1 / -1; color: var(--muted); font-size: .75rem; }
.ev-sig li.is-good b { color: var(--accent); } .ev-sig li.is-bad b { color: var(--warn); } .ev-sig li.is-none b { color: var(--muted); }
.cl-ma { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linejoin: round; }
.cl-line.is-raw { stroke: rgba(237,241,236,.35); stroke-width: 1.4; }
.dash-evo { text-decoration: none; color: inherit; display: block; }
.evo-line { display: flex; gap: 10px; margin: 8px 0 4px; }
.evo-line span { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 12px; background: rgba(255,255,255,.04); }
.evo-line small { color: var(--muted); font-size: .75rem; } .evo-line b { font-size: 1.4rem; color: var(--accent-text); }
.hist-filter { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; }
.hist-filter .sm-btn { background: rgba(255,255,255,.05); }
.lad-metrics .metric-hint.is-prog { background: rgba(240,182,74,.16); color: #f5cf86; }
.welcome { border-color: rgba(184,224,74,.35); margin-bottom: 12px; } .welcome p { margin: 6px 0 10px; }
/* v1.14.1 · logotipo DC */
.today-head { display: flex; align-items: center; justify-content: flex-start; gap: 12px; }
.today-head > div { flex: 1; min-width: 0; }
@media (min-width: 1024px) { .today-logo { display: none; } }
.today-logo { width: 44px; height: 44px; flex: 0 0 auto; color: var(--accent); }

/* ===== v1.15 · Semana navegable, calendario mensual, detalle de día ===== */
.nav-desk { display: none; }
@media (min-width: 1024px) { .nav-desk { display: list-item; } }
.today-prof { margin-left: auto; align-self: center; }
@media (min-width: 1024px) { .today-prof { display: none; } }
.wk { margin: 4px 0 10px; }
.wk-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.wk-title { margin: 0; font-size: 1rem; font-weight: 700; flex: 1; text-align: center; font-family: var(--font); text-transform: none; letter-spacing: 0; }
.wk-next svg, .cal-next svg { transform: rotate(180deg); }
.icon-btn.sm { width: 40px; height: 40px; min-width: 40px; }
.wk-today { order: 9; }
.week-strip button.ws-day { appearance: none; }
.ws-day.is-past b { color: #cfd8d0; }
.ws-day.is-sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(184,224,74,.35) inset; }
.ws-icons { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; min-height: 18px; }
.week-strip.slide-l { animation: wkL .22s ease-out; } .week-strip.slide-r { animation: wkR .22s ease-out; }
@keyframes wkL { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes wkR { from { transform: translateX(-24px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .week-strip.slide-l, .week-strip.slide-r { animation: none; } }
.act-i { font-style: normal; font-size: 13px; line-height: 1; display: inline-block; }
.act-i.st-plan { opacity: .38; filter: grayscale(.6); }
.act-i.st-miss { opacity: .45; filter: grayscale(1); text-decoration: line-through; position: relative; }
.act-i.st-miss::after { content: ''; position: absolute; left: -1px; right: -1px; top: 50%; border-top: 1.5px solid var(--danger); transform: rotate(-30deg); }
.act-i.st-live { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.dd { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid rgba(184,224,74,.28); }
.dd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dd-head h3 { margin: 0; font-size: 1rem; text-transform: capitalize; }
.dd-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.dd-act { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.dd-act.is-plan { background: transparent; border: 1px dashed var(--line); }
.dd-ic { font-size: 1.3rem; }
.dd-txt { display: flex; flex-direction: column; min-width: 0; } .dd-txt span, .dd-txt small { color: var(--muted); overflow-wrap: anywhere; } .dd-txt small { font-size: .8rem; }
.dd-empty { margin: 8px 0 0; }
.dd-more { margin-top: 8px; }

.today-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 20px; }
.today-col > .card, .today-col > a.card, .today-col > section { margin-bottom: 14px; }
.dash-more { display: inline-block; margin-top: 4px; color: var(--accent-text); font-weight: 600; font-size: .9rem; }
@media (min-width: 1024px) { .today-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }

.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-title { flex: 1; margin: 0; text-align: center; text-transform: capitalize; font-size: 1.35rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { text-align: center; font-size: .72rem; font-weight: 800; letter-spacing: .08em; color: var(--muted); padding: 4px 0; }
.cal-day { appearance: none; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; min-height: 58px; padding: 6px 2px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; min-width: 0; }
.cal-day b { font-size: 1rem; font-weight: 700; line-height: 1.1; }
.cal-day.is-out { opacity: .38; }
.cal-day.is-today { border-color: var(--accent); }
.cal-day.is-today b { color: var(--accent-text); }
.cal-day.is-sel { background: rgba(184,224,74,.14); border-color: var(--accent); }
.cal-day:focus-visible, .ws-day:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cal-icons { display: flex; flex-wrap: wrap; justify-content: center; max-width: 100%; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 4px; color: var(--muted); font-size: .8rem; }
.cal-sum { margin: 4px 0 14px; color: var(--muted); } .cal-sum b { color: var(--text); }
.cal-side .dd { margin-top: 4px; }
@media (hover: hover) { .cal-day:hover, .ws-day:hover { border-color: rgba(184,224,74,.5); } }
@media (max-width: 360px) { .cal-day { min-height: 50px; border-radius: 9px; } .act-i { font-size: 11px; } .cal-grid { gap: 3px; } }
@media (min-width: 768px) { .cal-day { min-height: 76px; } .act-i { font-size: 16px; } }
@media (min-width: 1024px) {
  .cal-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
  .cal-side { position: sticky; top: 16px; }
  .cal-day { min-height: 88px; }
}

/* ===== v1.15 · responsive: desktop aprovecha el ancho, móvil sin solapes ===== */
/* Móvil/tablet: el indicador de guardado es solo un punto mientras todo va bien (no tapa títulos). */
@media (max-width: 1023px) {
  .savechip[data-state="saved"] span, .savechip[data-state="saving"] span { display: none; }
  .savechip[data-state="saved"], .savechip[data-state="saving"] { padding: 6px; }
}
/* Detalle de día: el botón baja de línea cuando no cabe (aside estrecho o móvil). */
.dd { container-type: inline-size; }
.dd-act { grid-template-columns: auto minmax(0, 1fr); }
.dd-act > .btn { grid-column: 2; justify-self: start; }
@container (min-width: 440px) { .dd-act { grid-template-columns: auto minmax(0, 1fr) auto; } .dd-act > .btn { grid-column: auto; } }
/* Pantalla de entreno en móviles pequeños: la barra superior no se sale. */
@media (max-width: 380px) {
  .lad-btns { gap: 6px; }
  .lad-btns .icon-btn.round { width: 40px; height: 40px; min-width: 40px; }
  .lad-end { padding: 0 10px; font-size: .85rem; min-height: 40px; }
  .lad-exn { margin-left: 4px; padding: 0 8px; }
  .lad-time .num { font-size: 1.6rem; }
}
.lad-how { min-width: 40px; min-height: 40px; }
/* Días de natación: objetivo táctil suficiente. */
.swim-days button, .day-chip { min-width: 36px; min-height: 40px; }
/* Escritorio: páginas de panel más anchas, con columnas. */
@media (min-width: 1280px) {
  .page.today, .page.cal-page, .page.ev-page { max-width: 1200px; }
  .ev-dash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; align-items: start; }
  .ev-dash > .ev-goal, .ev-dash > .ev-range, .ev-dash > .ev-kpis { grid-column: 1 / -1; }
  .ev-dash > .card { margin-bottom: 18px; }
  .cal-layout { grid-template-columns: minmax(0, 1.7fr) minmax(340px, 1fr); }
}
@media (min-width: 1600px) { .page.today, .page.cal-page, .page.ev-page { max-width: 1320px; } }
.dow-pick .dow { min-width: 36px; min-height: 40px; }
/* La cabecera del entreno mide lo que mide: el contenido empieza siempre debajo (sin solapes en 320 px). */
.stage .slide { padding-top: max(calc(var(--sat) + 116px), calc(var(--hud-top, 116px) + 10px)) !important; }
.ev-head { flex-wrap: wrap; } .ev-head > h2, .ev-head > .h3, .ev-head > .section-title { white-space: nowrap; }
.dash-head { flex-wrap: wrap; row-gap: 2px; } .dash-head h2 { white-space: nowrap; }
@media (max-width: 380px) { .nav-arr { width: 34px; height: 34px; } .dash-head h2 { font-size: 1.25rem; } }
@media (max-width: 380px), (max-height: 700px) {
  .intro-row.is-rest { display: none; }
  .swipe-cue, .swipe-hint { display: none !important; }
}
.ev-mtable td small { color: var(--muted); }
.ev-due { margin: 10px 0 0; color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.ev-due.is-due { color: var(--warn); font-weight: 600; }
.ev-every { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); } .ev-every select { min-height: 36px; border-radius: 8px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); padding: 0 6px; }
.ev-trend { color: var(--accent-text) !important; font-style: normal; }

/* v1.15.1 · dentro del visor de Claude no hay muesca que salvar: sin hueco arriba. */
html.embedded { --sat: 0px; }
/* Móvil: el punto de guardado va abajo a la derecha, sobre la barra, para no ocupar la cabecera. */
@media (max-width: 1023px) {
  body:not(.immersive) .savechip { top: auto; bottom: calc(var(--nav-h) + 10px); right: 12px; }
}

/* v1.15.2 tabla de báscula: unidad en la etiqueta, cifras sin partir */
.ev-chart .ev-table td.num, .ev-chart .ev-table th { white-space: nowrap; }

/* v1.16 acceso (instalación con servidor) */
.login-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--sat) + 24px) 16px 24px; background: var(--bg); }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; padding: 28px 22px; }
.login-card h1 { margin: 0; }
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 24px; letter-spacing: .08em; }
.login-logo { width: 40px; height: 40px; }
.btn-block { width: 100%; justify-content: center; }
.account-card p { margin: 0 0 6px; }
@media (max-width: 359px) { .ev-chart .ev-table { font-size: 13px; } .ev-chart .ev-table td, .ev-chart .ev-table th { padding-left: 4px; padding-right: 4px; } }
