:root {
  /* Chrome app — neutre, découplé du thème parcours */
  --color-chrome: #111111;
  --color-chrome-ink: #ffffff;
  --color-surface: #ffffff;
  --color-surface-subtle: #f7f6f2;
  --color-surface-raised: #ffffff;
  --color-ink: #111111;
  --color-ink-muted: #7a7a7a;
  --color-border: #e8e7e3;

  /* Thème parcours — inchangés (JSON peut les surcharger) */
  --color-bg-dark: #1a1a2e;
  --color-accent: #f0c040;
  --color-theme: #8b1a1a;

  /* Alias legacy (éviter les régressions dans le code existant) */
  --color-text: #111111;
  --color-text-light: #7a7a7a;

  /* Typographie */
  --font-serif: Georgia, "Times New Roman", Times, serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Helvetica, sans-serif;
  --font-mono: "Courier New", Courier, monospace;

  /* Échelle typographique stricte — 4 tailles + display */
  --text-caption: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 20px;
  --text-display: clamp(2.2rem, 5vw, 3.2rem);

  /* Forme & ombre */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-sheet: 16px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.07);

  /* Mouvement */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 200ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-ui);
  color: var(--color-ink);
  background: var(--color-surface);
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.brand-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 20px;
  height: 44px;
  background: var(--color-chrome);
  color: var(--color-chrome-ink);
  z-index: 5;
}

.brand-bar__mark {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  font-weight: 700;
}

.brand-bar__tag {
  display: none;
}

.home-view {
  flex: 1;
  padding: 0 20px 64px;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
  background: var(--color-surface);
}

.home-view__hero {
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 36px;
}

.home-view__eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
  font-weight: 600;
}

.home-view__lede {
  max-width: 52ch;
  color: var(--color-ink-muted);
  line-height: 1.65;
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-base);
}

.home-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 64px 20px;
  text-align: center;
}

.home-error__icon {
  font-size: var(--text-lg);
  margin: 0;
}

.home-error__msg {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-ink);
}

.home-error__hint {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
}

.home-error__retry {
  margin-top: 12px;
  text-decoration: none;
}

.home-view__grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.tour-card {
  background: var(--color-surface-raised);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.tour-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.12);
}

.tour-card__cover {
  height: 220px;
  background-size: cover;
  background-position: center 15%;
  position: relative;
}

.tour-card__cover--placeholder {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.08) 0%, var(--ph, #8b1a1a) 55%, rgba(0, 0, 0, 0.5) 100%);
  overflow: hidden;
}

.tour-card__cover--placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 18px,
    rgba(255, 255, 255, 0.025) 18px,
    rgba(255, 255, 255, 0.025) 19px
  );
}

.tour-card__body {
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.tour-card__era {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.tour-card__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  line-height: 1.25;
  color: var(--color-ink);
}

.tour-card__sub {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
  font-style: normal;
}

.tour-card__desc {
  margin: 6px 0 0;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-ink-muted);
  flex: 1;
}

.tour-card__stats {
  display: flex;
  gap: 20px;
  margin: 14px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--color-border);
}

.tour-card__stats div {
  margin: 0;
}

.tour-card__stats dt {
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
  margin-bottom: 3px;
}

.tour-card__stats dd {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink);
}

.tour-card__credit {
  position: absolute;
  bottom: 6px;
  right: 8px;
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.3;
  max-width: 200px;
  text-align: right;
}

.tour-card__cta {
  margin-top: 16px;
  width: 100%;
  text-align: center;
  text-decoration: none;
  display: block;
}

.tour-view {
  flex: 1;
  position: relative;
  min-height: 0;
}

.map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.map .mapboxgl-canvas {
  outline: none;
}

.map .mapboxgl-ctrl-scale {
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  color: var(--color-ink-muted);
  border-color: rgba(0, 0, 0, 0.22);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.map .leaflet-control-scale-line {
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  border-color: rgba(0, 0, 0, 0.25) !important;
}

.back-home {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 4;
  padding: 9px 14px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--color-ink);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(4px);
  transition: background var(--dur) var(--ease);
}

.back-home:hover {
  background: #fff;
}

.routing-loader {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  background: rgba(26, 26, 46, 0.92);
  color: #f4f1ea;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 260px;
  box-shadow: var(--shadow-card);
}

.routing-loader.is-hidden {
  display: none;
}

.routing-loader__spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(240, 192, 64, 0.25);
  border-top-color: var(--color-accent);
  animation: spin 0.9s linear infinite;
}

.routing-loader__text {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.route-banner {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 4;
  margin: 0;
  max-width: min(520px, calc(100% - 32px));
  padding: 10px 14px;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  line-height: 1.45;
  text-align: center;
  color: var(--color-ink);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}

.route-banner.is-hidden {
  display: none;
}

#progress-mount {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: min(680px, calc(100% - 120px));
}

.progress-bar {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 8px 12px 10px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(4px);
}

.progress-bar__label {
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  color: var(--color-ink-muted);
  margin-top: 5px;
  text-align: center;
  letter-spacing: 0.06em;
}

.progress-bar__segments {
  display: flex;
  gap: 4px;
}

.progress-bar__seg {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  border: none;
  /* zone tactile agrandie sans modifier la hauteur visuelle */
  padding: 8px 0;
  background-clip: content-box;
  background: rgba(0, 0, 0, 0.1);
  cursor: pointer;
  min-width: 8px;
  transition: background var(--dur) var(--ease);
}

.progress-bar__seg:hover {
  background: rgba(0, 0, 0, 0.18);
}

.progress-bar__seg--past {
  background: color-mix(in srgb, var(--color-theme) 40%, transparent);
}

.progress-bar__seg--active {
  background: var(--color-theme);
}

#panel-mount {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.waypoint-panel {
  pointer-events: none;
}

.waypoint-panel__inner {
  pointer-events: auto;
  width: min(380px, 100vw);
  max-height: min(72vh, 640px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform var(--dur) var(--ease);
}

.waypoint-panel__handle {
  display: none;
}

.wp-block {
  margin-bottom: 12px;
}

.wp-tag {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--color-ink);
  color: #fff;
  margin-bottom: 6px;
}

.wp-qui {
  margin: 0;
  font-family: var(--font-ui);
  font-style: italic;
  color: var(--color-ink-muted);
  line-height: 1.6;
  font-size: var(--text-sm);
}

.wp-block--quoi p,
.wp-block p {
  margin: 0;
  font-family: var(--font-ui);
  line-height: 1.7;
  font-size: var(--text-base);
}

.wp-block--quoi {
  border-left: 3px solid var(--color-theme);
  padding: 8px 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: color-mix(in srgb, var(--color-theme) 6%, transparent);
}

.wp-block--quoi .wp-tag {
  margin-bottom: 8px;
}

.wp-block--quoi p {
  font-weight: 600;
  color: var(--color-bg-dark);
}

.wp-block--detail {
  background: #f0ede4;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.wp-block--detail .wp-tag {
  margin-bottom: 8px;
}

.wp-block--detail p {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
  font-style: italic;
}

.waypoint-panel__header {
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--color-border);
}

.waypoint-panel__acte {
  margin: 0 0 6px;
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.waypoint-panel__title {
  margin: 0;
  font-size: var(--text-lg);
  line-height: 1.3;
}

.waypoint-panel__coords {
  display: none;
}

.waypoint-panel__body {
  padding: 14px 16px 8px;
  overflow: auto;
  flex: 1;
}

.waypoint-panel__audio {
  padding: 8px 14px;
  border-top: 1px solid var(--color-border);
  background: transparent;
}

.waypoint-panel__audio-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.waypoint-panel__audio-row .btn--compact {
  flex: 1;
}

.waypoint-panel__audio-geo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  line-height: 1.4;
  color: var(--color-ink-muted);
  cursor: pointer;
}

.waypoint-panel__audio-geo input {
  flex-shrink: 0;
  accent-color: var(--color-ink);
}

.waypoint-panel__audio-hint {
  display: none;
}

.waypoint-panel__nav {
  display: flex;
  gap: 8px;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--color-border);
}

.btn {
  border-radius: 8px;
  border: 1px solid var(--color-border);
  padding: 10px 16px;
  min-height: 44px;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.btn:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn--compact {
  padding: 8px 14px;
  min-height: 40px;
  font-size: var(--text-sm);
}

.btn--ghost {
  flex: 1;
  background: #fff;
  color: var(--color-ink);
  border-color: var(--color-border);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--color-surface-subtle);
  border-color: #ccc;
}

.btn--primary {
  background: var(--color-ink);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}

.btn--primary:hover:not(:disabled) {
  background: #333;
}

@media (min-width: 900px) {
  #panel-mount {
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
  }

  .waypoint-panel {
    height: 100%;
  }

  .waypoint-panel__inner {
    border-radius: 0;
    border-left: 1px solid var(--color-border);
    border-top: none;
    border-right: none;
    border-bottom: none;
    max-height: none;
    height: 100%;
    width: 380px;
  }
}

@media (max-width: 899px) {
  #panel-mount {
    left: 0;
    right: 0;
    bottom: 0;
  }

  .waypoint-panel__inner {
    width: 100%;
    border-radius: 16px 16px 0 0;
    height: 55vh;
    max-height: 55vh;
    transform: translateY(0);
  }

  .waypoint-panel__inner--collapsed {
    transform: translateY(calc(100% - 68px));
  }

  .waypoint-panel__handle {
    display: block;
    width: 100%;
    height: 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
  }

  .waypoint-panel__handle::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
  }

  #progress-mount {
    top: 8px;
    left: 52px;
    right: 8px;
    width: auto;
    transform: none;
  }

  .back-home {
    top: 8px;
    padding: 8px 12px;
  }

  .back-home__label {
    display: none;
  }
}

.intro-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}

.intro-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 20, 0.86);
  backdrop-filter: blur(3px);
}

.intro-modal__card {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  background: var(--color-surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
  animation: introIn 420ms var(--ease) both;
  display: flex;
  flex-direction: column;
  /* Sur mobile : la card ne doit jamais dépasser le viewport (sinon CTA hors écran). */
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
}

.intro-modal--visible .intro-modal__card {
  animation-name: introIn;
}

.intro-modal--closing .intro-modal__card {
  animation: introOut 280ms var(--ease) both;
}

@keyframes introIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes introOut {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

.intro-modal__head {
  background: var(--color-bg-dark);
  padding: 20px 22px;
  border-bottom: 3px solid var(--color-accent);
}

.intro-modal__era {
  margin: 0 0 8px;
  font-family: var(--font-ui);
  color: var(--color-accent);
  font-size: var(--text-caption);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.intro-modal__title {
  margin: 0;
  color: #fff;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  line-height: 1.3;
}

.intro-modal__subtitle {
  color: var(--color-accent);
}

.intro-modal__meta {
  display: flex;
  gap: 18px;
  margin: 14px 0 0;
  padding: 0;
}

.intro-modal__meta div {
  margin: 0;
}

.intro-modal__meta dt {
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.intro-modal__meta dd {
  margin: 4px 0 0;
  color: #f6f2ea;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
}

.intro-modal__body {
  padding: 18px 22px 6px;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--color-ink);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.intro-modal__body p {
  margin: 0 0 12px;
}

.intro-modal__body .intro-pullquote {
  font-style: italic;
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
  border-left: 3px solid var(--color-accent);
  padding-left: 12px;
  margin-bottom: 18px;
}

.intro-modal__foot {
  /* CTA toujours visible : footer “sticky” en bas de la card */
  position: sticky;
  bottom: 0;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.map-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--m-fill, #111);
  border: 2.5px solid var(--m-border, #ddd);
  color: #fff;
  font-weight: 700;
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
  cursor: pointer;
  /* Pas de transition sur transform : évite le décalage visuel vs. le canvas au pan / zoom */
  transition: box-shadow var(--dur) var(--ease), filter var(--dur) var(--ease);
  font-family: var(--font-serif);
}

.map-marker span {
  line-height: 1;
}

.map-marker--lg {
  width: 44px;
  height: 44px;
  font-size: var(--text-lg);
  color: var(--color-accent);
}

.map-marker:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.map-marker--active {
  animation: markerPulse 1.6s ease-in-out infinite;
}

@keyframes markerPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(240, 192, 64, 0.45);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(240, 192, 64, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(240, 192, 64, 0);
  }
}

.leaflet-marker-wrap {
  background: transparent;
  border: none;
}

.map-user-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1e6bff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

path.leaflet-route--pulse {
  stroke-dasharray: 12 10;
  animation: dashMove 1.1s linear infinite;
}

@keyframes dashMove {
  to {
    stroke-dashoffset: -44;
  }
}

/* ─── End-tour modal (P3-U1 / U4 / U5) ─── */

.end-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.end-modal--visible {
  opacity: 1;
}

.end-modal--closing {
  animation: modalFadeOut 0.3s var(--ease) forwards;
}

@keyframes modalFadeOut {
  to { opacity: 0; transform: translateY(24px); }
}

.end-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.end-modal__card {
  position: relative;
  z-index: 1;
  background: var(--color-surface);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  padding: 28px 24px 36px;
  width: min(100%, 480px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: slideUp 0.32s var(--ease) forwards;
}

@keyframes slideUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.end-modal__check {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1a6b3a;
  color: #fff;
  font-size: 22px;
  line-height: 48px;
  margin: 0 auto 16px;
}

.end-modal__era {
  font-size: var(--text-caption);
  color: var(--color-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 4px;
}

.end-modal__title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--color-ink);
}

.end-modal__subtitle {
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
  margin: 0 0 20px;
}

.end-modal__stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 0 0 24px;
  padding: 14px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.end-modal__stats dt {
  font-size: var(--text-caption);
  color: var(--color-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.end-modal__stats dd {
  margin: 4px 0 0;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-ink);
}

/* Feedback stars (U5) */
.end-modal__feedback {
  margin: 0 0 20px;
  padding: 16px 0 0;
}

.end-modal__feedback-label {
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
  margin: 0 0 10px;
}

.end-modal__stars {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 8px;
}

.end-modal__star {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--color-ink-muted);
  padding: 4px;
  line-height: 1;
  transition: color var(--dur) var(--ease), transform 0.1s;
}

.end-modal__star:hover,
.end-modal__star--active {
  color: #f5a623;
  transform: scale(1.15);
}

.end-modal__star:disabled {
  cursor: default;
  transform: none;
}

.end-modal__feedback-sub {
  font-size: var(--text-caption);
  color: var(--color-ink-muted);
  margin: 0;
  min-height: 1.4em;
}

.end-modal__feedback-thanks {
  font-size: var(--text-sm);
  color: #1a6b3a;
  margin: 0;
  padding: 8px 0;
}

/* Actions */
.end-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.end-modal__actions .btn {
  width: 100%;
}

/* ─── Mobile safe-area & touch improvements (P2-T4) ─── */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .waypoint-panel__inner {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .end-modal__card {
    padding-bottom: calc(36px + env(safe-area-inset-bottom));
  }
}

.map {
  touch-action: pan-x pan-y;
}

/* ─── Home error state (P2 / P3) ─── */

.home-error {
  color: #c0392b;
  font-size: var(--text-base);
  margin: 16px 0 0;
}

.home-error a {
  color: inherit;
  font-weight: 600;
}
