/* ── Central palette ─────────────────────────────────────────────────
   Single source of truth for light/dark colors. The browser only tells
   us the mode (prefers-color-scheme); every actual color is ours.
   Components must use these variables instead of hard-coded colors so
   the whole app shifts tone together. */
:root {
  color-scheme: light dark;                    /* native widgets (selects, scrollbars) follow the mode */
  --vv-accent: #2563EB;                        /* active/brand blue (same in both modes) */
  --vv-link: #2563EB;                          /* text links */
  --vv-surface: #ffffff;                       /* bars, sheets, modals, pills */
  --vv-surface-2: #f3f4f6;                     /* secondary: inputs, subtle buttons, hovers */
  --vv-text: #111827;                          /* primary text */
  --vv-text-2: #6b7280;                        /* secondary text, inactive icons */
  --vv-border: #e5e7eb;                        /* separators inside surfaces */
  --vv-border-control: rgba(51, 51, 51, 0.3);  /* borders of floating controls over the map */
  --vv-muted: #d1d5db;                         /* handles, off-state toggle tracks */
}

@media (prefers-color-scheme: dark) {
  :root {
    --vv-link: #60a5fa;
    --vv-surface: #2a2a2a;
    --vv-surface-2: #1f1f1f;
    --vv-text: #f0f0f0;
    --vv-text-2: #9ca3af;
    --vv-border: rgba(255, 255, 255, 0.08);
    --vv-border-control: rgba(240, 240, 240, 0.38);
    --vv-muted: #555555;
  }
}

body {
  overflow: hidden;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  /* One typography across the whole app (matches the mobile menu). */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Form controls don't inherit font-family by default — force them to, so
   button/input labels use the same typography as everything else. */
button,
input,
select,
textarea {
  font-family: inherit;
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
}

/* Route Popup */
.vv-route-popup {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-width: 170px;
  max-width: 260px;
}

.vv-route-popup__number {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
  color: #111;
}

.vv-route-popup__name {
  font-size: 13px;
  color: #444;
  margin-bottom: 12px;
  line-height: 1.4;
}

.maplibregl-popup .vv-route-popup__share-btn {
  display: block !important;
  width: 100% !important;
  padding: 8px 12px !important;
  background: #2563EB !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
  cursor: pointer !important;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  text-align: center !important;
  box-sizing: border-box !important;
}

@media (max-width: 767px) {
  .maplibregl-popup .vv-route-popup__share-btn {
    padding: 11px 12px !important;
    font-size: 14px !important;
  }
}

@media (hover: hover) and (pointer: fine) {
  .maplibregl-popup .vv-route-popup__share-btn:hover {
    background: #1D4ED8 !important;
  }

  .maplibregl-popup .vv-route-popup__share-btn:active {
    background: #1E40AF !important;
  }
}

.maplibregl-popup .vv-route-popup__share-btn:focus {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
}

.maplibregl-popup .vv-route-popup__share-btn:focus:not(:focus-visible) {
  outline: none;
}

@media (prefers-color-scheme: dark) {
  .vv-route-popup__number {
    color: #f0f0f0;
  }

  .vv-route-popup__name {
    color: #ccc;
  }
}
