/* width-trials — classes the design system lacks. */

.w-width-trials-stage { padding: 14px 16px 16px; }
.w-width-trials-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 2px 12px; color: var(--muted); font-size: 0.8rem; }
.w-width-trials-key { display: inline-flex; align-items: center; gap: 7px; }
.w-width-trials-sw { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.w-width-trials-sw--good { background: var(--hml-good); }
.w-width-trials-sw--bad { background: var(--hml-bad); }
.w-width-trials-sw--ref { width: 3px; height: 14px; border-radius: 2px; background: var(--gold); }

.w-width-trials-cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1000px) { .w-width-trials-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .w-width-trials-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .w-width-trials-stage { padding: 12px 10px 14px; } }

.w-width-trials-card {
  display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-s); background: rgba(6, 20, 30, 0.85);
  transition: border-color 200ms ease;
}
.w-width-trials-card.is-running { border-color: rgba(92, 232, 241, 0.45); }
.w-width-trials-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.w-width-trials-w { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.w-width-trials-w b { color: var(--text); font-family: var(--mono); font-size: 1.15rem; font-weight: 600; margin-right: 2px; }
.w-width-trials-run.hml-btn { min-height: 38px; padding: 6px 14px; font-size: 0.8rem; }
.w-width-trials-glyph { display: block; width: 100%; height: 34px; }

.w-width-trials-tiles { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: 6px; cursor: pointer; }
.w-width-trials-tiles:focus-visible { outline: 2px solid var(--cyan-bright); outline-offset: 2px; }
.w-width-trials-tile {
  display: block; aspect-ratio: 1 / 1; border-radius: 2px; background: rgba(132, 194, 214, 0.1);
  transition: background-color 220ms ease, transform 220ms ease;
}
.w-width-trials-tile.is-good { background: var(--hml-good); }
.w-width-trials-tile.is-bad { background: var(--hml-bad); opacity: 0.78; }
.w-width-trials-tile.is-good, .w-width-trials-tile.is-bad { animation: w-width-trials-pop 260ms ease-out; }
.w-width-trials-tile.is-sel { outline: 2px solid var(--gold); outline-offset: 1px; position: relative; z-index: 1; }
@keyframes w-width-trials-pop { from { transform: scale(0.35); } to { transform: scale(1); } }

.w-width-trials-result { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-top: 2px; }
.w-width-trials-pct { font-family: var(--mono); font-size: 1.45rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.w-width-trials-sub { color: var(--quiet); font-size: 0.72rem; text-align: right; }
.w-width-trials-bar { position: relative; display: block; height: 10px; border-radius: 99px; background: rgba(132, 194, 214, 0.12); }
.w-width-trials-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0; }
.w-width-trials-fill--good { background: var(--hml-good); border-radius: 99px 0 0 99px; }
.w-width-trials-fill--bad { background: var(--hml-bad); opacity: 0.55; border-radius: 0 99px 99px 0; }
.w-width-trials-ref { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--gold); box-shadow: 0 0 0 2px var(--deep); }
.w-width-trials-reftxt { color: var(--muted); font-size: 0.72rem; line-height: 1.3; }
.w-width-trials-avg { color: var(--quiet); font-size: 0.72rem; line-height: 1.3; min-height: 0; }
.w-width-trials-avg:empty { display: none; }

@media (max-width: 460px) {
  .w-width-trials-ro { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w-width-trials-ro > :last-child { grid-column: 1 / -1; }
}
