.row-list {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-height: var(--tap-dense);
  padding: var(--space-1) 0;
  border-bottom: var(--line-width) solid var(--line);
  font-size: var(--text-md);
}

.row:last-child {
  border-bottom: 0;
}

/* The step under way (the coach page's class clock): a tint and a ring
   all round, the tint spread past the row's edge so its text keeps room. */
.row[aria-current="step"] {
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  box-shadow: 0 0 0 var(--space-1) var(--accent-soft), 0 0 0 calc(var(--space-1) + 2px) var(--accent);
}

/* A piece of work in a session (the coach page's workouts): a band behind
   it, in its energy system's tint (row-energy-*) or, with none, the day
   head's grey, which stands off the surface in both schemes, so the class's
   work reads apart from what leads into it. The band is the row's own, so
   the step under way keeps it inside its ring. */
.row-work {
  --row-band: var(--stratum-head);
  margin: var(--space-1) 0;
  padding: var(--space-2) var(--space-3);
  border-bottom: 0;
  border-radius: var(--radius-md);
  background: var(--row-band);
}

.row-work[aria-current="step"] {
  background: var(--row-band);
}

.row-energy-phosphagen {
  --row-band: var(--energy-phosphagen-soft);
}

.row-energy-glycolytic {
  --row-band: var(--energy-glycolytic-soft);
}

.row-energy-oxidative {
  --row-band: var(--energy-oxidative-soft);
}

.row-energy-skill {
  --row-band: var(--energy-skill-soft);
}

/* When the work starts, on its own line at the top of a work row: the
   clock the largest type on the page, so a coach finds it at a glance.
   The clock and a strong title take the row's ink, so a row stepped back
   (the coach page's coach-dim) takes them with it. */
.row-start {
  display: flex;
  flex-basis: 100%;
  align-items: baseline;
  gap: var(--space-2);
  font-variant-numeric: tabular-nums;
}

.row-start-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-muted);
}

.row-start-time {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: var(--leading-tight);
}

.row-start-when {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.row-start-when:empty {
  display: none;
}

.row-stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  padding: var(--space-2) 0;
}

/* A narrow strip of dots at the row's start, the row's line height, that a
   drag takes the row by. */
.row-grip {
  flex: none;
  align-self: stretch;
  width: 0.625rem;
  min-height: 1rem;
  background-image: radial-gradient(circle, var(--ink-muted) 1px, transparent 1.25px);
  background-size: 0.3125rem 0.3125rem;
  cursor: grab;
  user-select: none;
}

.row-grip:active {
  cursor: grabbing;
}

.row-meta {
  flex: 0 0 auto;
  min-width: 3rem;
  font-size: var(--text-xs);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* A zero basis, so a long title wraps within its line rather than pushing
   the row's end value down onto a line of its own. */
.row-title {
  flex: 1 1 0;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.row-title:hover {
  text-decoration: underline;
}

.row-end {
  flex: 0 0 auto;
  font-size: var(--text-sm);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.row-title-quiet {
  color: var(--ink-muted);
}

.row-title-strong {
  font-size: var(--text-lg);
  font-weight: 600;
}

.row-detail {
  flex-basis: 100%;
  min-width: 0;
  padding-left: calc(3rem + var(--space-2));
}

.row-detail-flush {
  padding-left: 0;
}

.row-detail-quiet {
  color: var(--ink-muted);
}

/* A band under a row that carries what the row holds (the coach page's
   warmup phases under the row of the window they are done in). A list
   item of its own. */
.row-band {
  padding: var(--space-1) 0;
}

/* A group heading between runs of rows (Components::Table group_by:): the
   wide table's heading on the phone list, at the dense tap height. Its
   title, note and end take their type from the data-group-* rules. */
.row-group {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  min-height: var(--tap-dense);
  padding: var(--space-1) var(--space-2);
  border-top: var(--line-width) solid var(--line);
  border-bottom: var(--line-width) solid var(--line);
  background: var(--surface-sunken);
  font-size: var(--text-sm);
  font-weight: 600;
}
