/* activity.css — cardio, natación, senderismo, otras actividades (.act-…) y peso corporal (.bw-…, .bwq-…). */

/* ---------- Formulario de actividad ---------- */
.act-screen { padding-bottom: 0; }
.act-body { display: flex; flex-direction: column; gap: 12px; }
.act-card { gap: 14px; }
.act-card-title { font-size: calc(15px * var(--ts)); font-weight: 750; color: var(--text-2); }
.act-kinds .seg-btn { min-height: 44px; font-size: calc(16px * var(--ts)); }

/* Selectores de deporte con 4–5 opciones (con senderismo, «Senderismo» no cabe en una fila de 375–430 px sin
   cortarse): dos filas, 3 + 2 con cinco opciones y 2 + 2 con cuatro. Lo usan el tipo del formulario de actividad
   (.act-kinds), el deporte de un objetivo y el filtro de km de Progreso (.act-seg-wrap). */
.act-kinds,
.act-seg-wrap { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.act-kinds > .seg-btn,
.act-seg-wrap > .seg-btn { grid-column: span 2; min-width: 0; }
.act-kinds > .seg-btn:nth-child(n + 4):nth-last-child(-n + 2),
.act-seg-wrap > .seg-btn:nth-child(n + 4):nth-last-child(-n + 2) { grid-column: span 3; }
.act-kinds > .seg-btn:first-child:nth-last-child(4),
.act-kinds > .seg-btn:first-child:nth-last-child(4) ~ .seg-btn,
.act-seg-wrap > .seg-btn:first-child:nth-last-child(4),
.act-seg-wrap > .seg-btn:first-child:nth-last-child(4) ~ .seg-btn { grid-column: span 3; }
.act-link .icon { color: var(--info); flex: none; }
.act-req { font-weight: 500; color: var(--muted); font-size: calc(13px * var(--ts)); }
.act-dur-hint { color: var(--info); }
.act-date { font-size: calc(17px * var(--ts)); }
.act-grid { gap: 12px 10px; }
.act-grid .input-suffix-wrap .input { padding-right: 46px; }
.act-grid .input-suffix { font-size: calc(14px * var(--ts)); }
.act-custom { margin-top: -4px; }

/* Métricas calculadas en vivo */
.act-live {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.act-live-single { grid-template-columns: 1fr; }
.act-live-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.act-live-label { font-size: calc(13px * var(--ts)); font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-live-value {
  font-size: calc(26px * var(--ts));
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
/* Unidad más pequeña y sin cortar («2:35 /100 m», «25,8 km/h»); si no cabe, baja de línea entera. */
.act-live-unit { font-size: calc(15px * var(--ts)); font-weight: 700; color: var(--text-2); white-space: nowrap; }
.act-load { color: var(--accent); }
.act-muted-val { color: var(--muted); }
.act-live-sub { font-size: calc(13px * var(--ts)); color: var(--text-2); line-height: 1.3; min-height: 17px; }

/* Barra inferior fija con estado + «Listo» (a mano del pulgar) */
.act-footer {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--sab));
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px -16px 0;
  padding: 10px 16px;
  background: rgba(11, 13, 16, 0.94);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--border);
}
.act-done { flex: none; min-width: 132px; }
.act-status {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: calc(14px * var(--ts));
  font-weight: 650;
  line-height: 1.25;
  color: var(--muted);
}
.act-status-ok { color: var(--ok); }
.act-status-draft { color: var(--text-2); }
.act-status-error { color: var(--danger); }
.act-delete { margin-top: 8px; }
.act-restored .btn { flex: none; min-height: 44px; padding: 0 14px; }
/* Posible duplicado: el texto arriba y las dos acciones debajo, a todo el ancho (caben a 320 px y con texto grande). */
.act-dup { flex-wrap: wrap; align-items: flex-start; }
.act-dup > .icon { color: var(--warn); flex: none; }
.act-dup-actions { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
.act-dup-actions .btn { flex: 1 1 auto; min-height: 44px; padding: 0 14px; }

/* ---------- Senderismo fuera del formulario ---------- */
/* Accesos rápidos de Hoy (views/today.js): con senderismo son seis; en 3 × 2 cada botón es ancho y «Senderismo»
   cabe entero (calendar.css los pone en una fila de cinco; dos clases para ganarle en especificidad). */
.today-quick.act-quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.today-quick.act-quick-grid .today-quick-btn { min-height: 64px; }
/* Fondo del emoji en las filas de sesión (Historial, Día, Hoy), como .cal-emoji-run… de calendar.css (que se carga
   después: dos clases para que no lo pise el fondo gris de .cal-emoji). */
.cal-emoji.cal-emoji-hike { background: rgba(45, 212, 191, 0.16); }

/* ---------- Peso corporal ---------- */
.bw-entry { gap: 12px; }
.bw-date { width: auto; min-width: 150px; max-width: 58%; min-height: 44px; padding: 6px 10px; font-size: calc(16px * var(--ts)); }
.bw-stepper .stepper-btn { width: 72px; min-height: 64px; border-radius: 14px; }
.bw-stepper .stepper-step { font-size: calc(17px * var(--ts)); }
.bw-stepper .stepper-input { min-height: 64px; font-size: calc(34px * var(--ts)); border-radius: 14px; }
.bw-stepper .stepper-suffix { font-size: calc(13px * var(--ts)); right: 10px; bottom: 8px; }
.bw-hint { text-align: center; }

.bw-summary { gap: 12px; }
.bw-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bw-kpi {
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bw-kpi-main { border-color: rgba(184, 243, 74, 0.45); background: var(--accent-soft); }
.bw-kpi-label { font-size: calc(13px * var(--ts)); font-weight: 700; color: var(--muted); }
.bw-kpi-main .bw-kpi-label { color: var(--accent); }
.bw-kpi-value { font-size: calc(24px * var(--ts)); font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.bw-kpi-na { font-size: calc(17px * var(--ts)); font-weight: 750; color: var(--text-2); white-space: normal; line-height: 1.25; padding: 4px 0 2px; }
.bw-unit { font-size: calc(13px * var(--ts)); font-weight: 650; color: var(--text-2); white-space: nowrap; }
.bw-kpi-sub { font-size: calc(12px * var(--ts)); color: var(--muted); line-height: 1.3; }
/* Sobre el verde suave de la tarjeta principal, --muted se queda en 4,48:1: un gris más claro */
.bw-kpi-main .bw-kpi-sub { color: var(--text-2); }
/* 320 px: «+0,09 kg/sem» no cabe en la mitad de la pantalla; el valor encoge y la unidad baja de línea si hace falta */
@media (max-width: 359px) {
  .bw-kpi { padding: 10px; }
  .bw-kpi-value { font-size: calc(20px * var(--ts)); overflow-wrap: anywhere; }
}
.bw-why-na { margin-top: 8px; color: var(--text-2); }
.bw-note { font-size: calc(14px * var(--ts)); line-height: 1.4; color: var(--text-2); }
.bw-chart-slot:empty { display: none; }

.bw-row { gap: 10px; }
.bw-row-kg { font-weight: 750; font-size: calc(17px * var(--ts)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bw-row-delta { min-width: 52px; text-align: right; font-size: calc(14px * var(--ts)); font-weight: 650; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bw-row-delta-none { color: var(--muted); }

/* Tarjeta compacta para Hoy */
.bwq { gap: 8px; }
.bwq-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  margin: -10px -6px -10px 0;
  padding: 0 4px 0 10px;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 700;
  font-size: calc(15px * var(--ts));
  /* Ronda 10 (UX-7): «Ver todo» no se parte con texto grande; el que cede es el título */
  flex: none;
  white-space: nowrap;
}
.bwq-info { font-size: calc(14px * var(--ts)); color: var(--text-2); }
.bwq-info b { color: var(--text); font-variant-numeric: tabular-nums; }
.bwq-sep { color: var(--muted); }
.bwq-row { display: flex; align-items: stretch; gap: 8px; }
.bwq-stepper { flex: 1; min-width: 0; }
.bwq-save { flex: none; min-height: 46px; padding: 0 16px; }
