/* ============================================================
   ESTILOS v2 — componentes nuevos (perfiles, CRUD, sesiones,
   progreso, diario, datos, modales). Usa los tokens de index.html
   ============================================================ */

/* ---- Header chip usuario ---- */
.user-chip { background: none; border: none; cursor: pointer; display: flex; align-items: center; padding: 0; }
.header-btn { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--ink); padding: 0 10px 0 0; line-height: 1; }
.header-btn:active { opacity: .5; }
.ic { display: inline-block; vertical-align: -0.15em; flex-shrink: 0; }
.btn .ic { margin-right: 2px; }
.icon-btn .ic { vertical-align: middle; }
.big-row-icon .ic, .menu-row .ic { vertical-align: middle; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #fff; font-weight: 700; flex-shrink: 0;
  font-family: 'Inter Tight', sans-serif; line-height: 1;
}

/* ---- Loading / empty ---- */
.loading { padding: 40px 0; text-align: center; color: var(--ink-dim); font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.empty-state { text-align: center; padding: 36px 16px; color: var(--ink-soft); }
.empty-state p { margin-bottom: 6px; font-size: 14px; }
.empty-state .dim { font-size: 12px; }
.dim { color: var(--ink-dim); }

/* ---- Botones ---- */
.btn {
  font-family: 'Inter Tight', sans-serif; font-size: 14px; font-weight: 600;
  border: 1px solid var(--line); background: var(--bg-card); color: var(--ink);
  padding: 10px 16px; border-radius: 10px; cursor: pointer; transition: opacity .15s, background .15s;
}
.btn:active { opacity: .65; }
.btn:disabled, .btn.disabled { opacity: .4; pointer-events: none; }
.btn.primary { background: var(--strong); border-color: var(--strong); color: #fff; }
.btn.danger { color: var(--priority); border-color: var(--priority-bg); background: var(--priority-bg); }
.btn.ghost { background: var(--bg-card); }
.btn.block { display: block; width: 100%; margin: 8px 0; }
.btn.small { font-size: 12px; padding: 6px 12px; border-radius: 8px; }

.icon-btn {
  background: none; border: none; cursor: pointer; font-size: 15px; padding: 4px 6px;
  border-radius: 6px; color: var(--ink-soft); line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:active { background: var(--line-soft); }
.icon-btn.danger { color: var(--priority); }

/* Agarrador para reordenar arrastrando (touch + ratón) */
.drag-handle {
  background: none; border: none; padding: 4px 4px; margin: 0;
  color: var(--ink-dim); cursor: grab; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  touch-action: none; /* clave: evita que el navegador haga scroll al arrastrar */
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  border-radius: 6px;
}
.drag-handle:active { cursor: grabbing; background: var(--line-soft); }
/* Elemento que flota bajo el dedo mientras se arrastra */
.dragging { opacity: .96; box-shadow: 0 12px 30px rgba(0,0,0,.28); border-color: var(--strong) !important; will-change: transform; }
/* Hueco que se abre donde caerá */
.drag-placeholder { border: 2px dashed var(--line); border-radius: 10px; background: var(--line-soft); opacity: .5; box-sizing: border-box; }
body.dragging-active { -webkit-user-select: none; user-select: none; cursor: grabbing; }
body.dragging-active * { cursor: grabbing !important; }
.ed-ex-list { display: block; }

/* Temporizador de descanso (entreno en vivo) */
.rest-timer {
  position: fixed; right: 12px;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
  z-index: 90; display: flex; align-items: stretch;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,0.18); overflow: hidden;
}
.rest-main {
  display: flex; align-items: center; gap: 7px;
  background: none; border: none; padding: 11px 16px; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 14px; color: var(--ink);
}
.rest-main:active { background: var(--line-soft); }
.rest-count { font-variant-numeric: tabular-nums; font-size: 16px; min-width: 44px; text-align: left; }
.rest-btn {
  background: none; border: none; border-left: 1px solid var(--line);
  padding: 0 14px; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 13px; color: var(--ink-soft);
}
.rest-btn:active { background: var(--line-soft); }
.rest-timer.running { background: var(--strong); border-color: var(--strong); animation: restPulse 1.6s ease-in-out infinite; }
.rest-timer.running .rest-main, .rest-timer.running .rest-btn { color: #fff; }
.rest-timer.running .rest-btn { border-left-color: rgba(255,255,255,0.3); }
.rest-timer.running .rest-main:active, .rest-timer.running .rest-btn:active { background: rgba(255,255,255,0.15); }
@keyframes restPulse { 0%,100% { box-shadow: 0 6px 20px rgba(0,0,0,0.18); } 50% { box-shadow: 0 6px 26px var(--strong); } }
.live-rest-spacer { height: 76px; }
/* Mientras hay un descanso en curso, el control de "empezar" de la vista en vivo
   se oculta: manda la píldora global (#globalRest), visible en toda la app. */
body.rest-running .rest-start { display: none; }
/* Si la barra "Entreno en curso" está visible, el descanso global se coloca
   justo encima para que no se solapen. */
body.has-active-bar #globalRest { bottom: calc(var(--nav-h) + var(--safe-bottom) + 66px); }

.chev { color: var(--ink-dim); font-size: 18px; }

/* ---- Secciones genéricas ---- */
.section { display: block; }
.section-intro { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 16px; }
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.card-label, .field-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--ink-dim);
  letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; margin-bottom: 8px; display: block;
}
.version-foot { font-size: 11px; color: var(--ink-dim); text-align: center; margin-top: 28px; font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.05em; line-height: 1.7; }
.foot-link { color: var(--strong); text-decoration: none; }
.foot-link:active { opacity: .6; }
.note-box { background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 12px 0; }
.note-box p { font-size: 13px; color: var(--ink-soft); line-height: 1.5; white-space: pre-wrap; }

/* ---- Formularios ---- */
.field { display: block; margin-bottom: 14px; }
.inp {
  width: 100%; font-family: 'Inter Tight', sans-serif; font-size: 15px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.inp:focus { outline: none; border-color: var(--strong); }
select.inp { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2382869a'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }
textarea.inp { resize: vertical; line-height: 1.4; }
.field-hint { display: block; font-size: 11px; color: var(--ink-dim); margin-top: 5px; line-height: 1.4; }
.measure-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.color-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.color-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.color-dot.sel { border-color: var(--ink); box-shadow: 0 0 0 2px var(--bg); }
.color-picker { align-items: center; }
.color-current { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); box-shadow: 0 0 0 2px var(--bg); flex-shrink: 0; }
.color-sep { width: 1px; align-self: stretch; min-height: 28px; background: var(--line); margin: 0 2px; flex-shrink: 0; }
.color-palette { display: inline-flex; align-items: center; justify-content: center; background: var(--line-soft); color: var(--ink-soft); }
.color-palette:active { background: var(--line); }
.palette-grid { gap: 12px; justify-content: center; }

.mini-check { font-size: 12px; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 4px; }
.mini-check input { accent-color: var(--strong); }

/* ---- Chips / tabs ---- */
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chips-row.small { margin-bottom: 10px; }
.chip {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 6px 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--bg-card);
  color: var(--ink-soft); cursor: pointer;
}
.chip.on { background: var(--strong-bg); border-color: var(--strong); color: var(--strong); }

.tabs { display: flex; gap: 4px; background: var(--line-soft); padding: 4px; border-radius: 12px; margin-bottom: 16px; }
.tab { flex: 1; border: none; background: none; padding: 9px 6px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-dim); cursor: pointer; }
.tab.on { background: var(--bg-card); color: var(--strong); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }

/* ---- Filas grandes (Más) ---- */
.big-row, .menu-row, .session-row, .profile-card, .prog-row, .journal-card { font-family: 'Inter Tight', sans-serif; }
.big-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  margin-bottom: 10px; cursor: pointer;
  color: var(--ink); text-decoration: none;
}
.big-row:active { background: var(--line-soft); }
.big-row-text strong { color: var(--ink); }
.big-row-text .dim { color: var(--ink-dim); }
.big-row-icon { font-size: 22px; }
.big-row-icon.tile { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.big-row-text { flex: 1; display: flex; flex-direction: column; }
.big-row-text strong { font-size: 15px; }
.big-row-text .dim { font-size: 12px; }

.menu-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.menu-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  font-size: 14px; color: var(--ink); cursor: pointer; text-align: left;
}
.menu-row:active { background: var(--line-soft); }

/* ---- Perfiles ---- */
.profile-card { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.profile-meta { flex: 1; display: flex; flex-direction: column; }
.profile-meta strong { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.profile-meta .dim { font-size: 12px; }
.profile-actions { display: flex; gap: 4px; }
.badge { font-family: 'IBM Plex Mono', monospace; font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; background: var(--strong-bg); color: var(--strong); }
.badge.guest { background: var(--sub-bg); color: var(--sub-accent); }
.badge.def { background: var(--line-soft); color: var(--ink-dim); }
.badge.soon { background: var(--moderate-bg); color: var(--moderate); }
.type-sel { max-width: 110px; font-size: 13px; padding: 6px 8px; }
.plan-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 10px; }
.plan-card.active { border-color: var(--strong); }
.plan-card.new { cursor: pointer; border-style: dashed; }
.plan-card.new:active { background: var(--line-soft); }
.plan-card-main { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.plan-card-main strong { font-size: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.plan-card-main .dim { font-size: 12px; }
.plan-card-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.plan-choices { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.plan-choice { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; background: var(--bg-card); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.plan-choice strong { font-size: 15px; }
.plan-choice .dim { font-size: 12px; line-height: 1.35; }
.plan-choice.sel { border-color: var(--strong); background: var(--strong-bg); }
.plan-choice.disabled { opacity: .6; cursor: default; }

.user-menu-active { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.user-menu-active div { display: flex; flex-direction: column; }
.user-menu-active strong { font-size: 16px; }
.user-menu-active .dim { font-size: 12px; }
.user-menu-active.small strong { font-size: 14px; }

/* ---- Toolbar de detalle ---- */
.detail-toolbar { display: flex; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.detail-toolbar .btn { flex: 1; }

/* ---- Home: los 7 días caben en pantalla sin desbordar ---- */
.week-days {
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* alto disponible = viewport - cabecera - nav - paddings de main */
  height: calc(100dvh - var(--header-h) - var(--nav-h) - var(--safe-top) - var(--safe-bottom) - 42px);
  min-height: 430px; /* en pantallas muy bajas, no aplastar de más (se permite scroll) */
}
.week-days .day-card {
  flex: 1 1 0;
  min-height: 0;
  margin: 0;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.week-days .day-row-1 { margin-bottom: 2px; }
.week-days .day-focus {
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- Sesiones ---- */
.date-filters { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.date-filter { width: auto; flex: 1; min-width: 0; font-size: 13px; padding: 8px 10px; padding-right: 26px; }
.date-filters .btn.small { flex-shrink: 0; }
.sessions-cta { display: flex; gap: 8px; margin-bottom: 18px; }
.sessions-cta .btn { flex: 1; }
.month-group { margin-bottom: 18px; }
.month-label { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); font-weight: 600; margin-bottom: 8px; }
.session-row { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; text-align: left; }
.session-row:active { background: var(--line-soft); }
.session-date { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-dim); width: 52px; flex-shrink: 0; line-height: 1.3; }
.session-main { flex: 1; display: flex; flex-direction: column; }
.session-main strong { font-size: 15px; }
.session-main .dim { font-size: 11px; }
.session-author { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--ink-soft); }

.detail-ex-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.set-detail-list { list-style: none; }
.set-detail-list li { display: flex; align-items: center; gap: 10px; padding: 6px 14px; font-size: 13px; color: var(--ink-soft); border-bottom: 1px solid var(--line-soft); }
.set-detail-list li:last-child { border: none; }
.set-n-sm { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-dim); width: 16px; }

/* ---- Registro en vivo ---- */
.live-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding: 14px 16px; background: var(--strong-bg); border-radius: 12px; }
.live-title { font-size: 17px; font-weight: 700; color: var(--strong); }
.live-timer { font-family: 'IBM Plex Mono', monospace; font-size: 22px; font-weight: 600; color: var(--strong); }
.live-head-right { display: flex; align-items: center; gap: 10px; }
.live-head-right .icon-btn { color: var(--strong); opacity: .85; }
.live-head-right .icon-btn:hover { opacity: 1; }
.prev-sess-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.prev-sess-meta span { display: inline-flex; align-items: center; gap: 5px; }
.prev-sess .block { margin-bottom: 10px; }
.live-actions { display: flex; gap: 8px; margin-top: 14px; }
.live-actions .btn { flex: 1; }

/* La tarjeta ocupa todo el ancho; el agarrador va dentro de la cabecera (junto
   al título), así las series usan el ancho completo sin canalón en blanco. */
.ex-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
/* En vivo: la serie sin apuntar se marca en su propia casilla, no en toda la fila. */
.ex-card.ex-pend { border-left: 3px solid var(--moderate); }
.set-wrap.pend .set-f { background: var(--moderate-bg); border-color: var(--moderate); }
.set-wrap.pend .set-f::placeholder { color: var(--moderate); opacity: .75; }
.set-wrap.pend .set-check-txt { color: var(--moderate); font-weight: 600; }
.ex-prog { flex: none; font-size: 12px; font-weight: 700; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.ex-card.ex-pend .ex-prog { color: var(--moderate); }
.ex-card-body { min-width: 0; }
.ex-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ex-card-head .drag-handle { margin-left: -4px; }
.ex-card-head strong { font-size: 15px; }
.ex-card-name { flex: 1; min-width: 0; }
.ex-card-actions { display: flex; gap: 2px; flex-shrink: 0; }
.last-time {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  margin: 0 0 9px; padding: 6px 9px;
  background: var(--line-soft); border-radius: 8px;
  font-size: 12px; color: var(--ink-dim);
}
.last-time .ic { flex-shrink: 0; }
.last-time span { color: var(--ink-soft); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Récords personales (PR) */
.pr-banner { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; padding: 10px 12px; background: var(--strong-bg); border: 1px solid var(--strong); border-radius: 10px; color: var(--ink); }
.pr-banner .ic { color: var(--strong); flex-shrink: 0; margin-top: 1px; }
.pr-banner > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pr-banner strong { color: var(--strong); font-size: 13px; }
.pr-chip { font-size: 13px; color: var(--ink-soft); }
.pr-chip b { color: var(--ink); font-variant-numeric: tabular-nums; }
/* Franja de récord en Progreso › Por ejercicio */
.pr-stat { display: flex; align-items: center; gap: 9px; margin: 12px 0 4px; padding: 10px 12px; background: var(--strong-bg); border-radius: 10px; }
.pr-stat .ic { color: var(--strong); flex-shrink: 0; }
.pr-stat-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pr-stat-label { font-size: 11.5px; font-weight: 600; color: var(--ink-dim); }
.pr-stat-date { font-size: 11px; color: var(--ink-dim); }
.pr-stat-val { margin-left: auto; font-size: 22px; font-weight: 800; color: var(--strong); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.pr-stat-cond { display: block; font-size: 12px; font-weight: 600; color: var(--ink-dim); margin-top: 1px; }
/* Panel "Tus números" (resumen de Progreso) */
.summary-card { margin-bottom: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 10px 4px; background: var(--strong-bg); border-radius: 10px; text-align: center; }
.stat-num { font-size: 22px; font-weight: 800; color: var(--strong); font-variant-numeric: tabular-nums; line-height: 1; }
.stat-cap { font-size: 10px; font-weight: 600; color: var(--ink-dim); }
.summary-pr { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12.5px; color: var(--ink-soft); }
.summary-pr .ic { color: var(--strong); flex-shrink: 0; }
.summary-pr strong { color: var(--ink); }
/* 1RM estimado: tick "solo esfuerzo" + explicación plegable */
.e1-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 2px; }
.e1-toggle { font-size: 13px; margin: 0; }
.e1-help-btn { background: none; border: none; color: var(--strong); font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 2px; white-space: nowrap; flex-shrink: 0; }
.e1-note { font-size: 12px; color: var(--ink-dim); margin: 4px 0; }
.e1-alert { display: flex; align-items: flex-start; gap: 8px; background: var(--strong-bg); color: var(--strong); font-size: 12.5px; font-weight: 500; line-height: 1.45; padding: 10px 12px; border-radius: 10px; margin: 8px 0 2px; }
.e1-alert .ic { flex-shrink: 0; margin-top: 1px; }
.e1-alert span { flex: 1; min-width: 0; }
.e1-alert strong { color: var(--strong); font-weight: 700; }
.e1-formula-row { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; margin: 8px 0 2px; }
.e1-formula-row .chips-row { flex: 0 0 auto; margin: 0; }
.e1-formula-label { font-size: 11px; font-weight: 600; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.e1-help { background: var(--strong-bg); border-radius: 10px; padding: 10px 12px; margin: 8px 0 2px; font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); }
.e1-help p { margin: 0 0 9px; }
.e1-help p:last-child { margin-bottom: 0; }
.e1-help strong { color: var(--ink); }
.e1-tips { margin: 6px 0 0; padding-left: 18px; }
.e1-tips li { margin-bottom: 4px; }
.e1-tips li:last-child { margin-bottom: 0; }
/* Lista "Tus récords" */
.rec-catsel { margin-bottom: 10px; }
.rec-catsel .field { margin: 0; }
.rec-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--line-soft); }
.rec-row:last-child { border-bottom: 0; }
.rec-medal { font-size: 17px; flex-shrink: 0; }
.rec-main { min-width: 0; flex: 1; }
.rec-name { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.rec-meta { font-size: 11px; color: var(--ink-dim); }
.rec-val { margin-left: auto; font-weight: 800; font-size: 15px; color: var(--strong); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
/* Racha y heatmap de consistencia (vista Sesiones) */
.streak-card { position: relative; background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.streak-expand { position: absolute; top: 7px; right: 7px; background: none; border: none; color: var(--ink-dim); cursor: pointer; padding: 4px; border-radius: 6px; display: inline-flex; }
.streak-expand:active { background: var(--line-soft); color: var(--strong); }
.streak-stats { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; padding-right: 26px; }
.streak-fig { display: flex; align-items: baseline; gap: 5px; }
.streak-num { font-size: 16px; font-weight: 800; color: var(--ink); line-height: 1; }
.streak-lbl { font-size: 10px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.cal-arrow { background: none; border: none; color: var(--strong); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 12px; }
.cal-arrow.disabled, .cal-arrow:disabled { color: var(--line); cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.streak-card .cal-grid[data-hist] { cursor: pointer; }
/* Modal de historial mensual */
.hist-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.hist-month { font-size: 15px; font-weight: 700; color: var(--ink); }
.hist-grid { gap: 4px; }
.hist-grid .cal-cell { height: 34px; font-size: 12.5px; border-radius: 7px; }
.cal-cell.out { opacity: .3; }
.hist-summary { margin: 12px 0 0; font-size: 13px; color: var(--ink-soft); text-align: center; }
.cal-dow { text-align: center; font-size: 9px; font-weight: 700; color: var(--ink-dim); line-height: 12px; }
.cal-cell { height: 14px; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 600; color: var(--ink-soft); background: var(--line-soft); border-radius: 4px; }
.cal-cell.on { color: #fff; }
.cal-cell.today { box-shadow: 0 0 0 1.5px var(--strong); font-weight: 800; }
.cal-cell.future { opacity: .3; }
.pr-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.pr-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--strong-bg); border-radius: 10px; }
.pr-ex { font-weight: 600; min-width: 0; }
.pr-vals { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.pr-now { font-weight: 800; font-size: 17px; color: var(--strong); font-variant-numeric: tabular-nums; }
.pr-prev { font-size: 11px; color: var(--ink-dim); }
.ai-providers { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.ex-target { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--ink-dim); margin-top: 2px; }
.set-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
/* Fila de serie: nº · valores · acciones (rejilla; las acciones nunca se parten) */
.set-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
/* flex-wrap: si la etiqueta/carga no cabe, baja de línea y los inputs quedan legibles */
.set-vals { display: flex; align-items: center; gap: 7px; min-width: 0; flex-wrap: wrap; row-gap: 6px; }
.set-acts { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.set-reps { flex: 0 1 96px; }
.load-chip { flex: 0 0 auto; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--ink-soft); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; }
.load-chip.on { background: var(--strong-bg); border-color: var(--strong); color: var(--strong); }
.load-chip:disabled { opacity: .55; }
.set-row.done { opacity: .55; }
.set-wrap { display: flex; flex-direction: column; gap: 5px; }
.set-wrap.done { opacity: .55; }
.set-extra { display: flex; gap: 6px; padding-left: 28px; flex-wrap: wrap; }
.ex-card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.metric-add { background: none; border: 1px dashed var(--line); color: var(--ink-soft); border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.metric-add .ic { color: var(--strong); }
.metric-add:active { background: var(--line-soft); }
.metric-opts { display: flex; flex-direction: column; }
.metric-opt { display: flex; align-items: center; gap: 11px; padding: 11px 4px; border-bottom: 1px solid var(--line-soft); cursor: pointer; font-weight: 500; }
.metric-opt input { width: 18px; height: 18px; flex-shrink: 0; }
.metric-opt em { color: var(--ink-dim); font-style: normal; font-size: 12px; }
/* Nota + nivel de esfuerzo por ejercicio */
.ex-note { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 4px 0 8px; padding: 7px 9px; background: var(--line-soft); border-radius: 8px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; }
.ex-note-txt { display: inline-flex; align-items: center; gap: 4px; }
.ex-note .ic { color: var(--ink-dim); flex-shrink: 0; }
.effort-badge { background: var(--strong-bg); color: var(--strong); font-weight: 700; font-size: 11px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.last-note { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 0 0 8px; padding: 0 2px; font-size: 12px; color: var(--ink-dim); }
.last-note .ic { flex-shrink: 0; }
.effort-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.effort-opt { background: var(--bg-card); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.effort-opt.sel { background: var(--strong); border-color: var(--strong); color: #fff; }
/* Chip de esfuerzo (RPE %) por serie, al final de la fila */
.set-rpe { flex-shrink: 0; height: 34px; min-width: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--ink-dim); font-size: 12px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; justify-content: center; }
.set-rpe.on { background: var(--strong-bg); border-color: var(--strong); color: var(--strong); }
.set-extra .set-f { height: 32px; font-size: 13px; padding: 0 8px; }
/* Cardio: etiqueta opcional por serie + fila de totales del ejercicio */
.set-label-chip { flex: 0 1 auto; height: 34px; min-width: 34px; max-width: 100%; padding: 0 9px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--ink-dim); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.set-label-chip .lc-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.set-label-chip.on { background: var(--strong-bg); border-color: var(--strong); color: var(--strong); }
.set-label-chip:disabled { opacity: .55; }
.ex-totals { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 2px; padding: 8px 10px; background: var(--strong-bg); border-radius: 10px; }
.ex-total-time { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 9px; font-weight: 700; font-size: 13px; color: var(--strong); white-space: nowrap; background: none; border: 1px solid transparent; border-radius: 10px; cursor: pointer; }
.ex-total-time.on { border-color: var(--strong); background: var(--bg-card); } /* tiempo total manual */
.ex-total-time .ic { color: var(--strong); }
.ex-total-f { flex: 1 1 80px; min-width: 0; height: 34px; padding: 0 10px; font-size: 14px; text-align: center; border-radius: 10px; }
.detail-totals { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--strong); }
.detail-totals .ic { color: var(--strong); flex-shrink: 0; }
.ex-variant { display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; font-size: 11px; font-weight: 600; color: var(--strong); background: var(--strong-bg); padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.ex-label-row { margin-bottom: 6px; }
.bk-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.bk-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bk-meta { display: flex; flex-direction: column; min-width: 0; }
.bk-meta strong { font-size: 14px; }
.bk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bk-actions .btn { flex: 1; min-width: 92px; }
.ed-ex-label { width: 96px; flex: 0 0 auto; font-size: 12px; padding: 4px 8px; height: 30px; }
.rep-row { max-width: 160px; margin-bottom: 8px; }
.rep-row .inp { width: 90px; }
.metric-group-label { font-size: 11px; font-weight: 700; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .03em; margin: 10px 0 4px; }
.metric-group-label:first-child { margin-top: 0; }
/* El número de serie va en el canalón izquierdo (alineado con el agarrador),
   fuera del flujo, para que los inputs arranquen en el borde del contenido. */
.set-n { text-align: center; font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-dim); }
.set-f { flex: 1 1 52px; min-width: 46px; height: 34px; padding: 0 8px; font-size: 15px; text-align: center; border-radius: 10px; font-variant-numeric: tabular-nums; }
.set-x { color: var(--ink-dim); font-size: 14px; flex-shrink: 0; }
.set-unit { font-size: 11px; color: var(--ink-dim); flex-shrink: 0; }
.set-done { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-dim); font-size: 16px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.set-done.on { background: var(--strong); border-color: var(--strong); color: #fff; }
/* La × de quitar serie, mismo tamaño y radio que el resto de controles */
.set-acts .icon-btn { width: 34px; height: 34px; border-radius: 10px; font-size: 19px; }
/* reps con lastre/asistencia */
.set-load-mode { flex: 0 1 auto; min-width: 0; max-width: 110px; width: auto; font-size: 12px; padding: 8px 6px; padding-right: 22px; }
.set-load { max-width: 64px; flex: 0 0 auto; }
/* dropsets */
.drop-row { display: flex; align-items: center; gap: 8px; padding-left: 28px; }
.drop-tag { font-family: 'IBM Plex Mono', monospace; font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sub-accent); background: var(--sub-bg); padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }
.set-foot { display: flex; align-items: center; gap: 18px; padding-left: 28px; }
.set-drop-btn { background: none; border: none; color: var(--sub-accent); font-size: 12px; font-weight: 600; cursor: pointer; padding: 2px 0; }
.set-drop-btn:active { opacity: .6; }

/* ---- Barra de entreno activo ---- */
.active-bar {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 10px);
  z-index: 90; display: flex; align-items: center; gap: 10px;
  background: var(--strong); color: #fff; border: none; cursor: pointer;
  padding: 12px 16px; border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  font-family: 'Inter Tight', sans-serif; text-align: left;
}
.active-bar:active { opacity: .85; }
.ab-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; flex-shrink: 0; animation: abpulse 1.4s ease-in-out infinite; }
@keyframes abpulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.ab-text { flex: 1; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-cta { font-size: 13px; font-weight: 700; flex-shrink: 0; }
@media (min-width: 600px) { .active-bar { max-width: 540px; margin: 0 auto; } }

/* ---- Progreso ---- */
.prog-row { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.prog-date { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-dim); width: 52px; flex-shrink: 0; }
.prog-vals { flex: 1; font-size: 13px; color: var(--ink-soft); }
.block-note { display: block; font-size: 12px; margin-top: 3px; }
.prog-actions { display: flex; gap: 2px; }
.kv-list { list-style: none; }
.kv-list li { display: flex; justify-content: space-between; padding: 8px 14px; font-size: 13px; color: var(--ink-soft); border-bottom: 1px solid var(--line-soft); }
.kv-list li:last-child { border: none; }
.ex-actions { display: flex; align-items: center; gap: 4px; }
.ex-line-main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ex-subs { font-size: 11px; color: var(--sub-accent); line-height: 1.35; }
.subs-box { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
.sub-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--sub-bg); color: var(--sub-accent); border-radius: 16px; padding: 5px 6px 5px 12px; font-size: 13px; font-weight: 500; }
.sub-chip button { background: var(--sub-accent); color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px; font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.catalog-title { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.catalog-title:first-child { margin-top: 4px; }
.ex-name-wrap { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ex-sub { font-size: 11px; color: var(--ink-dim); line-height: 1.3; }
.ex-type { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--ink-dim); letter-spacing: 0.06em; text-transform: uppercase; }

/* ---- Gráficas ---- */
.chart-wrap { margin-top: 8px; position: relative; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-hit { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.chart-tip { position: absolute; transform: translate(-50%, calc(-100% - 9px)); background: var(--ink); color: var(--bg); font-size: 11.5px; font-weight: 600; line-height: 1.3; padding: 5px 8px; border-radius: 8px; white-space: nowrap; pointer-events: none; z-index: 5; box-shadow: 0 4px 14px rgba(0,0,0,.22); border-left: 3px solid var(--tip-color, var(--accent)); }
.chart-tip::after { content: ''; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.chart-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.chart-axis { font-family: 'IBM Plex Mono', monospace; font-size: 8px; fill: var(--ink-dim); }
.chart-empty { text-align: center; padding: 30px 10px; color: var(--ink-dim); font-size: 12px; }
.chart-legend { display: flex; gap: 14px; justify-content: center; margin-top: 8px; font-size: 11px; color: var(--ink-soft); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.chart-title { font-size: 12px; color: var(--ink-soft); font-weight: 600; margin: 6px 0; text-align: center; }

/* ---- Diario ---- */
.journal-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.journal-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.journal-date { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-dim); flex: 1; }
.journal-mood { font-size: 20px; }
.journal-actions { display: flex; gap: 2px; }
.journal-text { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.mood-picker { display: flex; gap: 8px; margin-bottom: 14px; }
.mood-opt { font-size: 24px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; cursor: pointer; filter: grayscale(0.6); opacity: .6; }
.mood-opt.sel { filter: none; opacity: 1; border-color: var(--strong); background: var(--strong-bg); }

/* ---- Editor de día / sesión ---- */
.editor-meta, .editor-blocks { margin-bottom: 12px; }
.ed-block { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; background: var(--bg); }
.ed-block-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.block-name { flex: 1; font-weight: 600; }
.ed-ex { border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px; margin-bottom: 8px; background: var(--bg-card); }
.ed-ex-top { display: flex; gap: 8px; margin-bottom: 6px; }
.ed-ex-top .narrow { max-width: 90px; }
.ed-ex-pick { flex: 1; min-width: 0; text-align: left; font-family: 'Inter Tight', sans-serif; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-ex-pick:active { background: var(--line-soft); }
.ed-ex-pick.empty { color: var(--strong); border-style: dashed; border-color: var(--strong); }
.ed-cat-btn { flex: 1; min-width: 0; text-align: left; font-family: 'Inter Tight', sans-serif; font-size: 14px; font-weight: 700; color: var(--strong); background: var(--strong-bg); border: 1px solid var(--strong); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.ed-cat-btn:active { opacity: .7; }
.ed-ex-bottom .ex-type { margin-right: auto; }
.ed-ex-bottom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ed-ex-bottom select { flex: 1; min-width: 120px; font-size: 13px; padding: 6px 8px; }
.ed-ex-moves { margin-left: auto; display: flex; gap: 2px; }
.ed-block-moves { margin-left: auto; display: flex; gap: 2px; flex-shrink: 0; }

.check-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; font-size: 13px; color: var(--ink-soft); border-bottom: 1px solid var(--line-soft); }
.check-row input { accent-color: var(--strong); width: 18px; height: 18px; }
/* Importador: secciones editables */
.imp-sec { border-bottom: 1px solid var(--line-soft); }
.imp-sec-head { border-bottom: none; }
.imp-sec-head span:first-of-type { flex: 1; }
.imp-toggle { background: none; border: none; color: var(--strong); font-size: 12px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.imp-toggle:active { opacity: .6; }
.imp-items { max-height: 200px; overflow-y: auto; padding-left: 22px; margin-bottom: 4px; }
.imp-items .check-row.sub { padding: 6px 4px; font-size: 12px; border-bottom: none; }

/* ---- Selector de ejercicios con buscador ---- */
.picker-list { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.picker-search { position: sticky; top: 0; z-index: 2; background: var(--bg); }
.picker-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; background: var(--bg-card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.picker-row:active { background: var(--line-soft); }
.picker-row.new { background: var(--strong-bg); border-color: var(--strong); }
.picker-row.sel { border-color: var(--strong); background: var(--strong-bg); }
.select-btn { position: relative; width: 100%; text-align: left; font-family: 'Inter Tight', sans-serif; font-size: 15px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 34px 10px 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.select-btn:active { background: var(--line-soft); }
.select-caret { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-dim); pointer-events: none; }
.picker-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.picker-tag { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--ink-dim); letter-spacing: 0.04em; text-transform: uppercase; }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 20px + var(--safe-bottom)); left: 50%;
  transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 18px;
  border-radius: 10px; font-size: 13px; font-weight: 500; z-index: 400; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; box-shadow: 0 6px 20px rgba(0,0,0,0.25); max-width: 86%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--priority); color: #fff; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,18,14,0.45); z-index: 500;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
  animation: fadeIn .18s ease;
}
.modal {
  background: var(--bg); width: 100%; max-width: 540px; max-height: 100%; border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column; animation: slideUp .22s ease; padding-bottom: var(--safe-bottom);
}
.modal.wide { max-height: 100%; }
@keyframes slideUp { from { transform: translateY(40px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; font-weight: 700; }
.modal-x { background: none; border: none; font-size: 26px; line-height: 1; color: var(--ink-dim); cursor: pointer; padding: 0 4px; }
.modal-body { padding: 16px 18px; overflow-y: auto; overflow-x: hidden; flex: 1; }
.modal-text { font-size: 14px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.modal-actions .btn { flex: 1; }
body.modal-open { overflow: hidden; }

@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: 18px; max-height: 92vh; }
  .modal.wide { max-height: 92vh; }
}

/* ---- Onboarding ---- */
#onboarding { position: fixed; inset: 0; background: var(--bg); z-index: 600; overflow-y: auto; }
.onb-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.onb-card { max-width: 420px; width: 100%; }
.onb-eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 10px; font-weight: 500; }
.onb-card h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 12px; }
.onb-sub { font-size: 14px; color: var(--ink-soft); line-height: 1.55; margin-bottom: 24px; }
.guide-eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.18em; color: var(--ink-dim); text-transform: uppercase; margin-bottom: 8px; font-weight: 500; }

/* Prescripción del plan (tempo, carga, tope) bajo el nombre del ejercicio */
.ex-detail { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.ex-card-name .ex-detail { margin-top: 3px; }
.ed-ex-detail { width: 100%; margin-top: 6px; font-size: 13px; }
.modal-text.prewrap { white-space: pre-wrap; }

/* Vista de documento adjunto (imagen) */
.doc-view { display: block; width: 100%; height: auto; border-radius: 10px; }

/* Serie de tipo "hecho / no hecho" (estiramientos, movilidad) */
.set-row-check .set-vals { align-items: center; }
.set-check-txt { font-size: 13px; color: var(--ink-dim); }
.set-wrap.done .set-check-txt { color: var(--strong); font-weight: 600; }

/* ---- Semáforo: respuesta del cuerpo al día siguiente ---- */
.resp-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid; }
.resp-chip i, .resp-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.resp-dot { margin-right: 6px; vertical-align: baseline; }
.resp-chip.go   { color: #1f7a52; border-color: #a8d8c2; background: #e6f4ed; }
.resp-chip.wait { color: #8a6100; border-color: #e6cf94; background: #fbf1dc; }
.resp-chip.stop { color: #a33a2e; border-color: #e6b3ab; background: #fae7e3; }
.resp-chip.go i, .resp-dot.go { background: #2f9c6a; }
.resp-chip.wait i, .resp-dot.wait { background: #c08a12; }
.resp-chip.stop i, .resp-dot.stop { background: #c4503f; }
.detail-resp { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; }
.resp-pick { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.resp-opt { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-family: inherit; color: var(--ink); }
.resp-opt:active { opacity: .7; }
.resp-opt i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.resp-opt span { display: flex; flex-direction: column; gap: 2px; }
.resp-opt strong { font-size: 15px; font-weight: 600; }
.resp-opt em { font-style: normal; font-size: 12px; color: var(--ink-dim); }
.resp-opt.go i { background: #2f9c6a; } .resp-opt.wait i { background: #c08a12; } .resp-opt.stop i { background: #c4503f; }

/* ============ NUTRICIÓN ============ */
.beta-tag { font-family: 'IBM Plex Mono', monospace; font-size: 9px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; padding: 2px 5px; border-radius: 4px; background: var(--moderate-bg); color: var(--moderate); margin-left: 5px; vertical-align: 1px; }

/* Encabezados de sección: discretos, sin gritar */
.sec-label { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--ink-dim);
  margin: 22px 0 10px; }
.sec-label:first-child { margin-top: 4px; }

/* Cabecera de la pantalla */
.nut-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--strong-bg); border-radius: 14px; margin-bottom: 14px; }
.nut-head .nut-head-txt { flex: 1; min-width: 0; }
.nut-head .icon-btn { flex: none; color: var(--strong); }
.nut-head-txt { display: flex; flex-direction: column; gap: 3px; }
.nut-head-txt strong { font-size: 19px; font-weight: 700; color: var(--strong); letter-spacing: -.01em; }
.nut-head-txt .dim { font-size: 13px; }

/* Selector de día: píldoras, no bloques */
.nut-days { display: flex; gap: 8px; margin-bottom: 8px; }
.nut-day { flex: 1; font-size: 13.5px; font-weight: 600; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--line); color: var(--ink-soft); font-family: inherit;
  transition: background .12s, color .12s; }
.nut-day.sel { background: var(--strong); border-color: var(--strong); color: #fff; }
.nut-hint { font-size: 12.5px; color: var(--ink-dim); line-height: 1.45; margin-bottom: 4px; }
.nut-hint.warn { color: var(--moderate); }

/* Tarjeta de pauta */
.pauta-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px;
  padding: 15px 16px; margin-bottom: 10px; }
.pauta-card.off { opacity: .45; }
.pauta-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pauta-name { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.pauta-off { font-size: 10.5px; font-weight: 600; color: var(--moderate); background: var(--moderate-bg);
  padding: 3px 7px; border-radius: 5px; white-space: nowrap; }
.pauta-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line-soft); }

/* Línea de alimento: el gramaje destaca, lo demás no estorba */
.nut-row { margin-bottom: 11px; }
.nut-row:last-of-type { margin-bottom: 0; }
.nut-line { display: flex; align-items: baseline; gap: 7px; }
.nut-food { font-size: 14.5px; color: var(--ink); line-height: 1.35; }
.nut-dots { flex: 1; border-bottom: 1px dotted var(--line); transform: translateY(-3px); min-width: 10px; }
.nut-qty { font-size: 14px; font-weight: 700; color: var(--strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nut-eq { font-size: 11.5px; color: var(--ink-dim); margin-top: 2px; line-height: 1.4; }

/* Alternativas: texto, no botonazos */
.nut-swap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: 5px; }
.nut-swap-lbl { font-size: 11.5px; color: var(--ink-dim); }
.nut-alt { font-size: 12.5px; padding: 3px 8px; border-radius: 7px; cursor: pointer; font-family: inherit;
  background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }
.nut-alt.static { cursor: default; }
.nut-alt em { font-style: normal; color: var(--ink-dim); }
.nut-alt.add { border-style: dashed; color: var(--strong); }

/* Tus platos */
.meal-list { display: flex; flex-direction: column; gap: 8px; }
.meal-card { position: relative; display: flex; flex-direction: column; gap: 2px; text-align: left; width: 100%;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 32px 13px 15px;
  cursor: pointer; font-family: inherit; }
.meal-card:active { background: var(--line-soft); }
.meal-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.meal-sub { font-size: 12.5px; color: var(--ink-dim); line-height: 1.4; }
.meal-flag { font-size: 11px; color: var(--strong); display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; }
.meal-go { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-dim); font-size: 17px; }

/* Avisos, reglas y dudas */
.nut-reglas, .nut-dudas { background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 12px; }
.nut-dudas { border-color: var(--moderate); }
.nut-reglas ul, .nut-dudas ul { margin: 0; padding-left: 17px; }
.nut-reglas li, .nut-dudas li { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 5px; }
.duda-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.duda-row:last-of-type { border-bottom: 0; }
.duda-txt { flex: 1; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.duda-txt { overflow-wrap: anywhere; }
.duda-row .btn { flex: none; white-space: nowrap; }
.nut-dudas .field-hint { margin: 8px 0 0; }
.nut-intro { background: var(--strong-bg); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.nut-intro h3 { font-size: 17px; color: var(--strong); margin-bottom: 6px; }
.nut-intro p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.nut-or { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--ink-dim); font-size: 12px; }
.nut-or::before, .nut-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Previsualización del importador */
.nut-sum { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px 14px; background: var(--bg); border-radius: 10px; margin: 10px 0; font-size: 13px; color: var(--ink-soft); }
.nut-sum b { color: var(--strong); font-size: 15px; font-variant-numeric: tabular-nums; }
.nut-sum .warn b { color: var(--moderate); }
.nut-check { margin: 8px 0 0; padding-left: 17px; }
.nut-check li { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 4px; }
.nut-check.warn li { color: var(--moderate); }
.nut-check.err li { color: var(--priority); }

/* Edición */
.nut-qrow { display: grid; grid-template-columns: 1fr 88px 78px; gap: 8px; align-items: center; margin-bottom: 8px; }
.nut-qlbl { font-size: 12.5px; color: var(--ink-soft); }
@media (max-width: 420px) { .nut-qrow { grid-template-columns: 1fr 70px 62px; gap: 6px; } .nut-qlbl { font-size: 11.5px; } }
.nut-x { background: none; border: none; color: var(--priority); font-size: 16px; cursor: pointer; padding: 0 6px; line-height: 1; }
.btn.ghost.block.danger { color: var(--priority); }
.rec-foto { display: block; width: 100%; height: auto; border-radius: 12px; margin: 8px 0 4px; }
/* Ingredientes extra del plato */
.nut-qty.extra { color: var(--moderate); }
.extra-row { display: flex; align-items: baseline; gap: 7px; width: 100%; text-align: left;
  background: none; border: none; padding: 7px 0; cursor: pointer; font-family: inherit; }
.extra-row .nut-food { font-size: 14.5px; }
.extra-row .nut-mini { color: var(--ink-dim); }
/* Elegir con qué se hace el plato */
.elige-row { margin-bottom: 12px; }
.elige-lbl { display: block; font-size: 12.5px; color: var(--ink-dim); margin-bottom: 6px; }
.elige-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.nut-alt.on { background: var(--strong); border-color: var(--strong); color: #fff; }
.nut-alt.on em { color: rgba(255,255,255,.75); }
.elige-uno { font-size: 14.5px; color: var(--ink); margin-bottom: 2px; }
.elige-row { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.elige-row:last-child { border-bottom: 0; margin-bottom: 4px; }
.nut-qty.tuya { color: var(--moderate); }
/* Alternativas equivalentes: ninguna es la principal */
.nut-food.grupo { font-weight: 600; }
.nut-opts { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 6px; }
.nut-opt { font-size: 12.5px; color: var(--ink-soft); background: var(--bg); border: 1px solid var(--line);
  border-radius: 7px; padding: 3px 8px; }
.nut-opts-hint { font-size: 11px; color: var(--ink-dim); margin-top: 5px; }
.nut-grupo-lbl { font-size: 12px; color: var(--ink-dim); margin-bottom: 5px; }
.nut-line.igual { padding: 2px 0; }
/* Editor de una opción: cada línea, una tarjeta */
.grp-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; margin-bottom: 10px; background: var(--bg-card); }
.grp-head { margin-bottom: 4px; }
.inp.grp-name { font-weight: 600; padding: 7px 10px; font-size: 14px; }
.grp-hint { font-size: 11.5px; color: var(--ink-dim); margin: 0 0 8px; }
.tipo-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0 4px; }
.dias-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.dias-pick .nut-alt { padding: 6px 12px; font-size: 13px; }
.tipo-chips .nut-alt { font-size: 12px; }
.grp-card .btn.small { margin-top: 8px; }
/* Edición de un alimento dentro de la propia lista */
.fila-ed { border: 1px solid var(--strong); border-radius: 10px; padding: 11px 12px; margin: 6px 0 8px; background: var(--bg); }
.fila-ed > .inp { margin-bottom: 9px; }
.fila-ed .metric-opt { margin-bottom: 8px; }
.fila-ed-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.fila-ed-foot .btn { margin-top: 0; }
details.det { margin: 4px 0 6px; }
details.det > summary { cursor: pointer; font-size: 12.5px; color: var(--strong); padding: 5px 0; list-style: none; }
details.det > summary::-webkit-details-marker { display: none; }
details.det > summary::before { content: '▸ '; }
details.det[open] > summary::before { content: '▾ '; }
.det-body { padding-top: 4px; }
