/* Repaso del 21 nov: resumen de la ficha de entreno y lista compacta de Actividades (activity-summary.js). */
#app .activity-summary { margin:12px 0 16px; }
#app .activity-summary-grid, #app .activity-period-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
@media (min-width:700px) { #app .activity-summary-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } #app .activity-period-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
#app .activity-summary-grid > .compact-card, #app .activity-period-grid > .compact-card { min-height:92px; }
#app .activity-period-grid .compact-card-spark { width:100%; height:24px; margin-top:auto; fill:none; stroke:var(--accent); stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
/* Una sola línea que se desliza, sin saltos (Pablo, 21 nov). */
#app .activity-period-chips, #app .activity-filter-chips, #app .activity-zones-choice { display:flex; flex-wrap:nowrap !important; gap:8px; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; -webkit-overflow-scrolling:touch; padding:2px 0; margin:10px 0; } 
#app :is(.activity-period-chips,.activity-filter-chips,.activity-zones-choice)::-webkit-scrollbar { display:none; }
#app :is(.activity-period-chips,.activity-filter-chips,.activity-zones-choice) > * { flex:none; white-space:nowrap; }
#app .activity-zones { margin-top:8px; padding:12px; border-radius:14px; background:var(--fill); }
#app .activity-zones-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
#app .activity-zones-title { display:flex; align-items:center; gap:6px; font-size:13px; font-weight:600; color:var(--muted); }
#app .activity-zones-title svg { width:18px; height:18px; fill:none; stroke:var(--compact-color,var(--accent)); stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
#app .activity-zones-choice { margin:0; }
#app .activity-zones-bar { display:flex; gap:2px; height:16px; border-radius:6px; overflow:hidden; }
#app .activity-zones-bar > span { min-width:3px; }
#app .activity-zones-legend { display:flex; flex-wrap:wrap; gap:4px 12px; margin:8px 0 0; padding:0; list-style:none; font-size:12px; color:var(--muted); }
#app .activity-zones-legend li { display:flex; align-items:center; gap:5px; }
#app .activity-zones-legend i { width:9px; height:9px; border-radius:3px; flex:none; }
#app .activity-head h1.activity-head-title { display:flex !important; align-items:center; gap:10px; min-width:0; }
#app .activity-head-icon { flex:none; display:grid; place-items:center; width:34px; height:34px; border-radius:10px; background:var(--fill); }
#app .activity-head-icon svg, #app .activity-row-icon svg { width:20px; height:20px; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
#app .activity-rows { display:grid; grid-template-columns:minmax(0,1fr); gap:6px; }
#app .activity-row { all:unset; box-sizing:border-box; width:100%; min-width:0; display:flex; align-items:center; gap:12px; min-height:56px; padding:8px 12px; border-radius:14px; background:var(--fill); cursor:pointer; }
#app .activity-row:hover { background:var(--raised); }
#app .activity-row:focus-visible { outline:3px solid color-mix(in srgb,var(--accent) 55%,transparent); outline-offset:2px; }
#app .activity-row-icon { flex:none; display:grid; place-items:center; width:38px; height:38px; border-radius:10px; background:color-mix(in srgb,var(--text) 8%,transparent); }
#app .activity-row-text { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
#app .activity-row-text b { font-size:15px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#app .activity-row-text small { font-size:12.5px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#app .activity-row-go { flex:none; color:var(--muted); font-size:20px; }

/* Cabecera compacta: sin hueco entre Historial/Rutas y el periodo. */
#app .activity-overview > .activity-period-chips:first-child { margin-top:0; }
#app .activity-more-chip[aria-pressed="true"] { border-color:var(--accent); }

/* Rediseño 23 nov: lista de Actividades en filas compactas de ~52 px, con búsqueda, orden, semanas y panel de resumen en PC. */
#app .activity-tools { display:flex; gap:8px; margin:0 0 8px; }
#app .activity-search { flex:1; min-width:0; min-height:40px; }
#app .activity-sort { flex:none; min-height:40px; width:200px; max-width:46%; }
#app .activity-meta { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
#app .activity-meta .activity-list-note { margin:2px 0 8px; }
#app .activity-count { white-space:nowrap; }
#app .activity-rows { gap:0; border:1px solid var(--sep); border-radius:14px; overflow:hidden; background:var(--card); }
#app .activity-row { min-height:52px; padding:6px 12px; border-radius:0; background:none; border-top:1px solid var(--sep); }
#app .activity-row:first-child { border-top:0; }
#app .activity-row:hover { background:var(--raised); }
#app .activity-row[aria-current="true"] { background:color-mix(in srgb,var(--accent) 13%,var(--card)); box-shadow:inset 3px 0 0 var(--accent); }
#app .activity-row-icon { width:34px; height:34px; }
#app .activity-row-text b { font-size:14.5px; display:flex; align-items:center; gap:6px; }
#app .activity-row-text b > em { font-style:normal; font-size:10.5px; font-weight:700; padding:1px 6px; border-radius:6px; background:color-mix(in srgb,var(--accent) 22%,transparent); color:var(--accent); }
#app .activity-row-text small { font-size:12px; }
#app .activity-row-cols { display:none; }
#app .activity-group { display:flex; justify-content:space-between; align-items:baseline; gap:10px; padding:7px 12px; background:var(--bg); border-top:1px solid var(--sep); font-size:12px; color:var(--muted); position:sticky; top:0; z-index:1; }
#app .activity-group:first-child { border-top:0; }
#app .activity-group b { color:var(--text); font-size:12.5px; letter-spacing:.01em; }
#app .activity-cols { display:none; }
#app .activity-row-viz { display:none; }
#app .activity-dot { width:9px; height:9px; border-radius:50%; background:var(--muted); flex:none; }
#app .activity-dot.none { background:none; border:1px dashed var(--sep); }
#app .activity-dot.lvl-0 { background:#5ad1d1; } #app .activity-dot.lvl-1 { background:#3ecf7a; } #app .activity-dot.lvl-2 { background:#ffb347; } #app .activity-dot.lvl-3 { background:#ff5a5a; }
#app .activity-mini { display:block; flex:none; overflow:visible; }
/* Recorrido: baldosa oscura tipo mapa (trama de cuadrícula suave), trazado y salida/llegada en el color del deporte. */
#app .activity-mini-map { width:72px; height:48px; }
#app .activity-mini-map .tile { fill:color-mix(in srgb,var(--bg) 70%,#1d3a2e); stroke:var(--sep); }
#app .activity-mini-map .grid { stroke:rgba(255,255,255,.07); stroke-width:1; }
#app .activity-mini-map .trace { stroke:var(--tone,var(--accent)); stroke-width:2.2; stroke-linejoin:round; stroke-linecap:round; }
#app .activity-mini-map .start { fill:var(--bg); stroke:var(--tone,var(--accent)); stroke-width:1.6; }
#app .activity-mini-map .end { fill:var(--tone,var(--accent)); }
#app .activity-mini-map.is-empty { opacity:.5; }
#app .activity-mini-map.is-empty .tile { stroke-dasharray:3 3; fill:none; }
/* Perfil: línea base, relleno y un pie con su nombre (Altitud, Potencia o Pulso). */
#app .activity-mini-wrap { display:grid; justify-items:start; gap:1px; width:80px; flex:none; }
#app .activity-mini-wrap small { font-size:9.5px; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); line-height:1.1; }
#app .activity-mini-wrap.is-empty { opacity:.5; height:34px; align-content:center; border:1px dashed var(--sep); border-radius:8px; justify-items:center; }
#app .activity-mini-profile { width:80px; height:30px; }
#app .activity-mini-profile .base { stroke:var(--sep); stroke-width:1; }
#app .activity-mini-profile polyline { stroke:#8ab4ff; stroke-width:1.8; stroke-linejoin:round; }
#app .activity-mini-profile .fill { fill:#8ab4ff; opacity:.18; }
#app .activity-mini-profile.kind-power polyline { stroke:#c8a6ff; } #app .activity-mini-profile.kind-power .fill { fill:#c8a6ff; }
#app .activity-mini-profile.kind-hr polyline { stroke:#ff7a8a; } #app .activity-mini-profile.kind-hr .fill { fill:#ff7a8a; }
#app .activity-legend { display:none; }
#app .activity-cols-fill { flex:1; min-width:0; }
#app .activity-row-cols [data-col="asc"], #app .activity-row-cols [data-col="speed"], #app .activity-row-cols [data-col="power"], #app .activity-row-cols [data-col="hr"], #app .activity-row-cols [data-col="cad"], #app .activity-row-cols [data-col="kcal"] { display:none; }
#app .activity-cols .activity-row-cols [data-col="asc"], #app .activity-cols .activity-row-cols [data-col="speed"], #app .activity-cols .activity-row-cols [data-col="power"], #app .activity-cols .activity-row-cols [data-col="hr"], #app .activity-cols .activity-row-cols [data-col="cad"], #app .activity-cols .activity-row-cols [data-col="kcal"] { display:none; }
@media (min-width:1100px) {
  #app .activity-row-cols { display:grid; grid-auto-flow:column; grid-auto-columns:72px; gap:8px; text-align:right; font-size:13px; font-variant-numeric:tabular-nums; flex:none; }
  #app .activity-row-cols > span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  #app .activity-row .rl-rest { display:none; }
  #app .activity-row-viz { display:flex; align-items:center; gap:12px; flex:none; margin-right:10px; }
  #app .activity-viz-slot { display:flex; align-items:center; gap:10px; min-width:168px; justify-content:flex-end; }
  #app .activity-row { max-height:64px; }
  #app .activity-row-go { display:none; }
  #app .activity-cols { display:flex; align-items:center; gap:8px; padding:6px 12px; background:var(--bg); border-bottom:1px solid var(--sep); font-size:11px; color:var(--muted); }
  #app .activity-cols .activity-row-cols { font-size:11px; }
  #app .activity-cols .activity-row-cols > span { display:flex; align-items:center; justify-content:flex-end; gap:4px; }
  #app .activity-cols svg { width:13px; height:13px; fill:none; stroke:currentColor; stroke-width:2; flex:none; }
  #app .activity-cols em { font-style:normal; overflow:hidden; text-overflow:ellipsis; }
  #app .activity-legend { display:flex; flex-wrap:wrap; gap:4px 18px; align-items:center; margin:0 0 6px; }
  #app .activity-legend > span { display:inline-flex; align-items:center; gap:5px; }
  #app .activity-legend-ico svg { width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:2; display:block; }
  #app .activity-legend .activity-dot { display:inline-block; }
}
/* Más columnas con más ancho (las que no caben se quitan por orden): el «dato clave» deja su sitio a las de cada deporte. */
@media (min-width:1280px) {
  #app .activity-row-cols [data-col="asc"], #app .activity-row-cols [data-col="hr"] { display:block; }
  #app .activity-row-cols [data-col="key"], #app .activity-cols .activity-row-cols [data-col="key"] { display:none; }
  #app .activity-cols .activity-row-cols [data-col="asc"], #app .activity-cols .activity-row-cols [data-col="hr"] { display:flex; }
}
@media (min-width:1380px) {
  #app .activity-row-cols [data-col="speed"], #app .activity-row-cols [data-col="power"] { display:block; }
  #app .activity-cols .activity-row-cols [data-col="speed"], #app .activity-cols .activity-row-cols [data-col="power"] { display:flex; }
}
@media (min-width:1500px) {
  #app .activity-row-cols [data-col="cad"], #app .activity-row-cols [data-col="kcal"] { display:block; }
  #app .activity-cols .activity-row-cols [data-col="cad"], #app .activity-cols .activity-row-cols [data-col="kcal"] { display:flex; }
}
@media (min-width:1100px) and (max-width:1279px) { #app .activity-cols .activity-row-cols [data-col="key"] { display:flex; } }
/* Detalle: los datos de las gráficas en una sola línea que se desliza (eran 4 filas de chips). */
#app .metric-card .metric-chips { flex-wrap:nowrap !important; overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
#app .metric-card .metric-chips::-webkit-scrollbar { display:none; }

/* 2.ª vuelta 23 nov: «Tarjetas / Lista». Cards never split a word («Velocida d»): labels wrap only between words and
   each figure keeps one line; the tiles get a minimum width instead of breaking letters. */
#app .activity-tools { align-items:center; }
#app .activity-tools .activity-sort, #app .activity-tools .activity-search { height:40px; }
#app .activity-tools .activity-view { display:flex; flex:none; gap:4px; }
#app .activity-tools .activity-view .chip { min-height:40px; padding:0 12px; margin:0; }
#app .activity-card .activity-stats .summary-title,
#app .activity-card .activity-stats .summary-tile > b,
#app .activity-card .activity-stats .summary-secondary { overflow-wrap:normal; word-break:keep-all; hyphens:none; }
#app .activity-card .activity-stats .summary-tile { min-width:0; }
#app .activity-card .activity-stats .summary-tile > b { white-space:nowrap; }
#app .activity-card .summary-grid.activity-stats { grid-template-columns:repeat(auto-fill,minmax(96px,1fr)); }
@media (max-width:520px) {
  #app .activity-tools { flex-wrap:wrap; }
  #app .activity-tools .activity-search { flex:1 1 100%; }
  #app .activity-tools .activity-sort { flex:1; max-width:none; width:auto; }
}

/* «Para después» en la ficha: una franja baja (título, propuesta y acciones en la misma línea), no una tarjeta alta. */
#app .after-card { padding:8px 14px; display:flex; flex-wrap:wrap; align-items:center; gap:0 10px; }
#app .after-card .after-head { display:contents; }
#app .after-card h3 { order:1; margin:0; font-size:14px; }
#app .after-card .after-head > button { order:2; margin-left:auto; }
#app .after-card .after-off { order:3; }
#app .after-card .after-line { order:4; flex:1 1 100%; min-width:0; margin:0; font-size:13.5px; color:var(--muted); }
#app .after-card .after-head > button, #app .after-card .after-off { min-height:32px; padding:4px 8px; margin-top:0; margin-bottom:0; font-size:13px; }
#app .after-card .after-off { color:var(--muted); }
#app .after-card .after-done { order:5; flex-basis:100%; margin:0; }
@media (min-width:700px) {
  #app .after-card .after-line { order:2; flex:1 1 0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  #app .after-card .after-head > button { order:3; margin-left:0; }
  #app .after-card .after-off { order:4; }
}

/* Ficha a pantalla completa (como la de Mis rutas, sin panel lateral): barra fija arriba con «‹ Actividades», «n de N» y las flechas. */
#app .activity-nav { display:flex; align-items:center; gap:10px; position:sticky; top:0; z-index:5; background:var(--bg); padding:8px 0; margin:0 0 6px; border-bottom:1px solid var(--sep); }
#app .an-back { white-space:nowrap; min-height:38px; padding:4px 12px 4px 4px; border:0; background:none; color:var(--accent); font-size:15px; font-weight:700; margin:0; }
#app .an-pos { margin-left:auto; white-space:nowrap; font-size:12.5px; font-variant-numeric:tabular-nums; }
#app .an-nb { display:flex; gap:6px; }
#app .an-arrow { min-height:40px; min-width:40px; padding:0; margin:0; border-radius:9px; border:1px solid var(--sep); background:var(--raised); color:var(--text); font-size:22px; line-height:1; }
#app .an-arrow:disabled { opacity:.35; }
#app .activity-nav:not(:has(.an-pos)) .an-back { margin-right:auto; }
/* Mapa grande en la ficha (el móvil también: es lo que se mira primero). */
#app .activity-detail-split .explorer #map { height:clamp(280px,46vh,420px); }
@media (min-width:1100px) { #app .activity-detail-split .explorer #map { height:clamp(420px,58vh,640px); } }
#app .activity-laps { list-style:none; margin:0; padding:0; display:grid; }
#app .activity-laps li + li { border-top:1px solid var(--sep); }
#app .activity-laps button, #app .activity-laps .lap-row { all:unset; box-sizing:border-box; display:grid; grid-template-columns:28px repeat(3,minmax(0,1fr)); gap:6px; width:100%; padding:7px 4px; font-size:13px; font-variant-numeric:tabular-nums; cursor:default; }
#app .activity-laps button { cursor:pointer; border-radius:8px; }
#app .activity-laps button:hover, #app .activity-laps button:focus-visible { background:var(--raised); }
#app .activity-laps span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:right; }
#app .activity-laps span:first-child { text-align:left; color:var(--muted); }
#app .activity-laps-head { color:var(--muted); font-size:11.5px !important; }
