/* SummitFlux TransitMap renderer. */
.transit-map {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #dbe6ed;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.transit-map:active { cursor: grabbing; }
.tm-pane, .tm-controls, .tm-control-corner, .tm-vector, .tm-tiles {
  position: absolute;
  inset: 0;
}
.tm-pane { pointer-events: none; }
.tm-tiles-pane { z-index: 100; overflow: hidden; }
.tm-overlay-pane { z-index: 300; }
.tm-marker-pane { z-index: 400; }
.tm-popup-pane { z-index: 500; }
.tm-vector { width: 100%; height: 100%; overflow: visible; }
.tm-vector path, .tm-vector circle { pointer-events: auto; cursor: pointer; vector-effect: non-scaling-stroke; }
.tm-tiles img, .tm-tiles canvas {
  position: absolute;
  width: 256px;
  height: 256px;
  transform-origin: 0 0;
  border: 0;
  user-select: none;
  -webkit-user-drag: none;
}
/* Chromium can drop decoded tile layers when a CSS filter is composited inside
   the renderer's transformed tile/pane stack.  The old Leaflet presentation
   filters are cosmetic; keep first-party tiles visible and let each basemap's
   own cartography provide its tone.  This selector intentionally outranks the
   later `.gts-osm-* .leaflet-tile` rules in style.css without !important. */
.transit-map .tm-tiles-pane,
.transit-map .tm-tiles .leaflet-tile {
  filter: none;
}
.tm-marker {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  transform-origin: 0 0;
  will-change: transform;
}
.tm-marker > * { pointer-events: none; }
.tm-popup {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid rgb(15 35 55 / 18%);
  border-radius: 10px;
  background: rgb(255 255 255 / 97%);
  box-shadow: 0 10px 30px rgb(15 35 55 / 22%);
  color: #172432;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) translate(-50%, calc(-100% - 14px));
}
.tm-popup::after {
  content: "";
  position: absolute;
  left: calc(50% - 7px);
  bottom: -7px;
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  border-right: inherit;
  border-bottom: inherit;
  background: inherit;
}
.tm-popup-close {
  float: right;
  margin: -8px -8px 2px 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font: 20px/1 sans-serif;
  cursor: pointer;
}
.tm-tooltip {
  position: absolute;
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  padding: 5px 8px;
  border: 1px solid rgb(15 35 55 / 18%);
  border-radius: 5px;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 3px 12px rgb(15 35 55 / 16%);
  color: #172432;
  font: 12px/1.35 system-ui, sans-serif;
  pointer-events: none;
}
.tm-tooltip[data-direction="top"] { transform: translate(-50%, calc(-100% - 9px)); }
.tm-tooltip[data-direction="bottom"] { transform: translate(-50%, 9px); }
.tm-tooltip[data-direction="left"] { transform: translate(calc(-100% - 9px), -50%); }
.tm-tooltip[data-direction="right"] { transform: translate(9px, -50%); }
.tm-tooltip[data-direction="center"] { transform: translate(-50%, -50%); }
.tm-controls { z-index: 700; pointer-events: none; }
.tm-control-corner { inset: auto; display: flex; gap: 8px; padding: 10px; pointer-events: none; }
.tm-control-corner > * { pointer-events: auto; }
.tm-topleft { top: 0; left: 0; flex-direction: column; align-items: flex-start; }
.tm-topright { top: 0; right: 0; flex-direction: column; align-items: flex-end; }
.tm-bottomleft { bottom: 0; left: 0; flex-direction: column-reverse; align-items: flex-start; }
.tm-bottomright { right: 0; bottom: 0; flex-direction: column-reverse; align-items: flex-end; }
.tm-zoom { display: grid; overflow: hidden; border: 1px solid rgb(15 35 55 / 20%); border-radius: 9px; box-shadow: 0 3px 14px rgb(15 35 55 / 18%); }
.tm-zoom button { width: 36px; height: 36px; border: 0; border-bottom: 1px solid #d6dee5; background: #fff; color: #182b3b; font: 600 22px/1 sans-serif; cursor: pointer; }
.tm-zoom button:last-child { border-bottom: 0; }
.tm-zoom button:hover, .tm-zoom button:focus-visible { background: #eef5f8; }
.tm-attribution {
  position: absolute;
  z-index: 800;
  right: 0;
  bottom: 0;
  padding: 2px 6px;
  border-radius: 5px 0 0;
  background: rgb(255 255 255 / 86%);
  color: #34495a;
  font: 10px/1.4 system-ui, sans-serif;
  pointer-events: auto;
}
.tm-attribution a { color: inherit; }
@media (prefers-reduced-motion: no-preference) {
  .tm-marker { transition: transform 700ms linear; }
  .tm-marker.veh-no-trans, .veh-no-trans .tm-marker, .transit-map.veh-no-trans .tm-marker { transition: none; }
}
