body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

/* Text boxes, buttons, the date picker and map controls don't use the page font by default */
input,
button,
select,
.leaflet-container {
  font-family: inherit;
}

#map {
  height: 100vh;
  width: 100%;
  background: #f2f2f0;
}

/* Smooth fade between hours, so the shadows look like they move */
.leaflet-layer {
  transition: opacity 0.3s ease;
}

/* Toned-down OpenStreetMap, so its colours don't fight the heat colours */
.osm-soft {
  filter: saturate(0.3) brightness(1.08) contrast(0.95);
}

/* ---------- Top-left panel ---------- */

.panel {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 1000;
  width: 300px;
  max-width: calc(100% - 40px);
  box-sizing: border-box;
  background: white;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.panel h1 { margin: 0; font-size: 30px; font-weight: 800; }
.panel p  { color: #666; font-size: 14px; }

.panel input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 15px;
}

.panel button {
  width: 100%;
  padding: 12px;
  background: rgba(59, 115, 175, 0.847);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.panel button:hover { background: #0f766e; }

/* ---------- Address suggestions (autocomplete) ---------- */

.field {
  position: relative;
}

.suggestions {
  position: absolute;
  top: calc(100% - 6px);
  left: 0;
  right: 0;
  z-index: 10;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: white;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  max-height: 260px;
  overflow-y: auto;
}

.suggestions[hidden] {
  display: none;
}

.suggestion {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.suggestion.active,
.suggestion:hover {
  background: #f0fdfa;
}

.suggestion-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #222;
}

.suggestion-detail {
  display: block;
  font-size: 12px;
  color: #888;
}

.suggestion-outside {
  color: #b45309;
}

.time-bar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 520px;
  max-width: calc(100% - 40px);
  box-sizing: border-box;
  background: white;
  padding: 10px 16px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.time-bar select,
.time-bar input[type="date"] {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
  background: white;
}

.time-bar button {
  padding: 8px 14px;
  background: #0d9488;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.time-bar button:hover { background: #0f766e; }

.ruler-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

/* the fixed arrow in the middle */
.ruler-arrow {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid #0d9488;
  z-index: 2;
  pointer-events: none;
}

.ruler {
  display: flex;
  height: 50px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  mask-image: linear-gradient(to right, transparent, black 25%, black 75%, transparent);
}
.ruler::-webkit-scrollbar { display: none; }
.ruler.dragging { scroll-snap-type: none; cursor: grabbing; }

.ruler-spacer { flex: 0 0 auto; }

.tick {
  flex: 0 0 70px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  box-sizing: border-box;
  font-size: 13px;
  color: #999;
  scroll-snap-align: center;
  transition: color 0.15s, font-size 0.15s;
}

/* big tick on each hour */
.tick::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 14px;
  background: #bbb;
}

/* small tick on each half hour */
.tick::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  width: 1px;
  height: 7px;
  background: #ddd;
}

.tick.active {
  color: #0d9488;
  font-weight: 700;
  font-size: 15px;
}
.tick.active::before { background: rgb(13, 150, 139); height: 18px; }

/* ---------- Zoom buttons: two separate circles ---------- */

.leaflet-control-zoom.leaflet-bar {
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px !important;
  margin-right: 20px !important;
}

.leaflet-control-zoom a,
.leaflet-control-zoom a:first-child,
.leaflet-control-zoom a:last-child {
  width: 44px !important;
  height: 44px !important;
  line-height: 42px !important;
  border-radius: 50% !important;
  border: none !important;
  background: white;
  color: #303030;
  font-size: 24px !important;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  transition: background 0.15s, color 0.15s, transform 0.1s;
}

.leaflet-control-zoom a:hover {
  background: #0d9488;
  color: white;
}

.leaflet-control-zoom a:active {
  transform: scale(0.94);
}

.leaflet-control-zoom a.leaflet-disabled {
  background: #f3f3f3;
  color: #bbb;
}

/* ---------- Map layers ---------- */

/* On light maps, blend the heat colours in so streets and buildings show through */
.leaflet-tmrt-pane {
  mix-blend-mode: multiply;
}

/* On colourful maps and the aerial photo, blending makes colours muddy */
body.no-blend .leaflet-tmrt-pane {
  mix-blend-mode: normal;
}

/* ---------- Small screens ---------- */

@media (max-width: 700px) {
  .leaflet-bottom.leaflet-right { bottom: 90px; }
}

/* ---------- Custom pins ---------- */

.custom-pin { pointer-events: none; }

.pin {
  width: 40px;
  height: 42px;
  border-radius: 50% 50% 50% 0;
  background: var(--pin-color);
  transform: rotate(-45deg);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin span {
  transform: rotate(45deg);
  color: white;
  font-size: 13px;
  font-weight: 700;
}

/* ---------- Fastest <-> Coolest slider ---------- */

.route-slider { margin-top: 20px; }

.route-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
  margin-top: 8px;
  margin-bottom: -5px;
}

.route-slider-labels span {
  font-weight: 600;        /* <- text boldness knob */
  display: flex;
  align-items: center;
  gap: 4px;
}

#routeRange {
  width: 100%;
  accent-color: #0d9488;
  margin-top: 3px;         /* <- distance from labels to slider */
}

.route-summary {
  margin: 8px 0 4px;
  font-size: 13px;
  color: #444;
  font-weight: 700;
}

.summary-number {
  font-size: 18px;
  font-weight: 800;
  color: #0d9488;
}

/* Lightning bolt next to "Fastest" — pure CSS, no image needed */
.icon-lightning {
  width: 10px;
  height: 14px;
  background: #f59e0b;
  display: inline-block;
  clip-path: polygon(60% 0%, 0% 60%, 45% 60%, 40% 100%, 100% 40%, 55% 40%);
}
.icon-snowflake::before {
  content: "❄";
  font-size: 18px;
  color: #38bdf8;
  line-height: 1;
}

/* ---------- Route comparison table (nested inside the slider box) ---------- */

.route-table {
  width: 100%;
  box-sizing: border-box;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 24px 0 20px;
}

.route-table th:nth-child(1), .route-table td:nth-child(1) { width: 16%; }
.route-table th:nth-child(2), .route-table td:nth-child(2) { width: 26%; }
.route-table th:nth-child(3), .route-table td:nth-child(3) { width: 20%; }
.route-table th:nth-child(4), .route-table td:nth-child(4) { width: 38%; }

.route-table th {
  text-align: left;
  color: #888;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  padding: 4px 4px;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
}

.route-table td {
  padding: 6px;
  border-bottom: 1px solid #f2f2f2;
  font-size: 12px;
  color: #333;
}

.route-table tr { cursor: pointer; }

.route-table tr.active {
  background: #f0fdfa;
  font-weight: 700;
  color: #0d9488;
}

.route-table td .icon-lightning,
.route-table td .icon-snowflake {
  margin-left: 4px;
  vertical-align: middle;
  transform: translateY(-2px);
}

.logo {
  height: 45px;
  margin-bottom: -9px;
}