/* Compact card: the one tile for loose figures across the app (Marketing guide, 18 Nov 2026).
   Header (18 px icon in its metric colour + 13 px name), 22 px figure with its 13 px unit on the same line, optional
   one-line foot (status dot or change). Everything else (explanation, usual range, average, source, chart) lives in the
   detail that opens on press. Built by window.sportoneCompactCard (compact-card.js). */
.compact-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:8px; margin:0; }
/* Desktop: 160 px so «Listo para entrenar» fits on one line (Marketing, 18 Nov). */
@media (min-width:900px) { .compact-grid { grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); } }
.compact-card { all:unset; box-sizing:border-box; display:flex; flex-direction:column; justify-content:flex-start; gap:4px; min-width:0; min-height:88px; padding:12px; border-radius:14px; background:var(--card); border:1px solid var(--sep); color:var(--text); cursor:pointer; text-align:left; overflow:hidden; }
.compact-card:hover { background:var(--raised); }
.compact-card:focus-visible { outline:3px solid color-mix(in srgb,var(--accent) 55%,transparent); outline-offset:2px; }
.compact-card-head { display:flex; align-items:center; gap:6px; min-width:0; font-size:13px; font-weight:600; line-height:1.25; color:var(--muted); white-space:nowrap; }
.compact-card-head > span { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.compact-card-head svg { flex:none; width:18px; height:18px; fill:none; stroke:var(--compact-color,var(--accent)); stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.compact-card-value { font-size:22px; font-weight:700; line-height:1.1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-variant-numeric:tabular-nums; letter-spacing:-.01em; color:var(--text); }
.compact-card-value small { font-size:13px; font-weight:600; color:var(--muted); letter-spacing:0; }
.compact-card-foot { margin-top:auto; display:flex; align-items:center; gap:5px; min-width:0; font-size:12px; font-weight:500; line-height:1.25; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.compact-card-foot > span { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.compact-card-foot > i { flex:none; width:7px; height:7px; border-radius:50%; background:var(--muted); }
.compact-card-foot.ok > i { background:var(--ok,var(--green)); }
.compact-card-foot.warn > i { background:var(--yellow); }
.compact-card-foot.bad > i { background:var(--red); }
@media (prefers-reduced-motion:no-preference) { .compact-card { transition:background-color .12s; } }

/* The metric's own «i» (optional): small, on the name line, the only control inside a role=button tile. */
.compact-card-info { all:unset; box-sizing:border-box; position:absolute; top:0; right:0; width:44px; height:44px; display:grid; place-items:center; font:italic 600 13px/1 Georgia,serif; color:var(--muted); cursor:pointer; }
/* 44 px to touch, 22 px to see, laid over the top-right corner: the «i» takes no room from the name (Actividades, 360 px). */
.compact-card-info::before { content:''; position:absolute; width:22px; height:22px; border-radius:50%; border:1px solid var(--sep); }
.compact-card-info:hover { color:var(--text); }
.compact-card-info:focus-visible { outline:3px solid color-mix(in srgb,var(--accent) 55%,transparent); outline-offset:-8px; }
.compact-card.has-info { position:relative; }
.compact-card.has-info .compact-card-head { padding-right:22px; }
/* Narrow phones (Actividades, 360 px): a name that does not fit goes to a second line instead of «…»; the tile grows a little. */
@media (max-width:420px) {
  .compact-card-head { white-space:normal; align-items:flex-start; }
  .compact-card-head > span { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; text-overflow:clip; }
}

/* Inicio's widgets (CEO, 18 Nov): a small line of the last days under the figure, in the metric colour. */
.compact-card-spark { display:block; width:100%; height:22px; margin-top:2px; overflow:visible; }
.compact-card-spark path { fill:none; stroke:var(--compact-color,var(--accent)); stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; }
/* Without data: the same tile with the text and its action instead of the figure (Marketing guide §4). */
.compact-card-empty { gap:2px; }
.compact-card-empty .compact-card-note { font-size:13px; line-height:1.25; color:var(--muted); }
.compact-card-empty .compact-card-action { margin-top:auto; font-size:13px; line-height:1.25; font-weight:600; color:var(--accent); }

.sport-template-line { margin:0 0 12px; }
.sport-template-line > button { padding:0; color:inherit; font:inherit; text-align:left; overflow-wrap:anywhere; }
.sport-template-line > button:hover { color:var(--accent); }
.sport-template-panel > p { margin:10px 0 4px; }
.sport-template-panel .row { gap:6px; }
.sport-figure .compact-card-head { white-space:normal; align-items:flex-start; }
.sport-figure .compact-card-head > span { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }

/* Shared board. Inline column and row positions are assigned by sportoneTileBoard. */
.tile-board, .home-glance-board, .home-skeleton-tiles { --tile-height:176px; }
.tile-board {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  grid-auto-rows:calc((var(--tile-height) - 12px) / 2);
  gap:12px;
  min-width:0;
}
@media (min-width:850px) { .tile-board { grid-template-columns:repeat(4,minmax(0,1fr)); } }
#app .tile-board[hidden] { display:none; }
#app .bike-summary-tiles { display:grid; background:none; gap:12px; overflow:visible; }
#app .bike-summary-tiles > .summary-tile { padding:10px; border:1px solid var(--sep); border-radius:14px; overflow-wrap:anywhere; }
.bike-summary-tiles > .summary-tile b { font-size:clamp(19px,5vw,24px); }
#app .bike-summary-tiles > [data-glance-short] { padding:7px 9px; gap:2px; }
.bike-summary-tiles > [data-glance-short] .summary-secondary { font-size:11px; }
.tile-board > [data-glance-card] { box-sizing:border-box; min-width:0; min-height:0; height:var(--tile-height); }
.tile-board > [data-glance-short] { height:calc((var(--tile-height) - 12px) / 2); }
.tile-board > .compact-card { gap:4px; padding:10px; }
.tile-board > .compact-card[data-glance-short] { gap:2px; padding:7px 9px; }
.tile-board > .compact-card > :is(.compact-card-head,.compact-card-value,.compact-card-foot) { flex:none; }
.tile-board > .compact-card .compact-card-head { color:var(--text); white-space:normal; align-items:flex-start; }
.tile-board > .compact-card .compact-card-head > span { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.tile-board > [data-glance-short].compact-card .compact-card-head > span {
  display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.tile-board .compact-card-value { font-size:clamp(20px,5.8vw,28px); }
.tile-board [data-glance-short] .compact-card-value { font-size:20px; }
.tile-board .compact-card[data-tile-size="wide"] .compact-card-value { white-space:normal; overflow-wrap:anywhere; }
.tile-board .compact-card:not([data-glance-short]) .compact-card-foot { white-space:normal; overflow-wrap:anywhere; }
.tile-board .compact-card-value small { font-size:11px; white-space:nowrap; }
.tile-board .compact-card-spark { margin-top:auto; min-height:22px; }

/* Inicio's widget holders, editing and loading states. */
.home-glance-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 0 12px; }
.home-glance-head h2 { margin:0; }
.home-glance-head .small { display:block; margin-top:4px; }
.home-glance-head .small::first-letter { text-transform:uppercase; }
.home-glance-head button { min-height:44px; color:var(--accent); font-weight:700; }
#app .home-glance-board { grid-auto-flow:row; gap:12px; }
#app .home-glance-board > .home-widget[hidden] { display:none !important; }
#app .home-skeleton-tiles { grid-template-columns:repeat(2,minmax(0,1fr)); }
@media (min-width:850px) { #app .home-skeleton-tiles { grid-template-columns:repeat(4,minmax(0,1fr)); } }
#app .home-skeleton-tiles > .home-skeleton-tile { height:var(--tile-height); }
#app .home-glance-board:not(.editing-grid) [data-glance-card] { min-width:0; height:var(--tile-height); }
.home-glance-board:not(.editing-grid) [data-glance-card]:not(.compact-card, .summary-tile) > * { flex:1 1 auto; height:100%; max-height:100%; box-sizing:border-box; }   /* every tile fills its place: same size (Pablo, 20 Nov) */
.home-glance-board [data-glance-card] > .summary-tile { overflow:hidden; }
/* Half-height tiles for a figure on its own; two share one place (Pablo, 20 Nov). */
#app .home-glance-board:not(.editing-grid) [data-glance-card][data-glance-short] { height:calc((var(--tile-height) - 12px) / 2); min-height:0; }
.home-glance-board [data-glance-card][data-glance-short]:is(.compact-card, .summary-tile), .home-glance-board [data-glance-card][data-glance-short] :is(.compact-card, .summary-tile) { min-height:0; padding:7px 10px; gap:2px; justify-content:flex-start; }
.home-glance-board [data-glance-card][data-glance-short] .compact-card-value { font-size:20px; }
/* One line each, so a long name (a bike's, on a phone) never runs over the figure. */
.home-glance-board [data-glance-card][data-glance-short] .compact-card-head > span, .home-glance-board [data-glance-card][data-glance-short] .summary-secondary { -webkit-line-clamp:1; }
.home-glance-board [data-glance-card][data-glance-short] :is(.glance-visual, .compact-card-note) { margin-top:0; -webkit-line-clamp:1; }
.home-glance-board :is([data-glance-card].compact-card,[data-glance-card] .compact-card) { padding:12px; gap:4px; }
.home-glance-board [data-glance-card] .compact-card-head { min-height:20px; align-items:flex-start; color:var(--text); white-space:normal; }
.home-glance-board [data-glance-card] .compact-card-head > span,
.home-glance-board [data-glance-card] .summary-secondary { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; white-space:normal; overflow:hidden; text-overflow:ellipsis; }
.home-glance-board [data-glance-card] .compact-card-value { flex:none; font-size:clamp(21px,5.9vw,30px); letter-spacing:-.035em; }
.home-glance-board [data-glance-card] .compact-card-value small { font-size:11px; white-space:nowrap; }
.home-glance-board [data-glance-card] .summary-tile > b { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home-glance-board [data-glance-card] .compact-card-note { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
.home-glance-board [data-glance-card][data-glance-short] .compact-card-head > span { display:block; white-space:nowrap; }
.home-glance-board .home-contents > .compact-card { width:100%; }
.home-glance-board.editing-grid .compact-card { min-height:var(--tile-height); }
.glance-visual { display:flex; flex-direction:column; gap:4px; margin-top:auto; min-width:0; }
.glance-note, .glance-axis, .glance-legend, .glance-day { color:var(--muted); font-size:11px; line-height:1.2; }
.glance-note, .glance-axis > *, .glance-legend > span { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.glance-axis { display:flex; justify-content:space-between; gap:4px; }
.glance-axis strong, .glance-ring-row strong { color:var(--text); }
.glance-axis strong { flex:none; }
.glance-chart, .glance-phases { display:block; width:100%; color:var(--compact-color,var(--accent)); }
.glance-chart { height:45px; }
.glance-phases { height:20px; border-radius:4px; }
.glance-guide { stroke:var(--sep); vector-effect:non-scaling-stroke; }
.glance-trend { fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
.glance-chart circle { fill:currentColor; }
.glance-secondary { color:var(--blue); }
.home-glance-board .glance-ring, .glance-gauge { display:block; color:var(--compact-color,var(--accent)); fill:none; stroke:currentColor; stroke-width:5; }
.home-glance-board .glance-ring { width:35px; height:35px; margin:0; flex:none; }
.glance-gauge { width:100%; max-width:106px; height:42px; align-self:center; stroke-width:8; stroke-linecap:butt; }
.glance-track { stroke:var(--sep); }
.glance-ring-row { display:flex; align-items:center; gap:8px; font-size:13px; }
.glance-ring-row > span { min-width:0; }
.glance-week { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; }
.glance-day { display:grid; gap:2px; text-align:center; }
.glance-day-track { display:flex; align-items:end; height:18px; border-bottom:1px solid var(--sep); }
.glance-day-track i { width:100%; height:var(--glance-fill); background:var(--compact-color,var(--accent)); border-radius:2px 2px 0 0; }
.glance-band { position:relative; height:14px; margin:0 4px 5px; border-radius:4px; background:linear-gradient(to right,var(--sep) 25%,color-mix(in srgb,var(--compact-color) 65%,var(--card)) 25% 75%,var(--sep) 75%); }
.glance-band i { position:absolute; top:0; left:var(--glance-point); width:4px; height:100%; border-radius:2px; background:var(--text); transform:translateX(-50%); }
.glance-legend { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:2px 4px; }
.glance-legend i, .glance-status { display:inline-block; width:7px; height:7px; margin-right:4px; border-radius:50%; background:var(--glance-dot); }
.glance-status { width:9px; height:9px; margin-right:6px; vertical-align:middle; }
.glance-delta { color:var(--text); font-size:18px; }
.glance-stats { display:flex; flex-wrap:wrap; gap:4px 10px; line-height:1.2; }
.glance-stats > span { min-width:0; }
.glance-stats strong { font-size:14px; }
.glance-stats-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 10px; }
.glance-stats-grid > span { display:flex; flex-direction:column; overflow:hidden; }
.glance-stats-grid strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home-glance-board [data-shown-size="medium"] .glance-stats-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.home-glance-board [data-shown-size="small"] .glance-stats-grid > :nth-child(n+5) { display:none; }
.glance-battery { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 5px; align-items:center; }
.glance-battery strong { grid-column:2; grid-row:1; font-size:11px; white-space:nowrap; }
.glance-battery-track { grid-column:1 / -1; height:5px; border-radius:4px; background:var(--sep); overflow:hidden; }
.glance-battery-track i { display:block; width:var(--glance-fill); height:100%; background:var(--glance-bar); border-radius:inherit; }
.home-glance-board [data-shown-size="medium"] .glance-battery { grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; }
.home-glance-board [data-shown-size="medium"] .glance-battery strong { grid-column:3; }
.home-glance-board [data-shown-size="medium"] .glance-battery-track { grid-column:2; grid-row:1; }
