/* P25X Live -- History tab (js/tab-history.js). Builds on app.css (.panel, .ph, .ph-row, .range, .stats, .stat, .empty).

   ANIMATION AUDIT: none. No animation, no transition, nothing that moves or flashes; the bars are static SVG rects
   and width-set divs. (The tab change itself may cross-fade through a View Transition, see js/main.js; that is
   off under prefers-reduced-motion and the Reduce motion button.) */

.hist-tab { max-width: 1400px; margin: 0 auto; }
.hist-status { margin: 0 0 12px; color: var(--muted); font: 500 0.82rem/1.3 var(--mono); letter-spacing: 0.06em; }
.hist-bad { color: var(--warn); }
.hist-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.hist-grid > .hist-panel:first-child { grid-column: 1 / -1; }
.hist-panel .ph { margin-bottom: 12px; }
.hist-body { min-width: 0; }
.hist-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.hist-note { margin: 8px 0 0; color: var(--muted); font-size: 0.86rem; }

.hist-chart { display: block; width: 100%; height: 120px; background: rgba(4, 10, 26, 0.55); border: 1px solid rgba(77, 232, 255, 0.15); border-radius: 8px; }
.hist-bar-rect { fill: var(--cyan); opacity: 0.85; }
.hist-base { stroke: rgba(77, 232, 255, 0.35); stroke-width: 1; }
.hist-axis { display: flex; justify-content: space-between; margin: 4px 2px 0; color: var(--dim); font: 500 0.7rem/1.2 var(--mono); }

.hist-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hist-row { margin: 0; }
.hist-pick {
  display: grid; grid-template-columns: minmax(7rem, 14rem) minmax(0, 1fr) auto; align-items: center; gap: 10px;
  width: 100%; min-height: 36px; padding: 4px 8px; border-radius: 8px; text-align: left;
  border: 1px solid transparent; background: transparent; color: var(--ink); font: 500 0.84rem/1.2 var(--sans);
}
button.hist-pick { cursor: pointer; border-color: rgba(159, 179, 204, 0.15); background: rgba(5, 10, 26, 0.45); }
button.hist-pick:hover { border-color: var(--cyan); }
button.hist-pick[aria-pressed="true"] { border-color: var(--cyan); background: rgba(77, 232, 255, 0.14); box-shadow: 0 0 10px rgba(77, 232, 255, 0.25); }
.hist-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-meter { display: block; height: 8px; border-radius: 4px; background: rgba(159, 179, 204, 0.14); overflow: hidden; }
.hist-fill { display: block; height: 100%; border-radius: 4px; background: var(--gold); }
.hist-val { color: var(--muted); font: 500 0.74rem/1.2 var(--mono); white-space: nowrap; }

.hist-detail { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(77, 232, 255, 0.15); }
.hist-sub { margin: 0 0 8px; font: 700 0.82rem/1.3 var(--mono); letter-spacing: 0.1em; color: var(--gold); }
.hist-sub2 { margin: 12px 0 6px; font: 700 0.72rem/1.2 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.hist-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.hist-detail .hist-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 10px; }

@media (max-width: 900px) {
  .hist-grid { grid-template-columns: minmax(0, 1fr); }
  .hist-stats, .hist-detail .hist-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hist-cols { grid-template-columns: minmax(0, 1fr); }
  .hist-pick { grid-template-columns: minmax(6rem, 10rem) minmax(0, 1fr); }
  .hist-val { grid-column: 1 / -1; }
}

/* View Transitions (js/main.js): a short cross-fade; never under reduced motion. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.18s; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
