/* Metra Hub: the Stats tab (stats.js, stats-charts.js). The shared look's
   tokens only: mint is the one accent, --leg-l / --leg-r are the left and
   right legs, --warn a point with reps affected by dropped frames. */

.stats-screen { gap: 0; }
.st-root, .st-who { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ------------------------------------------------- the list of who */

.st-root-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 40px; align-items: start; }
.st-groups { order: -1; }
.st-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 4px 4px; font-size: 15px; font-weight: 600; }
.st-count { font-size: 13px; font-weight: 400; color: var(--i50); font-variant-numeric: tabular-nums; }
.st-rows { list-style: none; margin: 0; padding: 0; }
.st-rows li + li { border-top: 1px solid var(--hair); }
.st-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 9px 6px; border: 0; border-radius: 12px; background: none; color: var(--ink); font-size: 15px; text-align: left; }
.st-row:hover { background: rgba(255, 255, 255, .03); }
.st-row:focus-visible { outline-offset: -2px; }
.st-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.st-row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-row-sub { font-size: 12.5px; color: var(--i50); white-space: nowrap; }
.st-row-best { flex: none; min-width: 78px; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.st-row-num { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-row-unit { font-size: 11px; font-weight: 400; color: var(--i45); }
.st-spark { flex: none; }

/* ------------------------------------------- one athlete, one group */

.st-who > .back { align-self: flex-start; margin-bottom: -10px; }
.st-who-head { align-items: center; }
.st-who-head .page-title { min-width: 0; overflow-wrap: anywhere; }
.st-who-head .page-title:focus { outline: none; }
.st-who-head .chip { flex: none; }
.st-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--hair); }
.st-tab { position: relative; padding: 4px 0 11px; border: 0; background: none; font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--i35); white-space: nowrap; }
.st-tab:hover { color: var(--i60); }
.st-tab.on { color: var(--ink); }
.st-tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px; background: var(--mint); }
.st-page { padding-top: 4px; min-width: 0; }
.st-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.st-controls { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.st-controls .footnote { padding: 0 4px; }
.st-controls .row { min-height: 52px; padding-top: 8px; padding-bottom: 8px; }
.st-controls .row-value { max-width: 74%; }
.st-controls .row-text { white-space: normal; text-align: right; overflow-wrap: anywhere; }
.st-main { min-width: 0; }
.st-card { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 16px; min-width: 0; }
.st-empty { padding: 22px 4px; font-size: 14px; color: var(--i50); }

.st-headline { display: flex; flex-direction: column; gap: 2px; }
.st-hero { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.st-big { font-size: 54px; font-weight: 200; line-height: 1.05; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.st-hero.mid .st-big, .st-big.mid { font-size: 42px; }
.st-unit { margin-left: 2px; font-size: 17px; font-weight: 400; letter-spacing: 0; color: var(--i45); }
.st-cap { font-size: 12.5px; line-height: 1.4; color: var(--i50); }
.st-cap.good { color: var(--mint); }
.st-cap.center { text-align: center; }
.st-side { font-size: 19px; font-weight: 600; }
.st-warn { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--warn); }
.st-chip { display: inline-flex; align-items: center; gap: 7px; align-self: center; padding: 4px 11px 4px 4px; border-radius: 999px; background: var(--sub); box-shadow: inset 0 0 0 1px var(--hair); font-size: 13px; font-weight: 600; }
.st-chip .monogram { width: 22px; height: 22px; font-size: 9px; color: var(--mint); box-shadow: inset 0 0 0 1px rgba(111, 216, 192, .4); }

.st-ranges { display: flex; gap: 4px; }
.st-range { flex: 1; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--i50); font-size: 13px; font-weight: 600; }
.st-range:hover { color: var(--i75); }
.st-range.on { background: rgba(244, 244, 243, .12); color: var(--ink); }

/* -------------------------------------------------------------- charts */

.st-slot { display: block; min-width: 0; }
.st-chart { position: relative; display: block; border-radius: 10px; }
.st-chart:focus { outline: none; }
.st-chart:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
.st-svg { display: block; max-width: 100%; touch-action: pan-y; }
.st-svg text { font-family: var(--font); }
.st-grid { stroke: var(--rule); stroke-width: 1; }
.st-axis { fill: var(--i40); font-size: 11px; font-variant-numeric: tabular-nums; }
.st-rule { stroke: var(--i40); stroke-width: 1; }
.st-line { fill: none; stroke: var(--mint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.st-line.thin { stroke-width: 1.8; }
.st-line.leg-l { stroke: var(--leg-l); }
.st-line.leg-r { stroke: var(--leg-r); }
.st-fill-top { stop-color: var(--mint); stop-opacity: .2; }
.st-fill-foot { stop-color: var(--mint); stop-opacity: 0; }
.st-pt { fill: var(--ink); }
.st-pt.leg-l { fill: var(--leg-l); }
.st-pt.leg-r { fill: var(--leg-r); }
.st-pt.old { fill: var(--i45); }
.st-pt.warn { fill: var(--warn); }
.st-pt.on { fill: var(--mint); }
.st-zero { stroke: var(--rule2); stroke-width: 1; }
.st-band { stroke: var(--i35); stroke-width: 1; stroke-dasharray: 3 4; }
.st-seg { stroke: var(--mint); stroke-width: 2.2; stroke-linecap: round; }
.st-seg.dashed { stroke-width: 1.8; stroke-dasharray: 2 5; opacity: .75; }
.st-seg.old { stroke: var(--i40); opacity: 1; }
.st-ring { fill: var(--mint); }
.st-ring-in { fill: var(--surface); }
.st-end { fill: var(--mint); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.st-callout { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 9px; border-radius: 7px; background: var(--alert); box-shadow: 0 2px 8px rgba(0, 0, 0, .45); pointer-events: none; white-space: nowrap; }
.st-co-date { font-size: 11px; color: var(--i50); }
.st-co-value { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.st-co-cap { font-size: 11px; color: var(--mint); }

/* ----------------------------------------------------------- single leg */

.st-legs { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.st-leg { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-leg.leg-r { align-items: flex-end; text-align: right; }
.st-leg.leg-r .st-leg-name { flex-direction: row-reverse; }
.st-leg-name { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: 1.2px; color: var(--i60); }
.st-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.st-dot.leg-l { background: var(--leg-l); }
.st-dot.leg-r { background: var(--leg-r); }
.st-leg-mid { display: flex; flex-direction: column; align-items: center; gap: 3px; padding-top: 17px; text-align: center; }
.st-leg-mid .st-leg-name { max-width: 9em; justify-content: center; font-weight: 500; letter-spacing: 1px; color: var(--i40); }
.st-asym { display: flex; align-items: baseline; gap: 3px; }
.st-asym-num { font-size: 24px; font-weight: 300; font-variant-numeric: tabular-nums; }
.st-asym strong { margin-left: 3px; font-size: 15px; font-weight: 600; }
.st-band-box { height: 52px; display: flex; flex-direction: column; justify-content: center; }
.st-band-on { display: flex; flex-direction: column; gap: 3px; padding: 6px 12px; border-radius: 10px; background: var(--alert); }
.st-band-top { display: flex; justify-content: space-between; gap: 12px; }
.st-band-asym { font-size: 12.5px; font-weight: 600; color: var(--mint); }
.st-band-legs { display: flex; flex-wrap: wrap; gap: 2px 16px; }
.st-band-leg { display: inline-flex; align-items: center; gap: 5px; }
.st-band-leg strong { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ------------------------------------------- the load / velocity profile */

.st-ends { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.st-end-box { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-end-box.st-trail { align-items: flex-end; text-align: right; }
.st-end-box.st-trail .st-hero { justify-content: flex-end; }
.st-legend { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--i50); }
.st-key { width: 14px; height: 3px; border-radius: 1.5px; background: var(--mint); }
.st-key.old { margin-left: 10px; background: var(--i40); }
.st-notes { display: flex; flex-direction: column; gap: 2px; }
.st-notes .footnote, .st-card > .footnote { font-size: 12.5px; }
.st-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.st-table th, .st-table td { height: 36px; padding: 0 10px; font-size: 15px; font-weight: 400; text-align: right; white-space: nowrap; color: var(--i75); }
.st-table th:first-child, .st-table td:first-child { padding-left: 2px; text-align: left; }
.st-table th:last-child, .st-table td:last-child { padding-right: 2px; }
.st-table thead th { height: 28px; font-size: 11px; font-weight: 500; letter-spacing: 1.2px; text-transform: uppercase; color: var(--i40); vertical-align: bottom; padding-bottom: 6px; }
.st-table tbody tr > * { border-top: 1px solid var(--rule); }
.st-table .strong { color: var(--ink); }
.st-table .none { color: var(--i35); }
.st-tag { margin-left: 6px; padding: 1px 5px; border-radius: 4px; background: var(--sub); font-size: 10.5px; font-weight: 600; color: var(--i50); }

/* ------------------------------------------- the performance overview */

.st-overview { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.st-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; margin-top: 6px; }
.st-label { font-size: 16px; font-weight: 600; }
.st-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.st-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; padding: 12px 14px; color: var(--ink); text-align: left; }
button.st-tile:hover:not(:disabled), button.st-wide-card:hover:not(:disabled), .st-leg-row:hover { border-color: var(--bord); background: var(--sub); }
.st-tile-label { max-width: 100%; font-size: 12.5px; line-height: 1.3; color: var(--i50); overflow-wrap: anywhere; }
.st-tile-value { font-size: 30px; font-weight: 200; line-height: 1.1; font-variant-numeric: tabular-nums; }
.st-tile-value.none { color: var(--i35); }
.st-tile-value .st-unit { margin-left: 5px; font-size: 13px; }
.st-tile-sub { font-size: 11.5px; color: var(--i40); }
.st-ov-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 24px; align-items: start; }
.st-ov-sec { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.st-wide-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; color: var(--ink); text-align: left; }
.st-wide-card.stack { flex-direction: column; align-items: stretch; gap: 8px; }
.st-wide-card > .icon { flex: none; color: var(--i35); }
.st-wide-card .st-slot { width: 100%; }
.st-ov-lead { display: flex; flex-direction: column; gap: 2px; }
.st-ov-side { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.st-ov-parts { font-size: 13px; color: var(--i75); font-variant-numeric: tabular-nums; }
.st-leg-rows { overflow: hidden; }
.st-leg-row { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 12px 16px; border: 0; background: none; color: var(--ink); text-align: left; }
.st-leg-row + .st-leg-row { border-top: 1px solid var(--hair); }
.st-leg-row:focus-visible { outline-offset: -3px; border-radius: 14px; }
.st-leg-row-top { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--i50); }
.st-leg-row-nums { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.st-leg-val { display: inline-flex; align-items: baseline; gap: 5px; font-size: 20px; font-weight: 300; font-variant-numeric: tabular-nums; }
.st-leg-val strong { font-size: 12px; font-weight: 600; }
.st-leg-asym { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------- a group's table */

.card.table-wrap { padding: 4px 14px; border-radius: 16px; }
.st-table.group th, .st-table.group td { height: 42px; }
.st-table.group thead th { height: 38px; padding-bottom: 8px; }
.st-table.group .th-unit { display: block; letter-spacing: 0; text-transform: none; }
.st-table.group tfoot tr > * { border-top: 1px solid var(--rule2); font-size: 13.5px; color: var(--i60); }
.st-table.group tfoot th { color: var(--i50); }
.st-sort { padding: 4px 0; border: 0; border-radius: 6px; background: none; color: var(--i40); font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; white-space: nowrap; }
.st-sort:hover { color: var(--i75); }
.st-sort.on { color: var(--mint); }
.st-open { max-width: 100%; padding: 6px 0; border: 0; border-radius: 6px; background: none; color: var(--ink); font-size: 15px; font-weight: 500; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.st-open:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------ a laptop: 980 px up */

@media (min-width: 980px) {
  .st-root-cols { grid-template-columns: minmax(0, 1fr) 340px; }
  .st-groups { order: 0; }
  .st-cols { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 28px; }
  .st-controls { position: sticky; top: calc(var(--top) + 16px); }
  .st-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .st-ov-cols { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}
@media (max-width: 520px) {
  .st-tabs { gap: 20px; }
  .st-tab { font-size: 18px; }
  .st-card { padding: 14px 14px 12px; }
  .st-big { font-size: 46px; }
  .st-hero.mid .st-big, .st-big.mid { font-size: 34px; }
  .st-row-best { min-width: 66px; }
  .card.table-wrap { padding: 4px 10px; }
  .st-table.group th, .st-table.group td { padding: 0 7px; }
}
