/* Livemap page styles - adapted from web/public/assets/css/dashboard.css's
   LIVEMAP / LIVEMAP TRACKING HUD / LIVEMAP ROSTER PANEL sections (same
   #livemap-root markup and public/js/company-livemap.js, a vendored copy -
   see templates/livemap.tmpl and app.js's initLivemap for why it isn't
   loaded cross-origin from dev.haulora.net). Kept as a separate page-only
   stylesheet rather than folded into mobile.css since nothing else in this
   app uses these classes.

   Differences from the dev copy: this app has no bottom nav at any width
   (navigation is the slide-out sidebar, see mobile.css's SIDEBAR DRAWER
   section), so the 64px bottom-nav clearance baked into dev's mobile
   breakpoints is dropped here - .topbar is a fixed 56px everywhere, and
   safe-area-inset-bottom (already this app's convention, see .content in
   mobile.css) covers the home-indicator gap on notched phones instead. */

/* dev's dashboard.css tokens the nav/route planner sections below use -
   mobile.css's :root only has the base palette. */
#livemap-root {
  --accent-hi:  #00B8E8;
  --accent-dim: rgba(0, 152, 214, 0.12);
  --glow-soft:  0 0 14px rgba(0, 152, 214, 0.2);
  --glow-sm:    0 0 8px rgba(0, 152, 214, 0.35);
}

.maplibregl-ctrl-group.livemap-region-ctrl {
  display: flex;
  flex-direction: row;
  background: rgb(8, 7, 30);
  border: 1px solid var(--border-2);
  border-radius: 0;
  box-shadow: none;
}
.maplibregl-ctrl-group.livemap-region-ctrl button {
  width: auto;
  min-width: 4.5rem;
  height: 29px;
  padding: 0 1.375rem;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background-color: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
/* RegionControl's ProMods button on the ProMods Livemap. */
.maplibregl-ctrl-group.livemap-region-ctrl button.active { background-color: var(--accent-dim); }
.maplibregl-ctrl-group.livemap-region-ctrl button + button {
  border-top: none;
  border-left: 1px solid var(--border-2);
}
.maplibregl-ctrl-group.livemap-region-ctrl button:not(:disabled):hover { background-color: rgba(0, 152, 214, 0.12); }

.maplibregl-ctrl-top-right .maplibregl-ctrl-group,
.maplibregl-ctrl-group.livemap-roster-ctrl {
  background: rgb(8, 7, 30);
  border: 1px solid var(--border-2);
  border-radius: 0;
  box-shadow: none;
}
.maplibregl-ctrl-top-right .maplibregl-ctrl-group button,
.maplibregl-ctrl-group.livemap-roster-ctrl button {
  background-color: transparent;
}
.maplibregl-ctrl-top-right .maplibregl-ctrl-group button + button {
  border-top: 1px solid var(--border-2);
}
.maplibregl-ctrl-top-right .maplibregl-ctrl-group button:not(:disabled):hover,
.maplibregl-ctrl-group.livemap-roster-ctrl button:not(:disabled):hover {
  background-color: rgba(0, 152, 214, 0.12);
}
.maplibregl-ctrl-top-right .maplibregl-ctrl-group button.maplibregl-ctrl-compass,
.maplibregl-ctrl-top-right .maplibregl-ctrl-group button.maplibregl-ctrl-compass:active {
  cursor: pointer;
}

.livemap-view-toggle,
.livemap-roster-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
}
.livemap-view-toggle { color: var(--text-2); }
.livemap-view-toggle.active {
  color: var(--accent);
  background-color: rgba(0, 152, 214, 0.12);
}
.livemap-roster-toggle { color: var(--accent); }
.livemap-roster-toggle.active { background-color: rgba(0, 152, 214, 0.12); }
.maplibregl-ctrl-top-right .maplibregl-ctrl-icon {
  filter: invert(48%) sepia(94%) saturate(1907%) hue-rotate(160deg) brightness(97%) contrast(101%);
}

/* .content's standard padding is shared across every page - scope its
   removal to just this page by keying off #livemap-root's presence. */
.content:has(#livemap-root) { padding: 0; min-height: calc(100dvh - var(--topbar-h)); }

.livemap-layout { display: block; height: 100%; position: relative; }

.livemap-map {
  width: 100%;
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  overflow: hidden;
  background: #242f3e;
  isolation: isolate;
}

.livemap-marker {
  position: relative;
  width: 28px;
  height: 28px;
  cursor: pointer;
  --marker-color: var(--accent);
}
.livemap-marker.is-inactive { --marker-color: #F59E0B; }
.livemap-marker.is-offline { --marker-color: #5B6172; }
.livemap-marker.is-self { z-index: 20; }

.livemap-marker-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--marker-color);
  box-shadow: none;
  overflow: hidden;
  background: rgb(8, 7, 30);
  opacity: 1;
  transition: border-color 0.3s, box-shadow 0.3s, opacity 0.3s;
}
.livemap-marker-avatar img { width: 100%; height: 100%; object-fit: cover; }
.livemap-marker.is-active .livemap-marker-avatar { box-shadow: 0 0 8px rgba(0, 152, 214, 0.35); }
.livemap-marker.is-offline .livemap-marker-avatar { opacity: 0.55; }
/* Supporter marker style (company-livemap.js applyMarkerStyle): own colour
   while driving and a steady halo (no pulse). */
.livemap-marker.has-custom-color.is-active { --marker-color: var(--marker-custom); }
.livemap-marker.has-glow:not(.is-offline) .livemap-marker-avatar {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--marker-color) 35%, transparent), 0 0 16px 5px color-mix(in srgb, var(--marker-color) 55%, transparent);
}

.livemap-marker-heading {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-out;
}
.livemap-marker-heading::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 8px solid var(--marker-color);
  filter: drop-shadow(0 0 2px rgba(0, 184, 232, 0.6));
}

/* FullscreenControl's container is #livemap-root, so the topbar the calc()
   above reserves space for isn't part of the fullscreened subtree once
   fullscreen is active - without this the reserved space is an empty gap. */
#livemap-root:fullscreen .livemap-map,
#livemap-root:-webkit-full-screen .livemap-map {
  height: 100%;
}

/* ── LIVEMAP TRACKING HUD ────────────────────────────────── */
.livemap-hud {
  position: absolute;
  left: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 5;
  width: 250px;
  background: rgb(8, 7, 30);
  border: 1px solid var(--border-2);
  box-shadow: 0 0 14px rgba(0, 152, 214, 0.2);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  padding: 0.875rem 1rem 1rem;
  color: var(--text);
}
.livemap-hud[hidden] { display: none; }

.livemap-hud-close {
  position: absolute;
  top: 0.375rem;
  right: 0.625rem;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.125rem 0.25rem;
  transition: color 0.15s;
}
.livemap-hud-close:hover { color: var(--accent); }

.livemap-hud-driver {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.375rem;
}
.livemap-hud-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 8px rgba(0, 152, 214, 0.35);
  object-fit: cover;
  background: rgb(8, 7, 30);
  flex-shrink: 0;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.livemap-hud.is-inactive .livemap-hud-avatar { border-color: #F59E0B; }
.livemap-hud.is-offline .livemap-hud-avatar { border-color: var(--text-3); box-shadow: none; }
.livemap-hud-name {
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.livemap-hud-tracking {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  display: flex;
  align-items: center;
}
.livemap-hud.is-inactive .livemap-hud-tracking { color: #F59E0B; }
.livemap-hud.is-offline .livemap-hud-tracking { color: var(--text-3); }
.livemap-hud-tracking::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 0.35rem;
  box-shadow: 0 0 8px currentColor;
  animation: livemap-hud-pulse 1.6s ease-in-out infinite;
}
.livemap-hud.is-offline .livemap-hud-tracking::before { animation: none; opacity: 0.6; }
@keyframes livemap-hud-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.livemap-hud-gauge { position: relative; width: 100%; margin: 0 auto; }
.livemap-hud-gauge-svg { width: 100%; display: block; }
.livemap-hud-gauge-track,
.livemap-hud-gauge-value {
  fill: none;
  stroke-linecap: round;
}
.livemap-hud-gauge-track {
  stroke: var(--border-2);
  stroke-width: 10;
}
.livemap-hud-gauge-value {
  stroke: var(--accent);
  stroke-width: 10;
  stroke-dasharray: 0 100;
  filter: drop-shadow(0 0 4px rgba(0, 184, 232, 0.55));
  transition: stroke-dasharray 0.4s ease-out, stroke 0.3s;
}
.livemap-hud-gauge-value.is-over {
  stroke: #E8544A;
  filter: drop-shadow(0 0 4px rgba(232, 84, 74, 0.55));
}

.livemap-hud-gauge-readout {
  position: absolute;
  left: 50%;
  top: 64%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.livemap-hud-speed {
  display: block;
  font-weight: 700;
  font-size: 2.375rem;
  line-height: 1;
  color: var(--text);
  transition: color 0.3s;
}
.livemap-hud-speed.is-over { color: #E8544A; }
.livemap-hud-speed.is-cruise { color: #7DD3FC; }
.livemap-hud-speed-unit {
  display: block;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-top: 0.125rem;
}

.livemap-hud-dest {
  font-size: 0.75rem;
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.livemap-hud-cargo {
  font-size: 0.6875rem;
  color: var(--text-3);
  margin-top: 0.125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.livemap-hud-distbar {
  margin-top: 0.625rem;
  height: 4px;
  background: var(--border-2);
  position: relative;
  overflow: hidden;
}
.livemap-hud-distbar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #00B8E8);
  box-shadow: 0 0 8px rgba(0, 152, 214, 0.35);
  transition: width 0.4s ease-out;
}

.livemap-hud-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 0.75rem;
  margin-top: 0.625rem;
}
.livemap-hud-stat { display: flex; flex-direction: column; }
.livemap-hud-stat-label {
  font-size: 0.5625rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.livemap-hud-stat-value {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.livemap-hud-nojob,
.livemap-hud-lastseen {
  display: none;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-3);
  text-align: center;
}
.livemap-hud.is-no-job .livemap-hud-job { display: none; }
.livemap-hud.is-no-job .livemap-hud-nojob { display: block; }

.livemap-hud.is-offline .livemap-hud-job { display: none; }
.livemap-hud.is-offline .livemap-hud-nojob { display: none; }
.livemap-hud.is-offline .livemap-hud-lastseen { display: block; }
.livemap-hud.is-offline .livemap-hud-gauge { opacity: 0.4; }

@media (max-width: 600px) {
  .livemap-hud {
    left: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    width: calc(100% - 1.5rem);
    max-width: 280px;
  }
}

/* ── LIVEMAP ROSTER PANEL ────────────────────────────────── */
.livemap-roster {
  position: absolute;
  z-index: 5;
  width: 280px;
  max-height: min(60vh, 420px);
  display: flex;
  flex-direction: column;
  background: rgb(8, 7, 30);
  border: 1px solid var(--border-2);
  box-shadow: 0 0 14px rgba(0, 152, 214, 0.2);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  padding: 0.875rem 1rem 1rem;
  color: var(--text);
}
.livemap-roster[hidden] { display: none; }

.livemap-roster-title {
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.625rem;
}

.livemap-roster-tabs {
  display: flex;
  border: 1px solid var(--border-2);
  margin-bottom: 0.625rem;
  flex-shrink: 0;
}
.livemap-roster-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 0.375rem 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.livemap-roster-tab + .livemap-roster-tab { border-left: 1px solid var(--border-2); }
.livemap-roster-tab:hover { background: rgba(0, 152, 214, 0.12); }
.livemap-roster-tab.is-active,
.livemap-roster-tab.is-active:hover {
  color: #080A0D;
  background: var(--accent);
}

.livemap-roster-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.livemap-roster-list[hidden] { display: none; }

.livemap-roster-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.livemap-roster-row.is-clickable { cursor: pointer; }
.livemap-roster-row.is-clickable:hover {
  background: rgba(0, 152, 214, 0.12);
  border-color: var(--border-2);
}
.livemap-roster-row.is-offline { opacity: 0.7; }

.livemap-roster-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: rgb(8, 7, 30);
  flex-shrink: 0;
  border: 2px solid var(--accent);
}
.livemap-roster-avatar.has-custom-color { border-color: var(--marker-custom); }
.livemap-roster-row:not(.is-offline) .livemap-roster-avatar.has-glow { box-shadow: 0 0 0 2px color-mix(in srgb, var(--marker-custom, var(--accent-hi)) 35%, transparent), 0 0 10px 3px color-mix(in srgb, var(--marker-custom, var(--accent-hi)) 50%, transparent); overflow: visible; }
.livemap-roster-avatar.has-glow img { border-radius: 50%; }
.livemap-roster-row.is-offline .livemap-roster-avatar { border-color: var(--text-3); }
.livemap-roster-avatar img { width: 100%; height: 100%; object-fit: cover; }

.livemap-roster-info { min-width: 0; flex: 1; }
.livemap-roster-name {
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.livemap-roster-meta {
  font-size: 0.6875rem;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.livemap-roster-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}
.livemap-roster-status.is-inactive { background: #F59E0B; box-shadow: 0 0 6px #F59E0B; }

.livemap-roster-empty {
  padding: 0.75rem 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-3);
}

@media (max-width: 600px) {
  .livemap-roster {
    width: calc(100% - 1.5rem);
    max-width: 280px;
    max-height: min(50vh, 360px);
  }
}

/* ── LIVEMAP JOB NAVIGATION ─────────────────────────────── */
/* Turn card for the followed driver's job route (the "Job navigation"
   section of company-livemap.js) - top-center over the map like a sat-nav
   banner, same panel look as the HUD/roster. Maneuver arrows are inline
   SVGs using currentColor. */
.livemap-nav {
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: min(380px, calc(100% - 7.5rem));
  background: rgb(8, 7, 30);
  border: 1px solid var(--border-2);
  box-shadow: var(--glow-soft);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  padding: 0.75rem 1rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
}
.livemap-nav[hidden] { display: none; }

.livemap-nav-main {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.livemap-nav-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  color: var(--accent-hi);
}
.livemap-nav-icon svg,
.livemap-nav-then-icon svg,
.livemap-nav-lane svg { width: 100%; height: 100%; display: block; }
.livemap-nav.is-pending .livemap-nav-icon { display: none; }

.livemap-nav-text { min-width: 0; flex: 1; }
.livemap-nav-distance {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.1;
}
.livemap-nav-distance:empty { display: none; }
.livemap-nav-instruction {
  font-size: 0.875rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.livemap-nav.is-pending .livemap-nav-instruction { color: var(--text-2); font-size: 0.8125rem; }

.livemap-nav-lanes {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  padding: 0.25rem;
  border: 1px solid var(--border-2);
}
.livemap-nav-lanes[hidden] { display: none; }
.livemap-nav-lane {
  width: 22px;
  height: 22px;
  color: var(--text-3);
  opacity: 0.55;
}
.livemap-nav-lane.is-active { color: var(--accent-hi); opacity: 1; }

.livemap-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  color: var(--text-3);
}
.livemap-nav-footer:has(.livemap-nav-then[hidden]):has(.livemap-nav-status:empty) { display: none; }
.livemap-nav-then {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
  color: var(--text-2);
}
.livemap-nav-then[hidden] { display: none; }
.livemap-nav-then-icon { width: 16px; height: 16px; color: var(--text); }
.livemap-nav-status {
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Delivery depot flag on the map (reuses the route pin shape). */
.livemap-route-marker.livemap-nav-dest {
  background: #00688F;
  color: #fff;
  padding: 4px;
}
.livemap-route-marker.livemap-nav-dest svg { width: 100%; height: 100%; }

@media (max-width: 600px) {
  .livemap-nav { padding: 0.5rem 0.75rem; }
  .livemap-nav-icon { width: 34px; height: 34px; }
  .livemap-nav-distance { font-size: 1.25rem; }
}

/* ── LIVEMAP ROUTE PLANNER PANEL ─────────────────────────── */
/* RouteControl's panel (company-livemap.js) - reuses the roster panel's
   shell/title/tab styles via the shared .livemap-roster class; only the
   form, result card and route pins are specific to it. Positioned the same
   way (left/top set inline by positionRoutePanel()). */
/* max-height is set inline by positionRoutePanel() - the space left below
   the panel's anchor, which a percentage here can't express. */
.livemap-route {
  width: 300px;
  overflow-y: auto;
}

.livemap-route-form {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.livemap-route-leg {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
}
.livemap-route-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.livemap-route-label {
  font-size: 0.5625rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.livemap-route-select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  padding: 0.375rem 0.5rem;
  border-radius: 0;
}
.livemap-route-select:focus {
  outline: none;
  border-color: var(--accent);
}
.livemap-route-select:disabled { opacity: 0.5; }

/* A/B badges - the same letters/colours as the pins drawn on the map. */
.livemap-route-pin,
.livemap-route-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.8125rem;
  color: #fff;
  flex-shrink: 0;
}
.livemap-route-pin { margin-top: 1rem; }
.livemap-route-pin.is-start,
.livemap-route-marker.is-start { background: #4C8DF6; }
.livemap-route-pin.is-end,
.livemap-route-marker.is-end { background: #EA4335; }
.livemap-route-marker {
  width: 26px;
  height: 26px;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.livemap-route-stops {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.livemap-route-pin.is-waypoint,
.livemap-route-marker.is-waypoint { background: #F29900; }
.livemap-route-marker.is-waypoint {
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
}
.livemap-route-remove {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 1.125rem;
  line-height: 1;
  padding: 0.125rem 0.125rem;
  margin-top: 0.875rem;
  cursor: pointer;
  transition: color 0.15s;
}
.livemap-route-remove:hover { color: #EA4335; }

/* Map-clicked stops (company-mode waypoints between start/destination, or
   every free-draw point) - one compact row each, rendered by
   renderRoutePointList() in company-livemap.js. */
.livemap-route-points {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.livemap-route-points:empty,
.livemap-route-points[hidden] { display: none; }
.livemap-route-point {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.livemap-route-point .livemap-route-pin { margin-top: 0; }
.livemap-route-point-label {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.livemap-route-point .livemap-route-remove { margin-top: 0; }

.livemap-route-games { margin-bottom: 0.625rem; }
.livemap-route-companies[hidden] { display: none; }

.livemap-route-hint {
  font-size: 0.6875rem;
  color: var(--text-3);
}
.livemap-route-hint:empty { display: none; }

/* Clicked-point pins on the map remove themselves on click - hover makes
   that discoverable. */
.livemap-route-marker { cursor: default; }
/* No transform here - maplibre positions the marker element via its own
   inline transform, which a hover scale would overwrite. */
.livemap-route-marker.is-removable { cursor: pointer; transition: background 0.15s, box-shadow 0.15s; }
.livemap-route-marker.is-removable:hover {
  background: #EA4335;
  box-shadow: 0 0 0 3px rgba(234, 67, 53, 0.35), 0 1px 4px rgba(0, 0, 0, 0.5);
}

.livemap-route-legs:not(:empty) {
  margin-top: 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.livemap-route-leg-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.6875rem;
}
.livemap-route-leg-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  color: var(--text-2);
}
.livemap-route-leg-value { color: var(--text-2); white-space: nowrap; }

.livemap-route-modes { margin-bottom: 0; }

.livemap-route-actions {
  display: flex;
  gap: 0.5rem;
}
.livemap-route-btn {
  flex: 1;
  background: none;
  border: 1px solid var(--border-2);
  color: var(--text-2);
  padding: 0.4375rem 0;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.livemap-route-btn:hover { background: var(--accent-dim); color: var(--text); }
.livemap-route-btn.is-primary {
  flex: 2;
  background: var(--accent);
  border-color: var(--accent);
  color: #080A0D;
}
.livemap-route-btn.is-primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.livemap-route-btn:disabled { opacity: 0.5; cursor: default; }

.livemap-route-status {
  margin-top: 0.625rem;
  font-size: 0.75rem;
  color: var(--text-2);
}
.livemap-route-status[hidden],
.livemap-route-result[hidden] { display: none; }

.livemap-route-result {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-2);
}
.livemap-route-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.livemap-route-stats .livemap-hud-stat-value { font-size: 1.125rem; }
.livemap-route-ferries:not(:empty) {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.livemap-route-ferry {
  font-size: 0.6875rem;
  color: var(--text-2);
}
.livemap-route-note {
  margin-top: 0.5rem;
  font-size: 0.625rem;
  color: var(--text-3);
}

@media (max-width: 600px) {
  .livemap-route {
    width: calc(100% - 1.5rem);
    max-width: 300px;
  }
}

/* ── LIVEMAP EMPTY STATE (not in a company) ────────────────── */
.livemap-empty {
  min-height: calc(100dvh - var(--topbar-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: var(--text-3);
}

/* Supporter colour + staff shield next to driver names (company-livemap.js
   setDriverName). The website draws Font Awesome glyphs in these <i>
   elements; the pwa has no icon font, so they're plain shapes here. */
.supporter-name-hauler, .supporter-road-hauler { --tier: #C87533; }
.supporter-name-elite, .supporter-road-elite { --tier: #00C853; }
.supporter-name-legend, .supporter-road-legend { --tier: #9C27FF; }
.supporter-name-carrier, .supporter-road-carrier { --tier: #FFC107; }
.supporter-name { color: var(--tier, #FFC107); }
.name-icon { display: inline-block; width: 0.6em; height: 0.6em; margin-left: 0.3em; vertical-align: middle; border-radius: 2px; }
.supporter-road { background: var(--tier, #FFC107); }
.staff-shield { background: #E5484D; border-radius: 0 0 50% 50%; }

/* How many people have this Livemap open (company-livemap.js, page_viewers). */
.livemap-viewers { position: absolute; bottom: calc(0.75rem + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 4; padding: 0.25rem 0.75rem; background: rgb(8, 7, 30); border: 1px solid #272C3D; border-radius: 999px; font-size: 0.75rem; color: #9BA1B5; pointer-events: none; white-space: nowrap; }
.livemap-viewers[hidden] { display: none; }
/* the HUD takes the bottom of the screen */
.livemap-layout:has(.livemap-hud:not([hidden])) .livemap-viewers { display: none; }
