/*
 * Hexels variants ablation (#variants-root, static/js/variants.js): scene buttons, a synchronized grid of the
 * six variants' videos with one set of playback controls, and the variants' numbers as a table and a plot.
 *
 * Sizes, radii, ink and surfaces are the shared tokens of index.css; buttons, the scrubber and the table follow
 * the comparison player (compare.css) and the segmented controls follow the results explorer (explorer.css).
 * The appearance colors V1, V2 and V3 are the paper's teal, purple and orange (the site's --hx-ours), with teal
 * and purple adjusted in OKLCH lightness and chroma so that every pair stays distinct, also for color-blind
 * viewers, with at least 3:1 contrast on the white chart surface. Fixed variants are hollow hexagons and densified
 * ones filled, so population never rests on color. Teal and purple also mark 2DGS and 3DGS elsewhere on the page.
 * Every tile, row and point is labeled.
 */

.hx-var {
  --hx-var-v1: #2091b0;
  --hx-var-v2: #7f5690;
  --hx-var-v3: #cd7353;
  --hx-var-gap: 8px;
  --hx-var-gridline: #edf0f1;
  --hx-var-baseline: #c9ced1;
  --hx-var-leader: #b3bbbf;
  width: 100%;
  max-width: var(--hx-wide);
  margin: 0 auto;
  color: var(--hx-ink);
}

.hx-var [data-appearance="V1"] { --hx-var-color: var(--hx-var-v1); }
.hx-var [data-appearance="V2"] { --hx-var-color: var(--hx-var-v2); }
.hx-var [data-appearance="V3"] { --hx-var-color: var(--hx-var-v3); }

/* A variant's hexagon key: filled in its color, hollow (a colored outline) for a fixed population. */
.hx-var-swatch {
  display: inline-block;
  flex: none;
  overflow: visible;
  vertical-align: middle;
}

.hx-var-swatch path {
  fill: var(--hx-var-color, var(--hx-muted));
  stroke: var(--hx-var-color, var(--hx-muted));
  stroke-width: 0;
  stroke-linejoin: round;
}

.hx-var-swatch[data-population="fixed"] path {
  fill: var(--hx-surface);
  stroke-width: 2.2;
}

.hx-var-swatch.is-neutral {
  --hx-var-color: var(--hx-muted);
}

.hx-var-tag {
  color: var(--hx-muted);
  font-weight: 500;
}

/* Scene buttons ------------------------------------------------------------------------------ */

.hx-var-scenes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 30px;
  margin: 0 0 16px;
}

.hx-var-dataset {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.hx-var-dataset-label {
  color: var(--hx-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hx-var-dataset-scenes {
  display: flex;
  gap: 6px;
}

.hx-var-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 104px;
  padding: 4px 4px 5px;
  border: 1px solid transparent;
  border-radius: var(--hx-radius);
  background: none;
  color: var(--hx-muted);
  font: inherit;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.hx-var-scene img {
  display: block;
  width: 96px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--hx-surface-2);
}

.hx-var-scene-name {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.8rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: hover) {
  .hx-var-scene:hover {
    background: var(--hx-surface-2);
    color: var(--hx-ink);
  }
}

.hx-var-scene[aria-pressed="true"] {
  border-color: var(--hx-dark);
  background: var(--hx-surface);
  color: var(--hx-ink);
  box-shadow: inset 0 0 0 1px var(--hx-dark);
}

.hx-var-scene[aria-pressed="true"] .hx-var-scene-name {
  font-weight: 600;
}

.hx-var-scene:focus-visible {
  outline: 2px solid var(--hx-select);
  outline-offset: 2px;
}

/* Video grid --------------------------------------------------------------------------------- */

/* Two rows of three keep within about two thirds of the screen height: tall clips (DTU) narrow the grid. */
.hx-var-player {
  width: min(100%, calc(var(--hx-var-aspect, 1.5) * 1.5 * (66vh - var(--hx-var-gap)) + 2 * var(--hx-var-gap)));
  margin-inline: auto;
}

.hx-var-stage {
  position: relative;
  border-radius: var(--hx-radius);
  outline: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* The plain ring first, for browsers without color-mix(), which drop the second declaration. */
.hx-var-stage:focus-visible {
  box-shadow: 0 0 0 3px var(--hx-select);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hx-select) 55%, transparent);
}

.hx-var-stage.has-notice {
  cursor: default;
}

.hx-var-grid {
  display: grid;
  grid-template-columns: repeat(var(--hx-var-cols, 3), minmax(0, 1fr));
  gap: var(--hx-var-gap);
}

.hx-var-tile {
  position: relative;
  grid-column: var(--hx-var-col);
  grid-row: var(--hx-var-row);
  margin: 0;
  aspect-ratio: var(--hx-var-aspect, 1.5);
  overflow: hidden;
  border-radius: 8px;
  background: var(--hx-surface-2);
}

.hx-var-poster,
.hx-var-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.hx-var-poster { z-index: 0; }
.hx-var-video { z-index: 1; }

.hx-var-poster:not([src]) {
  visibility: hidden;
}

/* A hairline frame, and a ring in the variant's color while it is highlighted from the table or the plot. */
.hx-var-tile::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  content: "";
  pointer-events: none;
  transition: box-shadow 0.15s;
}

.hx-var-tile.is-hot::after {
  box-shadow: inset 0 0 0 3px var(--hx-var-color);
}

.hx-var-label {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 16px);
  padding: 3px 9px 3px 7px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  color: var(--hx-ink);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
}

.hx-var-label-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* "Click to play" or "Tap to play" while paused (the shared .hx-hint pill of index.css). */
.hx-var-cue {
  z-index: 6;
  left: 10px;
  bottom: 10px;
}

.hx-var-notice {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  border-radius: var(--hx-radius);
  background: var(--hx-surface-2);
  background: color-mix(in srgb, var(--hx-surface-2) 90%, transparent);
  color: var(--hx-muted);
  text-align: center;
}

.hx-var-notice .fa-solid {
  font-size: 1.6rem;
  opacity: 0.6;
}

/* Under a notice the tile labels would show through behind its text. */
.hx-var-stage.has-notice .hx-var-label {
  visibility: hidden;
}

/* The notice, the cue and hidden plot parts set their own display, so [hidden] is restated for them here. */
.hx-var-stage.has-notice .hx-var-cue,
.hx-var-notice[hidden],
.hx-var-cue[hidden],
.hx-var-svg [hidden] {
  display: none;
}

/* Playback controls ---------------------------------------------------------------------------- */

.hx-var-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.hx-var-play,
.hx-var-icon {
  display: grid;
  flex: none;
  place-items: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.hx-var-play {
  width: 38px;
  height: 38px;
  margin-right: 2px;
  background: var(--hx-dark);
  color: #fff;
}

.hx-var-icon {
  width: 34px;
  height: 34px;
  background: none;
  color: var(--hx-ink);
}

.hx-var-scrubber {
  --hx-var-progress: 0%;
  position: relative;
  flex: 1 1 auto;
  min-width: 60px;
  height: 28px;
  margin: 0 8px;
  cursor: pointer;
  touch-action: none;
  outline: none;
}

.hx-var-scrubber-track {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 4px;
  margin-top: -2px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--hx-line);
}

.hx-var-scrubber-fill {
  width: var(--hx-var-progress);
  height: 100%;
  background: var(--hx-dark);
}

.hx-var-scrubber-thumb {
  position: absolute;
  top: 50%;
  left: var(--hx-var-progress);
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--hx-dark);
  transition: transform 0.15s;
}

@media (hover: hover) {
  .hx-var-play:hover {
    background: #1f1f1f;
  }

  .hx-var-icon:hover {
    background: var(--hx-surface-2);
  }

  .hx-var-scrubber:hover .hx-var-scrubber-thumb {
    transform: scale(1.25);
  }
}

.hx-var-play:focus-visible,
.hx-var-icon:focus-visible {
  outline: 2px solid var(--hx-select);
  outline-offset: 2px;
}

.hx-var-scrubber:focus-visible {
  border-radius: 6px;
  outline: 2px solid var(--hx-select);
  outline-offset: 2px;
}

.hx-var-counter {
  flex: none;
  min-width: 68px;
  color: var(--hx-muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.hx-var-controls.is-disabled {
  opacity: 0.45;
}

.hx-var-controls.is-disabled .hx-var-scrubber {
  pointer-events: none;
}

.hx-var-controls button:disabled {
  cursor: default;
}

.hx-var-help {
  margin-top: 8px;
  color: var(--hx-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* What V1 to V3 and fixed or densified mean, in the data file's words. */
.hx-var-key {
  max-width: 62rem;
  margin: 14px auto 0;
  color: var(--hx-muted);
  font-size: 0.85rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.hx-var-key p + p {
  margin-top: 4px;
}

.hx-var-key-term {
  margin-right: 0.2rem;
  color: var(--hx-ink);
  font-weight: 600;
}

/* Numbers: header with the scope toggle, then the table and the plot side by side -------------- */

/* The table and the plot share one column under the grid, at the comparison table's width. */
.hx-var-results {
  max-width: 1040px;
  margin: 30px auto 0;
}

.hx-var-results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  margin-bottom: 12px;
}

.hx-var-results-title {
  margin: 0;
  font-family: var(--hx-font-title);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.hx-var-results-sub {
  margin-left: 10px;
  color: var(--hx-muted);
  font-family: var(--hx-font-body);
  font-size: 0.85rem;
  font-weight: 400;
}

.hx-var-results-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.hx-var-table-card,
.hx-var-plot-card {
  min-width: 0;
  border: 1px solid var(--hx-line);
  border-radius: var(--hx-radius);
  background: var(--hx-surface);
}

.hx-var-table-card {
  padding: 6px 6px 10px;
}

.hx-var-plot-card {
  padding: 14px 16px 12px;
}

/* Segmented buttons: the scope toggle and the plot's axes (explorer.css). */
.hx-var-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.hx-var-control-label {
  color: var(--hx-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hx-var-seg {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--hx-line);
  border-radius: 999px;
  background: var(--hx-line);
}

.hx-var-seg button {
  min-height: 32px;
  margin: 0;
  padding: 0 13px;
  border: 0;
  background: var(--hx-surface);
  color: var(--hx-ink);
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

@media (hover: hover) {
  .hx-var-seg button:hover {
    background: var(--hx-surface-2);
  }
}

.hx-var-seg button[aria-pressed="true"] {
  background: var(--hx-dark);
  color: #fff;
}

.hx-var-seg button:focus-visible {
  outline: 2px solid var(--hx-select);
  outline-offset: -4px;
}

.hx-var-seg button[aria-pressed="true"]:focus-visible {
  outline-color: #fff;
}

/* Table ---------------------------------------------------------------------------------------- */

/* Positioned so the absolutely positioned screen-reader caption stays inside the scroller. */
.hx-var-table-scroll {
  position: relative;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border-radius: 6px;
}

.hx-var-table-scroll:focus-visible {
  outline: 2px solid var(--hx-select);
  outline-offset: 2px;
}

.hx-var-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.hx-var-table th,
.hx-var-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--hx-line);
  vertical-align: middle;
  white-space: nowrap;
}

.hx-var-table tbody tr:last-child th,
.hx-var-table tbody tr:last-child td {
  border-bottom: 0;
}

.hx-var-table thead th {
  color: var(--hx-muted);
  font-weight: 600;
  line-height: 1.25;
  vertical-align: bottom;
}

.hx-var-head-name,
.hx-var-head-unit {
  display: block;
}

.hx-var-head-unit {
  font-size: 0.76rem;
  font-weight: 400;
}

.hx-var-table .hx-var-num {
  position: relative;
  text-align: right;
}

.hx-var-table .hx-var-variant-col,
.hx-var-table tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--hx-surface);
  text-align: left;
}

.hx-var-table tbody th {
  font-weight: 400;
}

.hx-var-row-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hx-var-table .is-best {
  font-weight: 700;
}

.hx-var-table tbody tr {
  transition: background-color 0.15s;
}

.hx-var-table tbody tr.is-hot,
.hx-var-table tbody tr.is-hot th {
  background: color-mix(in srgb, var(--hx-var-color) 9%, var(--hx-surface));
}

/* The dagger hangs in the cell padding, so marked numbers stay aligned with the others. */
.hx-var-dagger {
  position: absolute;
  top: 6px;
  margin-left: 1px;
  color: var(--hx-muted);
  font-weight: 400;
}

.hx-var-swipe {
  display: none;
  align-items: center;
  gap: 0.4rem;
  margin: 6px 6px 0;
  color: var(--hx-muted);
  font-size: 0.78rem;
}

.hx-var-table-card.is-scrollable .hx-var-swipe {
  display: flex;
}

.hx-var-note {
  margin: 8px 6px 0;
  color: var(--hx-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

/* Plot ----------------------------------------------------------------------------------------- */

.hx-var-plot-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-bottom: 14px;
}

.hx-var-chart {
  position: relative;
  min-width: 0;
}

.hx-var-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--hx-font-body);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hx-var-gridline {
  stroke: var(--hx-var-gridline);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.hx-var-baseline {
  stroke: var(--hx-var-baseline);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.hx-var-tick {
  fill: var(--hx-muted);
  font-variant-numeric: tabular-nums;
}

.hx-var-axis-title {
  fill: var(--hx-ink);
  font-weight: 600;
}

.hx-var-cue-text {
  fill: var(--hx-muted);
}

.hx-var-cue-arrow {
  fill: none;
  stroke: var(--hx-muted);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* A line joins each fixed variant to its densified one. */
.hx-var-link {
  stroke: var(--hx-var-color);
  stroke-width: 1.5;
  stroke-opacity: 0.5;
  stroke-linecap: round;
}

.hx-var-point {
  cursor: pointer;
  outline: none;
  transition: transform 450ms cubic-bezier(0.33, 0, 0.2, 1), opacity 0.2s ease;
}

/* The surface ring around every marker, so overlapping markers and lines stay legible. */
.hx-var-halo {
  fill: var(--hx-surface);
}

.hx-var-mark {
  fill: var(--hx-var-color);
  stroke: var(--hx-var-color);
  stroke-width: 0;
  stroke-linejoin: round;
}

.hx-var-point[data-population="fixed"] .hx-var-mark {
  fill: var(--hx-surface);
  stroke-width: 2.5;
}

.hx-var-focus {
  fill: none;
  stroke: var(--hx-ink);
  stroke-width: 1.5;
  opacity: 0;
  transition: opacity 0.15s;
}

.hx-var-point.is-hot .hx-var-focus {
  opacity: 0.55;
}

.hx-var-point:focus-visible .hx-var-focus {
  stroke: var(--hx-select);
  stroke-width: 2.5;
  opacity: 1;
}

.hx-var-svg.has-hot .hx-var-point:not(.is-hot) {
  opacity: 0.45;
}

.hx-var-point-label {
  fill: var(--hx-ink);
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--hx-surface);
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}

.hx-var-leader {
  stroke: var(--hx-var-leader);
  stroke-width: 1;
}

/* Lines and labels fade out while the points glide to a new selection, then back in. */
.hx-var-links,
.hx-var-labels {
  transition: opacity 0.2s ease;
}

.hx-var-svg.is-settling .hx-var-links,
.hx-var-svg.is-settling .hx-var-labels {
  opacity: 0;
  transition-duration: 0.1s;
}

.hx-var-tip {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  min-width: 9.5rem;
  padding: 7px 10px 8px;
  border: 1px solid var(--hx-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  color: var(--hx-ink);
  font-size: 0.8rem;
  line-height: 1.45;
  pointer-events: none;
}

.hx-var-tip-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  font-weight: 600;
  white-space: nowrap;
}

.hx-var-tip-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.hx-var-tip-row strong {
  color: var(--hx-ink);
  font-variant-numeric: tabular-nums;
}

.hx-var-tip-row span {
  color: var(--hx-muted);
}

.hx-var-plot-note {
  margin: 6px 0 0;
  color: var(--hx-muted);
  font-size: 0.78rem;
  text-align: center;
}

.hx-var-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 14px;
  margin-top: 8px;
  color: var(--hx-muted);
  font-size: 0.8rem;
}

.hx-var-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.hx-var-legend-gap {
  width: 1px;
  height: 14px;
  background: var(--hx-line);
}

.hx-var-legend-line line {
  stroke: var(--hx-muted);
  stroke-width: 1.5;
  stroke-opacity: 0.7;
  stroke-linecap: round;
}

/* How the numbers were measured, folded away ------------------------------------------------------ */

.hx-var-about {
  margin-top: 14px;
  color: var(--hx-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.hx-var-about summary {
  display: inline-block;
  color: var(--hx-link);
  cursor: pointer;
}

.hx-var-about summary::before {
  display: inline-block;
  width: 1em;
  content: "\25B8";
  transition: transform 0.15s;
}

.hx-var-about[open] summary::before {
  transform: rotate(90deg);
}

.hx-var-about summary::-webkit-details-marker {
  display: none;
}

.hx-var-about summary:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--hx-select);
  outline-offset: 2px;
}

.hx-var-about dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 16px;
  margin: 10px 0 0;
}

.hx-var-about dt {
  color: var(--hx-ink);
  font-weight: 600;
}

.hx-var-about dd {
  margin: 0;
}

.hx-var-about p {
  margin-top: 8px;
}

.hx-var-unavailable {
  color: var(--hx-muted);
  text-align: center;
}

/* Phones and narrow tablets: two video columns, fixed and densified, with a row per appearance model. */
@media (max-width: 700px) {
  .hx-var-player {
    width: 100%;
  }

  .hx-var-grid {
    grid-template-columns: repeat(var(--hx-var-rows, 2), minmax(0, 1fr));
    gap: 6px;
  }

  .hx-var-tile {
    grid-column: var(--hx-var-row);
    grid-row: var(--hx-var-col);
    border-radius: 6px;
  }

  .hx-var-label {
    top: 5px;
    left: 5px;
    gap: 4px;
    max-width: calc(100% - 10px);
    padding: 2px 6px 2px 5px;
    font-size: 0.72rem;
  }

  .hx-var-label .hx-var-swatch {
    width: 11px;
    height: 11px;
  }

  /* Small tiles keep only the hexagon key and the short tag (V1-G), so the label covers little of the video. */
  .hx-var-label-name {
    display: none;
  }

  .hx-var-label .hx-var-tag {
    color: var(--hx-ink);
    font-weight: 600;
  }

  .hx-var-cue {
    left: 6px;
    bottom: 6px;
  }
}

@media (max-width: 600px) {
  .hx-var-scenes {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .hx-var-dataset {
    display: grid;
    grid-template-columns: 4.9rem minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }

  .hx-var-dataset-label {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    white-space: normal;
  }

  .hx-var-dataset-scenes {
    gap: 4px;
  }

  .hx-var-scene {
    flex: 1 1 0;
    flex-direction: row;
    gap: 6px;
    width: auto;
    min-width: 0;
    padding: 3px 6px 3px 3px;
  }

  .hx-var-scene img {
    width: 46px;
    height: 30px;
    border-radius: 4px;
  }

  .hx-var-scene-name {
    font-size: 0.78rem;
  }

  .hx-var-controls {
    gap: 2px;
  }

  .hx-var-scrubber {
    margin: 0 6px;
  }

  .hx-var-counter {
    min-width: 0;
    font-size: 0.75rem;
  }

  .hx-var-key {
    font-size: 0.82rem;
  }

  .hx-var-results-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .hx-var-results-sub {
    display: block;
    margin-left: 0;
  }

  .hx-var-plot-card {
    padding: 12px 10px 10px;
  }

  .hx-var-plot-controls {
    flex-direction: column;
    gap: 10px;
  }

  /* Segmented buttons become an even grid (two by two for four), as in the results explorer. */
  .hx-var-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    width: 100%;
  }

  .hx-var-seg {
    display: grid;
    grid-auto-flow: row;
    grid-template-columns: repeat(var(--hx-var-count, 3), minmax(0, 1fr));
    border-radius: var(--hx-radius);
  }

  .hx-var-seg[data-count="2"] { --hx-var-count: 2; }
  .hx-var-seg[data-count="4"] { --hx-var-count: 2; }

  .hx-var-seg button {
    min-height: 38px;
    padding: 0 8px;
    font-size: 0.8rem;
    white-space: normal;
  }

  .hx-var-table {
    font-size: 0.8rem;
  }

  .hx-var-table th,
  .hx-var-table td {
    padding: 6px 8px;
  }

  .hx-var-about dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .hx-var-about dd {
    margin-bottom: 6px;
  }
}

/* The narrowest phones: smaller thumbnails and a narrower dataset column, so every scene name fits whole (the two
   DTU scans would otherwise both read "Scan..."). */
@media (max-width: 380px) {
  .hx-var-dataset {
    grid-template-columns: 4.1rem minmax(0, 1fr);
  }

  .hx-var-scene {
    gap: 4px;
    padding: 3px 4px 3px 3px;
  }

  .hx-var-scene img {
    width: 30px;
    height: 20px;
  }
}

/* Touch screens: tap targets of at least 40 px. */
@media (pointer: coarse) {
  .hx-var-play,
  .hx-var-icon {
    width: 40px;
    height: 40px;
  }

  .hx-var-scrubber {
    height: 40px;
  }

  .hx-var-seg button {
    min-height: 40px;
  }

  .hx-var-scene {
    min-height: 40px;
  }

  .hx-var-about summary {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-var-point,
  .hx-var-links,
  .hx-var-labels,
  .hx-var-scene,
  .hx-var-tile::after,
  .hx-var-scrubber-thumb {
    transition: none;
  }
}
