/* ─────────────────────────── Tokens ───────────────────────────
   Estilo: fondo beige, tarjetas claras redondeadas y azul eléctrico como
   acento. El verde marca lo hecho y la salud (cuestionario de aptitud física).
   El temporizador mantiene los colores de los discos olímpicos con
   significado: azul = descanso en curso, amarillo = últimos 10 s,
   rojo = a la próxima serie / peligro. */
:root {
  --bg: #f3ede3;
  --surface: #fffcf7;
  --surface-2: #f1e9dc;
  --ink: #1c1814;
  --ink-2: #665d52;
  --ink-3: #988d80;
  --line: #e7ddcd;
  --plate-blue: #1f4dff;
  --plate-blue-2: #4f7bff;
  --plate-red: #e0364f;
  --plate-yellow: #f0a80c;
  --plate-green: #17a35a;
  --on-plate: #ffffff;
  --accent-soft: #e5eaff;
  --accent-glow: rgb(31 77 255 / 0.22);
  --glow-top: rgb(31 77 255 / 0.11);
  --glow-bottom: rgb(240 168 12 / 0.13);
  --green-soft: #e0f4e7;
  --red-soft: #fce8eb;
  --warning-bg: #fcefd6;
  --warning-line: #f0a80c;
  --shadow: 0 1px 2px rgb(60 45 25 / 0.05), 0 6px 20px rgb(60 45 25 / 0.07);
  --shadow-hover: 0 2px 4px rgb(60 45 25 / 0.06), 0 14px 32px rgb(60 45 25 / 0.12);
  --shadow-float: 0 2px 6px rgb(60 45 25 / 0.07), 0 12px 32px rgb(60 45 25 / 0.14);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font-body);
  --radius: 12px;
  --radius-lg: 20px;
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15120e;
    --surface: #1f1b16;
    --surface-2: #2a251e;
    --ink: #f3ede4;
    --ink-2: #b3a999;
    --ink-3: #807769;
    --line: #362f27;
    --plate-blue: #4a6dff;
    --plate-blue-2: #7a95ff;
    --plate-red: #f0566c;
    --plate-yellow: #f5b82e;
    --plate-green: #34c474;
    --accent-soft: #1d2350;
    --accent-glow: rgb(74 109 255 / 0.28);
    --glow-top: rgb(74 109 255 / 0.17);
    --glow-bottom: rgb(240 168 12 / 0.07);
    --green-soft: #133022;
    --red-soft: #3b1a20;
    --warning-bg: #352a12;
    --warning-line: #c99320;
    --shadow: 0 0 0 1px var(--line);
    --shadow-hover: 0 0 0 1px var(--plate-blue);
    --shadow-float: 0 0 0 1px var(--line), 0 12px 32px rgb(0 0 0 / 0.45);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #15120e;
  --surface: #1f1b16;
  --surface-2: #2a251e;
  --ink: #f3ede4;
  --ink-2: #b3a999;
  --ink-3: #807769;
  --line: #362f27;
  --plate-blue: #4a6dff;
  --plate-blue-2: #7a95ff;
  --plate-red: #f0566c;
  --plate-yellow: #f5b82e;
  --plate-green: #34c474;
  --accent-soft: #1d2350;
  --accent-glow: rgb(74 109 255 / 0.28);
  --glow-top: rgb(74 109 255 / 0.17);
  --glow-bottom: rgb(240 168 12 / 0.07);
  --green-soft: #133022;
  --red-soft: #3b1a20;
  --warning-bg: #352a12;
  --warning-line: #c99320;
  --shadow: 0 0 0 1px var(--line);
  --shadow-hover: 0 0 0 1px var(--plate-blue);
  --shadow-float: 0 0 0 1px var(--line), 0 12px 32px rgb(0 0 0 / 0.45);
  color-scheme: dark;
}

/* ─────────────────────────── Base ─────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* Fondo: un resplandor azul arriba, uno cálido abajo y un grano muy fino,
   fijos detrás del contenido para que el beige no quede plano. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(55rem 38rem at 105% -8%, var(--glow-top), transparent 62%),
    radial-gradient(50rem 36rem at -12% 108%, var(--glow-bottom), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 1;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

a {
  color: var(--plate-blue);
  text-underline-offset: 3px;
}

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

p {
  margin: 0 0 0.75rem;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.02em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.print-only {
  display: none;
}

/* Tarjeta: la superficie base de casi todo. */
.today,
.sections,
.row-list,
.session-list,
.facts,
.more,
.timer-settings,
.settings-block,
.steps,
.parq,
.stat,
.ex,
.search-results,
.notice,
.confirm {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ─────────────────────────── Estructura ─────────────────────────── */
.app {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 40rem;
  margin: 0 auto;
  padding: 14px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 26px;
  height: 26px;
}

.main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 8px var(--gutter) 48px;
}

.page-title {
  font-size: 1.75rem;
  margin: 0.75rem 0 0.25rem;
}

.section-title {
  font-size: 1.125rem;
  margin: 2rem 0 0.75rem;
}

.lead {
  font-size: 1.0625rem;
  color: var(--ink-2);
  max-width: 34em;
}

.lead strong {
  color: var(--ink);
}

.lead-small {
  color: var(--ink-2);
}

.section-lead {
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.fine,
.disclaimer {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.disclaimer {
  margin-top: 2rem;
  text-align: center;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1.25rem;
}

.plain-list {
  margin: 0;
  padding-left: 1.1rem;
}

.plain-list li + li {
  margin-top: 0.35rem;
}

/* ─────────────────────────── Botones ─────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: none;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, filter 0.15s ease, transform 0.1s ease;
}

.button:active:not(:disabled) {
  transform: scale(0.98);
}

.button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.button-primary {
  background: linear-gradient(135deg, var(--plate-blue), var(--plate-blue-2));
  color: #fff;
  box-shadow: 0 6px 18px var(--accent-glow);
}

.button-primary:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: 0 10px 26px var(--accent-glow);
}

.button-secondary {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 1px 2px rgb(20 24 29 / 0.04);
}

.button-secondary:hover:not(:disabled) {
  background: var(--surface-2);
}

.button-ghost {
  color: var(--ink-2);
}

.button-ghost:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-2);
}

.button-link {
  min-height: 0;
  padding: 4px 0;
  color: var(--plate-blue);
  font-weight: 500;
}

.button-link:hover {
  text-decoration: underline;
}

.button-large {
  min-height: 54px;
  padding: 0 26px;
  font-size: 1.0625rem;
}

.button-small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.875rem;
}

.button-link.button-small {
  min-height: 0;
  padding: 2px 0;
}

.button-danger {
  background: var(--plate-red);
  color: #fff;
}

.button-danger-outline {
  background: var(--red-soft);
  color: var(--plate-red);
}

/* ─────────────────────────── Bienvenida ─────────────────────────── */
.hero {
  padding: 2.5rem 0 1.5rem;
}

.hero-title {
  font-size: clamp(2.25rem, 9vw, 3.25rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: 12ch;
  margin-bottom: 1rem;
}

.hero .lead {
  margin-bottom: 1.75rem;
}

.hero .button-large {
  width: 100%;
  max-width: 22rem;
}

.hero .fine {
  margin-top: 0.75rem;
}

.steps {
  margin: 0;
  padding: 6px 18px;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 14px 0 14px 3rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.steps li + li {
  border-top: 1px solid var(--line);
}

.steps li strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  margin-bottom: 2px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 14px;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--plate-blue);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9375rem;
}

/* ─────────────────────────── Formularios ─────────────────────────── */
.progress {
  margin: 0.75rem 0 1rem;
}

.progress-track {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--plate-blue), var(--plate-blue-2));
  border-radius: 999px;
  transition: width 0.45s var(--ease-out);
}

.progress-text {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-3);
}

.form {
  margin-top: 1.25rem;
}

.field {
  margin-bottom: 1.5rem;
  border: 0;
  padding: 0;
}

.fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1.5rem;
}

.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
  padding: 0;
}

.field-control {
  position: relative;
  display: flex;
  align-items: center;
}

.field-suffix {
  position: absolute;
  right: 14px;
  color: var(--ink-3);
  pointer-events: none;
}

.field-hint {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.field-error {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--plate-red);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0 12px;
}

.input {
  width: 100%;
  min-height: 50px;
  padding: 0 52px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input[type="search"] {
  padding-right: 14px;
}

.input::placeholder {
  color: var(--ink-3);
}

.input:focus {
  border-color: var(--plate-blue);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.field-invalid .input {
  border-color: var(--plate-red);
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
}

.segment {
  flex: 1 1 0;
  min-width: 3.25rem;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.segment[aria-checked="true"] {
  background: linear-gradient(135deg, var(--plate-blue), var(--plate-blue-2));
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
  animation: pop 0.28s var(--ease-pop);
}

.segmented-small {
  display: inline-flex;
}

.segmented-small .segment {
  min-height: 38px;
  flex: 0 0 4.5rem;
}

.choices {
  display: grid;
  gap: 8px;
}

.choice {
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 14px 16px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.choice-name {
  font-weight: 600;
}

.choice-hint {
  font-size: 0.875rem;
  color: var(--ink-2);
}

.choice[aria-checked="true"] {
  border-color: var(--plate-blue);
  background: var(--accent-soft);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chip[aria-pressed="true"],
.chip-on {
  background: var(--accent-soft);
  border-color: var(--plate-blue);
  color: var(--plate-blue);
}

.chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chips-removable {
  margin-top: 10px;
}

.search-results {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  overflow: hidden;
}

.search-result {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 8px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.search-result:hover {
  background: var(--surface-2);
}

.search-results li:last-child .search-result {
  border-bottom: 0;
}

.search-add {
  color: var(--plate-red);
  font-weight: 600;
  font-size: 0.875rem;
}

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
}

.check input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--plate-blue);
}

.parq {
  margin: 0 0 1rem;
  padding: 4px 16px;
  list-style: none;
}

.parq-item {
  padding: 14px 0;
}

.parq-item + .parq-item {
  border-top: 1px solid var(--line);
}

.parq-question {
  margin-bottom: 10px;
  font-size: 0.9375rem;
}

/* Salud: el cuestionario de aptitud física y el aviso de salud van en verde. */
.parq {
  counter-reset: parq;
  box-shadow: 0 0 0 1.5px var(--green-soft), var(--shadow);
}

.parq-item {
  counter-increment: parq;
  position: relative;
  padding-left: 2.6rem;
}

.parq-item::before {
  content: counter(parq);
  position: absolute;
  left: 0;
  top: 14px;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--plate-green);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8125rem;
}

.parq .segment[aria-checked="true"] {
  background: var(--plate-green);
  box-shadow: 0 4px 12px rgb(23 163 90 / 0.3);
}

.parq ~ .field .check input {
  accent-color: var(--plate-green);
}

.settings-block[aria-labelledby="aviso"] {
  background: var(--green-soft);
  box-shadow: none;
}

.settings-block[aria-labelledby="aviso"] .section-title {
  color: var(--plate-green);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2rem;
}

.form-actions .button-primary {
  flex: 1;
  max-width: 18rem;
}

/* ─────────────────────────── Avisos ─────────────────────────── */
.notice {
  padding: 14px 16px;
  margin: 1rem 0 1.5rem;
  font-size: 0.9375rem;
}

.notice-warning {
  background: var(--warning-bg);
  box-shadow: none;
}

.notice-title {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.notice-body > :last-child {
  margin-bottom: 0;
}

.confirm {
  padding: 16px;
  box-shadow: 0 0 0 1.5px var(--plate-red);
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

/* ─────────────────────────── Secciones (comunes) ─────────────────────────── */
.page-sub {
  color: var(--ink-2);
  margin-bottom: 1.25rem;
}

.list-title {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink-3);
  margin: 1.75rem 4px 0.6rem;
}

.tag {
  flex: none;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.tag-done {
  background: var(--green-soft);
  color: var(--plate-green);
}

.tag-progress {
  background: var(--accent-soft);
  color: var(--plate-blue);
}

.row-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.row,
.srow-head {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.row-list li + li .row,
.session-list li + li .srow-head {
  border-top: 1px solid var(--line);
}

.row-main {
  flex: 1;
  min-width: 0;
  display: grid;
}

.row-name {
  font-weight: 600;
  line-height: 1.3;
}

.row-meta {
  font-size: 0.8125rem;
  color: var(--ink-2);
}

/* ─────────────────────────── Barra de pestañas ─────────────────────────── */
/* Flotante: una píldora separada del borde de la pantalla. */
.app-tabs .main {
  padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
}

.tabbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: var(--shadow-float);
}

.tab {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 7px 4px 6px;
  border-radius: 999px;
  color: var(--ink-3);
  text-decoration: none;
  font-size: 0.6875rem;
  font-weight: 600;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.tab-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab[aria-current="page"] {
  color: var(--plate-blue);
  background: var(--accent-soft);
}

@media (min-width: 720px) {
  .tabbar {
    left: 50%;
    right: auto;
    bottom: 20px;
    transform: translateX(-50%);
    width: 26rem;
  }
}

/* ─────────────────────────── Inicio con rutina ─────────────────────────── */
.home {
  padding-top: 0.75rem;
}

.home-ready {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--plate-green);
  font-weight: 600;
  font-size: 0.8125rem;
}

.today {
  padding: 20px;
  background:
    radial-gradient(110% 80% at 100% 0%, var(--accent-soft), transparent 60%),
    var(--surface);
}

.today-week {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.today-title {
  font-size: clamp(1.75rem, 7vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-wrap: balance;
  margin-bottom: 0.4rem;
}

.today-meta {
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.today-cta {
  width: 100%;
  margin-top: 0.5rem;
}

.week-dots {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 1.25rem 0 0;
  padding: 0;
}

.dot {
  flex: 1;
  display: grid;
  gap: 6px;
}

.dot::before {
  content: "";
  height: 6px;
  border-radius: 999px;
  background: var(--line);
}

.dot-done::before {
  background: var(--plate-green);
}

.dot-progress::before {
  background: linear-gradient(90deg, var(--plate-blue) 50%, var(--line) 50%);
}

.dot-next::before {
  background: var(--plate-blue);
  opacity: 0.35;
}

.dot-progress.dot-next::before {
  opacity: 1;
}

.dot-day {
  font-size: 0.6875rem;
  color: var(--ink-3);
  font-weight: 600;
}

.dot-next .dot-day {
  color: var(--plate-blue);
}

.sections {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

.section-row {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 7.5rem;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s ease;
}

.section-row:active {
  transform: scale(0.98);
}

.section-name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.section-sum {
  font-size: 0.8125rem;
  color: var(--ink-2);
  line-height: 1.4;
}

/* Vista previa de la sesión de hoy: los primeros ejercicios con la última carga. */
.preview {
  list-style: none;
  margin: 14px 0 4px;
  padding: 0;
  display: grid;
  gap: 2px;
}

.preview-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 0.875rem;
}

.preview-row + .preview-row {
  border-top: 1px solid var(--line);
}

.preview-name {
  font-weight: 500;
  min-width: 0;
}

.preview-dose {
  flex: none;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.preview-up {
  color: var(--plate-blue);
  font-weight: 600;
}

.preview-more {
  padding-top: 4px;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

/* Calendario de la semana del plan. */
.week-cal {
  list-style: none;
  margin: 12px 0 0;
  padding: 10px 8px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.cal-day {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.cal-initial {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ink-3);
}

.cal-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.cal-today .cal-num {
  box-shadow: inset 0 0 0 1.5px var(--plate-blue);
  color: var(--plate-blue);
}

.cal-trained .cal-num {
  background: var(--plate-green);
  color: #fff;
  box-shadow: none;
  animation: pop 0.35s var(--ease-pop) 0.3s both;
}

/* Números de la semana. */
.home-stats {
  margin: 12px 0 0;
}

.stat-note {
  display: block;
  margin-top: 4px;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-3);
}

.stat-up {
  color: var(--plate-green);
}

/* Tarjetas chicas del inicio y del resumen: récords y última sesión. */
.home-card {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.home-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.records {
  list-style: none;
  margin: 0;
  padding: 0;
}

.record {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 0.9375rem;
}

.record + .record {
  border-top: 1px solid var(--line);
}

.record-name::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--plate-yellow);
  vertical-align: 1px;
}

.record-value {
  flex: none;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.last-session {
  margin: 0;
  font-weight: 500;
}

/* Nota de la semana (fase del plan o aviso de descarga). */
.home-note {
  margin: 12px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  color: var(--plate-blue);
  font-size: 0.875rem;
  font-weight: 500;
}

/* ─────────────────────────── Entrenar ─────────────────────────── */
.train-next {
  display: grid;
  gap: 2px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 100% 0%, rgb(255 255 255 / 0.22), transparent 55%),
    linear-gradient(135deg, var(--plate-blue), var(--plate-blue-2));
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 28px var(--accent-glow);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.train-next-label {
  font-size: 0.8125rem;
  font-weight: 600;
  opacity: 0.8;
}

.train-next-name {
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.train-next-meta {
  opacity: 0.85;
  font-size: 0.9375rem;
  margin-bottom: 16px;
}

.train-next-cta {
  justify-self: start;
  background: #fff;
  color: var(--plate-blue);
  min-width: 8rem;
}

.train-complete {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--green-soft);
  color: var(--plate-green);
  font-weight: 600;
}

/* ─────────────────────────── Rutina ─────────────────────────── */
.week-switch {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.5rem;
}

.week-arrow {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.week-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.week-switch-label {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.week-switch-title {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

.week-switch-of {
  color: var(--ink-3);
  font-weight: 500;
}

.week-switch-tags {
  display: flex;
  gap: 6px;
  min-height: 1.3rem;
}

.week-note {
  color: var(--ink-2);
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.badge {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--plate-blue);
}

.badge-deload {
  background: var(--green-soft);
  color: var(--plate-green);
}

.session-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.srow-day {
  flex: none;
  width: 3rem;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.srow-body {
  padding: 0 16px 18px calc(3rem + 30px);
}

.srow-focus {
  color: var(--ink-2);
  font-size: 0.875rem;
}

.ex-plain {
  margin: 0 0 16px;
  padding-left: 1.25rem;
  display: grid;
  gap: 8px;
}

.ex-plain li::marker {
  color: var(--ink-3);
  font-weight: 600;
}

.ex-plain-name {
  display: block;
  font-weight: 600;
  line-height: 1.3;
}

.ex-plain-dose {
  display: block;
  font-size: 0.8125rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* ─────────────────────────── Mis datos ─────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 1rem 0 1.25rem;
}

.stat {
  padding: 14px;
  min-width: 0;
}

.stat dt {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-3);
}

.stat dd {
  margin: 4px 0 0;
  font-weight: 800;
  font-size: 1.625rem;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.stat small {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-2);
}

.facts {
  margin: 0;
  padding: 2px 16px;
}

.fact {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 12px;
  padding: 12px 0;
}

.fact + .fact {
  border-top: 1px solid var(--line);
}

.fact dt {
  color: var(--ink-2);
  font-size: 0.875rem;
}

.fact dd {
  margin: 0;
  font-weight: 500;
  font-size: 0.9375rem;
  min-width: 0;
}

.more {
  margin-top: 1.25rem;
  padding: 0 16px;
}

.more summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 600;
  color: var(--plate-blue);
}

.more-body {
  padding-bottom: 8px;
}

.more-body p {
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.more-body strong {
  color: var(--ink);
}

.profile-settings {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.9375rem;
}

.volume-list {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.volume-row {
  display: grid;
  grid-template-columns: 7rem 1fr 4.5rem;
  align-items: center;
  gap: 10px;
}

.volume-name {
  font-weight: 500;
  font-size: 0.875rem;
}

.volume-bar {
  position: relative;
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
}

.volume-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--plate-blue);
  border-radius: 999px;
}

.volume-target {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
  border-radius: 2px;
}

.volume-num {
  font-weight: 700;
  font-size: 0.9375rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.volume-of {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--ink-3);
}

/* ─────────────────────────── Sesión ─────────────────────────── */
.app-workout .main {
  padding-top: 12px;
}

.workout-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.workout-title .page-title {
  font-size: 1.375rem;
  margin: 0;
}

.workout-meta {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.workout-count {
  margin: 0;
  text-align: right;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink-3);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.count-big {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.count-label {
  display: block;
  margin-top: 2px;
  font-size: 0.6875rem;
  font-weight: 500;
}

.workout-timer-open {
  padding-bottom: 220px;
}

.ex-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.ex {
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease;
}

.ex-open {
  box-shadow: 0 0 0 1.5px var(--plate-blue), var(--shadow);
}

.ex-complete {
  background: transparent;
  box-shadow: 0 0 0 1px var(--line);
}

.ex-top {
  display: flex;
  align-items: center;
  padding-right: 14px;
}

.ex-top .ex-head {
  flex: 1;
  min-width: 0;
  padding-right: 10px;
}

.ex-head {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-lg);
}

.ex-index {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 700;
  font-size: 0.875rem;
}

.ex-open .ex-index {
  background: var(--accent-soft);
  color: var(--plate-blue);
}

.ex-complete .ex-index {
  background: var(--green-soft);
  color: var(--plate-green);
}

.ex-title {
  display: grid;
}

.ex-title-name {
  font-weight: 600;
  line-height: 1.3;
}

.ex-title-meta {
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.ex-progress {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.ex-complete .ex-progress {
  color: var(--plate-green);
}

.ex-body {
  padding: 0 16px 16px;
}

.ex-sub {
  font-size: 0.875rem;
  color: var(--ink-2);
}

.rest-line {
  font-size: 0.875rem;
  color: var(--ink-2);
}

.rest-line strong {
  color: var(--ink);
}

.rest-editor {
  margin: 0 0 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.rest-editor-label {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 8px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.stepper-value {
  font-weight: 800;
  font-size: 1.625rem;
  letter-spacing: -0.02em;
  min-width: 4ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.rest-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.sets {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
}

.set {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}

.set-n {
  font-weight: 600;
  min-width: 4.5rem;
}

.set-result {
  font-variant-numeric: tabular-nums;
}

.set-done .set-result {
  font-weight: 600;
}

.set-done .set-n::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--plate-green);
  vertical-align: 1px;
}

.set-pending {
  color: var(--ink-3);
}

.set-current {
  display: block;
  padding: 14px 0 4px;
}

.set-current .set-n {
  display: block;
  margin-bottom: 8px;
}

.set-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mini-field {
  display: grid;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--ink-2);
  font-weight: 500;
}

.input-set {
  padding: 0 14px;
  background: var(--surface-2);
  border-color: transparent;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  min-height: 56px;
  font-variant-numeric: tabular-nums;
}

.set-done-btn {
  grid-column: 1 / -1;
  min-height: 54px;
  font-size: 1rem;
}

.finish {
  margin-top: 1.5rem;
  display: grid;
  gap: 12px;
}

.finish-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--plate-green);
  text-align: center;
  margin: 0;
}

/* Botón "?": cómo se hace el ejercicio. Redondo y con color para que se note. */
.help-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--plate-blue), var(--plate-blue-2));
  color: #fff;
  box-shadow: 0 3px 10px var(--accent-glow);
  font: inherit;
  font-weight: 800;
  font-size: 0.9375rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.help-btn:active {
  transform: scale(0.9);
}

/* En las listas (rutina y alternativas), el "?" va en una columna a la
   derecha, alineado en vertical, del mismo tamaño que en la sesión. */
.ex-plain-item,
.swap-item {
  position: relative;
  padding-right: 44px;
}

.ex-plain-item .help-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.ex-plain-item .help-btn:active {
  transform: translateY(-50%) scale(0.9);
}

.swap-item .help-btn {
  position: absolute;
  right: 0;
  top: 10px;
}

/* Hoja con la explicación: sube desde abajo en el celular. */
.sheet {
  width: 100%;
  max-width: min(32rem, 100%);
  max-height: 85vh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-float);
  overflow: auto;
}

.sheet[open] {
  animation: sheet-up 0.35s var(--ease-out);
}

.sheet::backdrop {
  background: rgb(20 15 10 / 0.45);
}

@media (min-width: 720px) {
  .sheet {
    margin: auto;
    border-radius: var(--radius-lg);
  }
  .sheet[open] {
    animation: rise 0.3s var(--ease-out);
  }
}

.sheet-body {
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom, 0px));
}

.sheet-kicker {
  margin: 0 0 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--plate-blue);
}

.sheet-title {
  font-size: 1.375rem;
  margin-bottom: 4px;
}

.sheet-meta {
  font-size: 0.875rem;
  color: var(--ink-2);
}

.sheet-text {
  font-size: 1rem;
  line-height: 1.6;
}

.sheet-fine {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.sheet-close {
  width: 100%;
  margin-top: 6px;
}

/* Cambiar un ejercicio por otro. */
.swap-open {
  display: block;
  margin: -4px 0 10px;
}

.swap {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  animation: rise 0.35s var(--ease-out);
}

.swap-title {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 8px;
}

.swap-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.swap-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 0;
}

.swap-item + .swap-item {
  border-top: 1px solid var(--line);
}

.swap-info {
  display: grid;
  min-width: 0;
}

.swap-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.swap-meta {
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.swap-actions {
  display: flex;
  gap: 6px;
}

/* Sugerencia de subir el peso: se ofrece antes de la primera serie y se puede ignorar. */
.suggestion {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  animation: rise 0.4s var(--ease-out);
}

.suggestion-text {
  margin-bottom: 10px;
  font-size: 0.875rem;
}

.suggestion-text strong {
  color: var(--plate-blue);
}

.suggestion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Resumen al terminar la sesión. */
.summary {
  padding-top: 1.5rem;
}

.summary-kicker {
  display: inline-block;
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--plate-green);
  font-size: 0.8125rem;
  font-weight: 600;
}

.summary .stats {
  margin-top: 1.25rem;
}

.summary-compare {
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.summary-up {
  color: var(--plate-green);
  font-weight: 600;
}

.summary-done {
  width: 100%;
}

.timer-settings {
  margin-top: 1.5rem;
  padding: 4px 16px 12px;
  font-size: 0.9375rem;
}

.timer-settings summary {
  cursor: pointer;
  font-weight: 600;
  padding: 12px 0;
}

/* ─────────────────────────── Temporizador ───────────────────────────
   Un anillo fino que se va llenando. El color sigue el código de los discos:
   azul descansando, amarillo en los últimos 10 s, rojo a la próxima serie. */
.timer {
  --plate: var(--plate-blue);
  --plate-ink: var(--ink);
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 18px max(var(--gutter), calc((100vw - 40rem) / 2 + var(--gutter))) calc(18px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-float);
}

.timer-yellow {
  --plate: var(--plate-yellow);
}

.timer-red {
  --plate: var(--plate-red);
}

.timer-grey {
  --plate: var(--ink-3);
}

.timer-plate {
  position: relative;
  width: 150px;
  height: 150px;
}

.plate-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.plate-body {
  fill: var(--plate);
  fill-opacity: 0.08;
}

.plate-groove {
  fill: none;
  stroke: var(--plate);
  stroke-opacity: 0.16;
  stroke-width: 6;
}

.plate-progress {
  fill: none;
  stroke: var(--plate);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke 0.3s ease;
}

.plate-hub {
  fill: none;
}

.plate-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.timer-clock {
  font-weight: 800;
  font-size: 2.5rem;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--plate-ink);
  font-variant-numeric: tabular-nums;
}

.timer-status {
  margin: 0;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.timer-red .timer-status {
  color: var(--plate-red);
}

.timer-next {
  margin: 4px 0 12px;
  font-size: 0.875rem;
  color: var(--ink-2);
  line-height: 1.35;
}

.timer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tbtn {
  min-width: 54px;
  min-height: 46px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.tbtn-main {
  min-width: 84px;
  background: var(--plate);
  color: #fff;
}

.tbtn-skip {
  font-weight: 500;
  background: none;
  color: var(--ink-2);
}

.button-on-plate {
  background: var(--plate-red);
  color: #fff;
  min-width: 120px;
}

@media (max-width: 420px) {
  .timer {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 8px;
  }
  .timer-plate {
    width: 128px;
    height: 128px;
  }
  .timer-clock {
    font-size: 2.1rem;
  }
  .timer-controls {
    justify-content: center;
  }
  .timer-next {
    margin-bottom: 8px;
  }
  .workout-timer-open {
    padding-bottom: 330px;
  }
}

/* ─────────────────────────── Ajustes ─────────────────────────── */
.settings-block {
  margin-bottom: 12px;
  padding: 4px 18px 18px;
}

.settings-block .section-title {
  margin-top: 14px;
}

.settings-block .field:last-child {
  margin-bottom: 0;
}

.settings-block p {
  max-width: 38em;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.empty {
  padding: 2rem 0;
}

/* ─────────────────────────── Pantallas chicas ─────────────────────────── */
@media (max-width: 520px) {
  .fact {
    grid-template-columns: 7rem 1fr;
  }
  .volume-row {
    grid-template-columns: 6.5rem 1fr 4rem;
    gap: 8px;
  }
  .stat dd {
    font-size: 1.375rem;
  }
}

/* ─────────────────────────── Movimiento ───────────────────────────
   Cada pantalla y cada paso del formulario entran con un deslizamiento corto,
   y las listas aparecen en cascada. Con "reducir movimiento" activado en el
   dispositivo no se anima nada (ver más abajo). */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pop {
  0% {
    transform: scale(0.94);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes grow {
  from {
    transform: scaleX(0);
  }
}

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.main > * > *,
.form > *,
.sections > *,
.row-list > li,
.session-list > li,
.ex-list > li,
.steps > li,
.stats > *,
.choices > * {
  animation: rise 0.5s var(--ease-out) both;
}

:is(.main > * > *, .form > *, .sections > *, .row-list > li, .session-list > li, .ex-list > li, .steps > li, .stats > *, .choices > *):nth-child(2) {
  animation-delay: 0.05s;
}
:is(.main > * > *, .form > *, .sections > *, .row-list > li, .session-list > li, .ex-list > li, .steps > li, .stats > *, .choices > *):nth-child(3) {
  animation-delay: 0.1s;
}
:is(.main > * > *, .form > *, .sections > *, .row-list > li, .session-list > li, .ex-list > li, .steps > li, .stats > *, .choices > *):nth-child(4) {
  animation-delay: 0.15s;
}
:is(.main > * > *, .form > *, .sections > *, .row-list > li, .session-list > li, .ex-list > li, .steps > li, .stats > *, .choices > *):nth-child(5) {
  animation-delay: 0.2s;
}
:is(.main > * > *, .form > *, .sections > *, .row-list > li, .session-list > li, .ex-list > li, .steps > li, .stats > *, .choices > *):nth-child(n + 6) {
  animation-delay: 0.25s;
}

.dot::before,
.volume-fill {
  transform-origin: left;
  animation: grow 0.7s var(--ease-out) 0.2s both;
}

.chip[aria-pressed="true"],
.choice[aria-checked="true"] {
  animation: pop 0.28s var(--ease-pop);
}

.choice:active,
.chip:active,
.train-next:active,
.tbtn:active {
  transform: scale(0.97);
}

.tab {
  transition: color 0.2s ease, background-color 0.25s var(--ease-out), transform 0.15s ease;
}

.tab:active {
  transform: scale(0.92);
}

.tab[aria-current="page"] .tab-icon {
  animation: pop 0.3s var(--ease-pop);
}

.section-row,
.choice,
.stat {
  transition:
    transform 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out),
    border-color 0.15s ease,
    background-color 0.15s ease;
}

/* Más específico que la cascada de arriba: el temporizador sube sin demora. */
.main .timer {
  animation: sheet-up 0.4s var(--ease-out) 0s;
}

.plate-progress {
  transition: stroke 0.3s ease, stroke-dasharray 0.25s linear;
}

.timer-yellow .timer-plate {
  animation: pulse 1s ease-in-out infinite;
}

.timer-red .timer-plate {
  animation: pulse 0.5s ease-in-out 3;
}

/* Efectos al pasar el mouse: solo con mouse, porque en pantallas táctiles
   quedan "pegados" después de tocar. */
@media (hover: hover) {
  .section-row:hover,
  .choice:hover,
  .stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
  }
  .train-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px var(--accent-glow);
  }
  .button-primary:hover:not(:disabled) {
    transform: translateY(-1px);
  }
  .segment:hover {
    color: var(--ink);
  }
  .row:hover,
  .srow-head:hover {
    background: var(--surface-2);
  }
  .tab:hover {
    color: var(--ink);
  }
  .tab[aria-current="page"]:hover {
    color: var(--plate-blue);
  }
  .section-row:hover .section-name {
    color: var(--plate-blue);
  }
  .tbtn:hover {
    filter: brightness(0.97);
  }
}

/* ─────────────────────── Recuadro del hosting ─────────────────────── */
/* El plan gratuito de Netlify agrega un recuadro fijo abajo a la derecha.
   Mientras está, HostBadge marca <html class="host-badge"> con su alto en
   --host-badge-h: lo fijo abajo sube por encima y el contenido deja lugar. */
.host-badge .main {
  padding-bottom: calc(48px + var(--host-badge-h));
}

.host-badge .app-tabs .main {
  padding-bottom: calc(112px + var(--host-badge-h) + env(safe-area-inset-bottom, 0px));
}

.host-badge .tabbar {
  bottom: max(calc(12px + env(safe-area-inset-bottom, 0px)), calc(var(--host-badge-h) + 8px));
}

.host-badge .timer {
  padding-bottom: max(calc(18px + env(safe-area-inset-bottom, 0px)), calc(var(--host-badge-h) + 8px));
}

.host-badge .workout-timer-open {
  padding-bottom: calc(220px + var(--host-badge-h));
}

@media (max-width: 420px) {
  .host-badge .workout-timer-open {
    padding-bottom: calc(330px + var(--host-badge-h));
  }
}

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

/* ─────────────────────────── Impresión / PDF ─────────────────────────── */
@media print {
  /* Siempre en claro al imprimir, aunque el modo oscuro esté activo. */
  :root,
  :root:not([data-theme="light"]),
  :root[data-theme="dark"] {
    color-scheme: light;
    --bg: #fff;
    --surface: #fff;
    --surface-2: #fff;
    --ink: #000;
    --ink-2: #333;
    --ink-3: #555;
    --line: #999;
    --shadow: none;
  }
  body {
    font-size: 11pt;
  }
  body::before {
    display: none;
  }
  .topbar,
  .tabbar,
  .help-btn,
  .no-print,
  .notice,
  .week-arrow,
  .timer,
  .disclaimer {
    display: none !important;
  }
  .print-only {
    display: block;
  }
  .main {
    max-width: none;
    padding: 0;
  }
  .page-title {
    font-size: 22pt;
  }
  .session-list {
    border-radius: 0;
  }
  .srow-head {
    padding: 8pt 0;
  }
  .srow-body {
    padding-left: calc(3rem + 14px);
  }
  .srow-body[hidden] {
    display: block !important;
  }
  .srow {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .srow-head .tag {
    display: none;
  }
  .print-footer {
    margin-top: 14pt;
    font-size: 9pt;
  }
}
