/* Runner Route Explorer (runner-route-explorer.html only) */

html:has(body.runner-route-page) {
  background-color: #0a0a0a;
}

.runner-route-page {
  --color-body-text: #f4f4f4;
  --color-text: #f4f4f4;
  --color-text-muted: #a3a3a3;
  --color-bg: #0a0a0a;
  --color-bg-elevated: #111111;
  --color-border: #2a2a2a;
  --color-accent: #40aeff;
  --color-header-bg: #0a0a0a;
  --color-footer-bg: #0a0a0a;
  --color-footer-text: #f4f4f4;
  --rre-black: #0a0a0a;
  --rre-lime: #40aeff;
  --rre-lime-ink: #111111;
  --rre-panel-bg: #111111;
  --rre-pill: var(--rre-lime);
  --rre-button: var(--rre-lime);
  --rre-button-text: var(--rre-lime-ink);
  color: var(--color-body-text);
  color-scheme: dark;
}

.runner-route-page,
.runner-route-page .site,
.runner-route-page .site-content,
.runner-route-page .site-main,
.runner-route-page .site-footer {
  background-color: #0a0a0a;
}

.runner-route-page .site-content {
  margin-left: 0;
}

.runner-route-page .site-main__inner,
.runner-route-page .site-content .site-main {
  padding: 0;
}

.rre-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 2rem 1.25rem 4rem;
  box-sizing: border-box;
  overflow-x: hidden;
}

.rre-app {
  display: grid;
  grid-template-columns: minmax(22.5rem, 26.25rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  max-width: 92rem;
  margin: 0 auto;
  min-width: 0;
}

.rre-panel {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1.5rem 1.35rem 1.4rem;
  background: var(--rre-panel-bg);
  border: 1px solid #2c2c2c;
  border-radius: 1.35rem;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.rre-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.rre-panel__heading {
  min-width: 0;
}

.rre-panel__eyebrow {
  margin: 0 0 0.4rem;
  max-width: none;
  font-size: 0.68rem;
  font-weight: var(--weight-medium);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rre-lime);
}

.rre-panel__title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: var(--weight-medium);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.rre-panel__icon {
  flex-shrink: 0;
  display: inline-flex;
  color: var(--rre-lime);
  margin-top: 0.15rem;
}

.rre-panel__icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.rre-controls {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  margin: 0;
  padding: 0;
  border: none;
}

.rre-field,
.rre-fieldset {
  margin: 0;
  padding: 0;
  border: none;
  min-width: 0;
}

.rre-field__label {
  display: block;
  margin: 0 0 0.55rem;
  padding: 0;
  max-width: none;
  font-size: 0.82rem;
  font-weight: var(--weight-regular);
  line-height: 1.35;
  letter-spacing: 0;
  color: #9a9a9a;
}

.rre-start-select {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.rre-start__icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--rre-lime);
}

.rre-start__icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.rre-start-select select {
  flex: 1;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0.55rem 1.75rem 0.55rem 0.15rem;
  border: none;
  border-radius: 0;
  background-color: transparent;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%2340aeff' d='M1.2.8L6 5.6 10.8.8 12 2 6 8 0 2z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.15rem center;
  background-size: 0.7rem;
  color: #f2f2f2;
  font-family: var(--font-family);
  font-size: 0.92rem;
  font-weight: var(--weight-medium);
  line-height: 1.35;
  cursor: pointer;
}

.rre-start-select select:focus-visible {
  outline: 2px solid var(--rre-lime);
  outline-offset: 3px;
}

.rre-start-select option {
  color: #f4f4f4;
  background: #111111;
}

.rre-pace__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}

.rre-pace__header .rre-field__label {
  margin: 0;
}

.rre-pace__value {
  flex-shrink: 0;
  font-size: 0.92rem;
  font-weight: var(--weight-medium);
  line-height: 1.35;
  color: #f2f2f2;
  font-variant-numeric: tabular-nums;
}

.rre-pace input[type="range"] {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0;
  background: transparent;
  accent-color: var(--rre-lime);
  cursor: pointer;
  touch-action: none;
}

.rre-pace input[type="range"]:focus {
  outline: none;
}

.rre-pace input[type="range"]:focus-visible {
  outline: 2px solid var(--rre-lime);
  outline-offset: 3px;
  border-radius: 999px;
}

.rre-pace input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 999px;
  background: #3a3a3a;
}

.rre-pace input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  margin-top: -0.4375rem;
  border: none;
  border-radius: 50%;
  background: var(--rre-lime);
  box-shadow: 0 0 0 2px #111111;
}

.rre-pace input[type="range"]::-moz-range-track {
  height: 2px;
  border: none;
  border-radius: 999px;
  background: #3a3a3a;
}

.rre-pace input[type="range"]::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border: none;
  border-radius: 50%;
  background: var(--rre-lime);
  box-shadow: 0 0 0 2px #111111;
}

.rre-pace__ends {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.72rem;
  line-height: 1.3;
  color: #8d8d8d;
}

.rre-summary__pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.85rem 1rem;
}

.rre-segment {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.2rem;
}

.rre-segment__option {
  position: relative;
  min-width: 0;
}

.rre-segment__option input,
.rre-radio__option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.rre-segment__label {
  display: block;
  padding: 0.62rem 0.4rem;
  font-size: 0.88rem;
  font-weight: var(--weight-regular);
  line-height: 1.25;
  text-align: center;
  color: #d8d8d8;
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.rre-segment--wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.2rem;
}

.rre-segment--wrap .rre-segment__option {
  min-width: 0;
}

.rre-field__hint {
  margin: 0.35rem 0 0.65rem;
  max-width: none;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #8d8d8d;
}

.rre-more {
  margin: 0;
  padding: 0;
  border: 1px solid #2c2c2c;
  border-radius: 0.95rem;
  background: transparent;
}

.rre-more__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.95rem;
  list-style: none;
  cursor: pointer;
  color: #f2f2f2;
  font-size: 0.88rem;
  font-weight: var(--weight-medium);
}

.rre-more__summary::-webkit-details-marker {
  display: none;
}

.rre-more__summary::after {
  content: "+";
  color: #8d8d8d;
  font-weight: var(--weight-regular);
}

.rre-more[open] .rre-more__summary::after {
  content: "–";
}

.rre-more__summary:focus-visible {
  outline: 2px solid var(--rre-lime);
  outline-offset: 3px;
  border-radius: 0.95rem;
}

.rre-more__title {
  min-width: 0;
}

.rre-more__active {
  margin-left: auto;
  margin-right: 0.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--rre-lime);
  color: var(--rre-lime-ink);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rre-more__body {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding: 0 0.95rem 1rem;
}

.rre-budget-hint {
  margin: 0;
  max-width: none;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--rre-lime);
}

.rre-segment__option input:checked + .rre-segment__label {
  background: var(--rre-lime);
  color: var(--rre-lime-ink);
  font-weight: var(--weight-medium);
}

.rre-segment__option input:focus-visible + .rre-segment__label,
.rre-radio__option input:focus-visible + .rre-radio__label {
  outline: 2px solid var(--rre-lime);
  outline-offset: 3px;
}

.rre-radio {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.rre-radio__option {
  position: relative;
}

.rre-radio__label {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #f2f2f2;
  cursor: pointer;
}

.rre-radio__mark {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.12rem;
  border: 1.5px solid #6f6f6f;
  border-radius: 50%;
  box-sizing: border-box;
  display: grid;
  place-items: center;
}

.rre-radio__mark::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--rre-lime);
  transform: scale(0);
  transition: transform 0.12s ease;
}

.rre-radio__option input:checked + .rre-radio__label .rre-radio__mark {
  border-color: var(--rre-lime);
}

.rre-radio__option input:checked + .rre-radio__label .rre-radio__mark::after {
  transform: scale(1);
}

.rre-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 3rem;
  margin-top: 0.35rem;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: 999px;
  background: var(--rre-button);
  color: var(--rre-button-text);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: var(--weight-medium);
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.rre-submit svg {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.rre-submit:hover:not(:disabled) {
  background: #66beff;
}

.rre-submit:focus-visible {
  outline: 2px solid var(--rre-lime);
  outline-offset: 3px;
}

.rre-submit:disabled {
  opacity: 0.62;
  cursor: wait;
}

.rre-results {
  scroll-margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  container-type: inline-size;
}

.rre-stale,
.rre-range,
.rre-compare-note {
  margin: 0;
  max-width: none;
  padding: 0.7rem 0.9rem;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: #d8d8d8;
  background: #141414;
  border: 1px solid #2c2c2c;
  border-radius: 0.8rem;
}

.rre-stale {
  border-color: var(--rre-lime);
  color: var(--rre-lime);
}

.rre-rank {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
}

.rre-rank[hidden] {
  display: none;
}

.rre-rank__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: var(--weight-medium);
  line-height: 1.3;
  color: #f2f2f2;
}

.rre-pace--results {
  margin: 0;
  padding: 0.15rem 0 0;
  border-top: 1px solid #2c2c2c;
}

.rre-pace--results[hidden] {
  display: none;
}

.rre-pace__times {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}

.rre-pace__times li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #bdbdbd;
}

.rre-pace__times strong {
  font-weight: var(--weight-medium);
  color: #f2f2f2;
}

.rre-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  min-width: 0;
}

@container (min-width: 42rem) {
  .rre-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.rre-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: 100%;
  margin: 0;
  padding: 0.95rem 1rem 1rem;
  text-align: left;
  color: #f2f2f2;
  background: #111111;
  border: 1px solid #2c2c2c;
  border-radius: 1rem;
  cursor: pointer;
  font-family: var(--font-family);
}

.rre-card[aria-pressed="true"] {
  border-color: var(--card-color, #0ad62e);
  box-shadow: inset 3px 0 0 var(--card-color, #0ad62e);
}

.rre-card:focus-visible {
  outline: 2px solid var(--rre-lime);
  outline-offset: 3px;
}

.rre-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.rre-card__swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--card-color, #0ad62e);
  flex-shrink: 0;
}

.rre-card__name {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: var(--weight-medium);
  line-height: 1.3;
}

.rre-card__badge {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #111111;
  background: var(--card-color, #0ad62e);
  border-radius: 999px;
  padding: 0.12rem 0.4rem;
}

.rre-card__badge--view {
  color: var(--rre-lime);
  background: transparent;
  border: 1px solid var(--rre-lime);
}

.rre-card__distance {
  font-size: 1.45rem;
  font-weight: var(--weight-medium);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.rre-card__stats {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.75rem;
}

.rre-card__stats div {
  min-width: 0;
}

.rre-card__stats dt {
  margin: 0;
  max-width: none;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8d8d8d;
}

.rre-card__stats dd {
  margin: 0.12rem 0 0;
  font-size: 0.86rem;
  line-height: 1.3;
  color: #f2f2f2;
  font-variant-numeric: tabular-nums;
}

.rre-card__over {
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ef9a9a;
}

@media (max-width: 63.99rem) {
  .rre-cards {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0.7rem;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .rre-card {
    flex: 0 0 min(18.5rem, 82vw);
    scroll-snap-align: start;
  }
}

.rre-map-wrap {
  position: relative;
  min-width: 0;
  min-height: clamp(22rem, 58vh, 40rem);
  border: 1px solid #2c2c2c;
  border-radius: 1.35rem;
  background: #141414;
  overflow: hidden;
}

.rre-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.rre-map-status {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 2;
  max-width: calc(100% - 1.5rem);
  padding: 0.5rem 0.75rem;
  font-size: var(--text-sm);
  line-height: 1.35;
  color: var(--color-body-text);
  background: rgba(20, 20, 20, 0.94);
  border: 1px solid var(--color-border);
  border-radius: 0.65rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.rre-map-status[data-tone="loading"] {
  color: var(--color-text-muted);
}

.rre-map-status[data-tone="unavailable"] {
  border-color: var(--color-border);
}

.rre-map-status[data-tone="error"] {
  border-color: #ef9a9a;
  color: #ef9a9a;
}

.rre-map-status[data-tone="ready"] {
  border-color: var(--color-accent);
}

.rre-summary__list {
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.rre-summary__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem;
}

.rre-summary__row dt {
  margin: 0;
  max-width: none;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.rre-summary__row dd {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--color-body-text);
}

.rre-explain {
  display: grid;
  gap: 0.85rem 1.5rem;
  margin: 0;
}

.rre-explain[hidden] {
  display: none;
}

@container (min-width: 42rem) {
  .rre-explain {
    grid-template-columns: 1fr 1fr;
  }
}

.rre-explain__block h3 {
  margin: 0 0 0.3rem;
  font-size: 0.68rem;
  font-weight: var(--weight-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8d8d8d;
}

.rre-explain__block p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: #e4e4e4;
}

.rre-summary__empty {
  margin: 0;
  max-width: none;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text-muted);
}

@media (max-width: 63.99rem) {
  .rre-app {
    grid-template-columns: 1fr;
  }

  .rre-panel {
    position: static;
    max-height: none;
    max-width: 31.25rem;
    margin: 0 auto;
  }

  .rre-map-wrap {
    min-height: clamp(18rem, 48vh, 28rem);
  }
}

@media (max-width: 47.99rem) {
  .rre-page {
    padding: 2rem 0.9rem 4rem;
  }

  .rre-panel {
    padding: 1.45rem 1.2rem 1.3rem;
    max-width: none;
  }

  .rre-panel__title {
    font-size: 1.45rem;
  }

  .rre-segment__label,
  .rre-radio__label,
  .rre-submit {
    min-height: 2.75rem;
  }

  .rre-radio__label {
    align-items: center;
  }

  .rre-radio__mark {
    margin-top: 0;
  }

  .rre-pace input[type="range"] {
    padding: 0.85rem 0;
  }

  .rre-pace input[type="range"]::-webkit-slider-thumb {
    width: 1.2rem;
    height: 1.2rem;
    margin-top: -0.55rem;
  }

  .rre-pace input[type="range"]::-moz-range-thumb {
    width: 1.2rem;
    height: 1.2rem;
  }
}
