:root {
  --map-ink: #222824;
  --map-paper: #f7f5ef;
  --map-water: #c9dde4;
  --map-route-future: #66706a;
  --map-route-past: #202421;
  --map-red: #d52c27;
  --map-green: #167a52;
  --map-yellow: #e6a11b;
  --map-blue: #155a9e;
  --map-control-edge: clamp(16px, 2.2vw, 28px);
  --map-control-size: 38px;
  --map-control-bg: rgba(38, 45, 41, 0.88);
  --map-control-hover: rgba(50, 58, 53, 0.96);
  --map-control-border: rgba(255, 253, 248, 0.5);
}

html,
body.live-map-page {
  width: 100%;
  height: 100%;
  overscroll-behavior: none;
}

body.live-map-page {
  overflow: hidden;
  color: var(--map-ink);
  background: var(--map-water);
}

@media (max-width: 760px) {
  html:has(body.live-map-page) {
    background: var(--map-water);
  }

  body.live-map-page {
    background: transparent;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.live-map-shell {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background: var(--map-water);
}

.live-map-shell::before {
  position: absolute;
  inset: 0;
  z-index: 15;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 42% 48% at 18% 46%,
      rgba(18, 22, 19, 0.24) 0%,
      rgba(18, 22, 19, 0.12) 44%,
      rgba(18, 22, 19, 0) 78%
    );
  opacity: 0;
  transition: opacity 700ms ease;
}

.live-map-shell.is-arrival-cinematic::before {
  opacity: 0;
}

.live-map-shell.is-loading::before {
  background:
    linear-gradient(115deg, #c9dde4 0%, #eef1ec 48%, #c9dde4 100%);
  background-size: 220% 100%;
  opacity: 1;
  animation: live-map-loading-surface 1800ms ease-in-out infinite;
}

.live-map-canvas {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 520ms ease;
}

.live-map-shell.is-ready .live-map-canvas {
  opacity: 1;
}

.live-map-canvas .maplibregl-canvas {
  outline: 0;
}

.live-map-canvas .maplibregl-canvas-container.maplibregl-interactive {
  cursor: grab;
}

.live-map-canvas .maplibregl-canvas-container.maplibregl-interactive:active {
  cursor: grabbing;
}

.live-map-shell::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  height: clamp(92px, 14vh, 148px);
  content: "";
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(247, 245, 239, 0.92),
    rgba(247, 245, 239, 0.5) 48%,
    rgba(247, 245, 239, 0)
  );
}

.live-map-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 40;
  display: flex;
  gap: 5px;
  align-items: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 6px 13px rgba(34, 40, 36, 0.14));
  transition: opacity 360ms ease, transform 420ms var(--ease-reveal);
}

.live-map-shell.is-ready .live-map-loader,
.live-map-shell.is-unavailable .live-map-loader {
  opacity: 0;
  transform: translate(-50%, calc(-50% - 5px));
}

.live-map-loader span {
  display: block;
  width: 5px;
  height: 24px;
  background: var(--map-green);
  border-radius: 999px;
  animation: live-map-loading 900ms ease-in-out infinite alternate;
}

.live-map-loader span:nth-child(2) {
  height: 31px;
  background: var(--map-yellow);
  animation-delay: 90ms;
}

.live-map-loader span:nth-child(3) {
  height: 27px;
  background: var(--map-red);
  animation-delay: 180ms;
}

.live-map-loader span:nth-child(4) {
  height: 34px;
  background: var(--map-blue);
  animation-delay: 270ms;
}

@keyframes live-map-loading {
  from {
    opacity: 0.38;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes live-map-loading-surface {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0 0; }
}

.live-map-back {
  position: absolute;
  z-index: 60;
  top: calc(env(safe-area-inset-top, 0px) + clamp(16px, 2.2vw, 28px));
  left: calc(env(safe-area-inset-left, 0px) + clamp(16px, 2.2vw, 28px));
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 10px 16px 8px;
  color: var(--map-ink);
  background: rgba(247, 245, 239, 0.94);
  border: 1px solid rgba(34, 40, 36, 0.15);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(25, 33, 28, 0.08);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  transition: background 160ms ease, transform 160ms ease;
}

.live-map-back:is(:hover, :focus-visible) {
  background: #fffdf8;
  transform: translateY(-1px);
}

body.live-map-page .language-switch {
  position: absolute;
  z-index: 60;
  top: calc(env(safe-area-inset-top, 0px) + clamp(16px, 2.2vw, 28px));
  right: calc(env(safe-area-inset-right, 0px) + var(--map-control-edge));
}

.live-map-reset {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 163px);
  right: calc(env(safe-area-inset-right, 0px) + var(--map-control-edge));
  z-index: 30;
  display: grid;
  width: var(--map-control-size);
  height: var(--map-control-size);
  place-items: center;
  padding: 0;
  color: #fffdf8;
  background: var(--map-control-bg);
  border: 1px solid var(--map-control-border);
  border-radius: 0 0 20px 20px;
  box-shadow: 0 8px 20px rgba(25, 32, 28, 0.18);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.live-map-reset svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.live-map-reset:is(:hover, :focus-visible) {
  background: var(--map-control-hover);
  transform: translateY(-1px);
}

.live-map-reset:focus-visible {
  outline: 2px solid #fffdf8;
  outline-offset: 3px;
}

.live-map-arrival {
  position: absolute;
  right: clamp(42px, 4vw, 62px);
  bottom: clamp(48px, 4.6vw, 68px);
  z-index: 2;
  display: grid;
  width: min(39vw, 540px);
  gap: 12px;
  color: var(--map-ink);
  pointer-events: none;
  text-align: right;
  opacity: 0;
  transform: translate3d(18px, 12px, 0) scale(0.95);
  transform-origin: right bottom;
  transition:
    opacity 620ms ease,
    transform 760ms var(--ease-reveal);
}

.live-map-arrival[hidden] {
  display: none;
}

.live-map-arrival strong {
  display: block;
  max-width: min(14ch, 100%);
  margin-left: auto;
  font-size: clamp(2.35rem, 4.7vw, 5.2rem);
  font-weight: 900;
  font-variation-settings: "wght" 900;
  letter-spacing: -0.045em;
  line-height: 0.79;
  text-transform: uppercase;
  -webkit-text-stroke: clamp(0.65px, 0.08vw, 1.15px) currentColor;
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 rgba(20, 25, 22, 0.18),
    0 12px 36px rgba(20, 25, 22, 0.2),
    0 2px 24px rgba(247, 245, 239, 0.98);
  perspective: 820px;
}

.live-map-title-word {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  opacity: 0;
  filter: blur(7px);
  clip-path: inset(100% -0.08em 0 -0.08em);
  transform: translate3d(0, 0.42em, 0) rotateX(-18deg) scale(0.96);
  transform-origin: 50% 100%;
  transition:
    opacity 380ms ease-out calc(var(--word-index) * 72ms),
    filter 520ms ease-out calc(var(--word-index) * 72ms),
    clip-path 640ms cubic-bezier(0.22, 1, 0.36, 1) calc(var(--word-index) * 72ms),
    transform 760ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--word-index) * 72ms);
  will-change: opacity, filter, clip-path, transform;
}

.live-map-arrival > span {
  display: block;
  margin-left: auto;
  color: rgba(34, 40, 36, 0.58);
  font-size: clamp(0.72rem, 1.05vw, 0.96rem);
  font-weight: 900;
  letter-spacing: 0.015em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(247, 245, 239, 0.92);
  opacity: 0;
  filter: blur(5px);
  clip-path: inset(0 0 0 100%);
  transform: translate3d(20px, 0, 0);
  transition:
    opacity 360ms ease-out calc(150ms + var(--title-stagger-end, 0ms)),
    filter 500ms ease-out calc(150ms + var(--title-stagger-end, 0ms)),
    clip-path 620ms cubic-bezier(0.22, 1, 0.36, 1) calc(150ms + var(--title-stagger-end, 0ms)),
    transform 680ms cubic-bezier(0.16, 1, 0.3, 1) calc(150ms + var(--title-stagger-end, 0ms));
  will-change: opacity, filter, clip-path, transform;
}

.live-map-arrival.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.live-map-arrival.is-visible .live-map-title-word {
  opacity: 1;
  filter: blur(0);
  clip-path: inset(-0.08em);
  transform: none;
}

.live-map-arrival.is-visible > span {
  opacity: 1;
  filter: blur(0);
  clip-path: inset(0);
  transform: none;
}

.live-map-arrival.is-exiting .live-map-title-word {
  opacity: 0;
  filter: blur(5px);
  clip-path: inset(0 -0.08em 100% -0.08em);
  transform: translate3d(-0.12em, -0.28em, 0) rotateX(10deg) scale(0.985);
  transition:
    opacity 280ms ease-in calc(var(--word-index) * 34ms),
    filter 390ms ease-in calc(var(--word-index) * 34ms),
    clip-path 440ms cubic-bezier(0.55, 0, 1, 0.45) calc(var(--word-index) * 34ms),
    transform 500ms cubic-bezier(0.55, 0, 1, 0.45) calc(var(--word-index) * 34ms);
}

.live-map-arrival.is-exiting > span {
  opacity: 0;
  filter: blur(4px);
  clip-path: inset(0 100% 0 0);
  transform: translate3d(-18px, -4px, 0);
  transition:
    opacity 240ms ease-in,
    filter 330ms ease-in,
    clip-path 400ms cubic-bezier(0.55, 0, 1, 0.45),
    transform 440ms cubic-bezier(0.55, 0, 1, 0.45);
}

.live-map-shell.is-arrival-receded .live-map-arrival {
  opacity: 0;
  transform: translate3d(-8px, -6px, 0) scale(0.98);
}

/* Place names are attached to their geography, but each landscape gets its
   own composition. Open-water labels sit beside the coast, inland labels sit
   diagonally clear of their roads, and the Winelands open to the east. */
.live-map-arrival[data-title-placement="north-west"] {
  right: clamp(68px, 6vw, 102px);
  bottom: clamp(82px, 7vw, 112px);
  width: min(34vw, 450px);
}

.live-map-arrival[data-title-placement="west"] {
  top: 50%;
  right: clamp(82px, 7vw, 118px);
  bottom: auto;
  width: min(35vw, 470px);
  transform: translate3d(12px, -50%, 0) scale(0.95);
  transform-origin: right center;
}

.live-map-arrival[data-title-placement="west"].is-visible {
  transform: translate3d(0, -50%, 0) scale(1);
}

.live-map-shell.is-arrival-receded
  .live-map-arrival[data-title-placement="west"] {
  transform: translate3d(-8px, calc(-50% - 5px), 0) scale(0.98);
}

.live-map-arrival[data-title-placement="south-west"] {
  top: clamp(42px, 4vw, 68px);
  right: clamp(64px, 5.5vw, 96px);
  bottom: auto;
  width: min(34vw, 450px);
  transform: translate3d(14px, -8px, 0) scale(0.95);
  transform-origin: right top;
}

.live-map-arrival[data-title-placement="south-west"].is-visible {
  transform: translate3d(0, 0, 0) scale(1);
}

.live-map-shell.is-arrival-receded
  .live-map-arrival[data-title-placement="south-west"] {
  transform: translate3d(-8px, 5px, 0) scale(0.98);
}

.live-map-arrival[data-title-placement="north-east"] {
  right: auto;
  bottom: clamp(48px, 4.6vw, 68px);
  left: clamp(70px, 6vw, 104px);
  width: min(34vw, 450px);
  text-align: left;
  transform: translate3d(-14px, 10px, 0) scale(0.95);
  transform-origin: left bottom;
}

.live-map-arrival[data-title-placement="north-east"] strong,
.live-map-arrival[data-title-placement="north-east"] > span {
  margin-right: auto;
  margin-left: 0;
}

.live-map-arrival[data-title-placement="north-east"].is-visible {
  transform: translate3d(0, 0, 0) scale(1);
}

.live-map-shell.is-arrival-receded
  .live-map-arrival[data-title-placement="north-east"] {
  transform: translate3d(8px, -5px, 0) scale(0.98);
}

/* The Peninsula Tour is an area presentation rather than a single city stop.
   Keep its title beside the peninsula so the coastline and animated route stay
   visible throughout the held section. */
.live-map-arrival[data-milestone^="peninsula-tour"] {
  top: 50%;
  right: clamp(54px, 6vw, 86px);
  bottom: auto;
  width: min(25vw, 330px);
  gap: 8px;
  transform: translate3d(12px, -50%, 0) scale(0.95);
  transform-origin: right center;
}

.live-map-arrival[data-milestone^="peninsula-tour"] strong {
  max-width: 9ch;
  font-size: clamp(1.9rem, 3.3vw, 3.65rem);
  line-height: 0.82;
}

.live-map-arrival[data-milestone^="peninsula-tour"].is-visible {
  transform: translate3d(0, -50%, 0) scale(1);
}

.live-map-shell.is-arrival-receded
  .live-map-arrival[data-milestone^="peninsula-tour"] {
  transform: translate3d(-8px, calc(-50% - 5px), 0) scale(0.98);
}

/* Geographic anchors for the Cape sequence. Cape Town sits over Table Bay;
   the Peninsula Tour moves south into the open water beside the Cape so the
   title never competes with the coastline or the animated route. */
.live-map-arrival[data-milestone^="cape-town"] {
  top: 42%;
  right: auto;
  bottom: auto;
  left: clamp(52px, 5vw, 84px);
  width: min(29vw, 380px);
  text-align: left;
  transform: translate3d(-14px, -50%, 0) scale(0.95);
  transform-origin: left center;
}

.live-map-arrival[data-milestone^="cape-town"] strong,
.live-map-arrival[data-milestone^="cape-town"] > span,
.live-map-arrival[data-milestone^="peninsula-tour"] strong,
.live-map-arrival[data-milestone^="peninsula-tour"] > span {
  margin-right: auto;
  margin-left: 0;
}

.live-map-arrival[data-milestone^="cape-town"].is-visible {
  transform: translate3d(0, -50%, 0) scale(1);
}

.live-map-shell.is-arrival-receded
  .live-map-arrival[data-milestone^="cape-town"] {
  transform: translate3d(8px, calc(-50% - 5px), 0) scale(0.98);
}

.live-map-arrival[data-milestone^="peninsula-tour"] {
  top: 66%;
  right: auto;
  bottom: auto;
  left: clamp(42px, 4vw, 70px);
  width: min(24vw, 315px);
  text-align: left;
  transform: translate3d(-12px, -50%, 0) scale(0.95);
  transform-origin: left center;
}

.live-map-arrival[data-milestone^="peninsula-tour"].is-visible {
  transform: translate3d(0, -50%, 0) scale(1);
}

.live-map-shell.is-arrival-receded
  .live-map-arrival[data-milestone^="peninsula-tour"] {
  transform: translate3d(8px, calc(-50% - 5px), 0) scale(0.98);
}

/* Every point-based destination uses one dependable map relationship: the
   complete label sits above and to the left of its marker. The Peninsula Tour
   remains the sole exception because it labels the landscape, not one point. */
.live-map-arrival:not([data-milestone^="peninsula-tour"]) {
  top: auto;
  right: clamp(18px, 2.4vw, 36px);
  bottom: clamp(46px, 5vw, 78px);
  left: auto;
  width: min(30vw, 420px);
  text-align: right;
  transform: translate3d(12px, 10px, 0) scale(0.95);
  transform-origin: right bottom;
}

.live-map-arrival:not([data-milestone^="peninsula-tour"]) strong,
.live-map-arrival:not([data-milestone^="peninsula-tour"]) > span {
  margin-right: 0;
  margin-left: auto;
}

.live-map-arrival:not([data-milestone^="peninsula-tour"]).is-visible {
  transform: translate3d(0, 0, 0) scale(1);
}

.live-map-shell.is-arrival-receded
  .live-map-arrival:not([data-milestone^="peninsula-tour"]) {
  transform: translate3d(-8px, -6px, 0) scale(0.98);
}

.live-map-route-control {
  position: absolute;
  right: clamp(24px, 4vw, 70px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(25px, 3.4vh, 42px));
  left: clamp(24px, 4vw, 70px);
  z-index: 12;
  display: grid;
  grid-template-columns: minmax(116px, max-content) max-content minmax(260px, 900px);
  gap: 16px;
  align-items: center;
  justify-content: center;
  color: var(--map-ink);
  transition: opacity 280ms ease, transform 480ms var(--ease-reveal);
}

.live-map-mobile-progress {
  display: none;
}

.live-map-shell.is-opening .live-map-route-control {
  opacity: 0;
  transform: translateY(10px);
}

.live-map-readout {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.live-map-readout span {
  color: rgba(34, 40, 36, 0.52);
  font-size: 0.61rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.live-map-readout strong {
  color: var(--map-ink);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.live-map-transport {
  display: flex;
  gap: 8px;
  align-items: center;
}

.live-map-play,
.live-map-rewind {
  position: relative;
  display: grid;
  width: var(--map-control-size);
  height: var(--map-control-size);
  padding: 0;
  color: #fffdf8;
  cursor: pointer;
  background: var(--map-control-bg);
  border: 1px solid var(--map-control-border);
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(26, 33, 29, 0.2);
  place-items: center;
  transition:
    background 180ms ease,
    box-shadow 180ms ease,
    transform 160ms ease;
}

.live-map-play:is(:hover, :focus-visible),
.live-map-rewind:is(:hover, :focus-visible) {
  background: var(--map-control-hover);
  box-shadow: 0 10px 27px rgba(26, 33, 29, 0.26);
  transform: translateY(-1px);
}

.live-map-play:focus-visible,
.live-map-rewind:focus-visible {
  outline: 2px solid #fffdf8;
  outline-offset: 3px;
}

.live-map-play svg {
  position: absolute;
  width: 15px;
  height: 15px;
  fill: currentcolor;
  transition: opacity 150ms ease, transform 180ms ease;
}

.live-map-rewind svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.live-map-rewind.is-rewinding svg {
  animation: live-map-rewind-spin 900ms linear infinite;
}

.live-map-rewind:disabled {
  cursor: default;
  box-shadow: none;
  opacity: 0.38;
  transform: none;
}

@keyframes live-map-rewind-spin {
  to {
    transform: rotate(-360deg);
  }
}

.live-map-play-symbol {
  margin-left: 1px;
}

.live-map-pause-symbol {
  opacity: 0;
  transform: scale(0.72);
}

.live-map-play.is-playing .live-map-play-symbol {
  opacity: 0;
  transform: scale(0.72);
}

.live-map-play.is-playing .live-map-pause-symbol {
  opacity: 1;
  transform: scale(1);
}

.live-map-play.is-at-stop {
  animation: live-map-stop-pulse 920ms ease-out infinite;
}

@keyframes live-map-stop-pulse {
  0% {
    box-shadow:
      0 8px 22px rgba(26, 33, 29, 0.2),
      0 0 0 0 rgba(22, 122, 82, 0.38);
  }

  72%,
  100% {
    box-shadow:
      0 8px 22px rgba(26, 33, 29, 0.2),
      0 0 0 9px rgba(22, 122, 82, 0);
  }
}

.live-map-track {
  position: relative;
  display: grid;
  min-width: 0;
  height: 40px;
  align-items: center;
}

.live-map-track input[type="range"] {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0;
  margin: 0;
  cursor: ew-resize;
  appearance: none;
  background: transparent;
  touch-action: none;
}

.live-map-track input[type="range"]:focus-visible {
  outline: none;
}

.live-map-track input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  background:
    linear-gradient(
      90deg,
      var(--map-route-past) 0 var(--route-position, 0%),
      #bcc2be var(--route-position, 0%) 100%
    );
  border-radius: 999px;
}

.live-map-track input[type="range"]::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  margin-top: -7px;
  appearance: none;
  background: var(--map-red);
  border: 2px solid var(--map-paper);
  border-radius: 50%;
  box-shadow:
    0 4px 12px rgba(25, 32, 28, 0.25),
    0 0 0 1px rgba(213, 44, 39, 0.12);
}

.live-map-track input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 4px 12px rgba(25, 32, 28, 0.25),
    0 0 0 5px rgba(213, 44, 39, 0.14);
}

.live-map-track input[type="range"]::-moz-range-track {
  height: 3px;
  background: #bcc2be;
  border-radius: 999px;
}

.live-map-track input[type="range"]::-moz-range-progress {
  height: 3px;
  background: var(--map-route-past);
  border-radius: 999px;
}

.live-map-track input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  background: var(--map-red);
  border: 2px solid var(--map-paper);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(25, 32, 28, 0.25);
}

.roots-current-marker {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 7px;
  overflow: visible;
  pointer-events: auto;
  cursor: pointer;
  background: #11110f;
  border: 2px solid #11110f;
  border-radius: 50%;
  box-shadow: 0 9px 24px rgba(20, 26, 23, 0.3);
  opacity: 1;
  transition:
    box-shadow 180ms ease,
    opacity 260ms ease,
    transform 300ms var(--ease-reveal);
}

.roots-current-marker-mark {
  display: flex;
  gap: 3px;
  align-items: flex-start;
  height: 30px;
  transform: rotate(6deg);
}

.roots-current-marker-bar {
  display: block;
  width: 6px;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(20, 26, 23, 0.12);
}

.roots-current-marker-bar.is-green {
  height: 25px;
  background: var(--map-green);
}

.roots-current-marker-bar.is-yellow {
  height: 24px;
  margin-top: 4px;
  background: var(--map-yellow);
}

.roots-current-marker-bar.is-red {
  height: 27px;
  margin-top: 1px;
  background: var(--map-red);
}

.roots-current-marker-bar.is-blue {
  height: 23px;
  margin-top: 7px;
  background: var(--map-blue);
}

.roots-current-marker:is(:hover, :focus-visible) {
  opacity: 1;
  transform: scale(1.06);
}

.roots-current-marker:focus-visible {
  outline: 2px solid #11110f;
  outline-offset: 4px;
}

.live-map-canvas .maplibregl-marker {
  z-index: 8;
}

.roots-arrival-marker {
  position: relative;
  z-index: 4;
  width: 1px;
  height: 1px;
  overflow: visible;
  pointer-events: none;
}

.roots-arrival-tether {
  position: relative;
  width: 1px;
  height: 1px;
  overflow: visible;
  pointer-events: none;
}

.live-map-canvas .maplibregl-ctrl-top-right {
  z-index: 9;
  top: calc(env(safe-area-inset-top, 0px) + 86px);
  right: calc(env(safe-area-inset-right, 0px) + var(--map-control-edge));
}

.live-map-canvas .maplibregl-ctrl-top-right .maplibregl-ctrl {
  margin: 0;
}

.live-map-canvas .maplibregl-ctrl-group {
  overflow: hidden;
  background: var(--map-control-bg);
  border: 1px solid var(--map-control-border);
  border-radius: 20px;
  box-shadow: 0 8px 22px rgba(25, 32, 28, 0.14);
  opacity: 0.86;
  backdrop-filter: blur(10px);
  transition: opacity 160ms ease, box-shadow 160ms ease;
}

.live-map-canvas .maplibregl-ctrl-group:is(:hover, :focus-within) {
  box-shadow: 0 10px 25px rgba(25, 32, 28, 0.2);
  opacity: 1;
}

.live-map-canvas .maplibregl-ctrl-group button {
  position: relative;
  width: var(--map-control-size);
  height: var(--map-control-size);
  color: #fffdf8;
  background: transparent;
}

.live-map-canvas .maplibregl-ctrl-group button + button {
  border-top: 1px solid rgba(255, 253, 248, 0.18);
}

.live-map-canvas .maplibregl-ctrl-group button span {
  display: none;
}

.live-map-canvas .maplibregl-ctrl-zoom-in::after,
.live-map-canvas .maplibregl-ctrl-zoom-out::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: Arial, sans-serif;
  font-size: 23px;
  font-weight: 400;
}

.live-map-canvas .maplibregl-ctrl-zoom-in::after {
  content: "+";
}

.live-map-canvas .maplibregl-ctrl-zoom-out::after {
  content: "−";
}

.live-map-canvas .maplibregl-ctrl-group button:is(:hover, :focus-visible) {
  background: var(--map-control-hover);
}

.live-map-attribution {
  position: absolute;
  right: 8px;
  bottom: 7px;
  z-index: 13;
  display: flex;
  gap: 4px;
  padding: 4px 6px;
  margin: 0;
  color: rgba(34, 40, 36, 0.5);
  background: rgba(247, 245, 239, 0.68);
  border: 1px solid rgba(34, 40, 36, 0.08);
  border-radius: 999px;
  font-size: 0.5rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.72;
  backdrop-filter: blur(8px);
  transition: opacity 150ms ease, background 150ms ease;
}

.live-map-attribution:hover {
  background: rgba(247, 245, 239, 0.92);
  opacity: 1;
}

.live-map-attribution a:hover {
  color: var(--map-ink);
}

.live-map-fallback {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(22px, 4vw, 34px);
  padding: clamp(28px, 6vw, 70px);
  color: var(--map-ink);
  text-align: center;
  background: var(--map-water);
}

.live-map-fallback[hidden] {
  display: none;
}

.live-map-fallback img {
  display: block;
  width: min(440px, 68vw);
  max-height: 82px;
  object-fit: contain;
}

.live-map-fallback p {
  max-width: 38ch;
  margin: 0;
  color: rgba(34, 40, 36, 0.78);
  font-size: clamp(1.12rem, 2vw, 1.7rem);
  font-weight: 800;
  line-height: 1.22;
}

.live-map-fallback-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: min(90vw, 620px);
  min-height: 48px;
  padding: 14px 22px 12px;
  color: #fffdf8;
  background: var(--map-green);
  border: 2px solid rgba(255, 253, 248, 0.78);
  border-radius: 999px;
  box-shadow: 0 12px 26px rgba(34, 40, 36, 0.18);
  font-size: clamp(0.78rem, 1.3vw, 0.92rem);
  font-weight: 900;
  line-height: 1.12;
  text-transform: uppercase;
  transition: transform 160ms ease, filter 160ms ease;
}

.live-map-fallback-action:hover,
.live-map-fallback-action:focus-visible {
  color: #fffdf8;
  filter: brightness(1.08);
  outline: none;
  transform: translateY(-2px);
}

.live-map-fallback-action:focus-visible {
  box-shadow: 0 0 0 4px #fffdf8, 0 12px 26px rgba(34, 40, 36, 0.18);
}

.live-map-shell.is-unavailable::after,
.live-map-shell.is-unavailable .live-map-arrival,
.live-map-shell.is-unavailable .live-map-route-control,
.live-map-shell.is-unavailable .live-map-attribution,
.live-map-shell.is-unavailable .live-map-reset,
.live-map-shell.is-unavailable .live-map-canvas .maplibregl-ctrl-top-right {
  display: none;
}

@media (max-width: 760px) {
  body.live-map-page {
    position: fixed;
    inset: 0;
  }

  /* Safari exposes only the visual viewport to the page while its glass
     toolbars are expanded. A largest-viewport map surface lets the artwork
     continue underneath translucent browser chrome, while the controls stay
     positioned inside the usable dynamic viewport. */
  .live-map-shell {
    position: fixed;
    inset: 0;
    height: 100dvh;
  }

  .live-map-canvas {
    top: 50%;
    right: 0;
    bottom: auto;
    left: 0;
    height: 100lvh;
    transform: translateY(-50%);
  }

  .live-map-shell::after {
    display: none;
  }

  .live-map-back {
    max-width: 43vw;
    min-height: 35px;
    padding-inline: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .live-map-arrival {
    top: auto;
    right: auto;
    bottom: 82px;
    left: 50%;
    width: min(82vw, 360px);
    gap: 7px;
    text-align: center;
    transform: translate3d(-50%, 9px, 0) scale(0.95);
    transform-origin: center bottom;
  }

  .live-map-arrival.is-visible {
    transform: translate3d(-50%, 0, 0) scale(1);
  }

  .live-map-shell::before {
    background:
      radial-gradient(
        ellipse 86% 34% at 18% 18%,
        rgba(18, 22, 19, 0.22) 0%,
        rgba(18, 22, 19, 0.1) 48%,
        rgba(18, 22, 19, 0) 82%
      );
  }

  .live-map-shell.is-arrival-receded .live-map-arrival {
    transform: translate3d(calc(-50% - 6px), -5px, 0) scale(0.98);
  }

  .live-map-arrival strong {
    max-width: min(13.5ch, 100%);
    margin-inline: auto;
    font-size: clamp(1.75rem, 8.4vw, 3rem);
    line-height: 0.82;
    -webkit-text-stroke-width: clamp(0.45px, 0.11vw, 0.7px);
  }

  /* Long destinations should frame the geography, not become the geography.
     This catches both Cape of Good Hope and its longer German translation. */
  .live-map-arrival[data-title-length="long"] strong {
    max-width: 12ch;
    font-size: clamp(1.35rem, 6.6vw, 2.2rem);
    line-height: 0.86;
  }

  .live-map-arrival > span {
    margin-inline: auto;
    font-size: 0.68rem;
  }

  .live-map-arrival[data-title-placement="west"] {
    top: 50%;
    right: clamp(76px, 14vw, 108px);
    bottom: auto;
    left: auto;
    width: min(54vw, 360px);
    text-align: right;
    transform: translate3d(8px, -50%, 0) scale(0.95);
    transform-origin: right center;
  }

  .live-map-arrival[data-title-placement="west"] strong,
  .live-map-arrival[data-title-placement="west"] > span,
  .live-map-arrival[data-title-placement="north-west"] strong,
  .live-map-arrival[data-title-placement="north-west"] > span,
  .live-map-arrival[data-title-placement="south-west"] strong,
  .live-map-arrival[data-title-placement="south-west"] > span {
    margin-right: 0;
    margin-left: auto;
  }

  .live-map-arrival[data-title-placement="west"][data-title-length="long"] strong {
    max-width: 11ch;
    font-size: clamp(1.2rem, 5vw, 2rem);
  }

  .live-map-arrival[data-title-placement="west"].is-visible {
    transform: translate3d(0, -50%, 0) scale(1);
  }

  .live-map-shell.is-arrival-receded
    .live-map-arrival[data-title-placement="west"] {
    transform: translate3d(-6px, calc(-50% - 4px), 0) scale(0.98);
  }

  .live-map-arrival[data-title-placement="north-west"] {
    top: auto;
    right: clamp(62px, 12vw, 94px);
    bottom: clamp(56px, 10vw, 82px);
    left: auto;
    width: min(52vw, 340px);
    text-align: right;
    transform: translate3d(8px, 8px, 0) scale(0.95);
    transform-origin: right bottom;
  }

  .live-map-arrival[data-title-placement="north-west"].is-visible {
    transform: translate3d(0, 0, 0) scale(1);
  }

  .live-map-shell.is-arrival-receded
    .live-map-arrival[data-title-placement="north-west"] {
    transform: translate3d(-6px, -4px, 0) scale(0.98);
  }

  .live-map-arrival[data-title-placement="south-west"] {
    top: clamp(40px, 7vw, 60px);
    right: clamp(62px, 12vw, 94px);
    bottom: auto;
    left: auto;
    width: min(52vw, 340px);
    text-align: right;
    transform: translate3d(8px, -8px, 0) scale(0.95);
    transform-origin: right top;
  }

  .live-map-arrival[data-title-placement="south-west"].is-visible {
    transform: translate3d(0, 0, 0) scale(1);
  }

  .live-map-shell.is-arrival-receded
    .live-map-arrival[data-title-placement="south-west"] {
    transform: translate3d(-6px, 4px, 0) scale(0.98);
  }

  .live-map-arrival[data-title-placement="north-east"] {
    top: auto;
    right: auto;
    bottom: clamp(42px, 8vw, 64px);
    left: clamp(62px, 12vw, 94px);
    width: min(52vw, 340px);
    text-align: left;
    transform: translate3d(-8px, 8px, 0) scale(0.95);
    transform-origin: left bottom;
  }

  .live-map-arrival[data-title-placement="north-east"] strong,
  .live-map-arrival[data-title-placement="north-east"] > span {
    margin-right: auto;
    margin-left: 0;
  }

  .live-map-arrival[data-title-placement="north-east"].is-visible {
    transform: translate3d(0, 0, 0) scale(1);
  }

  .live-map-shell.is-arrival-receded
    .live-map-arrival[data-title-placement="north-east"] {
    transform: translate3d(6px, -4px, 0) scale(0.98);
  }

  .live-map-arrival[data-milestone^="peninsula-tour"] {
    top: 50%;
    right: clamp(28px, 5vw, 42px);
    bottom: auto;
    left: auto;
    width: min(33vw, 230px);
    text-align: right;
    transform: translate3d(8px, -50%, 0) scale(0.95);
    transform-origin: right center;
  }

  .live-map-arrival[data-milestone^="peninsula-tour"] strong {
    max-width: 9ch;
    margin-right: 0;
    margin-left: auto;
    font-size: clamp(1.4rem, 5.6vw, 2.25rem);
    line-height: 0.84;
  }

  .live-map-arrival[data-milestone^="peninsula-tour"] > span {
    margin-right: 0;
  }

  .live-map-arrival[data-milestone^="peninsula-tour"].is-visible {
    transform: translate3d(0, -50%, 0) scale(1);
  }

  .live-map-shell.is-arrival-receded
    .live-map-arrival[data-milestone^="peninsula-tour"] {
    transform: translate3d(-6px, calc(-50% - 4px), 0) scale(0.98);
  }

  .live-map-arrival[data-milestone^="cape-town"] {
    top: 38%;
    right: auto;
    bottom: auto;
    left: clamp(18px, 5vw, 34px);
    width: min(48vw, 230px);
    text-align: left;
    transform: translate3d(-8px, -50%, 0) scale(0.95);
    transform-origin: left center;
  }

  .live-map-arrival[data-milestone^="cape-town"] strong,
  .live-map-arrival[data-milestone^="cape-town"] > span,
  .live-map-arrival[data-milestone^="peninsula-tour"] strong,
  .live-map-arrival[data-milestone^="peninsula-tour"] > span {
    margin-right: auto;
    margin-left: 0;
  }

  .live-map-arrival[data-milestone^="cape-town"].is-visible {
    transform: translate3d(0, -50%, 0) scale(1);
  }

  .live-map-shell.is-arrival-receded
    .live-map-arrival[data-milestone^="cape-town"] {
    transform: translate3d(6px, calc(-50% - 4px), 0) scale(0.98);
  }

  .live-map-arrival[data-milestone^="peninsula-tour"] {
    top: 68%;
    right: auto;
    bottom: auto;
    left: clamp(14px, 4vw, 28px);
    width: min(43vw, 210px);
    text-align: left;
    transform: translate3d(-8px, -50%, 0) scale(0.95);
    transform-origin: left center;
  }

  .live-map-arrival[data-milestone^="peninsula-tour"].is-visible {
    transform: translate3d(0, -50%, 0) scale(1);
  }

  .live-map-shell.is-arrival-receded
    .live-map-arrival[data-milestone^="peninsula-tour"] {
    transform: translate3d(6px, calc(-50% - 4px), 0) scale(0.98);
  }

  /* A few German and English place names contain a single long, unbroken
     word. Size only those labels down so every name remains inside its mobile
     geographic anchor, even on 320px-wide screens. */
  .live-map-arrival[data-title-fit="wide"] strong {
    max-width: 100%;
    font-size: clamp(1.2rem, 6.2vw, 2.35rem);
    letter-spacing: -0.052em;
  }

  .live-map-arrival[data-title-fit="compact"] strong {
    max-width: 100%;
    font-size: clamp(0.95rem, 4.6vw, 1.45rem);
    letter-spacing: -0.055em;
    line-height: 0.9;
  }

  /* Keep every city and point destination above-left on phones as well. The
     larger horizontal offset leaves a clean visual tether back to the point,
     while the capped width keeps even long names fully inside the viewport. */
  .live-map-arrival:not([data-milestone^="peninsula-tour"]) {
    top: auto;
    right: clamp(14px, 5vw, 28px);
    bottom: clamp(38px, 10vw, 60px);
    left: auto;
    width: min(44vw, 230px);
    text-align: right;
    transform: translate3d(8px, 8px, 0) scale(0.95);
    transform-origin: right bottom;
  }

  .live-map-arrival:not([data-milestone^="peninsula-tour"]) strong,
  .live-map-arrival:not([data-milestone^="peninsula-tour"]) > span {
    margin-right: 0;
    margin-left: auto;
  }

  .live-map-arrival:not([data-milestone^="peninsula-tour"]).is-visible {
    transform: translate3d(0, 0, 0) scale(1);
  }

  .live-map-shell.is-arrival-receded
    .live-map-arrival:not([data-milestone^="peninsula-tour"]) {
    transform: translate3d(-6px, -4px, 0) scale(0.98);
  }

  /* Mobile labels use a viewport-bounded composition instead of inheriting
     desktop marker offsets. JavaScript supplies the projected point position;
     these rules only handle typography and motion within the safe canvas. */
  .live-map-shell.is-mobile-layout > .live-map-arrival {
    right: auto;
    left: var(--arrival-mobile-left, 14px);
    width: var(--arrival-mobile-width, min(58vw, 280px));
    max-width: calc(100vw - 28px);
  }

  .live-map-shell.is-mobile-layout
    > .live-map-arrival[data-mobile-anchor="point"] {
    top: auto;
    bottom: var(--arrival-mobile-bottom, 96px);
    text-align: right;
    transform: translate3d(8px, 8px, 0) scale(0.95);
    transform-origin: right bottom;
  }

  .live-map-shell.is-mobile-layout
    > .live-map-arrival[data-mobile-anchor="point"] strong,
  .live-map-shell.is-mobile-layout
    > .live-map-arrival[data-mobile-anchor="point"] > span {
    max-width: 100%;
    margin-right: 0;
    margin-left: auto;
  }

  .live-map-shell.is-mobile-layout
    > .live-map-arrival[data-mobile-anchor="point"].is-visible {
    transform: translate3d(0, 0, 0) scale(1);
  }

  .live-map-shell.is-arrival-receded.is-mobile-layout
    > .live-map-arrival[data-mobile-anchor="point"] {
    transform: translate3d(-6px, -4px, 0) scale(0.98);
  }

  .live-map-shell.is-mobile-layout
    > .live-map-arrival[data-mobile-anchor="landscape"] {
    top: var(--arrival-mobile-top, 110px);
    right: auto;
    bottom: auto;
    text-align: left;
    transform: translate3d(-8px, 7px, 0) scale(0.95);
    transform-origin: left top;
  }

  .live-map-shell.is-mobile-layout
    > .live-map-arrival[data-mobile-anchor="landscape"] strong,
  .live-map-shell.is-mobile-layout
    > .live-map-arrival[data-mobile-anchor="landscape"] > span {
    max-width: 100%;
    margin-right: auto;
    margin-left: 0;
  }

  .live-map-shell.is-mobile-layout
    > .live-map-arrival[data-mobile-anchor="landscape"] strong {
    font-size: clamp(0.88rem, 4.9vw, 1.35rem);
    letter-spacing: -0.045em;
    line-height: 0.88;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .live-map-shell.is-mobile-layout
    > .live-map-arrival[data-mobile-anchor="landscape"] > span {
    font-size: clamp(0.58rem, 2.8vw, 0.7rem);
    line-height: 1.08;
  }

  .live-map-shell.is-mobile-layout
    > .live-map-arrival[data-mobile-anchor="landscape"].is-visible {
    transform: translate3d(0, 0, 0) scale(1);
  }

  .live-map-shell.is-arrival-receded.is-mobile-layout
    > .live-map-arrival[data-mobile-anchor="landscape"] {
    transform: translate3d(6px, -4px, 0) scale(0.98);
  }

  .live-map-route-control {
    right: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
    left: 50%;
    display: block;
    width: max-content;
    transform: translateX(-50%);
  }

  .live-map-shell.is-opening .live-map-route-control {
    transform: translate3d(-50%, 10px, 0);
  }

  .live-map-readout,
  .live-map-track {
    display: none;
  }

  .live-map-transport {
    gap: 10px;
  }

  .live-map-play,
  .live-map-rewind {
    width: 44px;
    height: 44px;
  }

  .live-map-canvas .maplibregl-ctrl-top-right,
  .live-map-reset {
    display: none;
  }

  .live-map-mobile-progress {
    --mobile-route-progress: 0%;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 95;
    display: block;
    width: 4px;
    height: 100dvh;
    overflow: hidden;
    pointer-events: none;
    contain: layout paint style;
  }

  .live-map-mobile-progress__fill {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: var(--mobile-route-progress);
    overflow: hidden;
    transition: height 80ms linear;
    will-change: height;
  }

  .live-map-mobile-progress__fill::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    content: "";
    background: linear-gradient(
      to bottom,
      var(--map-green) 0 25%,
      var(--map-yellow) 25% 50%,
      var(--map-red) 50% 75%,
      var(--map-blue) 75% 100%
    );
  }

  .live-map-attribution,
  .live-map-page .scroll-progress-rail {
    display: none;
  }

  .roots-current-marker {
    width: 46px;
    height: 46px;
    padding: 6px;
  }

  .roots-current-marker-mark {
    gap: 2px;
    height: 27px;
    transform: rotate(6deg) scale(0.9);
  }

}

@media (max-width: 440px) {
  .live-map-transport {
    gap: 9px;
  }

  .live-map-play,
  .live-map-rewind {
    width: 38px;
    height: 38px;
  }

  .live-map-mobile-progress {
    width: 3px;
  }

  .live-map-fallback img {
    width: min(300px, 76vw);
    max-height: 58px;
  }
}

@media (pointer: coarse) and (min-width: 761px) {
  .live-map-track,
  .live-map-track input[type="range"] {
    height: 48px;
  }

  .live-map-track input[type="range"]::-webkit-slider-thumb {
    width: 21px;
    height: 21px;
    margin-top: -9px;
  }
}

.live-map-reset.is-integrated {
  position: relative;
  top: auto;
  right: auto;
  z-index: auto;
  width: var(--map-control-size);
  height: var(--map-control-size);
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(255, 253, 248, 0.18);
  border-radius: 0;
  box-shadow: none;
}

.live-map-reset.is-integrated:is(:hover, :focus-visible) {
  background: var(--map-control-hover);
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .live-map-canvas,
  .live-map-loader,
  .live-map-arrival,
  .live-map-arrival strong,
  .live-map-arrival > span,
  .live-map-title-word,
  .live-map-route-control,
  .live-map-play,
  .live-map-rewind,
  .live-map-reset,
  .roots-current-marker {
    transition: none;
  }

  .live-map-title-word,
  .live-map-arrival.is-exiting .live-map-title-word,
  .live-map-arrival > span,
  .live-map-arrival.is-exiting > span {
    opacity: 1;
    filter: none;
    clip-path: none;
    transform: none;
  }

  .live-map-play.is-at-stop {
    animation: none;
    box-shadow:
      0 8px 22px rgba(26, 33, 29, 0.2),
      0 0 0 4px rgba(22, 122, 82, 0.24);
  }

  .live-map-rewind.is-rewinding svg {
    animation: none;
  }

  .live-map-loader span {
    animation: none;
  }
}
