:root {
  color-scheme: dark;
  --ink: #fff7f0;
  --muted: #dfb7cf;
  --subtle: #ad7898;
  --night: #150718;
  --night-2: #2d0a25;
  --glass: rgba(37, 8, 29, 0.87);
  --glass-soft: rgba(70, 16, 50, 0.75);
  --line: rgba(255, 124, 183, 0.2);
  --lime: #ffad4d;
  --lime-2: #ff6b3d;
  --orange: #f04437;
  --cyan: #9b5cff;
  --pink: #ff4f9a;
  --purple: #9857ff;
  --shadow: 0 22px 64px rgba(31, 3, 35, 0.52);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "Noto Sans Thai", "Noto Sans SC", "Noto Sans JP", "Leelawadee UI", Tahoma, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--night);
  color: var(--ink);
}

button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.route-app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 540px;
  isolation: isolate;
  background:
    radial-gradient(circle at 14% 8%, #4f1d70 0, transparent 36%),
    radial-gradient(circle at 72% 5%, #7a213d 0, #3d1028 32%, var(--night) 70%);
}

#map { position: absolute; inset: 0; background: #2f1028; }

.map-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 13% 10%, rgba(137, 65, 255, .3) 0, transparent 38%),
    radial-gradient(circle at 76% 13%, rgba(255, 63, 151, .24) 0, transparent 37%),
    radial-gradient(circle at 54% 5%, rgba(255, 102, 37, .25) 0, rgba(255, 84, 34, .07) 30%, transparent 48%),
    linear-gradient(180deg, rgba(35, 5, 30, 0.75) 0, transparent 24%, transparent 58%, rgba(35, 5, 30, 0.72) 100%),
    linear-gradient(90deg, rgba(41, 5, 38, 0.5) 0, transparent 30%, transparent 68%, rgba(65, 8, 42, 0.2) 100%);
}

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
}

.route-header {
  position: absolute;
  z-index: 4;
  top: calc(24px + var(--safe-top));
  left: 26px;
  display: flex;
  gap: 14px;
  align-items: center;
  max-width: calc(100% - 410px);
  text-shadow: 0 2px 18px rgba(0,0,0,.5);
}

.brand-mark {
  width: 74px;
  height: 62px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 4px;
  border: 1px solid rgba(255, 79, 154, .38);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(74, 15, 55, .88), rgba(40, 8, 35, .82));
  box-shadow: 0 12px 32px rgba(0,0,0,.28), 0 0 24px rgba(152,87,255,.16);
}

.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 7px rgba(255,45,87,.42)); }

.brand-copy { min-width: 0; }

.brand-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
}

.brand-topline .eyebrow { margin: 0; white-space: nowrap; }

.language-control {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 0 5px 0 7px;
  border: 1px solid rgba(255, 124, 183, .3);
  border-radius: 999px;
  color: #fff4f9;
  background: rgba(37, 8, 29, .76);
  box-shadow: 0 7px 20px rgba(23, 2, 25, .22);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  backdrop-filter: blur(12px) saturate(130%);
}

.language-control svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: #ff9bc8;
  stroke-width: 1.4;
}

.language-control select {
  width: 76px;
  min-width: 0;
  border: 0;
  outline: 0;
  color: inherit;
  background: transparent;
  font-size: .68rem;
  font-weight: 760;
  cursor: pointer;
}

.language-control option { color: #fff; background: #2d0a25; }

.partner-logos {
  position: absolute;
  z-index: 4;
  top: calc(122px + var(--safe-top));
  left: 26px;
  display: flex;
  gap: 9px;
  align-items: center;
  height: 57px;
  padding: 5px 9px;
  border: 1px solid rgba(255,124,183,.16);
  border-radius: 15px;
  background: rgba(28,6,24,.54);
  box-shadow: 0 12px 30px rgba(15,2,18,.24);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  backdrop-filter: blur(12px) saturate(120%);
}

.partner-logos img {
  display: block;
  width: auto;
  height: 45px;
  object-fit: contain;
  filter: drop-shadow(0 3px 7px rgba(0,0,0,.36));
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 3px;
  color: #ff86bd;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
}

.eyebrow span { width: 16px; height: 2px; border-radius: 99px; background: linear-gradient(90deg, var(--orange), var(--pink)); }

h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.3rem); line-height: 1.08; letter-spacing: -.035em; }
.route-date { margin: 6px 0 0; color: rgba(255,255,255,.78); font-size: .86rem; }

.summary-card {
  position: absolute;
  z-index: 4;
  top: calc(22px + var(--safe-top));
  right: 24px;
  width: 348px;
  padding: 17px;
  border-radius: 22px;
}

.summary-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 13px; }
.summary-heading p { margin: 0 0 1px; color: var(--muted); font-size: .78rem; }
.summary-heading strong { font-size: 1rem; font-weight: 680; }
.gpx-download {
  height: 32px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid rgba(255,173,77,.46);
  border-radius: 999px;
  color: #fff8f2;
  background: linear-gradient(135deg, rgba(240,68,55,.94), rgba(255,79,154,.92) 57%, rgba(152,87,255,.9));
  box-shadow: 0 7px 20px rgba(255,55,121,.22);
  font-size: .61rem;
  font-weight: 850;
  letter-spacing: .045em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: filter .2s, transform .2s;
}
.gpx-download:hover { filter: brightness(1.1); transform: translateY(-1px); }
.gpx-download:active { transform: translateY(0) scale(.97); }
.gpx-download svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.stat { min-width: 0; padding: 9px 9px 8px; border-radius: 13px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.06); }
.stat.primary { background: linear-gradient(145deg, rgba(255,107,61,.14), rgba(255,79,154,.12)); border-color: rgba(255,103,104,.2); }
.stat span { display: block; overflow: hidden; color: var(--muted); font-size: .7rem; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.stat strong { display: inline-block; margin-top: 4px; font-size: 1.28rem; line-height: 1; font-variant-numeric: tabular-nums; }
.stat small { margin-left: 3px; color: var(--subtle); font-size: .65rem; }
.stat.primary strong { color: var(--lime); }

.data-note { display: flex; gap: 7px; align-items: flex-start; margin: 11px 1px 0; color: #bd8fab; font-size: .68rem; line-height: 1.45; }
.data-note svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.5; }

.map-tools {
  position: absolute;
  z-index: 5;
  top: calc(246px + var(--safe-top));
  right: 24px;
  display: grid;
  gap: 5px;
  padding: 5px;
  border-radius: 16px;
}

.tool-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 11px;
  color: #d4ddd8;
  background: transparent;
  cursor: pointer;
  transition: color .2s, background .2s, transform .2s;
}
.tool-button:hover { color: #fff; background: rgba(255,255,255,.09); }
.tool-button:active { transform: scale(.94); }
.tool-button.active { color: var(--night); background: linear-gradient(145deg, var(--lime), #ff7b55); }
.tool-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tool-button span { font-size: .75rem; font-weight: 900; letter-spacing: -.02em; }

.player-card {
  position: absolute;
  z-index: 4;
  left: 24px;
  right: 24px;
  bottom: calc(22px + var(--safe-bottom));
  min-height: 204px;
  padding: 15px 17px 14px;
  border-radius: 24px;
}

.live-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 7px; }
.live-title { display: flex; align-items: center; gap: 9px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 5px rgba(255,79,154,.13), 0 0 18px rgba(152,87,255,.68); }
.live-title small, .live-metrics span { display: block; color: var(--muted); font-size: .7rem; }
.live-title strong { display: block; margin-top: 1px; font-size: 1.03rem; font-variant-numeric: tabular-nums; }
.live-metrics { display: flex; align-items: center; gap: clamp(20px, 4vw, 56px); text-align: right; }
.live-metrics strong { display: block; margin-top: 1px; font-size: .92rem; font-variant-numeric: tabular-nums; }

.profile-wrap { position: relative; height: 80px; margin: 0 -2px; cursor: crosshair; touch-action: pan-y; }
.profile-title { position: absolute; top: 1px; left: 3px; right: 3px; z-index: 1; display: flex; justify-content: space-between; color: var(--muted); font-size: .69rem; pointer-events: none; }
.profile-title small { color: #bd8aa8; }
#elevationChart { position: absolute; inset: 0; width: 100%; height: 100%; }
.profile-distance { position: absolute; bottom: 0; left: 3px; right: 3px; display: flex; justify-content: space-between; color: #9f6d8d; font-size: .62rem; pointer-events: none; }

.controls-row { display: flex; align-items: center; gap: 10px; min-width: 0; margin-top: 4px; }
.round-button { flex: 0 0 auto; width: 43px; height: 43px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; color: #e8eeeb; background: rgba(255,255,255,.06); cursor: pointer; }
.round-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.round-button:hover { background: rgba(255,255,255,.11); }
.play-button { width: 49px; height: 49px; color: #26081e; background: linear-gradient(145deg, var(--lime), var(--orange) 58%, var(--pink)); border-color: rgba(255,173,77,.7); box-shadow: 0 8px 24px rgba(255,61,117,.34); }
.play-button:hover { filter: brightness(1.1); }
.play-button .play-icon { display: block; fill: currentColor; stroke: none; margin-left: 2px; }
.play-button .pause-icon { display: none; }
.play-button.playing .play-icon { display: none; }
.play-button.playing .pause-icon { display: block; }

.timeline-group { min-width: 120px; flex: 1 1 auto; }
input[type="range"] { width: 100%; height: 18px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--orange) 0, var(--pink) var(--progress, 0%), rgba(255,255,255,.15) var(--progress, 0%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 99px; background: rgba(255,255,255,.15); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--orange), var(--pink)); }
input[type="range"]::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -6px; appearance: none; -webkit-appearance: none; border: 4px solid var(--night-2); border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 1px rgba(255,79,154,.58); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 4px solid var(--night-2); border-radius: 50%; background: var(--pink); }
.timeline-labels { display: flex; justify-content: space-between; color: var(--subtle); font-size: .63rem; font-variant-numeric: tabular-nums; }

.pill-button {
  height: 38px;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.05);
  font-size: .75rem;
  cursor: pointer;
}
.pill-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.pill-button.active { color: #ff91c2; border-color: rgba(255,79,154,.38); background: linear-gradient(135deg, rgba(255,79,154,.12), rgba(152,87,255,.11)); }

.speed-control { display: flex; align-items: center; gap: 8px; }
.speed-control > span { color: var(--subtle); font-size: .67rem; }
.speed-buttons { display: flex; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.06); }
.speed-buttons button { min-width: 38px; height: 31px; padding: 0 8px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-size: .68rem; font-weight: 700; cursor: pointer; }
.speed-buttons button.active { color: #26081e; background: linear-gradient(135deg, var(--lime), var(--pink)); }

.status-card {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  display: flex;
  gap: 13px;
  align-items: center;
  min-width: 275px;
  padding: 16px 18px;
  border-radius: 18px;
  transform: translate(-50%, -50%);
  transition: opacity .35s, transform .35s;
}
.status-card.hidden { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); pointer-events: none; }
.status-card strong, .status-card small { display: block; }
.status-card strong { font-size: .93rem; }
.status-card small { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.spinner { width: 24px; height: 24px; flex: 0 0 auto; border: 2px solid rgba(255,255,255,.14); border-top-color: var(--pink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-card { border-color: rgba(255,116,74,.32); }
.error-card > svg { width: 25px; fill: none; stroke: var(--orange); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.course-point-toast {
  position: absolute;
  z-index: 9;
  top: 48%;
  left: 50%;
  display: flex;
  gap: 13px;
  align-items: center;
  width: min(365px, calc(100% - 32px));
  padding: 14px 16px;
  border: 1px solid rgba(255,173,77,.5);
  border-radius: 20px;
  opacity: 0;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(53,10,38,.97), rgba(35,8,42,.97));
  box-shadow: 0 26px 76px rgba(0,0,0,.56), 0 0 38px rgba(255,79,154,.22);
  transform: translate(-50%, calc(-50% + 18px)) scale(.92);
  pointer-events: none;
  transition: opacity .28s ease, transform .42s cubic-bezier(.2,.85,.25,1.18);
}
.course-point-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.course-point-toast::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); pointer-events: none; }
.course-point-toast[data-kind="checkpoint"] { border-color: rgba(185,92,255,.56); }
.course-point-toast-icon { width: 54px; height: 54px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 17px; color: #2b0a21; background: linear-gradient(145deg, var(--lime), var(--orange) 62%, var(--pink)); box-shadow: 0 9px 25px rgba(255,76,119,.34); }
.course-point-toast[data-kind="checkpoint"] .course-point-toast-icon { color: #fff; background: linear-gradient(145deg, var(--purple), var(--pink)); }
.course-point-toast-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.course-point-toast-copy { min-width: 0; }
.course-point-toast-copy span, .course-point-toast-copy strong, .course-point-toast-copy small { display: block; }
.course-point-toast-copy > span { margin-bottom: 3px; color: var(--lime); font-size: .67rem; font-weight: 900; letter-spacing: .09em; }
.course-point-toast[data-kind="checkpoint"] .course-point-toast-copy > span { color: #d8a8ff; }
.course-point-toast-copy strong { font-size: 1.04rem; line-height: 1.3; }
.course-point-toast-copy small { margin-top: 2px; color: var(--muted); font-size: .74rem; }

.finish-toast {
  position: absolute;
  z-index: 9;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 250px;
  padding: 19px 22px;
  border: 1px solid rgba(255,79,154,.45);
  border-radius: 22px;
  opacity: 0;
  color: var(--ink);
  background: rgba(37,8,29,.96);
  box-shadow: 0 28px 80px rgba(0,0,0,.55), 0 0 36px rgba(152,87,255,.22);
  transform: translate(-50%, calc(-50% + 14px)) scale(.94);
  pointer-events: none;
  transition: opacity .35s, transform .35s;
}
.finish-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.finish-toast span { margin-bottom: 5px; color: var(--lime); font-size: .68rem; font-weight: 900; letter-spacing: .22em; }
.finish-toast strong { font-size: 1.12rem; }
.finish-toast small { margin-top: 4px; color: var(--muted); }

.endpoint-marker { position: relative; width: 29px; height: 29px; display: grid; place-items: center; border: 3px solid rgba(37,8,29,.92); border-radius: 10px 10px 10px 3px; color: #23071e; box-shadow: 0 8px 20px rgba(0,0,0,.34); font-size: .69rem; font-weight: 900; transform: rotate(-45deg); }
.endpoint-marker span { transform: rotate(45deg); }
.endpoint-marker.start { background: var(--cyan); }
.endpoint-marker.finish { background: var(--orange); }
.km-marker { display: grid; place-items: center; min-width: 25px; height: 25px; padding: 0 5px; border: 2px solid rgba(37,8,29,.86); border-radius: 999px; color: #26081e; background: rgba(255,242,249,.94); box-shadow: 0 5px 12px rgba(0,0,0,.25); font-size: .62rem; font-weight: 850; }

.course-point-marker { position: relative; width: 40px; height: 48px; pointer-events: auto; }
.course-point-pin { position: absolute; z-index: 2; left: 1px; bottom: 0; width: 38px; height: 38px; display: grid; place-items: center; border: 3px solid rgba(45,8,37,.94); border-radius: 50% 50% 50% 8px; color: #2b0a21; background: linear-gradient(145deg, var(--lime), var(--orange) 62%, var(--pink)); box-shadow: 0 8px 24px rgba(0,0,0,.42), 0 0 18px rgba(255,79,154,.34); transform: rotate(-45deg); transform-origin: center; }
.course-point-pin::before { content: ""; position: absolute; inset: -7px; border: 2px solid rgba(255,173,77,.38); border-radius: 50%; opacity: .72; animation: coursePointPulse 2.2s ease-out infinite; }
.course-point-pin svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transform: rotate(45deg); }
.course-point-marker.checkpoint-only .course-point-pin { color: #fff; background: linear-gradient(145deg, var(--purple), var(--pink)); }
.course-point-marker.checkpoint-only .course-point-pin::before { border-color: rgba(185,92,255,.5); }
.course-point-label { position: absolute; z-index: 1; bottom: 5px; left: 45px; display: block; min-width: 96px; padding: 5px 8px 6px; border: 1px solid rgba(255,173,77,.38); border-radius: 10px; color: #fff8f1; background: rgba(45,8,37,.94); box-shadow: 0 7px 20px rgba(0,0,0,.34); line-height: 1.1; white-space: nowrap; }
.course-point-marker.label-left .course-point-label { right: 45px; left: auto; text-align: right; }
.course-point-label strong, .course-point-label span { display: block; }
.course-point-label strong { color: var(--lime); font-size: .75rem; font-weight: 900; }
.course-point-label span { margin-top: 2px; color: #fff; font-size: .7rem; font-weight: 800; letter-spacing: .025em; }
.course-point-marker.checkpoint-only .course-point-label { border-color: rgba(185,92,255,.45); }
.course-point-marker.checkpoint-only .course-point-label strong { color: #d8a8ff; }
.course-point-marker.arrived .course-point-pin { animation: coursePointArrive .75s cubic-bezier(.2,.9,.25,1.35) both; }
.course-point-marker.arrived .course-point-pin::before { animation: coursePointBurst .9s ease-out 2; }
.course-point-marker.arrived .course-point-label { animation: coursePointLabelArrive .7s ease-out both; }

@keyframes coursePointPulse { 0% { opacity: .7; transform: scale(.72); } 75%, 100% { opacity: 0; transform: scale(1.35); } }
@keyframes coursePointBurst { 0% { opacity: 1; transform: scale(.65); } 100% { opacity: 0; transform: scale(1.75); } }
@keyframes coursePointArrive { 0% { transform: rotate(-45deg) scale(1); } 45% { transform: rotate(-45deg) scale(1.4); } 100% { transform: rotate(-45deg) scale(1.12); } }
@keyframes coursePointLabelArrive { 0% { opacity: .35; filter: brightness(1); } 50% { opacity: 1; filter: brightness(1.5); } 100% { opacity: 1; filter: brightness(1.08); } }

.maplibregl-ctrl-top-right { top: auto; right: 20px; bottom: 252px; }
.maplibregl-ctrl-group { overflow: hidden; border: 1px solid rgba(255,124,183,.2) !important; border-radius: 13px !important; background: rgba(37,8,29,.88) !important; box-shadow: 0 10px 28px rgba(0,0,0,.3) !important; }
.maplibregl-ctrl-group button { width: 39px; height: 39px; filter: invert(1); }
.maplibregl-ctrl-group button + button { border-top-color: rgba(0,0,0,.45); }
.maplibregl-ctrl-attrib { color: #a57494 !important; background: rgba(37,8,29,.72) !important; font-size: 10px !important; }
.maplibregl-ctrl-attrib a { color: #c092ae !important; }
.maplibregl-canvas { outline: none; }

button:focus-visible, input:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
[hidden] { display: none !important; }
noscript { position: fixed; z-index: 20; inset: 20px; display: grid; place-items: center; padding: 20px; color: #fff; background: #150718; }

@media (max-width: 820px) {
  .route-app { min-height: 600px; }
  .map-shade { background: radial-gradient(circle at 16% 7%, rgba(137,65,255,.28) 0, transparent 42%), radial-gradient(circle at 76% 9%, rgba(255,63,151,.22) 0, transparent 40%), radial-gradient(circle at 54% 8%, rgba(255,102,37,.2) 0, transparent 40%), linear-gradient(180deg, rgba(35,5,30,.82) 0, transparent 29%, transparent 52%, rgba(35,5,30,.79) 100%); }
  .route-header { top: calc(13px + var(--safe-top)); left: 14px; max-width: calc(100% - 28px); gap: 10px; }
  .brand-mark { width: 62px; height: 52px; border-radius: 13px; }
  .brand-topline { gap: 6px; margin-bottom: 1px; }
  .language-control { height: 25px; padding: 0 3px 0 6px; }
  .language-control svg { width: 12px; height: 12px; }
  .language-control select { width: 68px; font-size: .59rem; }
  .partner-logos { top: calc(226px + var(--safe-top)); left: 12px; gap: 6px; height: 45px; padding: 4px 7px; border-radius: 12px; }
  .partner-logos img { height: 35px; }
  h1 { font-size: 1.42rem; }
  .eyebrow { font-size: .61rem; }
  .route-date { margin-top: 3px; font-size: .7rem; }
  .summary-card { top: calc(82px + var(--safe-top)); left: 12px; right: 12px; width: auto; padding: 11px 12px; border-radius: 17px; }
  .summary-heading { margin-bottom: 8px; }
  .summary-heading p { font-size: .66rem; }
  .summary-heading strong { font-size: .82rem; }
  .gpx-download { height: 29px; padding: 0 8px; font-size: .55rem; }
  .gpx-download svg { width: 13px; height: 13px; }
  .stats-grid { grid-template-columns: repeat(6, minmax(75px, 1fr)); gap: 6px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
  .stats-grid::-webkit-scrollbar { display: none; }
  .stat { padding: 7px 8px; }
  .stat span { font-size: .62rem; }
  .stat strong { font-size: 1.02rem; }
  .data-note { display: none; }
  .map-tools { top: calc(199px + var(--safe-top)); right: 11px; padding: 4px; border-radius: 14px; }
  .tool-button { width: 38px; height: 38px; border-radius: 10px; }
  .maplibregl-ctrl-top-right { display: none; }
  .player-card { left: 10px; right: 10px; bottom: calc(9px + var(--safe-bottom)); min-height: 213px; padding: 12px; border-radius: 20px; }
  .live-row { align-items: flex-start; margin-bottom: 4px; }
  .live-metrics { gap: 13px; }
  .live-metrics > div:nth-child(2) { display: none; }
  .live-title small, .live-metrics span { font-size: .61rem; }
  .live-title strong, .live-metrics strong { font-size: .82rem; }
  .profile-wrap { height: 73px; }
  .controls-row { display: grid; grid-template-columns: 41px 47px 1fr; gap: 7px; }
  .round-button { width: 41px; height: 41px; }
  .play-button { width: 47px; height: 47px; }
  .timeline-group { min-width: 0; }
  .follow-control { grid-column: 1 / 3; }
  .pill-button { width: 100%; height: 34px; justify-content: center; }
  .speed-control { grid-column: 3; grid-row: 2; justify-content: flex-end; gap: 4px; }
  .speed-control > span { display: none; }
  .speed-buttons button { min-width: 34px; height: 29px; padding: 0 6px; }
  .finish-toast { top: 45%; }
  .course-point-toast { top: 48%; width: min(330px, calc(100% - 28px)); padding: 12px 13px; border-radius: 17px; }
  .course-point-toast-icon { width: 48px; height: 48px; border-radius: 14px; }
  .course-point-toast-icon svg { width: 25px; height: 25px; }
  .course-point-toast-copy > span { font-size: .59rem; }
  .course-point-toast-copy strong { font-size: .91rem; }
  .course-point-toast-copy small { font-size: .66rem; }
  .course-point-marker { width: 35px; height: 43px; }
  .course-point-pin { width: 34px; height: 34px; }
  .course-point-pin svg { width: 18px; height: 18px; }
  .course-point-label { bottom: 4px; left: 40px; min-width: 82px; padding: 4px 6px 5px; border-radius: 8px; }
  .course-point-marker.label-left .course-point-label { right: 40px; }
  .course-point-label strong { font-size: .7rem; }
  .course-point-label span { font-size: .66rem; }
}

@media (max-width: 420px) {
  .brand-topline .eyebrow { letter-spacing: .11em; }
  .language-control select { width: 64px; }
  .route-date { max-width: 260px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .summary-card { top: calc(79px + var(--safe-top)); }
  .partner-logos { top: calc(222px + var(--safe-top)); }
  .map-tools { top: calc(196px + var(--safe-top)); }
  .speed-buttons button { min-width: 31px; padding: 0 4px; }
}

@media (max-height: 700px) and (min-width: 821px) {
  .summary-card { transform: scale(.9); transform-origin: top right; }
  .map-tools { top: 220px; }
  .player-card { min-height: 180px; }
  .profile-wrap { height: 58px; }
  .maplibregl-ctrl-top-right { bottom: 222px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
