/* © 2026 Cromulent, Inc. All Rights Reserved.
   history.css - a program's past on /programs (programs/history.js): the day bars on the board and in the program's
   panel, the saved versions, and the clear all card on the stop rail. Reads only the tokens and programs.css / ops.css
   pieces; works at 390px with no sideways scroll. */

/* three cards on the stop rail: side by side when they fit, one under the other on a phone */
.pg-rail { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.hi-sec { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
#pg-history { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
#pg-history:empty { display: none; }

.hi-chart-wrap { min-width: 0; touch-action: pan-y; }
.hi-chart { display: block; width: 100%; height: 64px; border-radius: 8px; background: var(--panel-2); }
.hi-spark { display: block; width: 90px; height: 22px; }
.hi-spark-n { color: var(--ink-faint); font-size: 11px; white-space: nowrap; }
.hi-bar { fill: var(--orchid); }
.hi-bar.good { fill: var(--good); }
.hi-bar.caution { fill: var(--caution); }
.hi-bar.bad { fill: var(--bad); }
.hi-bar.none { fill: var(--orchid); }
.hi-bar.zero { fill: var(--line); }
.hi-bar.on { stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hi-axis { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0 0; font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.hi-readout { color: var(--ink-2); text-align: center; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

.hi-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.hi-steps .hi-steps { margin-top: 4px; }
.hi-block { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.hi-go { margin-top: 10px; }
.hi-version .ops-dl { margin-top: 0; }

/* a saved version: the same row as a run (programs.css .pg-run), its own class so a run's trace handler never opens it */
.hi-version { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.hi-version > summary { list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 12px; }
.hi-version > summary::-webkit-details-marker { display: none; }
.hi-version > summary:focus-visible { outline: 2px solid var(--orchid); outline-offset: -2px; }
