/* Marca Arce Performance Lab (ver MARCA.md): verde bosque sobre marfil, cobre de acento,
   tipografia Archivo (servida desde fonts/, sin llamar a Google). */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(fonts/archivo-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(fonts/archivo-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Paleta oficial */
  --apl-green: #1B4D3A;
  --apl-night: #10241F;
  --apl-green-light: #6FBF95;
  --apl-copper: #B25F26;
  --apl-copper-light: #D9874A;
  --apl-ivory: #F4F1EA;
  --apl-muted: #4A5A54;
  --apl-muted-light: #A9BDB4;

  /* Roles que usa la pagina */
  --fondo: var(--apl-ivory);
  --tarjeta: #ffffff;
  --texto: var(--apl-night);
  --suave: var(--apl-muted);
  --borde: #ddd7ca;
  --acento: var(--apl-green);
  --acento-texto: #ffffff;
  --acento-suave: #dcebe2;
  --acento-suave-texto: var(--apl-green);
  --cobre: var(--apl-copper);
  --cobre-texto: #ffffff;
  --barra: var(--apl-night);
  --barra-texto: var(--apl-ivory);
  --barra-acento: var(--apl-copper-light);
  --ok: #15803d;
  --ok-texto: #ffffff;
  --error: #c8322b;
  --aviso: #f5a524;
  --aviso-texto: #1b1300;
  --radio: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: var(--apl-night);
    --tarjeta: #17302a;
    --texto: var(--apl-ivory);
    --suave: var(--apl-muted-light);
    --borde: #28463d;
    --acento: var(--apl-green-light);
    --acento-texto: var(--apl-night);
    --acento-suave: var(--apl-green);
    --acento-suave-texto: #c6e8d5;
    --cobre: var(--apl-copper-light);
    --cobre-texto: var(--apl-night);
    --barra: #0b1a16;
    --ok: #3fbf75;
    --ok-texto: #04130a;
    --error: #ef5b52;
    --aviso: #f2a516;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: Archivo, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 500;
  background: var(--fondo);
  color: var(--texto);
  font-size: 16px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
h1, h2, h3 { font-weight: 800; }
button, input, select { font: inherit; color: inherit; }

/* Barra superior */
.barra {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--barra); color: var(--barra-texto);
}
.marca { display: flex; align-items: center; gap: 10px; font-weight: 700; min-width: 0; }
.marca span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marca img { flex: none; height: 36px; width: auto; }
.marca-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.marca-txt small { font-size: 12px; font-weight: 600; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Con la marca (no con el nombre de un cliente) el texto imita al logo: ARCE / PERFORMANCE LAB */
.marca.es-marca span { font-size: 20px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1; }
.marca.es-marca small { font-size: 9.5px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--barra-acento); opacity: 1; margin-top: 3px; }
@media (min-width: 600px) { .marca img { height: 44px; } .marca.es-marca span { font-size: 24px; } .marca.es-marca small { font-size: 11px; } }
.espacio { flex: 1; }
.icono {
  background: none; border: 0; color: inherit; font-size: 30px; line-height: 1;
  padding: 0 8px 4px 0; cursor: pointer;
}

main { max-width: 640px; margin: 0 auto; padding: 16px; }
.cargando, .vacio { color: var(--suave); text-align: center; padding: 40px 0; }

/* Tarjetas y formularios */
.tarjeta {
  background: var(--tarjeta); border: 1px solid var(--borde);
  border-radius: var(--radio); padding: 16px; margin-bottom: 12px;
}
h1 { font-size: 22px; margin: 4px 0 4px; }
h2 { font-size: 17px; margin: 0 0 10px; }
.sub { color: var(--suave); font-size: 14px; margin: 0 0 14px; }
label { display: block; font-size: 14px; color: var(--suave); margin: 12px 0 6px; }
input[type=email], input[type=password], input[type=text], input[type=number], input[type=search],
input[type=url], input[type=date], input:not([type]), select, textarea {
  width: 100%; padding: 13px 14px; border-radius: 10px;
  border: 1px solid var(--borde); background: var(--fondo); font-size: 16px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--acento); outline-offset: 1px; }
textarea { resize: vertical; font: inherit; }
input[type=date] { min-height: 48px; }
.btn {
  display: block; width: 100%; margin-top: 16px; padding: 14px;
  border: 0; border-radius: 10px; background: var(--acento); color: var(--acento-texto);
  font-weight: 700; font-size: 16px; cursor: pointer;
}
.btn:disabled { opacity: .6; }
.btn.sec { background: transparent; color: var(--texto); border: 1px solid var(--borde); }
a.btn { text-align: center; text-decoration: none; }
.casilla { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; color: var(--texto); }
.casilla input { width: 20px; height: 20px; flex: none; margin: 2px 0 0; accent-color: var(--acento); }
.enlace { background: none; border: 0; color: var(--acento); padding: 12px 0 0; cursor: pointer; font-size: 14px; }
.enlace:disabled { opacity: .5; cursor: default; }
.enlace-rir { display: block; padding: 0 0 12px; font-weight: 600; text-align: left; }
.error { color: var(--error); font-size: 14px; margin: 10px 0 0; }

.login { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }
.logo-entrada { margin: 0 auto 10px; width: min(100%, 230px); }
.logo-entrada img { display: block; width: 100%; height: auto; }
.login h1 { text-align: center; }
.login .sub { text-align: center; }
.solo-lectores {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Selector de dias */
.dias { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.dias::-webkit-scrollbar { display: none; }
.dias button {
  flex: none; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--borde); background: var(--tarjeta); font-weight: 600;
}
.dias button.activo { background: var(--acento); border-color: var(--acento); color: var(--acento-texto); }

/* Progresiones (fases): pestanas mas cuadradas, con las semanas abajo */
.fases { background: var(--acento-suave); color: var(--acento-suave-texto); border-radius: var(--radio); padding: 12px 12px 4px; margin: 0 0 14px; }
.fases-tit { margin: 0 0 8px; font-size: 14px; }
.fases-tabs button { border-radius: 12px; padding: 7px 14px; line-height: 1.2; text-align: center; color: var(--texto); }
.fases-tabs button small { display: block; font-size: 11px; font-weight: 500; opacity: .8; }
.fase-nota { margin: 0 0 10px; font-size: 14px; white-space: pre-line; }
.fase-aviso { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between;
  background: var(--tarjeta); color: var(--texto); border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; }
.fase-aviso p { margin: 0; font-size: 14px; flex: 1 1 180px; }
.fase-aviso.suave { background: transparent; color: inherit; padding: 0 0 6px; }
.ed-fases .fases-tabs { margin-top: 4px; }
.ed-fase-etq { font-size: 13px; font-weight: 600; color: var(--acento); }

/* Ejercicios */
.ejercicio { padding: 0; overflow: hidden; }
.ejercicio > button {
  display: flex; gap: 12px; width: 100%; text-align: left; align-items: flex-start;
  background: none; border: 0; padding: 14px 16px; cursor: pointer;
}
.num {
  flex: none; min-width: 28px; height: 28px; padding: 0 5px; border-radius: 14px;
  background: var(--fondo); border: 1px solid var(--borde);
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--suave);
}
/* Bloques en la vista del cliente */
.bloque { border-left: 4px solid var(--acento); padding-left: 10px; margin: 0 0 12px; }
.bloque .ejercicio { margin-bottom: 8px; }
.bloque-cab { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 8px; }
.bloque-letra { flex: none; min-width: 28px; height: 28px; padding: 0 5px; border-radius: 14px; display: grid; place-items: center;
  background: var(--acento); color: var(--acento-texto); font-weight: 800; font-size: 14px; }
.bloque-texto { margin: 3px 0 0; font-size: 14px; font-weight: 600; }
.bloque-nota { margin: 4px 0 0; font-size: 14px; color: var(--suave); white-space: pre-line; }
.ej-cuerpo { flex: 1; min-width: 0; }
.ej-nombre { font-weight: 650; overflow-wrap: anywhere; }
.ej-dosis { color: var(--acento); font-weight: 700; font-size: 15px; margin-top: 2px; }
.ej-obs { color: var(--suave); font-size: 14px; margin-top: 4px; overflow-wrap: anywhere; }
.ej-ultimo { font-size: 13px; color: var(--suave); margin-top: 6px; }
.ej-panel { border-top: 1px solid var(--borde); padding: 12px 16px 16px; }
.fila { display: flex; gap: 10px; }
.fila > div { flex: 1; min-width: 0; }
.grid-form > div { min-width: 0; }
input[type=date] { min-width: 0; max-width: 100%; }
.fila label { margin-top: 0; }
.ej-panel .btn { margin-top: 12px; }
.historial { list-style: none; padding: 0; margin: 12px 0 0; font-size: 14px; color: var(--suave); }
.historial li { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px dashed var(--borde); }

/* Medidas */
.grid-medidas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.medida { background: var(--fondo); border-radius: 10px; padding: 10px 12px; }
.medida .k { font-size: 12px; color: var(--suave); }
.medida .v { font-size: 18px; font-weight: 700; }
.medida .d { font-size: 12px; font-weight: 600; }
.d.baja { color: var(--ok); } .d.sube { color: var(--error); } .d.igual { color: var(--suave); }

/* Datos de salud y perfil */
.dato { padding: 10px 0; border-top: 1px solid var(--borde); }
.dato:first-of-type { border-top: 0; }
.dato .k { font-size: 13px; color: var(--suave); }
.dato .v { white-space: pre-wrap; overflow-wrap: anywhere; }
.candado { font-size: 13px; color: var(--suave); background: var(--fondo); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.notas-rutina { white-space: pre-line; }
.chip-entrenador { font-size: 12px; background: var(--acento); color: var(--acento-texto); border-radius: 999px; padding: 2px 8px; margin-left: 6px; }

/* Lista de clientes (entrenador) */
.lista { list-style: none; padding: 0; margin: 12px 0 0; }
.lista button {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 8px; cursor: pointer; text-align: left;
}
.lista .meta { font-size: 13px; color: var(--suave); }

/* Barra inferior */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: var(--tarjeta); border-top: 1px solid var(--borde);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  flex: 1; background: none; border: 0; padding: 16px 0; font-weight: 600;
  color: var(--suave); cursor: pointer;
}
.tabs button.activo { color: var(--acento); box-shadow: inset 0 3px 0 var(--acento); }

.aviso {
  position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom));
  max-width: 480px; margin: 0 auto; z-index: 20;
  background: var(--barra); color: var(--barra-texto); padding: 12px 16px; border-radius: 12px;
  text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

/* ---------- Panel del entrenador, graficas y editor ---------- */

/* Botones chicos */
.btn-chico {
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--borde);
  background: var(--tarjeta); font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-chico:disabled { opacity: .35; cursor: default; }
.btn-chico.primario { background: var(--acento); border-color: var(--acento); color: var(--acento-texto); }
.btn-chico.peligro { color: var(--error); }
.barra-ent label { margin-top: 0; }
.acciones, .ed-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Selector Cuerpo / Fuerza */
.segmento {
  display: flex; background: var(--tarjeta); border: 1px solid var(--borde);
  border-radius: 12px; padding: 4px; margin-bottom: 14px;
}
.segmento button {
  flex: 1; padding: 10px; border: 0; border-radius: 9px; background: none;
  font-weight: 700; color: var(--suave); cursor: pointer;
}
.segmento button.activo { background: var(--acento); color: var(--acento-texto); }

.chips { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.chips button {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--borde);
  background: var(--tarjeta); font-size: 14px; font-weight: 600; cursor: pointer;
}
.chips button.activo { background: var(--texto); border-color: var(--texto); color: var(--tarjeta); }

/* Tiles de medidas como botones */
button.medida { border: 1px solid transparent; text-align: left; cursor: pointer; width: 100%; }
button.medida.sel { border-color: var(--acento); }

/* Grafica */
.grafica { position: relative; }
.grafica svg { display: block; overflow: visible; touch-action: pan-y; }
.g-rejilla { stroke: var(--borde); stroke-width: 1; }
.g-base { stroke: var(--suave); stroke-width: 1; opacity: .5; }
.g-eje { fill: var(--suave); font-size: 11px; }
.g-linea { fill: none; stroke: var(--acento); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.g-punto { fill: var(--acento); stroke: var(--tarjeta); stroke-width: 2; }
.g-activo { fill: var(--acento); stroke: var(--tarjeta); stroke-width: 2; }
.g-cruz { stroke: var(--suave); stroke-width: 1; stroke-dasharray: 3 3; }
.g-valor { fill: var(--texto); font-size: 12px; font-weight: 700; }
.g-tip {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none;
  background: var(--barra); color: var(--barra-texto); border-radius: 8px; padding: 6px 10px;
  font-size: 13px; white-space: nowrap; display: flex; flex-direction: column; align-items: center;
}
.g-tip span { font-size: 12px; opacity: .8; }

/* Video */
.btn-video { margin: 0 0 12px; }
.video { position: relative; aspect-ratio: 16 / 9; margin-bottom: 12px; border-radius: 10px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ej-yt { color: var(--acento); font-size: 12px; }

/* Mediciones */
.medicion-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.medicion-cab h2 { margin: 0; }
.medicion-cab div { display: flex; gap: 6px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

/* Catalogo */
h2.grupo { margin: 18px 0 8px; font-size: 15px; color: var(--suave); }
.item-cat {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%;
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 6px; text-align: left; cursor: pointer;
}
.item-cat .meta { font-size: 13px; color: var(--suave); }
.tiene-video { color: var(--acento); font-weight: 700; font-size: 13px; white-space: nowrap; }
.sin-video { color: var(--suave); font-size: 13px; white-space: nowrap; }
.historial small { color: var(--suave); }

/* Editor de rutinas */
.ed-dia > input { margin-bottom: 4px; }
.ed-dia-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ed-dia-cab h2 { margin: 0; }
.ed-dia-cab .ed-acciones { margin-top: 0; }
.ed-ej { border-top: 1px dashed var(--borde); padding: 14px 0 6px; margin-top: 12px; }
.ed-ej-cab { display: flex; gap: 10px; align-items: center; }
.ed-ej-cab input { font-weight: 650; }
.ed-ej label { margin-top: 8px; }
/* Bloques en el editor: franja con borde lateral y su cabecera */
.ed-bloque { border-left: 4px solid var(--acento); background: var(--fondo); border-radius: 0 12px 12px 0;
  padding: 12px 12px 4px; margin: 14px 0 0 -4px; }
.ed-bloque .ed-ej:first-of-type { margin-top: 8px; }
.ed-bloque-cab { display: flex; gap: 10px; align-items: center; }
.ed-bloque-cab .num { background: var(--acento); border-color: var(--acento); color: var(--acento-texto); }
.ed-bloque-cab select { flex: 1; min-width: 0; }
.ed-bloque > input[data-k="notas"] { margin-top: 8px; }
.ed-bloque-ayuda { font-size: 13px; margin: 8px 0 0; }

.ed-guardar { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 5; padding-top: 4px; }
.ed-guardar .btn { box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.ed-guardar .casilla, .ed-guardar .sub {
  margin: 0 0 8px; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 10px; padding: 10px 12px;
}

/* ---------- Guia RIR ---------- */

/* Aviso de arriba de la rutina */
.ayuda-rir {
  display: flex; align-items: stretch; margin: 0 0 14px;
  background: var(--acento-suave); color: var(--acento-suave-texto); border-radius: 12px;
}
.ayuda-abrir {
  flex: 1; display: flex; align-items: center; gap: 12px; padding: 12px 4px 12px 14px;
  background: none; border: 0; color: inherit; text-align: left; cursor: pointer; min-width: 0;
}
.ayuda-abrir small { color: inherit; opacity: .85; }
.ayuda-ic {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: var(--acento); color: var(--acento-texto); font-size: 12px; font-weight: 800; letter-spacing: .02em;
}
.ayuda-flecha { margin-left: auto; font-size: 22px; padding-left: 4px; }
.ayuda-cerrar {
  flex: none; width: 44px; background: none; border: 0; color: inherit; font-size: 22px;
  cursor: pointer; opacity: .7; border-left: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}

.guia { font-size: 16px; }
.guia p { margin: 0 0 12px; }
.guia h3 { font-size: 16px; margin: 0 0 10px; }
.guia-marca { color: var(--cobre); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .2em; margin: 4px 0 0 !important; }
.etiqueta { color: var(--suave); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .2em; margin: 0 0 4px !important; }
.idea { border-color: var(--acento); border-width: 2px; }
.idea-frase { font-size: 17px; margin: 0 !important; }
.guia-seccion { margin-top: 28px; scroll-margin-top: 72px; }
.guia-seccion > h2 { font-size: 20px; margin: 0 0 10px; }

/* Indice */
.indice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 0; }
.indice button {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; text-align: left; cursor: pointer;
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 10px; font-size: 14px; font-weight: 600;
}
.indice button span {
  flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--acento); color: var(--acento-texto); font-size: 12px;
}

/* Ejemplo: 8 hechas + 2 en reserva */
.reps-ejemplo { display: grid; grid-template-columns: repeat(11, minmax(0, 32px)); gap: 4px; margin: 4px 0 8px; }
.rep {
  display: inline-grid; place-items: center; width: 100%; aspect-ratio: 1 / 1; border-radius: 50%;
  font-size: 12px; font-weight: 700; font-style: normal;
}
.rep.hecha { background: var(--acento); color: var(--acento-texto); }
.rep.reserva { border: 2px dashed var(--acento); color: var(--acento); }
.rep.no { border: 1px solid var(--borde); color: var(--suave); text-decoration: line-through; }
.reps-leyenda { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--suave); }
.reps-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.reps-leyenda .rep { width: 14px; height: 14px; aspect-ratio: auto; }

/* Escala */
.escala { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.escala li {
  display: flex; gap: 12px; align-items: center; padding: 10px 12px;
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 12px;
}
.escala-n {
  flex: none; display: grid; place-items: center; align-content: center; width: 56px; height: 56px; border-radius: 12px;
  line-height: 1;
}
.escala-n b { font-size: 22px; }
.escala-n small { font-size: 10px; font-weight: 700; letter-spacing: .06em; margin-top: 3px; }
.escala-txt { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.escala-txt > span { color: var(--suave); font-size: 14px; }
.escala-txt > .chip-meta { color: var(--acento-suave-texto); font-size: 11px; }
.n4 { background: var(--fondo); color: var(--suave); border: 1px solid var(--borde); }
.n3 { background: var(--acento-suave); color: var(--acento-suave-texto); }
.n2 { background: var(--acento); color: var(--acento-texto); }
.n1 { background: var(--aviso); color: var(--aviso-texto); }
.n0 { background: var(--error); color: #fff; }
.chip-meta {
  display: inline-block; align-self: flex-start; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--acento-suave); color: var(--acento-suave-texto); vertical-align: 1px;
}
.pista { font-size: 15px; }
.pista:last-child { margin-bottom: 0 !important; }

/* Notas destacadas */
.nota-rir {
  border-left: 4px solid var(--acento); background: var(--tarjeta); border-radius: 0 12px 12px 0;
  padding: 12px 14px; margin: 12px 0; font-size: 15px;
}
.nota-rir p { margin: 6px 0 0 !important; }
.nota-rir.alerta { border-left-color: var(--error); }

/* "Si en tu rutina dice..." */
.tabla-rir { margin: 0; display: grid; gap: 8px; }
.tabla-rir > div { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 12px; padding: 12px 14px; }
.tabla-rir dt { font-weight: 700; }
.tabla-rir dd { margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--borde); font-size: 15px; }
.tabla-rir small { display: block; font-size: 11px; font-weight: 700; color: var(--suave); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }

/* Reclutamiento: de unidades pequenas a las de alto umbral */
.reclutamiento { margin: 4px 0 14px; }
.reclutamiento-barra {
  height: 14px; border-radius: 999px;
  background: linear-gradient(90deg, var(--acento-suave), var(--acento) 60%, var(--error));
}
.reclutamiento-txt { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 13px; font-weight: 600; }
.reclutamiento-txt span:last-child { text-align: right; }
.reclutamiento-txt small { color: var(--suave); font-weight: 400; }

/* Prueba rapida */
.pregunta + .pregunta { border-top: 1px dashed var(--borde); margin-top: 14px; padding-top: 14px; }
.pregunta-texto { font-size: 15px; }
.opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.opcion {
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--borde); background: var(--fondo);
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.opcion.bien { background: var(--ok); border-color: var(--ok); color: var(--ok-texto); }
.opcion.mal { border-color: var(--error); color: var(--error); text-decoration: line-through; }
.explicacion { font-size: 14px; margin: 10px 0 0 !important; }
.explicacion:empty { display: none; }
.explicacion.bien { color: var(--ok); }
.explicacion.mal { color: var(--texto); }
.resultado { font-weight: 700; margin: 14px 0 0 !important; }
.resultado:empty { display: none; }

/* ---------- Progreso -> Fuerza: resumen de ejercicios y records ---------- */
.lista-fuerza { display: grid; gap: 8px; }
.ej-fuerza {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 12px; padding: 12px 12px 12px 14px;
}
.ej-fuerza-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ej-fuerza-nombre { overflow-wrap: anywhere; }
.ej-fuerza .meta { font-size: 13px; color: var(--suave); }
.ej-fuerza .d { font-size: 13px; font-weight: 700; }
.ej-fuerza .mini { flex: none; }
.ej-fuerza .flecha { flex: none; color: var(--suave); font-size: 20px; }
.mini .g-linea { stroke-width: 2; }
.mini .g-punto, .mini .g-record { stroke-width: 1.5; }
.chip-record {
  display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px;
  background: var(--aviso); color: var(--aviso-texto); vertical-align: 1px; white-space: nowrap;
}
.nota-record {
  background: var(--tarjeta); border: 1px solid var(--borde); border-left: 4px solid var(--aviso);
  border-radius: 0 12px 12px 0; padding: 10px 14px; margin-bottom: 12px; font-size: 15px;
}
.volver-resumen { display: block; padding: 0 0 6px; font-weight: 600; font-size: 15px; }
.g-record { fill: var(--aviso); stroke: var(--texto); stroke-width: 1.5; }
.g-record.chico { stroke: none; }
.leyenda-record { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--suave); margin: 8px 0 0; }
.leyenda-record i { flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--aviso); border: 1.5px solid var(--texto); }
.mejora { color: var(--ok); font-weight: 700; margin-left: 4px; }

/* ---------- Entrenar ---------- */
.centro { text-align: center; }
.btn-play { font-size: 18px; padding: 18px; }
.plan-lista { margin: 0; padding-left: 22px; }
.plan-lista li { padding: 8px 0; border-top: 1px dashed var(--borde); }
.plan-lista li:first-child { border-top: 0; }
.plan-lista.con-bloques { list-style: none; padding-left: 0; }
.plan-lista.con-bloques li[data-etq]::before { content: attr(data-etq); display: inline-block; min-width: 30px; font-weight: 800; color: var(--suave); }
.plan-lista .plan-bloque > ul { list-style: none; margin: 6px 0 0; padding: 0 0 0 10px; border-left: 3px solid var(--acento); }
.plan-lista .plan-bloque > ul li { border-top: 0; padding: 4px 0; }
.plan-nombre { display: block; font-weight: 650; overflow-wrap: anywhere; }
.plan-dosis { display: block; font-size: 14px; color: var(--suave); }

.sesion-tiempos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.sesion-tiempos div {
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 12px; padding: 8px 6px; text-align: center;
}
.sesion-tiempos small { display: block; font-size: 12px; color: var(--suave); }
.sesion-tiempos b { font-size: 19px; font-variant-numeric: tabular-nums; }
.sesion-avance { height: 6px; border-radius: 999px; background: var(--borde); overflow: hidden; }
.sesion-avance div { height: 100%; background: var(--acento); transition: width .3s; }
.sesion-donde { font-size: 14px; color: var(--suave); margin: 8px 0 12px; }

.reproductor { text-align: center; padding: 18px 16px; }
.reproductor .etiqueta { margin-bottom: 6px !important; }
.rep-ej { font-size: 22px; margin: 0 0 4px; overflow-wrap: anywhere; }
.rep-ej small { font-size: 14px; color: var(--suave); font-weight: 600; }
.rep-dosis { font-weight: 700; color: var(--acento); margin: 0; }
.rep-obs, .rep-ultimo { font-size: 14px; color: var(--suave); margin: 4px 0 0; }
.reloj { position: relative; width: 210px; max-width: 70vw; aspect-ratio: 1 / 1; margin: 14px auto 8px; }
.anillo { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.anillo circle { fill: none; stroke-width: 8; }
.anillo-fondo { stroke: var(--borde); }
.anillo-barra { stroke: var(--acento); stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .3s; }
.fase-descanso .anillo-barra { stroke: var(--aviso); }
.tramo-prep .anillo-barra { stroke: var(--aviso); }
.rep-bloque { margin: 2px 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--suave); }
.reloj.cumplido .anillo-barra { stroke: var(--ok); }
.reloj-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.reloj-txt b { font-size: 52px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.reloj-txt small { font-size: 13px; color: var(--suave); margin-top: 6px; max-width: 150px; }
.reloj.cumplido .reloj-txt b { color: var(--ok); }
.pausada .reloj { opacity: .45; }
@media (prefers-reduced-motion: no-preference) {
  .reloj.cumplido { animation: latido 1s ease-in-out infinite; }
  .reloj.contando .anillo-barra { animation: pulso 1.8s ease-in-out infinite; }
}
@keyframes latido { 50% { transform: scale(1.035); } }
@keyframes pulso { 50% { opacity: .4; } }
.btn-grande { font-size: 18px; padding: 17px; margin-top: 10px; }
.btn-fin { background: var(--ok); color: var(--ok-texto); }
.ajuste { display: flex; gap: 10px; justify-content: center; }
.ajuste .btn-chico { min-width: 84px; padding: 10px 14px; }
.rep-sigue { font-size: 14px; color: var(--suave); margin: 12px 0 0; }
.anotar { text-align: left; background: var(--fondo); border-radius: 12px; padding: 12px; margin-top: 14px; }
.anotar p { margin: 0 0 4px; }
.anotar .fila label { margin-top: 8px; }
.anotar .btn { margin-top: 10px; }
.anotar .sub { margin: 8px 0 0; font-size: 12px; }
.sesion-acciones { display: flex; gap: 8px; justify-content: center; margin: 2px 0 12px; }
.sesion-lista summary { cursor: pointer; font-weight: 700; }
.sesion-lista ul { list-style: none; padding: 0; margin: 10px 0 0; }
.sesion-lista li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--borde); }
.sl-marca { flex: none; width: 22px; text-align: center; color: var(--suave); font-weight: 800; }
.sl-nombre { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sl-nombre small { display: block; color: var(--suave); font-size: 12px; }
.sesion-lista li.actual .sl-marca, .sesion-lista li.actual .sl-nombre { color: var(--acento); font-weight: 700; }
.sesion-lista li.hecho .sl-marca { color: var(--ok); }
.sesion-lista li.saltado .sl-nombre { color: var(--suave); }
.peligro-texto { color: var(--error); }
.pildora-sesion {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 15;
  bottom: calc(68px + env(safe-area-inset-bottom));
  background: var(--acento); color: var(--acento-texto); border: 0; border-radius: 999px;
  padding: 10px 18px; font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.28); font-variant-numeric: tabular-nums;
}
.resumen-sesion h1 { font-size: 26px; }
.sub.ok { color: var(--ok); font-weight: 600; }

/* Sesiones (Progreso, Panel, Ficha) */
.sesiones-lista { list-style: none; padding: 0; margin: 0; }
.sesiones-lista > li { border-top: 1px dashed var(--borde); }
.sesiones-lista > li:first-child { border-top: 0; }
.sesiones-lista details summary {
  display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; cursor: pointer; list-style: none;
}
.sesiones-lista details summary::-webkit-details-marker { display: none; }
.sesiones-lista summary small { display: block; color: var(--suave); font-size: 13px; }
.sesiones-lista .ses-dur { text-align: right; font-weight: 700; white-space: nowrap; }
.sesiones-lista table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0 0 10px; }
.sesiones-lista th, .sesiones-lista td { text-align: left; padding: 4px 0; border-top: 1px solid var(--borde); color: var(--suave); }
.sesiones-lista th { font-weight: 600; }
.sesiones-lista td:not(:first-child), .sesiones-lista th:not(:first-child) { text-align: right; }
.uso-base .v small { font-weight: 600; }
.medida.alerta { outline: 2px solid var(--error); }
.ej-desc { color: var(--suave); font-weight: 600; font-size: 13px; margin-left: 6px; }
.fila-3 > div { flex: 1 1 0; }
.reloj.chico { width: 140px; margin: 10px auto 4px; }
.reloj.chico .reloj-txt b { font-size: 36px; }
.reloj.chico .reloj-txt small { font-size: 12px; max-width: 110px; }
.reproductor .anotar { margin: 6px 0 4px; }
.aviso-borrado {
  background: var(--tarjeta); border: 1px solid var(--borde); border-left: 4px solid var(--error);
  border-radius: 0 12px 12px 0; padding: 12px 14px; margin: 0 0 14px; font-size: 14px;
}
.aviso-borrado b { color: var(--error); }
.nota-borrado { margin: 6px 0 0 30px; font-size: 13px; }
.nota-borrado.pronto { color: var(--error); }
.casilla.resaltar { outline: 2px solid var(--aviso); outline-offset: 6px; border-radius: 6px; }

/* ---------- Cuestionario de salud ---------- */
.cs { padding-bottom: 8px; }
.cs-progreso { position: sticky; top: calc(54px + env(safe-area-inset-top)); z-index: 5; background: var(--fondo); padding: 4px 0 12px; }
.cs-bloque { font-size: 13px; font-weight: 700; color: var(--suave); margin-bottom: 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cs-saltar { flex: none; background: none; border: 1px solid var(--acento); color: var(--acento); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; font-weight: 700; cursor: pointer; }
.cs-omitir-grande { margin-top: 18px; }
.cs-barra { height: 6px; border-radius: 999px; background: var(--borde); overflow: hidden; }
.cs-barra div { height: 100%; background: var(--acento); transition: width .3s ease; }
.cs-pantalla { min-height: 46vh; }
@media (prefers-reduced-motion: no-preference) {
  .cs-adelante { animation: cs-entra .24s ease both; }
  .cs-atras { animation: cs-vuelve .24s ease both; }
}
@keyframes cs-entra { from { opacity: 0; transform: translateX(24px); } }
@keyframes cs-vuelve { from { opacity: 0; transform: translateX(-24px); } }
.cs-nav { display: flex; gap: 10px; margin-top: 18px; }
.cs-nav .btn { margin-top: 0; }
.cs-nav .btn.sec { flex: 0 0 34%; }
.cs-marca { color: var(--cobre); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .2em; margin: 4px 0 6px; }
.cs-pregunta { font-size: 21px; line-height: 1.3; margin: 0 0 10px; }
.cs-nota { color: var(--suave); font-size: 14px; font-style: italic; margin: 0 0 12px; }
.cs-texto-largo { font-size: 15px; line-height: 1.5; }
.cs-nota-caja {
  background: var(--acento-suave); color: var(--acento-suave-texto); border-radius: 12px;
  padding: 10px 12px; font-size: 14px; margin: 10px 0 12px;
}
.cs-ayuda-btn { padding: 0 0 10px; font-weight: 600; }
.cs-ayuda { background: var(--tarjeta); border: 1px solid var(--borde); border-left: 4px solid var(--acento); border-radius: 0 10px 10px 0; padding: 10px 12px; font-size: 15px; margin-bottom: 12px; }
.cs-bienvenida { padding-top: 6vh; }
.cs-bienvenida h1 { font-size: 26px; }
.cs-bienvenida p { font-size: 16px; line-height: 1.5; }
.cs-acepto { font-size: 16px; font-weight: 600; }
.cs-acepto input { width: 24px; height: 24px; }

/* Sí / No: dos tarjetas grandes */
.cs-sino { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0; }
.cs-tarjeta-sino {
  padding: 22px 10px; border-radius: 16px; border: 2px solid var(--borde); background: var(--tarjeta);
  font-size: 20px; font-weight: 800; cursor: pointer; transition: background .15s, border-color .15s;
}
.cs-tarjeta-sino.activo { background: var(--acento); border-color: var(--acento); color: var(--acento-texto); }
.cs-cond-det .cs-sino, .cs-item .cs-sino { max-width: 260px; }
.cs-cond-det .cs-tarjeta-sino, .cs-item .cs-tarjeta-sino { padding: 10px; font-size: 16px; border-radius: 12px; }

/* Chips */
.cs-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.cs-chip {
  padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--borde); background: var(--tarjeta);
  font-size: 15px; font-weight: 600; cursor: pointer; text-align: left;
}
.cs-chip.activo { background: var(--acento); border-color: var(--acento); color: var(--acento-texto); }
.cs-chips.grande { flex-direction: column; flex-wrap: nowrap; }
.cs-chips.grande .cs-chip { padding: 16px 18px; border-radius: 14px; font-size: 17px; }
.cs-extra { border-top: 1px dashed var(--borde); margin-top: 14px; padding-top: 12px; }
.cs-extra h2 { font-size: 16px; }
.cs-mini { display: block; font-size: 13px; color: var(--suave); margin: 8px 0 4px; }
.cs-ok { color: var(--ok); }

/* Escala con color */
.cs-escala { margin: 18px 0 8px; }
.cs-escala-valor { display: block; text-align: center; font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.cs-escala.sin-tocar .cs-escala-valor { font-size: 15px; font-weight: 600; color: var(--suave); }
.cs-escala input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 14px; border-radius: 999px; outline-offset: 4px;
  background: linear-gradient(90deg, var(--ok), var(--aviso), var(--error));
}
.cs-escala.invertida input[type=range] { background: linear-gradient(90deg, var(--error), var(--aviso), var(--ok)); }
.cs-escala input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--tarjeta); border: 3px solid var(--texto); box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.cs-escala input[type=range]::-moz-range-thumb {
  width: 30px; height: 30px; border-radius: 50%; background: var(--tarjeta); border: 3px solid var(--texto);
}
.cs-escala.sin-tocar input[type=range]::-webkit-slider-thumb { opacity: .55; }
.cs-escala-extremos { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--suave); margin-top: 8px; }

/* Caritas */
.cs-caritas { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0; }
.cs-carita {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 2px;
  border: 2px solid var(--borde); border-radius: 14px; background: var(--tarjeta); cursor: pointer;
}
.cs-carita span { font-size: 30px; line-height: 1; }
.cs-carita small { font-size: 11px; color: var(--suave); text-align: center; }
.cs-carita.activo { border-color: var(--acento); background: var(--acento-suave); }

/* Tabla Sí / No / No sé (5.2) */
.cs-tabla-fila { padding: 10px 0; border-top: 1px solid var(--borde); }
.cs-tabla-fila:first-child { border-top: 0; }
.cs-tabla-txt { font-weight: 600; }
.cs-tabla .cs-chips { margin-bottom: 0; }

/* Historial: cuadricula de grupos */
.cs-grupos { display: grid; gap: 10px; }
.cs-grupo { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 14px; overflow: hidden; }
.cs-grupo.abierto { border-color: var(--acento); }
.cs-grupo-cab {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; background: none; border: 0;
  cursor: pointer; text-align: left; font-size: 16px; font-weight: 700;
}
.cs-grupo-ic { flex: none; font-size: 26px; width: 40px; text-align: center; }
.cs-grupo-nombre { flex: 1; min-width: 0; }
.cs-grupo-nombre small { display: block; font-size: 12px; font-weight: 600; color: var(--acento); }
.cs-grupo-cuerpo { padding: 0 14px 12px; }
.cs-cond { border-top: 1px dashed var(--borde); padding: 2px 0 10px; }
.cs-cond .casilla { margin-top: 10px; font-size: 15px; }
.cs-cond .casilla input { width: 22px; height: 22px; }
.cs-cond-det { margin: 4px 0 0 32px; }
.cs-cond-det input[type=text] { margin-top: 8px; }
.cs-item { background: var(--fondo); border-radius: 12px; padding: 4px 12px 12px; margin: 8px 0; }
.cs-item label { margin-top: 10px; }
.cs-mesanio { margin-top: 2px; }

/* Silueta */
.sil { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 10px; }
.sil-figura { margin: 0; text-align: center; }
.sil-figura svg { width: 100%; max-height: 330px; }
.sil-figura figcaption { font-size: 13px; font-weight: 700; color: var(--suave); }
.sil-cuerpo { fill: var(--borde); }
.sil-zona { cursor: pointer; outline: none; }
.sil-toque { fill: transparent; }
.sil-punto { fill: var(--tarjeta); stroke: var(--acento); stroke-width: 2; transition: fill .15s; }
.sil-zona:hover .sil-punto, .sil-zona:focus-visible .sil-punto { fill: var(--acento-suave); }
.sil-zona.marcada .sil-punto { fill: var(--error); stroke: var(--error); }
.cs-zonas { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cs-zona-chip { background: var(--error); color: #fff; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 700; }

/* Medicamentos */
.cs-med-cat { margin-bottom: 16px; }
.cs-med-cat h2 { margin: 12px 0 0; }
.cs-buscador { position: relative; }
.cs-sugerencias {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 6; background: var(--tarjeta);
  border: 1px solid var(--borde); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); overflow: hidden;
}
.cs-sugerencias button { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-top: 1px solid var(--borde); background: none; cursor: pointer; font-weight: 600; }
.cs-sugerencias button:first-child { border-top: 0; }
.cs-sugerencias small { color: var(--suave); font-weight: 400; }

/* Archivos */
.cs-subir { display: inline-block; margin: 4px 0; }
.cs-docs { list-style: none; padding: 0; margin: 0 0 8px; font-size: 14px; }

/* Resumen */
.cs-resumen-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cs-resumen-cab h2 { margin: 0; }
.cs-resumen dl { margin: 8px 0 0; }
.cs-resumen dt { font-size: 13px; color: var(--suave); margin-top: 10px; }
.cs-resumen dd { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 600; }

/* Firma */
.cs-firma {
  display: block; width: 100%; height: 170px; touch-action: none; cursor: crosshair;
  background: var(--tarjeta); border: 2px dashed var(--borde); border-radius: 12px; color: var(--texto);
}
.firma-svg { display: block; max-width: 100%; color: var(--texto); }

/* Resultado */
.cs-resultado { border-width: 2px; border-color: var(--acento); }
.cs-resultado h1 { font-size: 22px; line-height: 1.3; }
.cs-resultado ul, .cs-retrase ul { padding-left: 20px; margin: 8px 0 0; }
.cs-resultado li, .cs-retrase li { margin-bottom: 8px; }
.cs-retrase { border-left: 4px solid var(--aviso); }

/* Perfil: tarjeta "Mi salud" */
.mi-salud .btn { margin-top: 10px; }

/* ---------- Salud: vista del entrenador ---------- */
.punto-sem { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; }
.s-verde { background: var(--ok); }
.s-amarillo { background: var(--aviso); }
.s-rojo { background: var(--error); }
.s-nada { background: transparent; border: 2px solid var(--borde); }
.s-declaracion { background: var(--suave); }
.dec-texto { margin: 14px 0 6px; border-left: 4px solid var(--acento); }
.cli-nombre { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.cli-nombre .punto-sem { margin-top: 5px; }
.sin-revisar { color: var(--error); }
.indice-salud { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 12px; scrollbar-width: none; }
.indice-salud::-webkit-scrollbar { display: none; }
.indice-salud a {
  flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--borde); background: var(--tarjeta);
  color: var(--texto); text-decoration: none; font-size: 14px; font-weight: 600;
}
.tarjeta[id^="s-"] { scroll-margin-top: 70px; }
.sem-grande { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; }
.sem-grande .punto-sem { width: 22px; height: 22px; }
.caja-acsm { background: var(--fondo); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; border-left: 4px solid var(--acento); }
.caja-acsm .k { font-size: 13px; font-weight: 700; color: var(--suave); }
.caja-acsm .v { font-weight: 650; margin-top: 4px; }
.lista-simple { list-style: none; padding: 0; margin: 0; }
.lista-simple > li { padding: 8px 0; border-top: 1px dashed var(--borde); font-size: 15px; }
.lista-simple > li:first-child { border-top: 0; }
.lista-simple small { color: var(--suave); }
.lista-simple.pendientes li { color: var(--suave); font-style: italic; }
.lista-simple li.resaltada { background: var(--acento-suave); border-radius: 8px; padding-left: 8px; }
details summary { cursor: pointer; font-weight: 700; margin-top: 8px; }
.alertas { list-style: none; padding: 0; margin: 0; }
.alertas li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; margin-bottom: 6px; font-size: 15px; }
.alertas .punto-sem { margin-top: 5px; }
.al-rojo { background: color-mix(in srgb, var(--error) 12%, transparent); }
.al-amarillo { background: color-mix(in srgb, var(--aviso) 14%, transparent); }
.bloque-tit { font-size: 13px; color: var(--cobre); margin: 14px 0 4px; text-transform: uppercase; letter-spacing: .2em; }
.afirmativas { margin: 0; }
.afirmativas dt { font-size: 13px; color: var(--suave); margin-top: 8px; }
.afirmativas dd { margin: 2px 0 0; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.med-ficha { border-top: 1px solid var(--borde); padding: 12px 0; }
.med-ficha:first-of-type { border-top: 0; padding-top: 0; }
.med-ficha h3 { margin: 0 0 4px; font-size: 17px; }
.med-ficha h3 small { color: var(--suave); font-weight: 600; font-size: 13px; }
.chip-alerta { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--aviso); color: var(--aviso-texto); vertical-align: 2px; }
.form-farmaco { margin-top: 10px; background: var(--fondo); border-radius: 12px; padding: 4px 12px 12px; }
.doc-fila { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sugerencia { border-top: 1px dashed var(--borde); padding: 10px 0; }
.sugerencia h3 { margin: 0 0 6px; font-size: 15px; }
.sug-col { background: var(--fondo); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; white-space: pre-wrap; font-size: 14px; }
.sug-col small { display: block; color: var(--suave); font-size: 12px; }
.sug-col.nuevo { background: var(--acento-suave); color: var(--acento-suave-texto); }
.nota-revision { background: var(--fondo); border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; margin: 10px 0 0; }
.firmas { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.firmas small { display: block; color: var(--suave); font-size: 12px; margin-bottom: 4px; }
.firmas .firma-svg { border-bottom: 1px solid var(--borde); width: 100%; }
.version-fila { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.version-fila > div { flex: 1; min-width: 0; }
.version-fila > .diferencias { flex: 0 0 100%; }
.diferencias table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.diferencias thead td { font-size: 12px; font-weight: 700; color: var(--suave); padding: 4px 6px; }
.diferencias th { text-align: left; font-size: 13px; font-weight: 600; color: var(--suave); padding: 10px 0 4px; }
.diferencias td { vertical-align: top; padding: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.diferencias .antes { background: color-mix(in srgb, var(--error) 10%, transparent); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--error) 60%, transparent); }
.diferencias .ahora { background: color-mix(in srgb, var(--ok) 12%, transparent); font-weight: 600; }

/* ---------- Nota SOAP ---------- */
.texto-soap { white-space: pre-wrap; margin: 0; line-height: 1.5; }
.tabla-o, .tabla-p { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla-o th, .tabla-o td, .tabla-p th, .tabla-p td { text-align: left; vertical-align: top; padding: 6px 6px; border-top: 1px solid var(--borde); }
.tabla-o thead th, .tabla-p thead th { font-size: 12px; color: var(--suave); border-top: 0; }
.tabla-o small { color: var(--suave); }
.tabla-p-envoltura { overflow-x: auto; }
.tabla-p { min-width: 560px; }
.p-obj-cab { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; }
.p-obj-cab .enlace { padding: 0; }

/* ---------- Expediente imprimible ---------- */
.acciones-pdf { margin-bottom: 16px; }
.acciones-pdf .btn { margin-top: 8px; }
.expediente { background: #fff; color: #111; border-radius: var(--radio); padding: 20px; font-size: 13px; line-height: 1.45; }
.expediente h1 { font-size: 20px; margin: 0; }
.expediente h2 { font-size: 15px; margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--apl-green); }
.expediente h3 { font-size: 13px; margin: 12px 0 4px; }
.expediente section { break-inside: auto; }
.exp-cab { display: flex; align-items: center; gap: 14px; }
.exp-cab img { width: 150px; height: auto; }
.exp-cab p { margin: 2px 0 0; color: #555; }
.exp-datos, .exp-resp { width: 100%; border-collapse: collapse; }
.exp-datos th, .exp-datos td, .exp-resp th, .exp-resp td { text-align: left; vertical-align: top; padding: 3px 6px; border-bottom: 1px solid #ddd; }
.exp-datos th { width: 32%; font-weight: 600; color: #444; }
.exp-resp th { width: 58%; font-weight: 400; color: #333; }
.exp-resp td { font-weight: 600; white-space: pre-wrap; }
.exp-declaracion { font-style: italic; }
.expediente .firmas { margin-top: 10px; }
.expediente .firmas small { color: #444; }
.expediente .firma-svg { color: #000; border-bottom: 1px solid #555; }
.expediente .tabla-o th, .expediente .tabla-o td, .expediente .tabla-p th, .expediente .tabla-p td { border-color: #ddd; }
.expediente .tabla-p { min-width: 0; }
.exp-autor { color: #444; margin-top: 8px; }

@media print {
  @page { margin: 14mm; }
  :root { --fondo: #fff; --tarjeta: #fff; --texto: #000; --suave: #444; --borde: #bbb; color-scheme: light; }
  body { background: #fff; padding: 0; }
  .barra, .tabs, .aviso, .no-imprimir, .pildora-sesion { display: none !important; }
  main { max-width: none; padding: 0; }
  .expediente { padding: 0; border-radius: 0; }
  .expediente h2, .expediente h3 { break-after: avoid; }
  .exp-datos tr, .exp-resp tr, .tabla-o tr, .tabla-p tr, .exp-firmas { break-inside: avoid; }
}
