.workout-page {
  display: grid;
  gap: var(--space-4);
}

.workout-stack {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.workout-summary {
  display: grid;
}

@media (min-width: 64rem) {
  .workout-summary {
    display: none;
  }
}

.workout-note {
  max-width: 70ch;
  white-space: pre-wrap;
}

/* The source system's own id for the workout, beside the system's name. */
.workout-source-id {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}

/* A workout's scores as dots (Components::ScoreScatter): one column per
   day, divisions side by side in it, each dot at its score. RX is a filled
   accent dot, Scaled a hollow muted ring, RX+ a filled ink dot, so a
   division reads by shape as well as colour. */
/* The chart is drawn at the width its days need (--chart-width, set on
   the svg) and never wider, so it shrinks to a phone whole. */
.score-scatter {
  margin: 0;
  display: grid;
  gap: var(--space-2);
}

.score-scatter-svg {
  display: block;
  width: 100%;
  max-width: var(--chart-width, 64rem);
  height: auto;
}

.score-scatter-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.score-scatter-tick {
  fill: var(--ink-muted);
  font-size: 12px;
}

.score-dot {
  stroke-width: 2;
  cursor: pointer;
  transition: r 120ms ease-out;
}

/* A dot under the pointer, or one whose athlete is lit, grows; a focused
   dot shows the focus ring the kit gives every control. */
.score-dot:hover {
  r: 7;
}

/* A finger needs more dot than a pointer. */
@media (pointer: coarse) {
  .score-dot {
    r: 7;
  }
}

.score-dot:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.score-athlete-line {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
  pointer-events: none;
}

.score-median-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
}

.score-median-line-rx {
  stroke: var(--accent);
}

.score-median-line-scaled {
  stroke: var(--ink-muted);
  stroke-dasharray: 6 4;
}

.score-median-line-rx-plus {
  stroke: var(--ink);
}

.score-median-line-other {
  stroke: var(--ink-muted);
  stroke-dasharray: 2 3;
}

/* One athlete's dots and line, lit while a dot of theirs is hovered,
   focused or open in the popover. After the dot and line rules, so it
   wins by source order. */
.score-athlete-active {
  r: 7;
  stroke: var(--ink);
  stroke-width: 3;
}

.score-scatter-swatch-line {
  width: 1rem;
  height: 0;
  border-top: 2px solid var(--accent);
}

.score-scatter-swatch-line-scaled {
  border-top-color: var(--ink-muted);
  border-top-style: dashed;
}

.score-scatter-swatch-line-rx-plus {
  border-top-color: var(--ink);
}

.score-scatter-swatch-line-other {
  border-top-color: var(--ink-muted);
  border-top-style: dotted;
}

.score-scatter-swatch-line-athlete {
  border-top: 1.5px solid var(--line);
}

.score-scatter-popover {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

.score-scatter-popover-name {
  margin: 0;
  font-weight: 600;
}

.score-scatter-popover-detail {
  margin: 0;
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

.score-dot-rx {
  fill: var(--accent);
  stroke: var(--accent);
}

.score-dot-scaled {
  fill: var(--surface);
  stroke: var(--ink-muted);
}

.score-dot-rx-plus {
  fill: var(--ink);
  stroke: var(--ink);
}

.score-dot-other {
  fill: var(--line);
  stroke: var(--ink-muted);
}

.score-scatter-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.score-scatter-key {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.score-scatter-swatch {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  border: 2px solid var(--ink-muted);
}

.score-scatter-swatch-rx {
  background: var(--accent);
  border-color: var(--accent);
}

.score-scatter-swatch-scaled {
  background: var(--surface);
}

.score-scatter-swatch-rx-plus {
  background: var(--ink);
  border-color: var(--ink);
}

.score-scatter-swatch-other {
  background: var(--line);
}
