:root {
  --navy: #10069f;
  --red: #dc241f;
  --ink: #1c1f2e;
  --muted: #6f7387;
  --line: rgba(28, 31, 46, 0.08);
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}

#map {
  position: absolute;
  inset: 0;
  background: #e8e8e4;
}

/* Mute the base map so the heat colors stand out. */
.base-tiles {
  filter: grayscale(0.85) brightness(1.06) contrast(0.96);
}

/* ---------- Panel ---------- */

.panel {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1000;
  width: 248px;
  padding: 20px 20px 16px;
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(16, 20, 60, 0.14), 0 1px 3px rgba(16, 20, 60, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

/* TfL-ish roundel */
.roundel {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  border: 6px solid var(--red);
  border-radius: 50%;
  box-sizing: border-box;
}

.roundel::after {
  content: "";
  position: absolute;
  left: -9px;
  right: -9px;
  top: 50%;
  height: 7px;
  transform: translateY(-50%);
  background: var(--navy);
  border-radius: 1px;
}

.brand-text h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-top: 1px;
}

/* ---------- Toggle rows ---------- */

.rows {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: center;
  padding: 7px 0;
  cursor: pointer;
  user-select: none;
}

.row .txt {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.row input {
  display: none;
}

.sw {
  margin-left: auto;
  flex: none;
  width: 34px;
  height: 20px;
  border-radius: 10px;
  background: rgba(28, 31, 46, 0.16);
  position: relative;
  transition: background 0.18s ease;
}

.sw::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease;
}

.row input:checked ~ .sw {
  background: var(--navy);
}

.row input:checked ~ .sw::after {
  transform: translateX(14px);
}

.row:hover .sw {
  filter: brightness(1.08);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 10px 0 12px;
}

/* ---------- Slider ---------- */

.slider-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cap {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

#radius-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(28, 31, 46, 0.14);
  outline: none;
  margin: 0 0 4px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--navy);
  border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--navy);
  border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

/* ---------- Legend ---------- */

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.legend-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right,
    rgb(215, 48, 39),
    rgb(254, 224, 139),
    rgb(26, 152, 80));
}

.legend-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* ---------- Marker badges ----------
   .badge is the shared round emoji chip; each layer has a color variant,
   and a "-bold" variant marks the top tier (★★★ cafes, 9.0+ food, hub stations). */

.badge {
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(16, 20, 60, 0.28);
}

.badge--coffee { border: 1px solid #b08968; font-size: 12px; }
.badge--coffee-bold { border: 2px solid #7f4f24; background: #fff3e0; }

.badge--food { border: 1px solid #845ef7; }
.badge--food-bold { border: 2px solid #5f3dc4; background: #f3f0ff; }

.badge--station { border: 1px solid #4263eb; }
.badge--station-bold { border: 2px solid var(--navy); background: #edf2ff; }

/* ---------- Leaflet chrome ---------- */

.leaflet-container {
  font-family: "Hanken Grotesk", -apple-system, sans-serif;
}

.leaflet-control-zoom {
  border: none !important;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(16, 20, 60, 0.16) !important;
}

.leaflet-control-zoom a {
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: none !important;
}

.leaflet-control-zoom a:hover {
  background: #fff !important;
  color: var(--navy) !important;
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.7) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 9px !important;
  color: var(--muted) !important;
  border-radius: 8px 0 0 0;
}

.leaflet-control-scale-line {
  font-family: "Hanken Grotesk", -apple-system, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1.5px solid var(--ink) !important;
  border-top: none !important;
  border-radius: 0 0 6px 6px;
  padding: 2px 6px 1px;
  box-shadow: 0 2px 8px rgba(16, 20, 60, 0.12);
}

/* ---------- Popups ---------- */

.leaflet-popup-content-wrapper {
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(16, 20, 60, 0.2);
  padding: 4px 2px;
}

.leaflet-popup-content {
  margin: 10px 14px;
  font-family: "Hanken Grotesk", -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

.leaflet-popup-tip {
  box-shadow: 0 2px 8px rgba(16, 20, 60, 0.12);
}

.note-popup {
  max-width: 240px;
}

.note-popup .score {
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  margin-bottom: 3px;
}

.note-popup .date {
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}
