/*! aerofitting-v2-charts.css — styles for #wyniki (results) only.
 * Consumed by layouts/partials/aerofitting-v2/results.html.
 * Reuses tokens from aerofitting-v2.css (--av2-radius, --av2-ease) and the
 * shared brand palette (--gold, --brg, --border, --text-*). */

/* Tunnel chart scroll state comes from the shared site.js scroll-region controller. */
.av2-chart-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: var(--av2-space-block); }

/* Grouped reported-session mosaic (left-to-right by category); outlines mean no CdA drop. */
.av2-results .av2-heading { margin-bottom: 28px; }
.av2-results .av2-heading h2 { max-width: 25ch; font-size: clamp(32px, 4.5vw, 56px); }
.av2-res-proof { margin: 0 0 24px; }
.av2-res-ratio { display: grid; grid-template-columns: repeat(auto-fill, minmax(10px, 1fr)); gap: 3px; }
.av2-res-cell { aspect-ratio: 1; border: 1.5px solid var(--brg); background: var(--brg); border-radius: 1px; box-sizing: border-box; }
.av2-res-cell--b, .av2-res-cell--d { border-color: var(--gold); background: var(--gold); }
.av2-res-cell--held { background: transparent; border-width: 2px; }
.av2-res-proof figcaption { margin-top: 12px; font-size: 13px; color: var(--text-secondary); }
.av2-res-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--text-secondary); }
.av2-res-legend li { display: flex; align-items: baseline; gap: 8px; }
.av2-res-legend .av2-res-cell { width: 10px; height: 10px; flex-shrink: 0; }
.av2-res-legend strong { color: var(--text-primary); }
.av2-res-translation { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 24px; font-size: clamp(16px, 1.8vw, 20px); color: var(--text-primary); }
.av2-res-translation strong { font-weight: 700; }
.av2-res-arrow { color: var(--gold); }
.av2-res-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; list-style: none; margin: 0 0 28px; padding: 0; }
.av2-res-scale li { padding: 16px 12px; border: 1px solid var(--border); border-radius: var(--av2-radius); background: var(--bg-alt); text-align: center; min-width: 0; }
.av2-res-scale strong { display: block; font-size: clamp(22px, 2.4vw, 28px); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; color: var(--brg); font-variant-numeric: tabular-nums; }
.av2-res-scale span { display: block; margin-top: 4px; font-size: 12px; line-height: 1.4; color: var(--text-muted); }
.av2-res-note { margin: 8px 0 0; max-width: 85ch; font-size: 13px; line-height: 1.6; color: var(--text-secondary); }

/* Two distinct source measures; preserve fractional shares and explicit noise buckets. */
.av2-cat-charts { margin-block: 28px; }
.av2-cat-title { margin: 0 0 12px; font-size: 22px; font-weight: 700; color: var(--text-primary); }
.av2-cat-chart { margin: 24px 0 0; }
.av2-cat-chart h4 { margin: 0 0 12px; font-size: 16px; color: var(--text-primary); }
.av2-cat-stack { display: flex; width: 100%; overflow: hidden; border-radius: 3px; clip-path: inset(0 100% 0 0); transition: clip-path 900ms var(--av2-ease); }
.av2-cat-chart.is-visible .av2-cat-stack { clip-path: inset(0); }
.av2-cat-segment, .av2-cat-key { background: var(--text-muted); }
.av2-cat-segment { flex: 0 1 var(--av2-share); min-width: 0; height: 24px; }
.av2-cat-color--cockpit { background: var(--brg); }
.av2-cat-color--helmet { background: var(--brg-light); }
.av2-cat-color--position_head { background: var(--gold); }
.av2-cat-color--wheels_tyres { background: #76601F; }
.av2-cat-color--hydration_storage { background: #57685D; }
.av2-cat-color--apparel { background: var(--text-secondary); }
/* Tail buckets keep neutral hues but distinct matched patterns in the bar and key. */
.av2-cat-color--unclassified { background: #777; }
.av2-cat-color--repeat_unresolved { background: repeating-linear-gradient(45deg, #555 0 2px, #ddd 2px 4px); }
.av2-cat-color--virtual { background: repeating-linear-gradient(-45deg, #555 0 2px, #ddd 2px 4px); }
.av2-cat-color--baseline_like { background: repeating-linear-gradient(0deg, #555 0 2px, #ddd 2px 4px); }
.av2-cat-color--noise_repeat { background: repeating-linear-gradient(45deg, #333 0 2px, #aaa 2px 4px); }
.av2-cat-color--noise_virtual { background: repeating-linear-gradient(-45deg, #333 0 2px, #aaa 2px 4px); }
.av2-cat-color--noise_baseline_like { background: repeating-linear-gradient(0deg, #333 0 2px, #aaa 2px 4px); }
.av2-cat-color--cadence_pedalling { background: repeating-linear-gradient(90deg, #555 0 2px, #ddd 2px 4px); }
.av2-cat-color--bike_frame { background: #8D806A; }
.av2-cat-color--other { background: repeating-linear-gradient(90deg, #333 0 2px, #aaa 2px 4px); }
.av2-cat-key { width: 10px; height: 10px; flex-shrink: 0; }
.av2-cat-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 20px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--text-secondary); }
.av2-cat-legend li { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.av2-cat-legend strong { white-space: nowrap; color: var(--text-primary); }
.av2-res-cta { margin-top: 4px; }

@media (max-width: 900px) {
  .av2-res-scale { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .av2-res-scale li:first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .av2-res-cell { border-radius: 1px; }
  .av2-res-translation { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
  .av2-res-translation > span:first-child { grid-column: 2; }
  .av2-res-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
  .av2-cat-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .av2-cat-stack { clip-path: none !important; transition: none !important; }
}
