:root {
  --bg: #0e141b;
  --surface: #121b25;
  --surface-soft: #182433;
  --ink: #eef2f7;
  --muted: #bdc9d9;
  --gold: #c5973a;
  --gold-soft: #e2c27a;
  --line: rgba(255, 255, 255, 0.12);
  --max: 1320px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body.neighbourhood-map {
  font-family: "Outfit", sans-serif;
  background:
    radial-gradient(circle at 10% 20%, rgba(197, 151, 58, 0.14), transparent 36%),
    radial-gradient(circle at 80% 0%, rgba(72, 133, 202, 0.18), transparent 40%),
    linear-gradient(180deg, #0e141b 0%, #0c1118 100%);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
}

.neighbourhood-map a { color: inherit; text-decoration: none; }

.map-page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px 24px 70px;
}

.map-hero {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(24, 36, 51, 0.92), rgba(18, 27, 37, 0.95));
  border-radius: 20px;
  padding: 22px 28px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.map-hero .tag {
  margin: 0 0 6px;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
}

.map-hero h1 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.5rem, 3.4vw, 2.4rem);
  font-weight: 600;
  line-height: 1.1;
}

.map-hero h1 span { color: var(--gold-soft); font-style: italic; font-weight: 400; }

.map-hero p { margin: 6px 0 0; color: var(--muted); max-width: 62ch; font-size: 0.95rem; }

.map-layout {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 18px;
  align-items: start;
}

.map-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(10, 15, 22, 0.55);
  min-height: 560px;
}

#mapCanvas {
  width: 100%;
  height: 70vh;
  min-height: 520px;
  background: transparent;
}

.map-controls {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 400;
}

.map-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(12, 17, 24, 0.82);
  color: var(--ink);
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.72rem;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.map-btn:hover { border-color: rgba(197, 151, 58, 0.55); color: var(--gold-soft); }
.map-btn[hidden] { display: none; }

.map-legend {
  position: absolute;
  bottom: 14px;
  right: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(12, 17, 24, 0.82);
  font-size: 0.72rem;
  color: var(--muted);
  max-width: 260px;
  backdrop-filter: blur(8px);
  z-index: 400;
}

.map-sidebar {
  position: sticky;
  top: 108px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(18, 27, 37, 0.74);
  padding: 18px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
}

.sidebar-breadcrumb {
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 6px;
}

.sidebar-breadcrumb .crumb-active { color: var(--gold-soft); }

.sidebar-title {
  margin: 0 0 14px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  font-weight: 600;
}

.chip-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.chip-tray:empty { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(197, 151, 58, 0.5);
  background: rgba(197, 151, 58, 0.14);
  color: var(--gold-soft);
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
}

.chip button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.chip-clear-all {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.68rem;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.chip-clear-all:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.3); }

.listings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 10px;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--gold-soft);
}

.listings-head small { color: var(--muted); font-weight: 400; letter-spacing: 0.04em; text-transform: none; font-size: 0.78rem; }

.listings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 1080px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-sidebar { position: static; max-height: none; }
  .listings-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 720px) {
  .listings-grid { grid-template-columns: 1fr; }
}

.map-suggest {
  margin: 0 0 18px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(197, 151, 58, 0.26);
  background: linear-gradient(135deg, rgba(197, 151, 58, 0.08), rgba(24, 36, 51, 0.5));
  border-radius: 14px;
}

.map-suggest-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.map-suggest-label {
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.74rem;
  color: var(--gold-soft);
}

.map-suggest-head small {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  text-transform: none;
  font-family: "Outfit", sans-serif;
}

.listings-sentinel {
  height: 1px;
  width: 100%;
  margin: 4px 0;
}

.map-empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 24px 0;
  text-align: center;
}

.map-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 22px 0;
}

.map-loading::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  animation: map-pulse 1.1s ease-in-out infinite;
}

@keyframes map-pulse {
  0%, 100% { transform: scale(0.6); opacity: 0.4; }
  50% { transform: scale(1); opacity: 1; }
}

/* Leaflet overrides */
.leaflet-container {
  font-family: "Outfit", sans-serif;
  background: transparent;
}

.leaflet-tooltip.map-label {
  background: rgba(12, 17, 24, 0.88);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: none;
  white-space: nowrap;
}

.leaflet-tooltip.map-label.sector {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--gold-soft);
  border-color: rgba(197, 151, 58, 0.4);
}

.leaflet-tooltip.map-label.sector::before,
.leaflet-tooltip.map-label::before { display: none !important; }

/* Listing card reset (copied from listings/index.html so cards look identical here) */
.map-sidebar .card {
  background: rgba(10, 15, 22, 0.55);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, transform 0.15s;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.map-sidebar .card:hover { background: rgba(18, 27, 37, 0.9); transform: translateY(-1px); }

.map-sidebar .card-photo-wrap {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--surface);
  overflow: hidden;
}

.map-sidebar .card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s;
}

.map-sidebar .card:hover .card-photo { transform: scale(1.04); }

.map-sidebar .card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--gold);
  color: #0e1017;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
}

.map-sidebar .card-days {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(14, 16, 23, 0.75);
  backdrop-filter: blur(4px);
  color: var(--muted);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
}

.map-sidebar .card-my-listing {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(197, 151, 58, 0.18);
  border: 1px solid rgba(197, 151, 58, 0.5);
  color: var(--gold-soft);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
}

.map-sidebar .card-body {
  padding: 10px 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.map-sidebar .card-price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.map-sidebar .card-address {
  font-size: 0.78rem;
  color: var(--ink);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-sidebar .card-community {
  font-size: 0.7rem;
  color: var(--gold);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}

.map-sidebar .card-stats {
  display: flex;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.map-sidebar .card-stat { display: flex; align-items: center; gap: 4px; }
.map-sidebar .card-stat svg { width: 11px; height: 11px; flex-shrink: 0; }
