/* Anchor markers at the right edge so longer lines extend left. */
.section-progress { justify-items: end; }
.section-progress button::before {
  content: attr(data-progress-label);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  width: max-content;
  max-width: min(240px, calc(100vw - 90px));
  color: inherit;
  font: 400 10px/1.4 "Montserrat", Arial, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: right;
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms ease;
  pointer-events: none;
}
.section-progress:hover button::before,
.section-progress:focus-within button::before,
.section-progress button.is-active::before {
  opacity: 1;
  visibility: visible;
}
.section-progress:hover button,
.section-progress:focus-within button { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .section-progress button, .section-progress button::before { transition: none; }
}
/* Extend each row's hit area through its label without moving the markers. */
.section-progress button::after {
  content: "";
  position: absolute;
  top: -7px;
  bottom: -7px;
  right: -6px;
  left: -190px;
  cursor: pointer;
}
.section-progress button::before { pointer-events: auto; }
@media (max-width: 767px) {
  .section-progress button::after { top: -5.5px; bottom: -5.5px; left: -190px; }
}

/* Mobile rail rests between scroll gestures; desktop visibility is unchanged. */
@media (max-width: 767px) {
  .section-progress.is-idle:not(:has(:focus-visible)) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 280ms ease, visibility 0s linear 280ms;
  }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .section-progress.is-idle { transition: none; }
}
