*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Same brand palette as /styles.css (this page doesn't load it). */
  --ink: #09090b;
  --ink-2: #141417;
  --ink-3: #1f1f24;
  --primary: #6D2F9A;
  --violet: #9444CB;
  --lilac: #C19FDC;
  --teal: #02DCC7;
  --success: #34C759;
  --bg-primary: var(--ink);
  --bg-secondary: var(--ink-2);
  --bg-tertiary: var(--ink-3);
  --text-primary: #FFFFFF;
  --text-secondary: #9b9ba5;
  --border: rgba(255, 255, 255, 0.1);
  --glass: rgba(18, 18, 22, 0.82);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ── Full-screen map ── */
#map {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* ── Leaflet overrides ── */
.leaflet-container { background: var(--ink); }
.leaflet-control-zoom a {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--glass-border) !important;
}
.leaflet-control-attribution {
  background: rgba(0,0,0,0.5) !important;
  color: rgba(255,255,255,0.4) !important;
  font-size: 10px;
}
.leaflet-control-attribution a { color: rgba(255,255,255,0.5) !important; }

/* ── Cluster markers ── */
.cluster-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(18, 18, 22, 0.92);
  border: 1.5px solid rgba(109,47,154,0.7);
  box-shadow: 0 0 14px 6px rgba(109,47,154,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Individual markers ── */
.map-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
}
.marker-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -58%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(109, 47, 154, 0.35);
  box-shadow: 0 0 14px 7px rgba(109, 47, 154, 0.45);
  pointer-events: none;
}
.marker-glow.selected {
  width: 48px;
  height: 48px;
  background: rgba(109, 47, 154, 0.55);
  box-shadow: 0 0 20px 10px rgba(200, 160, 255, 0.5);
}
.marker-emoji {
  font-size: 28px;
  line-height: 1;
  z-index: 1;
  transition: transform 0.15s;
}
.map-marker:hover .marker-emoji { transform: scale(1.15); }
/* Selected pin (chosen from the map or the results list) — enlarge + always
   label it; the brighter glow comes from .marker-glow.selected above. */
.map-marker.is-selected .marker-emoji { transform: scale(1.2); }
.map-marker.is-selected .marker-name  { display: block; }
.marker-name {
  background: rgba(18, 18, 22, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 7px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  margin-top: 3px;
  z-index: 1;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
/* Name labels are hidden by default and revealed by density (zoomed in OR
   only a few markers in view, via the .map-show-names container class) or on
   hover for an individual marker. */
.marker-name { display: none; }
.map-show-names .marker-name { display: block; }
.map-marker:hover .marker-name { display: block; }

/* ── Top overlay: search bar + chips ── */
#top-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 12px 12px 0;
  pointer-events: none;
}

/* Logo bar */
#logo-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  pointer-events: auto;
}
#logo-bar a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 6px 12px 6px 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
#logo-bar img { width: 22px; height: 22px; border-radius: 5px; }
#logo-bar span { font-size: 14px; font-weight: 800; letter-spacing: 0.2px; }
#logo-bar .logo-bar-links { display: flex; gap: 6px; }
#logo-bar .logo-bar-links a { font-size: 13px; font-weight: 600; padding: 7px 14px; }
#logo-bar .get-app {
  background: var(--primary);
  border-color: transparent;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 10px;
}

/* Search bar */
#search-wrap {
  position: relative;
  pointer-events: auto;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-field { position: relative; flex: 1; min-width: 0; }
#search-wrap .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}
#search-input {
  width: 100%;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px 44px 14px 42px;
  font-size: 16px;
  color: var(--text-primary);
  font-family: inherit;
  box-shadow: var(--shadow);
  -webkit-appearance: none;
  transition: border-color 0.2s;
}
#search-input:focus { outline: none; border-color: rgba(109,47,154,0.6); }
#search-input::placeholder { color: var(--text-secondary); }
#search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  display: none;
}
#search-clear.visible { display: block; }

/* Category chips */
#chips-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  pointer-events: auto;
}
#chips-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 7px 10px;
  font-size: 16px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.chip:hover { border-color: rgba(109,47,154,0.5); color: var(--text-primary); }
.chip.active {
  background: rgba(109,47,154,0.75);
  backdrop-filter: blur(12px);
  border-color: rgba(109,47,154,0.8);
  color: #fff;
}

/* ── Smart-search dropdown (Places · Regions · Tags) ── */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: 60vh;
  overflow-y: auto;
}
.search-dropdown[hidden] { display: none; }
.sd-header {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: 9px 14px 4px;
}
.sd-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 14px;
  background: none;
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  text-align: left;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
}
.sd-header + .sd-item { border-top: 0; }
.sd-item:hover { background: rgba(109,47,154,0.18); }
.sd-icon { flex-shrink: 0; font-size: 18px; width: 22px; text-align: center; }
.sd-text { display: flex; flex-direction: column; min-width: 0; }
.sd-text strong { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-sub { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

/* ── Active stackable tag filters ── */
.active-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  pointer-events: auto;
}
.active-tags:empty { display: none; }
.active-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(109,47,154,0.75);
  border: 1px solid rgba(109,47,154,0.8);
  border-radius: 16px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.active-tag-x { opacity: 0.8; font-size: 11px; }
.active-tag:hover .active-tag-x { opacity: 1; }

/* ── Location enable banner ── */
#location-banner {
  position: fixed;
  bottom: 24px;
  left: 12px;
  right: 12px;
  z-index: 110;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
#location-banner-body {
  display: flex;
  align-items: center;
  gap: 12px;
}
#location-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#location-banner-text strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
#location-banner-text span {
  font-size: 12px;
  color: var(--text-secondary);
}
#location-banner-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}
#location-banner-btn:hover { background: var(--violet); }
.banner-dismiss {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
}

/* ── Locate-me button (lives in the search row) ── */
.map-locate {
  flex-shrink: 0;
  width: 48px; height: 48px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: background 0.15s, border-color 0.15s;
}
.map-locate:hover { background: rgba(109,47,154,0.3); border-color: rgba(109,47,154,0.5); }
.map-locate.active { background: rgba(109,47,154,0.6); border-color: var(--primary); color: #fff; }
.map-locate svg { display: block; }

/* Results launcher — a purple bubble (bottom-right) matching the admin concierge
   chat launcher; re-opens the collapsed results list. */
.results-launcher {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 110;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.results-launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,0.42); }
.results-launcher svg { display: block; }

/* Feedback launcher — a small pill (bottom-left), always visible. */
.feedback-launcher {
  position: fixed;
  bottom: 20px; left: 20px;
  z-index: 110;
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  border-radius: 20px;
  background: rgba(24,24,27,0.92);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 13px; font-family: inherit; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.feedback-launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,0.42); }

/* ── User-location dot (Apple Maps style): purple dot + white ring + pulse ── */
.user-loc { position: relative; width: 22px; height: 22px; }
.user-loc-dot {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); border: 3px solid #fff;
  box-shadow: 0 0 1px 1px rgba(0,0,0,0.25), 0 1px 5px rgba(0,0,0,0.45);
}
.user-loc-pulse {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(109,47,154,0.45);
  animation: user-loc-pulse 2s ease-out infinite;
}
@keyframes user-loc-pulse {
  0%   { transform: translate(-50%,-50%) scale(1);   opacity: 0.6; }
  100% { transform: translate(-50%,-50%) scale(3.2); opacity: 0; }
}

/* ── Bottom sheet ── */
#bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 32px rgba(0,0,0,0.5);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32,0.72,0,1);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}
#bottom-sheet.visible { transform: translateY(0); }

#sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  flex-shrink: 0;
  position: relative;
}
.sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 8px;
}
#sheet-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
#sheet-count {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
#sheet-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
#sheet-close:hover { background: rgba(255,255,255,0.18); }

#sheet-content {
  overflow-y: auto;
  flex: 1;
  padding: 0 12px 24px;
  overscroll-behavior: contain;
}

/* ── Place detail card ── */
/* Back button */
.sheet-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #A47CC5;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0 12px;
  font-family: inherit;
}
.sheet-back-btn:hover { color: #c09ee0; }

/* ── Result cards in sheet ── */
.result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.15s;
  margin-bottom: 8px;
  cursor: pointer;
}
.result-card:hover { background: rgba(255,255,255,0.09); }
.result-card.selected {
  background: rgba(109,47,154,0.18);
  border-color: rgba(109,47,154,0.55);
}
.result-emoji {
  font-size: 22px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.07);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.result-info { flex: 1; min-width: 0; }
.result-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-meta { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.result-right { text-align: right; flex-shrink: 0; }
.result-dist { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.result-chevron { font-size: 16px; color: var(--text-secondary); margin-left: 4px; }

/* Event cards */
.event-result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.15s;
  margin-bottom: 8px;
}
.event-result-card:hover { background: rgba(255,255,255,0.09); }
.event-poster {
  width: 48px; height: 48px; border-radius: 10px;
  object-fit: cover; flex-shrink: 0; background: var(--bg-tertiary);
}
.event-poster-placeholder {
  width: 48px; height: 48px; border-radius: 10px;
  background: radial-gradient(circle at 30% 20%, rgba(148, 68, 203, 0.6), transparent 65%), var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.event-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase;
  color: var(--teal); margin-bottom: 2px;
}

/* ── States ── */
.sheet-state {
  text-align: center;
  padding: 28px 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}
.sheet-state-icon { font-size: 32px; margin-bottom: 8px; }

/* spinner */
.spinner-sm {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Location error / city fallback ── */
#location-error {
  position: fixed;
  bottom: 80px;
  left: 12px;
  right: 12px;
  z-index: 110;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  box-shadow: var(--shadow);
}
#location-error p { margin-bottom: 8px; }
.city-wrap { display: flex; gap: 6px; }
.city-input {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
}
.city-input:focus { outline: none; border-color: rgba(109,47,154,0.6); }
.city-input::placeholder { color: var(--text-secondary); }
.city-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.error-dismiss {
  position: absolute;
  top: 10px; right: 12px;
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 16px; cursor: pointer;
}

@media (min-width: 600px) {
  #top-overlay { padding: 16px 16px 0; max-width: 480px; }
  /* Results list becomes a right-side drawer. */
  #bottom-sheet {
    top: 16px; right: 16px; bottom: 16px; left: auto;
    width: 400px; max-width: none; max-height: none;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: -6px 0 28px rgba(0,0,0,0.5);
    transform: translateX(calc(100% + 32px));
  }
  #bottom-sheet.visible { transform: translateX(0); }
  #sheet-header .sheet-handle { display: none; }
  #location-error { max-width: 420px; left: 50%; transform: translateX(-50%); right: auto; width: calc(100% - 24px); }
  #location-banner { max-width: 420px; left: 50%; transform: translateX(-50%); right: auto; width: calc(100% - 24px); }
}

/* ── Report a problem modal ─────────────────────────────────────────────── */
.report-modal-backdrop {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.report-modal-backdrop.hidden { display: none; }
.report-modal {
  width: 100%; max-width: 380px;
  background: rgba(24,24,27,0.98);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(0,0,0,0.6);
  padding: 22px;
}
.report-modal h3 { margin: 0 0 6px; font-size: 17px; color: var(--text-primary); }
.report-modal-sub { margin: 0 0 16px; font-size: 13px; color: var(--text-secondary); }
.report-modal-field { margin-bottom: 14px; }
.report-modal-field label {
  display: block; font-size: 12px; color: var(--text-secondary);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px;
}
.report-modal-field select,
.report-modal-field textarea,
.report-modal-field input {
  width: 100%; background: var(--bg-tertiary); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; font-family: inherit; resize: vertical;
}
.report-modal-feedback { min-height: 16px; font-size: 13px; color: var(--error, #FF3B30); margin: 0 0 8px; }
.report-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.report-modal-actions button {
  border-radius: 10px; padding: 9px 16px; font-size: 14px; font-family: inherit;
  cursor: pointer; border: 1px solid var(--border); background: transparent; color: var(--text-primary);
}
.report-modal-actions #btn-submit-report { background: var(--primary); border-color: var(--primary); }
.report-modal-actions button:disabled { opacity: 0.6; cursor: default; }

/* ── Place with an event: teal glow + badge, and its label stays on
   ("Tonight · Name") — events at our places live on the place's marker. ── */
.map-marker.has-event .marker-glow {
  background: rgba(2, 220, 199, 0.3);
  box-shadow: 0 0 16px 8px rgba(2, 220, 199, 0.45);
}
.map-marker.has-event .marker-name { display: block; max-width: 180px; border-color: rgba(2, 220, 199, 0.5); }
.marker-ev-badge {
  position: absolute; top: -6px; right: -4px; z-index: 2;
  min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--teal); color: var(--ink);
  font-size: 11px; font-weight: 800; line-height: 1;
  box-shadow: 0 0 10px rgba(2, 220, 199, 0.7);
}

/* ── Place card: a popup anchored to the pin (replaces the old side drawer) ── */
.place-popup .leaflet-popup-content-wrapper {
  background: var(--ink-2); color: var(--text-primary);
  border: 1px solid var(--glass-border); border-radius: 18px; padding: 0;
  box-shadow: var(--shadow);
}
.place-popup .leaflet-popup-content { margin: 0; width: 280px !important; }
.place-popup .leaflet-popup-tip { background: var(--ink-2); }
.place-popup .leaflet-popup-content-wrapper { overflow: hidden; }
.pc-hero { aspect-ratio: 16 / 9; background: var(--ink-3); }
.pc-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-hero.is-logo { aspect-ratio: auto; height: 110px; padding: 16px; }
.pc-hero.is-logo img { object-fit: contain; }
.pc { padding: 14px; font-family: inherit; }
.pc-head { display: flex; align-items: center; gap: 12px; }
.pc-emoji { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; font-size: 24px;
  background: radial-gradient(circle at 30% 20%, rgba(148, 68, 203, 0.45), transparent 65%), var(--ink-3); }
.pc-emoji.is-logo { padding: 5px; overflow: hidden; }
.pc-emoji.is-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.result-emoji.has-img { padding: 0; overflow: hidden; }
.result-emoji.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-title { flex: 1; min-width: 0; }
.pc-name { font-size: 16px; font-weight: 800; line-height: 1.25; }
.pc-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.pc-x { align-self: flex-start; width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,0.08); color: var(--text-secondary); font-size: 12px; }
.pc-x:hover { background: rgba(255,255,255,0.16); color: var(--text-primary); }
.pc-events { margin-top: 12px; display: grid; gap: 6px; }
.pc-event { display: block; text-decoration: none; color: inherit; padding: 8px 10px; border-radius: 10px;
  background: rgba(2, 220, 199, 0.08); border: 1px solid rgba(2, 220, 199, 0.3); }
/* Leaflet colors every link in the map (.leaflet-container a); card links keep our text color. */
.leaflet-container a.pc-event, .leaflet-container a.ev-pop { color: var(--text-primary); }
.pc-event-when { display: block; font-size: 11px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: 0.3px; }
.pc-event-title { display: block; font-size: 13px; font-weight: 700; margin-top: 1px; }
.pc-desc { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: #c9c9d1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pc-chips { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.pc-chips span { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 10px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--glass-border); }
.pc-actions { margin-top: 14px; display: flex; gap: 6px; }
.pc-btn { flex: 1; text-align: center; text-decoration: none; font-size: 13px; font-weight: 700; padding: 9px 6px; border-radius: 10px;
  color: var(--text-primary) !important; background: rgba(255,255,255,0.07); border: 1px solid var(--glass-border); }
.pc-btn:hover { background: rgba(255,255,255,0.12); }
.pc-btn.primary { background: var(--primary); border-color: transparent; }
.pc-btn.primary:hover { background: var(--violet); }
.pc-foot { margin-top: 10px; text-align: center; font-size: 11px; color: var(--text-secondary); }
.pc-foot button { font: inherit; color: var(--text-secondary); background: none; border: none; cursor: pointer; padding: 0; }
.pc-foot button:hover { color: var(--text-primary); text-decoration: underline; }

/* ── Layer toggle (All / Places / Events) ── */
#layer-toggle {
  flex-shrink: 0;
  display: flex;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
#layer-toggle button {
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  background: none; border: none; cursor: pointer;
  padding: 5px 12px; border-radius: 16px;
}
#layer-toggle button.on { background: var(--primary); color: #fff; }

/* ── Event pins (teal, pulsing — same language as the homepage) ── */
.ev-pin {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink-2);
  border: 2px solid var(--teal);
  box-shadow: 0 0 14px 4px rgba(2, 220, 199, 0.45);
  font-size: 17px; cursor: pointer; position: relative;
}
.ev-pin::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(2, 220, 199, 0.55);
  animation: evPulse 2.4s ease-out infinite;
}
@keyframes evPulse { from { transform: scale(0.7); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }

.ev-popup .leaflet-popup-content-wrapper {
  background: var(--ink-2); color: var(--text-primary);
  border: 1px solid var(--glass-border); border-radius: 16px; padding: 0; overflow: hidden;
  box-shadow: var(--shadow);
}
.ev-popup .leaflet-popup-content { margin: 0; width: 240px !important; }
.ev-popup .leaflet-popup-tip { background: var(--ink-2); }
.ev-pop { display: block; text-decoration: none; color: inherit; }
.ev-pop img, .ev-pop-blank { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.ev-pop-blank { display: grid; place-items: center; font-size: 36px;
  background: radial-gradient(circle at 30% 20%, rgba(148, 68, 203, 0.55), transparent 60%),
              radial-gradient(circle at 80% 90%, rgba(2, 220, 199, 0.35), transparent 55%), var(--ink-3); }
.ev-pop-body { padding: 10px 12px 12px; }
.ev-pop-when { font-size: 11px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: 0.3px; }
.ev-pop-title { font-size: 15px; font-weight: 700; line-height: 1.3; margin-top: 2px; }
.ev-pop-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ── Homepage → map: the hero map grows into this one (cross-document
   View Transitions; browsers without support just navigate). ── */
@view-transition { navigation: auto; }
#map { view-transition-name: map; }
::view-transition-group(map) { animation-duration: 0.6s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }

@media (prefers-reduced-motion: reduce) {
  .ev-pin::after { animation: none; }
  @view-transition { navigation: none; }
}
