/* Forja: paleta tomada de los discos olímpicos (rojo 25 kg, azul 20 kg, amarillo 15 kg, verde 10 kg) */
:root {
  --fondo: #EDF0EC;
  --superficie: #FFFFFF;
  --tinta: #1D2733;
  --tenue: #5B6672;
  --linea: #CBD2CF;
  --acero: #8A949C;
  --rojo: #C62F3B;
  --azul: #2457A4;
  --amarillo: #E1A912;
  --verde: #2F8A57;
  --sobre-oscuro: #FFFFFF;
  --cabecera: #1D2733;
  --radio: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #141920;
    --superficie: #1D242D;
    --tinta: #E6EAE7;
    --tenue: #9AA5AF;
    --linea: #2F3944;
    --acero: #6D7882;
    --rojo: #E04B57;
    --azul: #4F86D8;
    --amarillo: #F0BE3A;
    --verde: #49B47A;
    --cabecera: #0F1318;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--tinta);
  font: 400 16px/1.5 "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
h1, h2, h3, .num {
  font-family: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: .01em;
}
h1 { font-size: 2rem; margin: 0 0 .25rem; }
h2 { font-size: 1.45rem; margin: 0 0 .6rem; }
h3 { font-size: 1.15rem; margin: 0 0 .4rem; }
p { margin: 0 0 .75rem; }
a { color: var(--azul); }
small, .tenue { color: var(--tenue); }

/* Cabecera y navegación */
.cabecera {
  position: sticky; top: 0; z-index: 10;
  background: var(--cabecera); color: var(--sobre-oscuro);
  padding-top: env(safe-area-inset-top, 0px);
}
.cabecera-in {
  max-width: 980px; margin: 0 auto; padding: .5rem 1rem;
  display: flex; align-items: center; gap: 1rem;
}
.marca {
  font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.5rem;
  color: #fff; text-decoration: none; display: flex; align-items: center; gap: .45rem;
}
.marca svg { width: 26px; height: 26px; }
.nav { display: flex; gap: .15rem; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: #C9D2D9; text-decoration: none; padding: .45rem .65rem; border-radius: var(--radio);
  white-space: nowrap; font-weight: 500;
}
.nav a:hover { color: #fff; }
.nav a.activo { color: #fff; box-shadow: inset 0 -3px 0 var(--amarillo); border-radius: 0; }
.salir { background: none; border: 0; color: #C9D2D9; cursor: pointer; font: inherit; padding: .45rem; }

.contenido { max-width: 980px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

/* Bloques */
.bloque {
  background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 1rem 1.1rem; margin-bottom: 1rem;
}
.rejilla { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .rejilla.dos { grid-template-columns: 1fr 1fr; } }
.rejilla > .bloque { margin-bottom: 0; }
.fila { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.entre { justify-content: space-between; }

/* Hoy: la barra cargada */
.carga { padding: 1.25rem 1.1rem 1rem; }
.carga-cifra { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 3.6rem; line-height: 1; }
.carga-cifra span { font-size: 1.4rem; font-weight: 500; color: var(--tenue); }
.barra { width: 100%; max-width: 640px; height: auto; display: block; margin: .75rem 0; }
.barra .eje { fill: var(--acero); }
.barra .tope { fill: var(--tinta); }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.macro { border-left: 6px solid var(--c); padding: .15rem 0 .15rem .6rem; }
.macro b { display: block; font-family: "Barlow Condensed", sans-serif; font-size: 1.35rem; font-weight: 600; }
.macro small { display: block; }
.c-prot { --c: var(--rojo); } .c-carb { --c: var(--amarillo); } .c-gras { --c: var(--azul); }
.excedido { color: var(--rojo); font-weight: 600; }

/* Listas */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .55rem 0; border-top: 1px solid var(--linea); }
.lista li:first-child { border-top: 0; }
.lista .der { text-align: right; white-space: nowrap; }
.pasos { margin: .25rem 0 0; padding-left: 1.2rem; }
.pasos li { margin: .2rem 0; }

/* Formularios */
label { display: block; font-weight: 500; font-size: .92rem; margin-bottom: .25rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--tinta); background: var(--superficie);
  border: 1px solid var(--linea); border-radius: var(--radio); padding: .55rem .65rem; min-height: 44px;
}
textarea { min-height: 7rem; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--amarillo); outline-offset: 1px;
}
input[type=checkbox] { width: auto; min-height: 0; accent-color: var(--verde); }
.campos { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: .75rem; }
.campos .ancho { grid-column: 1 / -1; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.dias { display: flex; flex-wrap: wrap; gap: .35rem; }
.dias label { display: inline-flex; gap: .3rem; align-items: center; font-weight: 400; border: 1px solid var(--linea); border-radius: var(--radio); padding: .25rem .5rem; margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: 600 1rem "Barlow", sans-serif; min-height: 44px; padding: .5rem 1rem;
  border-radius: var(--radio); border: 1px solid var(--tinta); background: var(--tinta); color: var(--fondo);
  cursor: pointer; text-decoration: none;
}
.btn.sec { background: transparent; color: var(--tinta); border-color: var(--linea); }
.btn.ok { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn.chico { min-height: 34px; padding: .25rem .65rem; font-size: .9rem; }
.btn-x {
  background: none; border: 0; color: var(--tenue); cursor: pointer; font-size: 1.2rem; line-height: 1;
  min-width: 34px; min-height: 34px; border-radius: var(--radio);
}
.btn-x:hover { color: var(--rojo); }
form.enlinea { display: inline; margin: 0; }

/* Mensajes */
.aviso { border-radius: var(--radio); padding: .7rem .9rem; margin-bottom: 1rem; border: 1px solid; }
.aviso.ok { border-color: var(--verde); background: color-mix(in srgb, var(--verde) 12%, var(--superficie)); }
.aviso.error { border-color: var(--rojo); background: color-mix(in srgb, var(--rojo) 10%, var(--superficie)); }
.aviso ul { margin: 0; padding-left: 1.1rem; }

/* Días del plan */
details.dia { border-top: 1px solid var(--linea); padding: .6rem 0; }
details.dia:first-of-type { border-top: 0; }
details.dia summary { cursor: pointer; display: flex; justify-content: space-between; gap: .75rem; list-style: none; }
details.dia summary::-webkit-details-marker { display: none; }
details.dia[open] summary { margin-bottom: .6rem; }
.etiqueta { display: inline-block; font-size: .82rem; padding: .05rem .45rem; border-radius: 3px; background: var(--fondo); color: var(--tenue); }
.hoy-marca { box-shadow: inset 4px 0 0 var(--amarillo); padding-left: .6rem; }

/* Gráficos */
.grafico { width: 100%; height: auto; display: block; }
.grafico polyline { fill: none; stroke: var(--azul); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.grafico circle { fill: var(--azul); }
.grafico .meta { stroke: var(--verde); stroke-dasharray: 6 6; stroke-width: 2; }

/* Tablas */
.tabla-env { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .45rem .5rem; border-top: 1px solid var(--linea); }
th { font-weight: 600; color: var(--tenue); border-top: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }

/* Acceso */
.acceso { max-width: 380px; margin: 8vh auto 0; }
.acceso .marca { color: var(--tinta); font-size: 2.4rem; margin-bottom: 1rem; }

@media (max-width: 520px) {
  h1 { font-size: 1.7rem; }
  .carga-cifra { font-size: 3rem; }
  .macro b { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .barra .disco { transition: width .4s ease; }
}

/* Fichas de ejercicios */
details.como { margin: .3rem 0 .6rem; }
details.como summary { cursor: pointer; color: var(--azul); font-size: .92rem; }
.ficha { margin: .6rem 0 0; }
.ficha-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; margin-bottom: .4rem; }
.ficha-imgs img { width: 100%; height: auto; border-radius: var(--radio); background: var(--linea); display: block; }
.ficha figcaption b { font-family: "Barlow Condensed", sans-serif; font-size: 1.15rem; font-weight: 600; }
.catalogo { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.catalogo .ficha { margin: 0; }
