.run-calendar {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: stretch;
  scroll-margin-top: var(--sticky-row-offset, 260px);
}

.run-calendar-panel {
  min-width: 0;
  overflow: visible;
  border: 1px solid rgba(194, 202, 215, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 249, 252, 0.76)),
    rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(24, 33, 47, 0.06);
}

.run-calendar-months {
  display: grid;
  gap: 0;
}

.run-calendar-month {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 8px;
  border-left: 1px solid rgba(215, 221, 231, 0.62);
  padding: 12px;
}

.run-calendar-month:first-child {
  border-left: 0;
}

.run-calendar-month h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.run-calendar-weekdays,
.run-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.run-calendar-weekdays {
  color: rgba(102, 112, 133, 0.68);
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.run-calendar-days {
  gap: 3px;
}

.run-calendar-blank,
.run-calendar-day {
  aspect-ratio: 1;
}

.run-calendar-day {
  position: relative;
  min-width: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(24, 33, 47, 0.78);
  font: inherit;
  font-size: clamp(0.68rem, 1.2vw, 0.82rem);
  font-weight: 840;
  line-height: 1;
}

.run-calendar-day.is-outside-month {
  color: rgba(102, 112, 133, 0.46);
  font-weight: 780;
}

.run-calendar-day.has-run {
  cursor: pointer;
}

.run-calendar-date-number {
  position: relative;
  z-index: 2;
  font-variant-numeric: tabular-nums;
}

.run-calendar-day.has-run {
  color: var(--run-label-color, white);
  font-weight: 920;
  text-shadow: var(--run-label-shadow, 0 1px 1px rgba(15, 23, 42, 0.18));
}

.run-calendar-day.has-run.is-outside-month .run-calendar-date-number {
  color: rgba(255, 255, 255, 0.78);
}

.run-calendar-day.has-run::before {
  content: "";
  position: absolute;
  z-index: 1;
  width: var(--run-size, 22px);
  height: var(--run-size, 22px);
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 42%),
    hsl(158 39% var(--run-lightness, 56%));
  box-shadow:
    0 5px 12px rgba(45, 95, 77, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.26);
}

.run-calendar-day.has-run.no-pace::before {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 42%),
    rgba(96, 121, 138, 0.62);
}

.run-calendar-day.has-run.complete-only {
  color: rgba(24, 33, 47, 0.78);
  text-shadow: none;
}

.run-calendar-day.has-run.complete-only::before {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.38) 50%),
    rgba(245, 248, 251, 0.9);
  box-shadow:
    0 5px 12px rgba(46, 64, 82, 0.12),
    inset 0 0 0 2px rgba(96, 121, 138, 0.54),
    inset 0 0 0 5px rgba(255, 255, 255, 0.72);
}

.run-calendar-day.has-run.planned-run {
  color: #f8fbff;
  text-shadow: 0 1px 1px rgba(21, 52, 82, 0.34);
}

.run-calendar-day.has-run.planned-run::before {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 42%),
    hsl(207 76% 54%);
  box-shadow:
    0 5px 12px rgba(40, 98, 148, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.run-calendar-day.has-run.previous-run {
  color: rgba(24, 33, 47, 0.84);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.46);
}

.run-calendar-day.has-run.previous-run::before {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.04) 46%),
    hsl(42 82% 69%);
  box-shadow:
    0 5px 12px rgba(128, 96, 32, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.34);
}

.run-calendar-day.has-run.is-outside-month {
  color: rgba(55, 65, 81, 0.58);
  text-shadow: none;
}

.run-calendar-day.has-run.is-outside-month .run-calendar-date-number {
  color: currentColor;
}

.run-calendar-day.has-run.is-outside-month::before {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.08) 44%),
    rgba(148, 163, 184, 0.34);
  box-shadow:
    0 4px 10px rgba(46, 64, 82, 0.08),
    inset 0 0 0 1px rgba(96, 121, 138, 0.2);
}

.run-calendar-day.has-run:hover,
.run-calendar-day.has-run:focus-visible {
  outline: 0;
}

.run-calendar-day.has-run:focus-visible .run-calendar-date-number {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.run-calendar-tooltip,
.distance-projection-popover,
.week-day-meta-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 30;
  display: grid;
  gap: 2px;
  width: max-content;
  max-width: min(230px, calc(100vw - 48px));
  padding: 9px 11px;
  border: 1px solid rgba(194, 202, 215, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(24, 33, 47, 0.14);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 760;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  text-shadow: none;
  transform: translate(-50%, 5px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0.16s ease;
  visibility: hidden;
}

.distance-projection-popover {
  position: fixed;
  top: var(--projection-popover-top, 50vh);
  bottom: auto;
  left: var(--projection-popover-left, 50vw);
  z-index: var(--z-projection-popover);
  transform: translate(-50%, calc(-100% + 5px));
}

.distance-projection-popover.is-below {
  transform: translate(-50%, -5px);
}

.distance-projection-popover-portal {
  z-index: var(--z-projection-popover);
}

.distance-projection-popover-portal.is-open {
  opacity: 1;
  transform: translate(-50%, -100%);
  visibility: visible;
}

.distance-projection-popover-portal.is-open.is-below {
  transform: translate(-50%, 0);
}

.week-day-meta-tooltip {
  position: fixed;
  top: var(--run-meta-popover-top, 50vh);
  bottom: auto;
  left: var(--run-meta-popover-left, 50vw);
  z-index: var(--z-floating-popover);
  transform: translate(-50%, calc(-100% + 5px));
}

.run-meta-tooltip-portal {
  z-index: var(--z-dialog-raised);
}

.run-meta-tooltip-portal.is-open {
  opacity: 1;
  transform: translate(-50%, -100%);
  visibility: visible;
}

.week-day-meta-tooltip.is-below {
  transform: translate(-50%, -5px);
}

.run-meta-tooltip-portal.is-open.is-below {
  transform: translate(-50%, 0);
}

.run-calendar-tooltip::after,
.distance-projection-popover::after,
.week-day-meta-tooltip::after {
  --floating-popover-notch-fill: var(--border);
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(194, 202, 215, 0.88);
  border-bottom: 1px solid rgba(194, 202, 215, 0.88);
  background: var(--floating-popover-notch-fill, rgba(255, 255, 255, 0.96));
  transform: translate(-50%, -5px) rotate(45deg);
}

.distance-projection-popover.is-below::after {
  top: auto;
  bottom: 100%;
  border: 0;
  border-top: 1px solid rgba(194, 202, 215, 0.88);
  border-left: 1px solid rgba(194, 202, 215, 0.88);
  transform: translate(-50%, 5px) rotate(45deg);
}

.distance-projection-popover::after {
  left: var(--projection-popover-notch-x, 50%);
}

.week-day-meta-tooltip::after {
  left: var(--run-meta-popover-notch-x, 50%);
}

.week-day-meta-tooltip.is-below::after {
  top: auto;
  bottom: 100%;
  border: 0;
  border-top: 1px solid rgba(194, 202, 215, 0.88);
  border-left: 1px solid rgba(194, 202, 215, 0.88);
  transform: translate(-50%, 5px) rotate(45deg);
}

.run-calendar-tooltip strong,
.distance-projection-popover strong,
.week-day-meta-tooltip strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 900;
}

.run-calendar-tooltip span,
.distance-projection-popover span,
.week-day-meta-tooltip span {
  display: block;
  color: rgba(102, 112, 133, 0.94);
}

.run-calendar-day.has-run:hover .run-calendar-tooltip,
.run-calendar-day.has-run:focus .run-calendar-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.run-calendar-arrow {
  min-width: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(194, 202, 215, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  box-shadow: 0 8px 18px rgba(24, 33, 47, 0.05);
  cursor: pointer;
}

.run-calendar-arrow:hover,
.run-calendar-arrow:focus-visible {
  border-color: rgba(47, 128, 98, 0.38);
  outline: 0;
  color: var(--green);
  background: rgba(245, 252, 249, 0.92);
}

.run-calendar-arrow:disabled {
  cursor: default;
  opacity: 0.38;
}

.run-calendar-arrow .icon {
  width: 18px;
  height: 18px;
}

.plan-end-note {
  min-height: max(160px, calc(100vh - var(--sticky-row-offset, 360px) + 32px));
  position: relative;
  z-index: 120;
  display: grid;
  gap: 18px;
  align-content: start;
  justify-items: center;
  color: rgba(24, 33, 47, 0.34);
  margin-top: -8px;
  padding: 0 16px 104px;
  text-align: center;
  font-size: 0.94rem;
  overflow: visible;
  pointer-events: auto;
}

.plan-end-note:has(.distance-projection-popover-hit:hover),
.plan-end-note:has(.distance-projection-popover-hit:focus),
.plan-end-note:has(.distance-projection-popover-hit.selected) {
  z-index: 240;
}

.plan-end-note blockquote {
  position: relative;
  z-index: 2;
  max-width: 620px;
  margin: 0;
  padding-top: 4px;
  mix-blend-mode: multiply;
}

.plan-end-note p {
  margin: 0;
  color: rgba(24, 33, 47, 0.36);
  font-size: clamp(1rem, 1.7vw, 1.28rem);
  font-style: italic;
  font-weight: 620;
  line-height: 1.45;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.38);
}

.plan-end-note cite {
  display: block;
  margin-top: 10px;
  color: rgba(102, 112, 133, 0.42);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.distance-projection {
  position: relative;
  z-index: 40;
  display: grid;
  justify-self: stretch;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-inline: 0;
  overflow: visible;
  padding-inline: 0;
  isolation: isolate;
}

.distance-projection-scroll {
  display: grid;
  gap: 6px;
  min-width: 0;
  overflow: visible;
}

.distance-projection-scroll:focus-visible {
  outline: 2px solid rgba(53, 102, 214, 0.38);
  outline-offset: 4px;
  border-radius: 8px;
}

.distance-projection-chart-wrap {
  position: relative;
  min-width: 0;
  overflow: visible;
  cursor: crosshair;
  touch-action: pan-y;
}

.distance-projection-mobile-axis {
  display: none;
}

.distance-projection-chart {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1280 / 212;
  min-height: 124px;
  overflow: visible;
  border-radius: 8px;
  opacity: 0.86;
  mix-blend-mode: multiply;
  touch-action: pan-y;
}

.distance-projection-grid line {
  stroke: rgba(102, 112, 133, 0.18);
  stroke-dasharray: 3 8;
}

.distance-projection-grid text {
  fill: rgba(102, 112, 133, 0.56);
  font-size: 12px;
  font-weight: 760;
}

.distance-projection-area.past {
  fill: rgba(96, 121, 138, 0.1);
}

.distance-projection-area.future {
  fill: rgba(47, 128, 98, 0.14);
}

.distance-projection-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

.distance-projection-line.past {
  stroke: rgba(96, 121, 138, 0.62);
}

.distance-projection-line.future {
  stroke: rgba(47, 128, 98, 0.78);
}

.distance-projection-dot {
  fill: rgba(47, 128, 98, 0.88);
  opacity: 0.3;
}

.distance-projection-point.past .distance-projection-dot {
  fill: rgba(96, 121, 138, 0.78);
  opacity: 0.36;
}

.distance-projection-hit {
  fill: transparent;
  pointer-events: all;
}

.distance-projection-point:focus {
  outline: none;
}

.distance-projection-selection-ring {
  fill: rgba(53, 102, 214, 0.12);
  opacity: 0;
  pointer-events: none;
  stroke: rgba(53, 102, 214, 0.82);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.distance-projection-guide {
  opacity: 0;
  stroke: rgba(53, 102, 214, 0.34);
  stroke-dasharray: 4 6;
  vector-effect: non-scaling-stroke;
}

.distance-projection-popovers {
  position: absolute;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  touch-action: pan-y;
}

.distance-projection-popover-hit {
  position: absolute;
  z-index: 1;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: crosshair;
  padding: 0;
  pointer-events: auto;
  margin: -14px 0 0 -14px;
  touch-action: pan-y;
}

.distance-projection-popover-hit:focus {
  outline: none;
}

.distance-projection-popover-hit:focus-visible {
  outline: 2px solid rgba(53, 102, 214, 0.74);
  outline-offset: 2px;
}

.distance-projection-popover-hit:hover,
.distance-projection-popover-hit:focus,
.distance-projection-popover-hit.selected {
  z-index: 220;
}

.distance-projection-popover-hit.align-start .distance-projection-popover {
  transform: translate(-50%, calc(-100% + 5px));
}

.distance-projection-popover-hit.align-end .distance-projection-popover {
  transform: translate(-50%, calc(-100% + 5px));
}

.distance-projection-popover-hit .distance-projection-popover:not(.distance-projection-popover-portal) {
  display: none;
}

.distance-projection-point:hover .distance-projection-dot,
.distance-projection-point:focus-within .distance-projection-dot,
.distance-projection-point.selected .distance-projection-dot {
  opacity: 1;
  fill: var(--blue);
}

.distance-projection-point:hover .distance-projection-selection-ring,
.distance-projection-point:focus-within .distance-projection-selection-ring,
.distance-projection-point.selected .distance-projection-selection-ring {
  opacity: 1;
}

.distance-projection-point.current .distance-projection-dot {
  opacity: 1;
  fill: var(--current-week-deep);
}

.distance-projection-point.current .distance-projection-guide {
  opacity: 0.55;
  stroke: rgba(48, 75, 92, 0.34);
}

.distance-projection-point:hover .distance-projection-guide,
.distance-projection-point:focus-within .distance-projection-guide,
.distance-projection-point.selected .distance-projection-guide {
  opacity: 1;
}

.distance-projection-point.selected .distance-projection-guide {
  stroke: rgba(53, 102, 214, 0.78);
  stroke-dasharray: none;
  stroke-width: 5;
}

.distance-projection-scale {
  position: relative;
  display: block;
  min-height: 18px;
  color: rgba(102, 112, 133, 0.58);
  font-size: 0.76rem;
  font-weight: 820;
  text-transform: uppercase;
}

.distance-projection-scale span {
  position: absolute;
  top: 0;
  white-space: nowrap;
}

.distance-projection-scale-start {
  left: 0;
}

.distance-projection-scale-end {
  right: 0;
}

.distance-projection-slider,
.distance-projection-slider input {
  width: 100%;
}

.distance-projection-slider {
  display: none;
}

.distance-projection-slider input {
  accent-color: var(--green);
  min-height: 36px;
  margin: 0;
  cursor: pointer;
}

.distance-projection-slider input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

.distance-projection-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(47, 128, 98, 0.34), rgba(53, 102, 214, 0.26));
  box-shadow: inset 0 0 0 1px rgba(96, 121, 138, 0.16);
}

.distance-projection-slider input[type="range"]::-moz-range-track {
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(47, 128, 98, 0.34), rgba(53, 102, 214, 0.26));
  box-shadow: inset 0 0 0 1px rgba(96, 121, 138, 0.16);
}

.distance-projection-slider input[type="range"]::-webkit-slider-thumb {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(24, 33, 47, 0.24);
  -webkit-appearance: none;
  margin-top: -11px;
}

.distance-projection-slider input[type="range"]::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(24, 33, 47, 0.24);
}

.distance-projection-slider input:disabled {
  opacity: 0.38;
}

.distance-projection.compact {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding-inline: 0;
  opacity: 0.92;
}

.distance-projection.compact .distance-projection-chart {
  min-height: 76px;
  max-height: 92px;
}

.distance-projection.compact .distance-projection-grid text {
  font-size: 10px;
}

.distance-projection.compact .distance-projection-line {
  stroke-width: 3;
}

.distance-projection.compact .distance-projection-dot {
  r: 2.4px;
}

.distance-projection.compact .distance-projection-scale {
  min-height: 14px;
  font-size: 0.58rem;
}

.distance-projection.compact .distance-projection-scroll {
  gap: 4px;
}
