/* app.css — todo el diseño. Los colores viven solo en el bloque de temas:
   cambiar de estilo es cambiar ese bloque, nada más.

   Tres decisiones que sostienen el resto:
   1. Elevación real: fondo → tarjeta → control, cada nivel se ve. Con hairline y sombra.
   2. Jerarquía en tres niveles de texto y dos de botón: en cada pantalla manda una cosa.
   3. Escala fija: tipos (32/22/17/15.5/13/11.5), radios (18/12/pastilla) y espacios (4-8-12-16-20-28). */

/* ------------------------------------------------------------ temas */
:root, [data-tema="noche"] {
  --fondo: #08080B; --superficie: #131317; --superficie2: #1F1F25; --superficie3: #2B2B33;
  --linea: rgba(255,255,255,.08);
  --texto: #F5F5F7; --texto2: #9B9BA6; --texto3: #74747F;
  --acento: #9B8CFF; --enlace: #B3A8FF;
  --boton: #9B8CFF; --sobre-boton: #0B0716;
  --check: #9B8CFF; --sobre-check: #0B0716; --hecho: rgba(155,140,255,.12);
  --sug-fondo: rgba(155,140,255,.13); --sug-texto: #C4BBFF;
  --chip-fondo: rgba(155,140,255,.16); --chip-texto: #C4BBFF;
  --timer-fondo: #9B8CFF; --timer-texto: #0B0716; --timer-linea: #0B0716; --timer-btn: rgba(11,7,22,.14);
  --acento2: #C4BBFF; --anillo2: #F4F4F6; --anillo2b: #FFFFFF; --tab-activo: #9B8CFF;
  --aviso-fondo: rgba(255,120,110,.13); --aviso-texto: #FF9D94;
  --pinguino: #39404F; --pinguino-borde: rgba(255,255,255,.22);
  --num-font: -apple-system, "SF Pro Display", system-ui, "Segoe UI", sans-serif; --num-peso: 700; --num-track: -0.02em;
  --titulo-font: -apple-system, "SF Pro Display", system-ui, "Segoe UI", sans-serif; --titulo-peso: 700; --titulo-transform: none; --titulo-track: -0.022em;
  color-scheme: dark;
}

/* Grafito: gris oscuro suave en vez de negro puro. Lavanda de protagonista y rosa palo
   de segundo color (anillo de proteína). El fondo va un punto por debajo de las tarjetas
   para que cada tarjeta se lea como una pieza y no como una mancha. */
[data-tema="grafito"], [data-tema="grafito-rosa"], [data-tema="mixto"] {
  --fondo: #212127; --superficie: #2C2C34; --superficie2: #383842; --superficie3: #45454F;
  --linea: rgba(255,255,255,.075);
  --texto: #F5F5F8; --texto2: #A6A6B2; --texto3: #7C7C88;
  --acento: #A99BFF; --enlace: #BDB2FF;
  --boton: #A99BFF; --sobre-boton: #17122E;
  --check: #A99BFF; --sobre-check: #17122E; --hecho: rgba(169,155,255,.13);
  --sug-fondo: rgba(169,155,255,.14); --sug-texto: #CFC7FF;
  --chip-fondo: rgba(169,155,255,.17); --chip-texto: #D2CBFF;
  --timer-fondo: #A99BFF; --timer-texto: #17122E; --timer-linea: #17122E; --timer-btn: rgba(23,18,46,.14);
  --acento2: #CFC7FF; --anillo2: #EDB4C2; --anillo2b: #F7D2DB; --tab-activo: #BDB2FF;
  --aviso-fondo: rgba(255,138,118,.14); --aviso-texto: #FF9F8C;
  --pinguino: #3C4354; --pinguino-borde: rgba(255,255,255,.22);
}
/* La misma base con el rosa palo de protagonista y la lavanda de segundo color. */
[data-tema="grafito-rosa"] {
  --acento: #EDB4C2; --enlace: #F2C3CF;
  --boton: #EDB4C2; --sobre-boton: #2B1419;
  --check: #EDB4C2; --sobre-check: #2B1419; --hecho: rgba(237,180,194,.12);
  --sug-fondo: rgba(237,180,194,.14); --sug-texto: #F5CCD6;
  --chip-fondo: rgba(237,180,194,.17); --chip-texto: #F7D2DB;
  --timer-fondo: #EDB4C2; --timer-texto: #2B1419; --timer-linea: #2B1419; --timer-btn: rgba(43,20,25,.12);
  --acento2: #F7D2DB; --anillo2: #B9AEFF; --anillo2b: #D2CBFF; --tab-activo: #F2C3CF;
  --aviso-texto: #FF8F7A;
}

/* Lavanda y rosa: los dos a la vez. Lavanda en títulos, cabeceras, botones principales
   y pestañas; rosa palo en todo lo de cada ejercicio (series, ✓, sugerencias), el
   descanso y el anillo de proteína. */
[data-tema="mixto"] {
  --titulo-color: #CDC5FF;
  --check: #EDB4C2; --sobre-check: #2B1419; --hecho: rgba(237,180,194,.13);
  --timer-fondo: #EDB4C2; --timer-texto: #2B1419; --timer-linea: #2B1419; --timer-btn: rgba(43,20,25,.12);
  --anillo2: #EDB4C2;
}
[data-tema="mixto"] .ej {
  --acento: #EDB4C2; --enlace: #F2C3CF;
  --sug-fondo: rgba(237,180,194,.14); --sug-texto: #F5CCD6;
  --chip-fondo: rgba(237,180,194,.17); --chip-texto: #F7D2DB;
}

/* ------------------------------------------------------------ temas claros
   Gris muy claro casi blanco, con la tarjeta en blanco puro. Mismo sistema de fichas:
   solo cambian los valores. `claro-salvia` es el de Aida: verde suculenta y menta. */
[data-tema="claro"], [data-tema="claro-salvia"] {
  --fondo: #ECECF1; --superficie: #FFFFFF; --superficie2: #F1F1F6; --superficie3: #E3E3EB;
  --linea: rgba(22,22,38,.10);
  --texto: #1B1B22; --texto2: #585866; --texto3: #83838F;
  --acento: #6E5CE6; --acento2: #9B8CFF; --enlace: #5947D4;
  --boton: #6E5CE6; --sobre-boton: #FFFFFF;
  --check: #DE7F98; --sobre-check: #FFFFFF; --hecho: rgba(222,127,152,.12);
  --sug-fondo: rgba(110,92,230,.10); --sug-texto: #4A3BB5;
  --chip-fondo: rgba(110,92,230,.12); --chip-texto: #4A3BB5;
  --timer-fondo: #DE7F98; --timer-texto: #FFFFFF; --timer-linea: #FFFFFF; --timer-btn: rgba(255,255,255,.24);
  --anillo2: #DE7F98; --anillo2b: #F0AEC0; --tab-activo: #6E5CE6;
  --aviso-fondo: rgba(198,64,40,.10); --aviso-texto: #B23C28;
  --titulo-color: #4A3BB5;
  --marca: var(--texto2); --marca-sombra: none;
  --sombra: 0 1px 2px rgba(20,20,45,.07), 0 10px 22px -14px rgba(20,20,45,.22);
  --sombra-alta: 0 2px 6px rgba(20,20,45,.10), 0 24px 48px -22px rgba(20,20,45,.30);
  color-scheme: light;
}
/* El de Aida: verde suculenta de protagonista, menta de segundo color. */
[data-tema="claro-salvia"] {
  --fondo: #ECEFE9; --superficie: #FFFFFF; --superficie2: #F1F4ED; --superficie3: #E2E8DE;
  --linea: rgba(28,45,28,.10);
  --texto: #1A231B; --texto2: #545E54; --texto3: #7D877D;
  --acento: #4E8C5A; --acento2: #86B68C; --enlace: #3F7A4C;
  --boton: #4E8C5A; --sobre-boton: #FFFFFF;
  --check: #4E8C5A; --sobre-check: #FFFFFF; --hecho: rgba(78,140,90,.13);
  --sug-fondo: rgba(78,140,90,.11); --sug-texto: #35663F;
  --chip-fondo: rgba(78,140,90,.13); --chip-texto: #35663F;
  --timer-fondo: #4E8C5A; --timer-texto: #FFFFFF; --timer-linea: #FFFFFF; --timer-btn: rgba(255,255,255,.24);
  --anillo2: #86B68C; --anillo2b: #BFD9BC; --tab-activo: #3F7A4C;
  --aviso-fondo: rgba(190,80,40,.10); --aviso-texto: #A8542C;
  --titulo-color: #35663F;
  --sombra: 0 1px 2px rgba(25,40,25,.07), 0 10px 22px -14px rgba(25,40,25,.22);
  --sombra-alta: 0 2px 6px rgba(25,40,25,.10), 0 24px 48px -22px rgba(25,40,25,.30);
}
/* En claro, dentro de una hoja las tarjetas se quedan en blanco con filo. */
[data-tema="claro"] .hoja .lista, [data-tema="claro"] .hoja .tarjeta,
[data-tema="claro-salvia"] .hoja .lista, [data-tema="claro-salvia"] .hoja .tarjeta { background: var(--superficie2); }

/* medidas comunes a todos los temas */
:root {
  --radio: 18px;          /* contenedores: tarjetas, listas, fotos grandes */
  --radio-b: 12px;        /* controles: botones, campos, casillas */
  --sombra: 0 1px 2px rgba(0,0,0,.3), 0 10px 24px -14px rgba(0,0,0,.55);
  --sombra-alta: 0 2px 6px rgba(0,0,0,.35), 0 24px 48px -20px rgba(0,0,0,.65);
  --borde: inset 0 0 0 1px var(--linea);
}

/* ------------------------------------------------------------ base */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
html { background: var(--fondo); }
body {
  margin: 0; background: var(--fondo); color: var(--texto);
  font: 15.5px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  overscroll-behavior: none; -webkit-user-select: none; user-select: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
a { color: var(--enlace); text-decoration: none; }
svg { display: block; flex: none; }
h1, h2, h3, p { margin: 0; }
.num { font-family: var(--num-font); font-weight: var(--num-peso); letter-spacing: var(--num-track); font-variant-numeric: tabular-nums; }
.titulo { font-family: var(--titulo-font); font-weight: var(--titulo-peso); text-transform: var(--titulo-transform); letter-spacing: var(--titulo-track); color: var(--titulo-color, inherit); }
.t2 { color: var(--texto2); }
.t3 { color: var(--texto3); }
.peq { font-size: 13px; line-height: 1.4; }
.crece { flex: 1; min-width: 0; }
.fila-f { display: flex; align-items: center; gap: 10px; }
.corta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ------------------------------------------------------------ esqueleto */
#app { min-height: 100%; }
.pantalla {
  min-height: 100vh; min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 112px);
  max-width: 560px; margin: 0 auto;
}
.pantalla.con-descanso { padding-bottom: calc(env(safe-area-inset-bottom) + 190px); }
.entra { animation: entra .28s cubic-bezier(.2,.8,.2,1); }
@keyframes entra { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
.aparece { animation: aparece .2s ease-out; }
@keyframes aparece { from { opacity: 0; } to { opacity: 1; } }

.cabecera { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 2px 2px 20px; }
.cabecera h1 { font-size: 38px; line-height: 1; }
.cabecera .eyebrow { font-size: 13px; font-weight: 600; color: var(--texto3); margin-bottom: 3px; }
.volver { display: inline-flex; align-items: center; gap: 2px; height: 36px; margin: 0 0 8px -6px; color: var(--enlace); font-size: 16px; font-weight: 600; }
.icono-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--superficie); box-shadow: var(--borde); color: var(--texto2); flex: none; }
.icono-btn:active { background: var(--superficie2); }
.seccion { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 2px 10px; }
.seccion h2 { font-size: 21px; }
.seccion button { color: var(--enlace); font-size: 15px; font-weight: 600; }

/* barra de pestañas */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 8px 6px calc(env(safe-area-inset-bottom) + 6px);
  background: color-mix(in srgb, var(--fondo) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(22px); backdrop-filter: saturate(1.8) blur(22px);
  border-top: 1px solid var(--linea);
}
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 3px 0 2px; font-size: 10.5px; font-weight: 600; letter-spacing: -.01em; color: var(--texto3); }
.tabs svg { width: 24px; height: 24px; }
.tabs a.activo { color: var(--tab-activo); }

/* portada: tarjeta con la foto del ejercicio a sangre y el texto encima.
   Es la pieza que da carácter: se usa en el entreno que toca y en elegir sesión. */
.portada { position: relative; border-radius: var(--radio); overflow: hidden; background: var(--superficie); box-shadow: var(--borde), var(--sombra); }
.portada > .fondo { position: absolute; inset: 0 0 auto; height: 190px; }
.portada > .fondo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.62) brightness(.72); }
.portada > .fondo::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,.15) 34%, color-mix(in srgb, var(--superficie) 72%, transparent) 72%, var(--superficie) 100%);
}
.portada .encima { position: relative; padding: 16px; }
.portada .hueco { height: 104px; }
.portada h3 { font-size: 30px; line-height: 1.02; margin: 4px 0 4px; }
.portada .marca { font-size: 13px; font-weight: 700; color: var(--marca, #fff); text-shadow: var(--marca-sombra, 0 1px 6px rgba(0,0,0,.5)); }
.portada .tira { display: flex; gap: 6px; margin-top: 12px; }
.portada .tira .mini { width: 44px; height: 44px; border-radius: 10px; }

/* tarjetas y listas */
.tarjeta { background: var(--superficie); border-radius: var(--radio); padding: 16px; box-shadow: var(--borde), var(--sombra); }
.pila > * + * { margin-top: 12px; }
.lista { background: var(--superficie); border-radius: var(--radio); overflow: hidden; box-shadow: var(--borde), var(--sombra); }
.lista > * + * { border-top: 1px solid var(--linea); }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 58px; width: 100%; text-align: left; }
.item:active { background: var(--superficie2); }
.item .nombre { font-size: 15.5px; font-weight: 600; line-height: 1.25; }
.item .meta { font-size: 13px; color: var(--texto3); margin-top: 3px; }
.chevron { color: var(--texto3); }

/* botones: uno manda (lleno), el resto acompañan (contorno o texto) */
.boton {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 52px; padding: 0 18px; border-radius: var(--radio-b); color: var(--sobre-boton);
  background: linear-gradient(118deg, var(--boton) 0%, color-mix(in srgb, var(--boton) 55%, var(--anillo2)) 100%);
  font-weight: 700; font-size: 17px; letter-spacing: -.01em; transition: transform .12s, opacity .12s;
}
.boton:active { transform: scale(.985); opacity: .92; }
.boton[disabled] { opacity: .4; }
.boton.suave { background: transparent; color: var(--texto); box-shadow: var(--borde); font-weight: 600; }
.boton.suave:active { background: var(--superficie2); }
.boton.peligro { background: transparent; color: var(--aviso-texto); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--aviso-texto) 35%, transparent); font-weight: 600; }
.boton.chico { width: auto; min-height: 34px; padding: 0 14px; border-radius: 99px; font-size: 14.5px; }
.dos-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* chips y pastillas */
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 13px; display: inline-flex; align-items: center; border-radius: 99px; font-size: 13.5px; font-weight: 600; background: var(--superficie2); color: var(--texto2); white-space: nowrap; }
.chip.activo { background: var(--chip-fondo); color: var(--chip-texto); }
.chip.sec { background: transparent; box-shadow: var(--borde); color: var(--texto3); }
.pastilla { display: inline-block; padding: 4px 10px; border-radius: 99px; background: var(--chip-fondo); color: var(--chip-texto); font-size: 12.5px; font-weight: 700; letter-spacing: -.01em; }
.sugerencia { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border-radius: var(--radio-b); background: var(--sug-fondo); color: var(--sug-texto); font-size: 14px; font-weight: 600; line-height: 1.4; }
.sugerencia svg { margin-top: 1px; }
.aviso { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border-radius: var(--radio-b); background: var(--aviso-fondo); color: var(--aviso-texto); font-size: 13.5px; font-weight: 600; line-height: 1.4; }

/* buscador */
.buscador { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 13px; border-radius: var(--radio-b); background: var(--superficie); box-shadow: var(--borde); color: var(--texto3); }
.buscador input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 16px; color: var(--texto); }
.buscador input::placeholder { color: var(--texto3); }

/* campos */
.campo { display: block; }
.campo > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--texto3); margin: 0 3px 6px; }
.entrada {
  width: 100%; height: 48px; padding: 0 14px; border-radius: var(--radio-b); border: 0; outline: none;
  background: var(--superficie2); font-size: 16.5px; color: var(--texto); box-shadow: var(--borde);
}
.entrada:focus { box-shadow: inset 0 0 0 2px var(--acento); }
.rejilla-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rejilla-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* interruptor de ajustes */
.interruptor { position: relative; width: 51px; height: 31px; flex: none; }
.interruptor input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.interruptor i { position: absolute; inset: 0; border-radius: 99px; background: var(--superficie3); transition: background .2s; pointer-events: none; }
.interruptor i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.3); transition: transform .2s; }
.interruptor input:checked + i { background: var(--acento); }
.interruptor input:checked + i::after { transform: translateX(20px); }

/* ------------------------------------------------------------ fotos animadas */
.anim { position: relative; overflow: hidden; background: var(--superficie2); flex: none; box-shadow: var(--borde); }
/* Las fotos vienen de una base libre y traen fondos de gimnasio muy saturados: se bajan
   de tono para que convivan con la paleta en vez de pelearse con ella. */
.anim img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.72) contrast(1.04) brightness(.94); }
.anim img + img { animation: alterna 2.6s ease-in-out infinite; }
.anim.quieta img + img { animation: none; opacity: 0; }
@keyframes alterna { 0%, 38% { opacity: 0; } 50%, 88% { opacity: 1; } 100% { opacity: 0; } }
.lleno { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
.mini { width: 52px; height: 52px; border-radius: var(--radio-b); }
.mini-g { width: 62px; height: 62px; border-radius: 14px; }
.foto-grande { width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radio); }
.foto-grande .etiqueta-foto { position: absolute; left: 10px; bottom: 10px; z-index: 1; padding: 5px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: #fff; background: rgba(0,0,0,.5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* ------------------------------------------------------------ hoja (panel desde abajo) */
.velo { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: aparece .2s ease-out; }
.hoja {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column; max-width: 560px; margin: 0 auto;
  background: var(--superficie); border-radius: 24px 24px 0 0; box-shadow: var(--sombra-alta);
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 16px);
  animation: sube .3s cubic-bezier(.2,.8,.2,1);
}
@keyframes sube { from { transform: translateY(100%); } to { transform: none; } }
.hoja .asa { width: 36px; height: 5px; border-radius: 3px; background: var(--superficie3); margin: 0 auto 12px; flex: none; }
.hoja .cab-hoja { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex: none; }
.hoja .cab-hoja h2 { font-size: 21px; }
.hoja .cuerpo-hoja { overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; flex: 1; }
.hoja .lista, .hoja .tarjeta { background: var(--superficie2); box-shadow: none; }
.hoja .lista > * + * { border-top-color: var(--linea); }
.hoja .entrada, .hoja .buscador { background: var(--superficie2); }
.hoja .icono-btn { background: var(--superficie2); box-shadow: none; }
/* Dentro de una tarjeta de una hoja, la tarjeta ya es superficie2: las casillas un tono más claro. */
.hoja .tarjeta .entrada, .hoja .tarjeta .caja { background: var(--superficie3); }

/* aviso flotante */
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 12px); z-index: 80; transform: translateX(-50%);
  padding: 12px 16px; border-radius: var(--radio-b); max-width: calc(100% - 32px);
  background: var(--superficie3); color: var(--texto); font-size: 14.5px; font-weight: 600; box-shadow: var(--sombra-alta);
  animation: baja .25s ease-out;
}
@keyframes baja { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ------------------------------------------------------------ entreno */
.cab-entreno { display: flex; align-items: flex-start; gap: 12px; margin: 2px 2px 14px; }
.cab-entreno h1 { margin-top: 4px; font-size: 27px; line-height: 1.08; }
.crono { display: flex; align-items: center; gap: 12px; margin: 0 2px 18px; }
.crono .num { font-size: 24px; min-width: 66px; line-height: 1; }
.barra-fina { flex: 1; height: 4px; border-radius: 99px; background: var(--superficie2); overflow: hidden; }
.barra-fina i { display: block; height: 100%; background: var(--acento); border-radius: 99px; transition: width .4s; }
.crono .t2 { font-size: 13px; }
.crono.pasado .num, .crono.pasado .t2 { color: var(--aviso-texto); }
.crono.pasado .barra-fina i { background: var(--aviso-texto); }

.ej-cab { display: flex; gap: 12px; align-items: center; }
.ej-nombre { font-size: 16.5px; font-weight: 650; line-height: 1.22; letter-spacing: -.01em; }
.ej-meta { font-size: 13px; color: var(--texto3); margin-top: 3px; }
.mas { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--texto3); flex: none; }
.mas:active { background: var(--superficie2); }

.series { margin-top: 12px; }
.fila-serie { display: grid; grid-template-columns: 34px 1fr 64px 52px 44px 42px; gap: 6px; align-items: center; padding: 4px 5px; border-radius: var(--radio-b); }
.fila-serie.cabeza { font-size: 11px; font-weight: 700; color: var(--texto3); letter-spacing: .02em; padding-bottom: 4px; }
.fila-serie.cabeza span:not(:nth-child(2)) { text-align: center; }
.fila-serie .n { text-align: center; font-weight: 700; color: var(--texto2); font-variant-numeric: tabular-nums; }
/* el número de la serie se toca para quitarla */
.fila-serie button.n { width: 100%; height: 40px; border-radius: 10px; color: var(--texto2); }
.fila-serie button.n:active { background: var(--superficie2); }
.fila-serie .ant { font-size: 13px; color: var(--texto3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caja {
  width: 100%; height: 40px; border-radius: 10px; border: 0; outline: none; text-align: center;
  background: var(--superficie2); font-size: 17px; font-weight: 600; padding: 0 2px; -moz-appearance: textfield;
  font-variant-numeric: tabular-nums;
}
.caja::-webkit-outer-spin-button, .caja::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.caja::placeholder { color: var(--texto3); opacity: .7; font-weight: 500; }
.caja:focus { box-shadow: inset 0 0 0 2px var(--acento); }
.ok { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--superficie2); color: var(--texto3); transition: transform .15s; }
.ok:active { transform: scale(.9); }
.fila-serie.hecha { background: var(--hecho); }
.fila-serie.hecha .caja { background: transparent; color: var(--texto); }
.fila-serie.hecha .n { color: var(--check); }
.fila-serie.hecha .ok { background: var(--check); color: var(--sobre-check); }
.anadir-serie { margin-top: 8px; width: 100%; height: 40px; border-radius: 11px; background: transparent; box-shadow: var(--borde); font-weight: 600; font-size: 14.5px; color: var(--texto2); }
.anadir-serie:active { background: var(--superficie2); }
.plegada { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.hecho-marca { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--check); color: var(--sobre-check); flex: none; }

/* series por lados y de aproximación */
.fila-serie .n small { display: block; margin-top: -1px; font-size: 9.5px; font-weight: 700; letter-spacing: .02em; color: var(--texto3); }
.fila-serie.calent { opacity: .82; }
.fila-serie.calent .n { font-size: 12.5px; color: var(--texto3); }
.fila-serie.calent .ant { font-size: 12px; }
.fila-serie.calent .caja { font-size: 15.5px; font-weight: 500; }

/* el cronómetro del entreno se toca para cambiar la hora de inicio */
button.crono { width: calc(100% - 4px); text-align: left; color: inherit; }

/* filas de series en «Editar entreno» */
.fila-edit { display: grid; grid-template-columns: 40px 1fr 1fr 52px 36px; gap: 6px; align-items: center; padding: 4px 0; }
.fila-edit.cabeza { font-size: 11px; font-weight: 700; color: var(--texto3); letter-spacing: .02em; padding-bottom: 2px; }
.fila-edit.cabeza span:not(:first-child) { text-align: center; }
.fila-edit .n { text-align: center; font-weight: 700; color: var(--texto2); font-size: 14px; }
.fila-edit .n small { display: block; font-size: 10px; color: var(--texto3); }
.fila-edit.calent .n { font-size: 13px; }

/* pasos del calentamiento */
.paso-cal { display: flex; gap: 11px; align-items: flex-start; width: 100%; padding: 8px 0; text-align: left; font-size: 14.5px; line-height: 1.4; }
.paso-cal i { flex: none; width: 21px; height: 21px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--superficie3); }
.paso-cal.hecho i { background: var(--check); color: var(--sobre-check); box-shadow: none; }
.paso-cal.hecho span { color: var(--texto3); text-decoration: line-through; }

/* descanso: la barra que se vacía */
.descanso {
  position: fixed; left: 10px; right: 10px; z-index: 31; max-width: 540px; margin: 0 auto;
  bottom: calc(env(safe-area-inset-bottom) + 74px);
  transition: bottom .18s ease-out;
  border-radius: var(--radio); background: var(--timer-fondo); color: var(--timer-texto);
  padding: 12px 12px 12px 18px; display: flex; align-items: center; gap: 8px;
  box-shadow: var(--sombra-alta); overflow: hidden; animation: sube .3s cubic-bezier(.2,.8,.2,1);
}
.descanso .linea { position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: var(--timer-linea); transform-origin: left; transition: transform 1s linear; opacity: .5; }
.descanso small { display: block; font-size: 11.5px; font-weight: 700; opacity: .7; letter-spacing: -.01em; }
.descanso .num { font-size: 32px; line-height: 1; }
.descanso button { height: 40px; min-width: 46px; padding: 0 10px; border-radius: 11px; background: var(--timer-btn); font-weight: 700; font-size: 14.5px; }
.descanso.fin { animation: late .5s ease-in-out 3; }
/* Con el teclado abierto: fuera las pestañas y el descanso justo encima del teclado. */
.con-teclado .tabs { display: none; }
.con-teclado .descanso { bottom: calc(var(--teclado, 0px) + 10px); }
@keyframes late { 50% { transform: scale(1.02); } }

/* ------------------------------------------------------------ datos y gráficas */
/* El número es el contenido: grande y tabular, con la unidad discreta al lado. */
.dato small { display: block; font-size: 12.5px; color: var(--texto3); font-weight: 600; }
.dato .num { font-size: 27px; margin-top: 5px; line-height: 1.05; }
.dato .num span, .unidad { font-size: 14.5px; color: var(--texto3); font-family: -apple-system, system-ui, sans-serif; font-weight: 600; letter-spacing: 0; }
.grafica { margin-top: 4px; }
.grafica .area { fill: var(--acento); opacity: .13; }
.grafica .trazo { fill: none; stroke: var(--acento); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.grafica .punto { fill: var(--acento); stroke: var(--superficie); stroke-width: 3; }
.grafica .guia { stroke: var(--linea); stroke-width: 1; stroke-dasharray: 2 5; }
.grafica .barra { fill: var(--superficie3); }
.grafica .barra.si { fill: var(--acento); }
.grafica text { fill: var(--texto3); font-size: 10px; font-weight: 600; font-family: -apple-system, system-ui, sans-serif; }

.anillos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.anillo { display: flex; align-items: center; gap: 11px; }
.anillo svg { width: 62px; height: 62px; transform: rotate(-90deg); }
.anillo .pista { fill: none; stroke: var(--superficie2); stroke-width: 7; }
.anillo .valor { fill: none; stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray .5s; }
.anillo .num { font-size: 21px; line-height: 1.05; }
.anillo small { display: block; font-size: 12px; color: var(--texto3); font-weight: 600; margin-top: 2px; line-height: 1.25; }
/* anillo grande con el número dentro: el dato del día se ve de un vistazo */
.anillo.centro { display: grid; place-items: center; gap: 0; }
.anillo.centro svg { grid-area: 1 / 1; width: 132px; height: 132px; }
.anillo.centro .pista, .anillo.centro .valor { stroke-width: 9; }
.anillo.centro > div { grid-area: 1 / 1; text-align: center; padding: 0 12px; }
.anillo.centro .num { font-size: 30px; letter-spacing: -.03em; }
.anillo.centro small { font-size: 11.5px; margin-top: 3px; }
.macros { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; font-size: 12.5px; }
.macros .t { display: flex; justify-content: space-between; color: var(--texto3); font-weight: 600; }
.macros .t b { color: var(--texto2); font-variant-numeric: tabular-nums; }
.macros .barra-fina { margin-top: 6px; }
.macros .barra-fina i { background: var(--texto3); }

.semana { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.semana span { font-size: 11px; font-weight: 700; color: var(--texto3); }
.semana i { display: grid; place-items: center; width: 34px; height: 34px; margin: 8px auto 0; border-radius: 50%; background: var(--superficie2); font-style: normal; font-size: 12px; font-weight: 700; color: var(--texto2); }
.semana .si i { background: var(--check); color: var(--sobre-check); }
.semana .hoy i { box-shadow: inset 0 0 0 1.5px var(--texto2); color: var(--texto); }
.semana .hoy.si i { box-shadow: none; }

.pasos-lista { list-style: none; margin: 0; padding: 0; }
.pasos-lista li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; }
.pasos-lista li + li { margin-top: 12px; }
.pasos-lista b { flex: none; width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; background: var(--superficie2); color: var(--texto2); }

/* ------------------------------------------------------------ ciclo y pingüinas */
.pinguinos { flex: none; overflow: visible; }
.pinguinos .cuerpo { fill: var(--pinguino, #2E3440); stroke: var(--pinguino-borde, transparent); stroke-width: 2; }
.pinguinos .tripa { fill: #FBFBFD; }
.pinguinos .ala { fill: var(--pinguino, #2E3440); }
.pinguinos .colorete { fill: #F0A6A6; opacity: .55; }
.pinguinos .ojo { fill: #FBFBFD; }
.pinguinos .pupila { fill: #262B36; }
.pinguinos .brillo { fill: #fff; }
.pinguinos .pico, .pinguinos .pata { fill: #F2A65A; }
.pinguinos .ala-saluda { animation: saludar 3s ease-in-out infinite; }
@keyframes saludar { 0%, 62%, 100% { transform: rotate(0deg); } 70% { transform: rotate(-26deg); } 78% { transform: rotate(6deg); } 86% { transform: rotate(-20deg); } }
.hola-pinguinas { display: flex; align-items: center; gap: 10px; }
.globo { display: inline-block; padding: 6px 12px; border-radius: 14px 14px 14px 4px; background: var(--chip-fondo); color: var(--chip-texto); font-weight: 700; font-size: 14px; }

/* el ciclo en un anillo, como en la app de salud del iPhone */
.anillo-ciclo { display: block; width: 100%; max-width: 250px; margin: 2px auto 0; }
.anillo-ciclo .pista { stroke: var(--superficie2); }
.anillo-ciclo .regla { stroke: var(--anillo2); }
.anillo-ciclo .prevista { stroke: color-mix(in srgb, var(--anillo2) 42%, transparent); }
.anillo-ciclo .fertil { stroke: color-mix(in srgb, var(--acento) 60%, transparent); }
.anillo-ciclo .hoy { fill: var(--texto); stroke: var(--superficie); stroke-width: 3; }
.anillo-ciclo .centro-num { fill: var(--texto); font-family: var(--num-font); font-size: 46px; font-weight: 700; letter-spacing: -.03em; }
.anillo-ciclo .centro-txt { fill: var(--texto3); font-size: 13px; font-weight: 600; }
.prevista-txt { text-align: center; font-size: 14.5px; font-weight: 600; margin-top: 4px; }
.leyenda { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--texto3); }
.leyenda span { display: inline-flex; align-items: center; gap: 5px; }
.leyenda i { width: 10px; height: 10px; border-radius: 50%; }
.leyenda .p-regla { background: var(--anillo2); }
.leyenda .p-prevista { background: color-mix(in srgb, var(--anillo2) 42%, transparent); }
.leyenda .p-fertil { background: color-mix(in srgb, var(--acento) 60%, transparent); }

.tira-ciclo { display: flex; gap: 3px; flex-wrap: wrap; }
.dia-ciclo { flex: 1 1 12px; height: 24px; border-radius: 7px; background: var(--superficie2); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; }
.dia-ciclo.menstrual { background: var(--anillo2); }
.dia-ciclo.ovulacion { background: var(--acento2); }
.dia-ciclo.lutea { background: color-mix(in srgb, var(--acento) 32%, transparent); }
.dia-ciclo.hoy { box-shadow: inset 0 0 0 2px var(--texto); color: var(--texto); }

.consejo .nivel { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; }
.consejo .nivel.demostrado { background: var(--sug-fondo); color: var(--sug-texto); }
.consejo .nivel.plausible { background: var(--superficie2); color: var(--texto2); }
.consejo .nivel.mito { background: var(--aviso-fondo); color: var(--aviso-texto); }
.consejo p { font-size: 14.5px; line-height: 1.45; }

/* comida */
.toma { margin-top: 12px; }
.toma-cab { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px 9px; }
.toma-cab h3 { font-size: 16.5px; font-weight: 650; letter-spacing: -.01em; }
.toma-cab .num { font-size: 14px; color: var(--texto3); }
.anadir-toma { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 14px; color: var(--enlace); font-weight: 600; font-size: 14.5px; }
.cantidad-grande { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 8px 0 16px; }
.cantidad-grande .caja { width: 132px; height: 62px; font-size: 32px; font-weight: 700; border-radius: 14px; }
.paso-btn { width: 50px; height: 50px; border-radius: 50%; background: var(--superficie2); font-size: 24px; font-weight: 600; display: grid; place-items: center; color: var(--texto2); }
.paso-btn:active { background: var(--superficie3); }
.macro-linea { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.macro-linea .num { font-size: 19px; }
.macro-linea small { display: block; font-size: 11.5px; color: var(--texto3); font-weight: 600; margin-top: 2px; }
.segmentado { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--superficie2); }
.segmentado button { flex: 1; padding: 8px 0; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--texto3); transition: background .15s; }
.segmentado button.activo { background: var(--superficie); color: var(--texto); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.vacio { text-align: center; padding: 30px 18px; color: var(--texto3); font-size: 14px; line-height: 1.45; }
.vacio b { display: block; color: var(--texto); font-size: 16.5px; font-weight: 650; margin-bottom: 5px; }
