.tour-route-section {
  --route-ink: #123c35;
  --route-deep: #0d332e;
  --route-moss: #176557;
  --route-gold: #e6ad3e;
  --route-paper: #f5f0e6;
  position: relative;
  padding: clamp(4.5rem, 8vw, 8rem) 0;
  overflow: hidden;
  color: var(--route-ink);
  background:
    radial-gradient(circle at 84% 3%, rgba(230, 173, 62, .2), transparent 25rem),
    linear-gradient(155deg, #f8f4eb 0%, #eee7da 100%);
}

.tour-route-section::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: .28;
  background-image: repeating-linear-gradient(135deg, transparent 0 22px, rgba(18, 60, 53, .035) 22px 23px);
}

.tour-route-section > * {
  position: relative;
  width: min(1180px, calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
}

.tour-route-heading {
  display: flex;
  gap: 2.5rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.tour-route-eyebrow,
.tour-route-kicker {
  margin: 0 0 .65rem;
  color: #a97114;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .16em;
}

.tour-route-heading h2 {
  max-width: 760px;
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.8rem, 5.5vw, 5.3rem);
  line-height: .9;
  letter-spacing: -.045em;
}

.tour-route-heading p:not(.tour-route-eyebrow) {
  max-width: 640px;
  margin: 1rem 0 0;
  color: #55716b;
}

.tour-route-section .tour-route-download {
  display: grid;
  grid-template-columns: 44px 1fr;
  min-width: 285px;
  padding: 1rem 1.15rem;
  color: #fff;
  background: var(--route-moss);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 1.15rem;
  box-shadow: 0 18px 40px rgba(13, 51, 46, .2);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.tour-route-section .tour-route-download:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 24px 48px rgba(13, 51, 46, .26);
}

.tour-route-download > span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--route-deep);
  font-size: 1.3rem;
  background: var(--route-gold);
  border-radius: 50%;
}

.tour-route-download strong {
  color: #fff;
  font-size: .86rem;
  line-height: 1.2;
}

.tour-route-download small {
  margin-top: .2rem;
  color: rgba(255, 255, 255, .7);
  font-size: .62rem;
}

.tour-route-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(340px, .78fr);
  min-height: 720px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(18, 60, 53, .1);
  border-radius: 1.75rem;
  box-shadow: 0 35px 90px rgba(24, 55, 46, .16);
}

.tour-route-fullscreen {
  position: absolute;
  z-index: 4;
  top: 1rem;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 38px;
  padding: .55rem .75rem;
  color: #fff;
  font: inherit;
  font-size: .68rem;
  font-weight: 850;
  background: rgba(13, 51, 46, .88);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: .75rem;
  box-shadow: 0 8px 22px rgba(8, 35, 30, .22);
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.tour-route-fullscreen:hover { background: var(--route-moss); }
.tour-route-fullscreen > span:first-child { font-size: 1.2rem; line-height: 1; }

.tour-route-shell:fullscreen {
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  grid-template-columns: minmax(0, 1.7fr) minmax(340px, .65fr);
  border: 0;
  border-radius: 0;
}

.tour-route-shell:fullscreen .tour-route-map { min-height: 0; }
.tour-route-shell:fullscreen .tour-route-panel { max-height: 100dvh; }
.tour-route-map {
  z-index: 1;
  min-height: 720px;
  background: #dce7df;
}

.tour-route-panel {
  position: relative;
  z-index: 2;
  padding: 1.4rem;
  overflow: auto;
  background: rgba(255, 253, 248, .98);
  box-shadow: -20px 0 60px rgba(18, 60, 53, .08);
}

.tour-route-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
}

.tour-route-stats > div {
  padding: .9rem;
  background: #f1ede4;
  border: 1px solid rgba(18, 60, 53, .07);
  border-radius: .9rem;
}

.tour-route-stats strong,
.tour-route-stats span {
  display: block;
}

.tour-route-stats strong {
  color: var(--route-deep);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.65rem;
  line-height: 1;
}

.tour-route-stats span {
  margin-top: .35rem;
  color: #72827e;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.tour-route-elevation,
.tour-route-live,
.tour-route-strava,
.tour-route-history {
  margin-top: .8rem;
  padding: 1rem;
  border: 1px solid rgba(18, 60, 53, .1);
  border-radius: 1rem;
}

.tour-route-elevation > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #55716b;
  font-size: .67rem;
}

.tour-route-elevation canvas {
  display: block;
  width: 100%;
  height: 128px;
  margin-top: .35rem;
}

.tour-route-live {
  color: #fff;
  background:
    radial-gradient(circle at 100% 0, rgba(230, 173, 62, .25), transparent 13rem),
    var(--route-deep);
  border-color: rgba(255, 255, 255, .08);
}

.tour-route-live h3 {
  margin: 0;
  color: #fff;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.9rem;
}

.tour-route-live-copy {
  margin: .35rem 0 .85rem;
  color: rgba(255, 255, 255, .65);
  font-size: .7rem;
  line-height: 1.55;
}

.tour-route-live-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
}

.tour-route-live-metrics span {
  padding: .55rem .65rem;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: .65rem;
}

.tour-route-live-metrics strong,
.tour-route-live-metrics small {
  display: block;
}

.tour-route-live-metrics strong {
  font-size: .78rem;
}

.tour-route-live-metrics small {
  margin-top: .15rem;
  color: rgba(255, 255, 255, .55);
  font-size: .56rem;
}

.tour-route-actions {
  display: flex;
  gap: .45rem;
  margin-top: .75rem;
}

.tour-route-actions button,
.tour-track-history__actions button {
  min-height: 38px;
  padding: .55rem .75rem;
  color: var(--route-deep);
  font-size: .64rem;
  font-weight: 900;
  cursor: pointer;
  background: #fff;
  border: 0;
  border-radius: .65rem;
}

.tour-route-actions .button-primary {
  background: var(--route-gold);
}

.tour-route-status {
  min-height: 1.1rem;
  margin: .65rem 0 0;
  color: rgba(255, 255, 255, .68);
  font-size: .62rem;
  line-height: 1.45;
}

.tour-route-status[data-tone="warning"] { color: #ffd37c; }
.tour-route-status[data-tone="danger"] { color: #ff9d8d; }
.tour-route-status[data-tone="success"] { color: #9ee7c9; }

.tour-route-strava {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: .75rem;
  align-items: start;
  background: #fff;
}

.strava-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
  background: #fc4c02;
  border-radius: .8rem;
}

.tour-route-strava strong,
.tour-route-strava p,
.tour-route-strava small {
  display: block;
}

.tour-route-strava p {
  margin: .18rem 0 .45rem;
  color: #62746f;
  font-size: .66rem;
  line-height: 1.5;
}

.tour-route-strava small { color: #84918e; font-size: .58rem; }
.tour-route-strava a,
.tour-route-strava .strava-device-action { padding: 0; color: #d93d00; font: inherit; font-size: .66rem; font-weight: 900; cursor: pointer; background: transparent; border: 0; }
.tour-route-strava .strava-disconnect { display: inline-block; margin-top: .45rem; color: #7b8582; font-size: .58rem; }

.tour-route-history {
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.tour-route-history summary {
  padding: .9rem 1rem;
  color: var(--route-deep);
  font-size: .69rem;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.tour-route-history summary::-webkit-details-marker { display: none; }
.tour-route-history [data-track-history] { padding: 0 1rem .8rem; }
.tour-route-history [data-track-history] > p { color: #74827e; font-size: .65rem; }
.tour-route-history article { padding: .75rem 0; border-top: 1px solid #ece8df; }
.tour-route-history article > div:first-child { display: flex; justify-content: space-between; gap: .5rem; font-size: .65rem; }
.tour-route-history article span { color: #71807c; }
.tour-track-history__actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.tour-track-history__actions button { min-height: 32px; color: #fff; background: var(--route-moss); }
.tour-track-history__actions .is-strava { background: #fc4c02; }
.tour-track-history__actions .is-delete { color: #8a4438; background: #f3e8e4; }

.tour-route-missing {
  padding: 2rem;
  background: #fff;
  border: 1px solid rgba(18, 60, 53, .12);
  border-left: 6px solid var(--route-gold);
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(24, 55, 46, .1);
}

.tour-route-missing strong { font-size: 1.1rem; }
.tour-route-missing p { max-width: 760px; margin: .45rem 0 0; color: #62746f; }

.route-pin {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  font-size: .65rem;
  font-weight: 900;
  background: var(--route-deep);
  border: 4px solid #fff;
  border-radius: 50% 50% 50% 8px;
  box-shadow: 0 8px 22px rgba(13, 51, 46, .35);
  transform: rotate(-45deg);
}

.route-pin span { transform: rotate(45deg); }
.route-pin--finish { color: var(--route-deep); background: var(--route-gold); }
.tour-route-map .leaflet-control-attribution { font-size: 8px; }
.tour-route-map .leaflet-control-zoom a { color: var(--route-deep); }

@media (max-width: 940px) {
  .tour-route-heading { align-items: stretch; flex-direction: column; gap: 1.25rem; }
  .tour-route-download { min-width: 0; width: min(100%, 390px); }
  .tour-route-shell { grid-template-columns: 1fr; min-height: 0; }
  .tour-route-map { min-height: min(62svh, 560px); }
  .tour-route-panel { overflow: visible; box-shadow: 0 -20px 50px rgba(18, 60, 53, .1); }
}

@media (max-width: 600px) {
  .tour-route-section { padding: 2rem 0; }
  .tour-route-section > * { width: min(100% - 24px, 1180px); }
  .tour-route-heading { gap: .75rem; margin-bottom: 1rem; }
  .tour-route-heading h2 { font-size: clamp(2rem, 10vw, 3rem); }
  .tour-route-heading p:not(.tour-route-eyebrow) { font-size: .8rem; }
  .tour-route-shell { border-radius: 1.15rem; }
  .tour-route-map { min-height: 52svh; }
  .tour-route-panel { padding: .8rem; }
  .tour-route-stats > div { padding: .75rem; }
  .tour-route-stats strong { font-size: 1.35rem; }
  .tour-route-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .tour-route-actions button:first-child { grid-column: 1 / -1; }
  .tour-route-actions button { min-height: 44px; }
  .tour-route-live { padding: .9rem; }
  .tour-route-history article > div:first-child { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .tour-route-download { transition: none; }
}
