/* ---------------------------------------------------------------
   Den Haag Discovery
   Layout: topbar / sticky filterbar / two-pane split (feed + map).
   Below 900px the panes become exclusive and a floating pill toggles them.
   --------------------------------------------------------------- */

:root {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --ink: #1b1a18;
  --ink-soft: #5d5953;
  --ink-faint: #8b857d;
  --line: #e6e1da;
  --accent: #1f6f5c;
  --accent-soft: #e8f2ef;
  --offer: #b3541e;
  --offer-soft: #fdf1e7;
  --restaurant: #d94f4f;
  --cafe: #c8813a;
  --bar: #4a7fa5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(27, 26, 24, .05), 0 8px 24px rgba(27, 26, 24, .06);
  --topbar-h: 64px;
  --filter-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- topbar ---------- */

.topbar {
  height: var(--topbar-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  z-index: 30;
}

.topbar__brand { display: flex; align-items: center; gap: 12px; }

.topbar__mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .02em;
}

.topbar__title { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.topbar__sub { margin: 1px 0 0; font-size: 12.5px; color: var(--ink-faint); }

/* ---------- filter bar ---------- */

.filterbar {
  flex: 0 0 auto;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 10px 20px;
  z-index: 25;
}

.filterbar__row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chips { display: flex; gap: 6px; }

.chip-toggle {
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-faint);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.chip-toggle:hover { border-color: var(--ink-faint); }

.chip-toggle.is-on { color: #fff; border-color: transparent; }
.chip-toggle--restaurant.is-on { background: var(--restaurant); }
.chip-toggle--cafe.is-on { background: var(--cafe); }
.chip-toggle--bar.is-on { background: var(--bar); }

.toggle {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--ink-soft);
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.toggle:has(input:checked) {
  background: var(--offer-soft);
  border-color: var(--offer);
  color: var(--offer);
  font-weight: 550;
}
.toggle input { margin: 0; accent-color: var(--offer); }
.toggle__count { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.toggle:has(input:checked) .toggle__count { color: inherit; }

.select, .search {
  font: inherit;
  font-size: 13px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
}
.search { min-width: 200px; flex: 1 1 200px; max-width: 320px; }
.select:focus, .search:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.reset {
  font: inherit; font-size: 13px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.reset:hover { border-color: var(--ink-faint); color: var(--ink); }

.count {
  margin-left: auto;
  font-size: 13px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- panes ---------- */

.panes {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(380px, 480px) 1fr;
  min-height: 0;
}

.pane { min-height: 0; position: relative; }

.pane--feed {
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--line);
}

.pane--map { background: #dfe6e4; }
#map { position: absolute; inset: 0; }

/* ---------- feed ---------- */

.feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

.card:hover { border-color: #cfc8be; transform: translateY(-1px); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow);
}

/* gallery */

.gallery { position: relative; background: #efeae4; }

.gallery__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  aspect-ratio: 3 / 2;
}
.gallery__track::-webkit-scrollbar { display: none; }

.gallery__img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  scroll-snap-align: start;
  display: block;
}
.gallery__img.is-fallback { object-fit: contain; padding: 20%; opacity: .5; }

.gallery--empty { aspect-ratio: 3 / 2; display: grid; place-items: center; }
.gallery--empty img { width: 40%; opacity: .4; }

.gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  color: var(--ink);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .18);
}
.gallery__nav--prev { left: 8px; }
.gallery__nav--next { right: 8px; }
.card:hover .gallery__nav, .gallery__nav:focus-visible { opacity: 1; }

.gallery__dots {
  position: absolute;
  bottom: 9px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 5px;
  pointer-events: none;
}
.gallery__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 0 2px rgba(0, 0, 0, .4);
  transition: background .2s;
}
.gallery__dot.is-active { background: #fff; }

/* card body */

.card__body { padding: 14px 16px 16px; }

.card__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 7px;
}

.badge {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
}
.badge--restaurant { background: var(--restaurant); }
.badge--cafe { background: var(--cafe); }
.badge--bar { background: var(--bar); }

.card__rating {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.card__name {
  margin: 0 0 2px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.015em;
  line-height: 1.25;
}

.card__meta { margin: 0 0 8px; font-size: 12.5px; color: var(--ink-faint); }

.card__tagline {
  margin: 0 0 8px;
  font-size: 14.5px;
  font-weight: 550;
  color: var(--ink);
  line-height: 1.4;
}

.card__desc { margin: 0 0 11px; font-size: 13.5px; color: var(--ink-soft); }

.card__chips {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 5px;
  margin: 0 0 11px; padding: 0;
}
.chip {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.card__offer {
  font-size: 13px;
  line-height: 1.45;
  color: #7d3a13;
  background: var(--offer-soft);
  border: 1px solid #f2d9c4;
  border-left: 3px solid var(--offer);
  border-radius: 8px;
  padding: 9px 11px;
  margin-bottom: 12px;
}
.card__offer-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--offer);
  margin-bottom: 2px;
}

.card__actions { display: flex; gap: 8px; align-items: center; }

.card__cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 7px 13px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  transition: background .15s, color .15s;
}
.card__cta:hover { background: var(--accent); color: #fff; }
.card__cta--disabled {
  color: var(--ink-faint);
  border-color: var(--line);
  cursor: default;
}
.card__cta--disabled:hover { background: transparent; color: var(--ink-faint); }

.card__map-btn {
  font: inherit; font-size: 13px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.card__map-btn:hover { border-color: var(--ink-faint); color: var(--ink); }

.empty { text-align: center; color: var(--ink-faint); padding: 40px 20px; font-size: 14px; }

.sitefoot {
  padding: 4px 18px 26px;
  color: var(--ink-faint);
  font-size: 11.5px;
  line-height: 1.55;
}
.sitefoot p { margin: 0; }

/* ---------- map markers ---------- */

.venue-marker-wrap { background: none; border: none; }

.venue-marker {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: var(--marker-color);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
  font-size: 13px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.venue-marker > * { transform: rotate(45deg); }

.venue-marker.is-selected {
  transform: rotate(-45deg) scale(1.3);
  box-shadow: 0 0 0 4px rgba(31, 111, 92, .3), 0 3px 10px rgba(0, 0, 0, .35);
  z-index: 1000;
}

/* leaflet popup */

.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-popup-content { margin: 12px 14px; font-family: var(--font); }
.popup__name { margin: 6px 0 2px; font-size: 15.5px; font-weight: 650; }
.popup__meta { margin: 0 0 6px; font-size: 12px; color: var(--ink-faint); }
.popup__tagline { margin: 0 0 6px; font-size: 13px; color: var(--ink-soft); line-height: 1.4; }
.popup__offer {
  margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--offer);
}
.popup__cta {
  font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--accent); background: transparent;
  color: var(--accent); cursor: pointer;
}
.popup__cta:hover { background: var(--accent); color: #fff; }

/* ---------- mobile ---------- */

.view-toggle {
  display: none;
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 11px 22px;
  border: none;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .28);
  cursor: pointer;
}

@media (max-width: 899px) {
  .panes { grid-template-columns: 1fr; }
  .pane--feed { border-right: none; }
  .panes[data-view="feed"] .pane--map { display: none; }
  .panes[data-view="map"] .pane--feed { display: none; }
  .view-toggle { display: block; }
  .feed { padding-bottom: 80px; }
  .topbar__sub { display: none; }
  .count { margin-left: 0; }
  .search { max-width: none; }
}

@media (max-width: 560px) {
  .filterbar { padding: 9px 12px; }
  .filterbar__row { gap: 7px; }
  .feed { padding: 12px; }
  .topbar { padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- data problem banner ---------- */

.datawarn {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 2000;
  max-width: 560px;
  margin: 0 auto;
  background: #fff8ec;
  border: 1px solid #f0c98a;
  border-left: 4px solid var(--offer);
  border-radius: 10px;
  padding: 12px 38px 12px 14px;
  font-size: 13px;
  color: #6b3a10;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .16);
  max-height: 40vh;
  overflow-y: auto;
}
.datawarn strong { display: block; margin-bottom: 5px; }
.datawarn ul { margin: 0; padding-left: 18px; }
.datawarn li { margin: 2px 0; }
.datawarn__close {
  position: absolute; top: 6px; right: 8px;
  border: none; background: transparent;
  font-size: 20px; line-height: 1; cursor: pointer; color: #6b3a10;
}

/* A venue added by hand may have no verified rating yet. */
.card__rating--none {
  font-weight: 500;
  font-size: 11.5px;
  color: var(--ink-faint);
  border: 1px dashed var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}

/* ===============================================================
   Feed page (feed.html) — deals, discounts and recurring events
   =============================================================== */

.page-feed { overflow: auto; display: block; }

.topbar__home { text-decoration: none; }

.nav { margin-left: auto; display: flex; gap: 4px; }
.nav__link {
  font-size: 13.5px;
  font-weight: 550;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.nav__link:hover { background: var(--bg); color: var(--ink); }
.nav__link.is-current {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #cfe3dd;
}

.feedpage {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 20px 60px;
}

.feedpage__intro { max-width: 640px; margin-bottom: 20px; }
.feedpage__title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -.02em;
}
.feedpage__lede { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

/* day selector */

.dayrow {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
  scrollbar-width: none;
}
.dayrow::-webkit-scrollbar { display: none; }

.daybtn {
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.daybtn:hover { border-color: var(--ink-faint); color: var(--ink); }
.daybtn.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.feedpage__filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

/* offer cards */

.offerlist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.offercard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: border-color .15s, transform .15s;
}
.offercard:hover { border-color: #cfc8be; transform: translateY(-2px); }

.offercard__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #efeae4;
  overflow: hidden;
  /* The card is a flex column; without this the media block stretches to fill
     the tallest card in the grid row and the aspect ratio is ignored. */
  flex: 0 0 auto;
}
.offercard__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.offercard__kind {
  position: absolute;
  top: 10px; left: 10px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--offer);
  color: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .25);
}

.offercard__body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }

.offercard__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 9px;
}

.offercard__days {
  font-size: 12px;
  font-weight: 600;
  color: var(--offer);
  background: var(--offer-soft);
  border: 1px solid #f2d9c4;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.offercard__deal {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 620;
  line-height: 1.35;
  letter-spacing: -.01em;
}

.offercard__venue { margin: 0 0 6px; font-size: 13.5px; display: flex; flex-direction: column; }
.offercard__venue span { color: var(--ink-faint); font-size: 12.5px; }

.offercard__tagline {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--ink-soft);
  flex: 1;
}

.offercard__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.offercard__actions .card__map-btn { text-decoration: none; display: inline-block; }

/* footer prompt */

.feedpage__cta {
  margin-top: 34px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 720px;
}
.feedpage__cta h3 { margin: 0 0 6px; font-size: 16px; font-weight: 640; }
.feedpage__cta p { margin: 0 0 8px; font-size: 13.5px; color: var(--ink-soft); }
.feedpage__cta code {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 12.5px;
}
.feedpage__stat { color: var(--ink-faint); font-size: 12.5px; margin: 0; }

@media (max-width: 560px) {
  .feedpage { padding: 18px 12px 50px; }
  .feedpage__title { font-size: 22px; }
  .offerlist { grid-template-columns: 1fr; }
  .nav__link { padding: 6px 10px; font-size: 12.5px; }
}

/* ===============================================================
   Google-Maps-like basemap
   OSM's default raster is far more saturated than Google's road map.
   Muting it in CSS gets the same calm, low-contrast ground without
   needing a hosted vector style (which would mean an API key again).
   =============================================================== */

/* No filter: the raw tiles read better than a muted version, and the terrain
   basemap carries its own relief shading that washing out would destroy. */

.leaflet-container { background: #e8eaed; font: inherit; }

/* Controls, Google-style: white pills, soft shadow, bottom-right */

.leaflet-bottom.leaflet-right { margin-bottom: 22px; margin-right: 12px; }

.leaflet-control-zoom {
  border: none !important;
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.leaflet-control-zoom a {
  width: 40px !important;
  height: 40px !important;
  line-height: 40px !important;
  color: #3c4043 !important;
  font-size: 20px !important;
  border-bottom: 1px solid #e6e6e6 !important;
  background: #fff !important;
}
.leaflet-control-zoom a:last-child { border-bottom: none !important; }
.leaflet-control-zoom a:hover { background: #f1f3f4 !important; }

.leaflet-control-attribution {
  background: rgba(255, 255, 255, .8) !important;
  font-size: 10.5px !important;
  color: #70757a !important;
  padding: 2px 7px !important;
  border-radius: 4px 0 0 0;
}

/* My-location control */

.locate-btn {
  /* Placed by Leaflet as a bottom-right control; it stacks above the zoom
     buttons on its own, so no per-breakpoint offsets here. */
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: none;
  border-radius: 10px;
  background: #fff;
  color: #3c4043;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
  margin-bottom: 10px;
  padding: 0;
}
.locate-btn:hover { background: #f1f3f4; }
.locate-btn svg { width: 20px; height: 20px; display: block; }
.locate-btn.is-active { color: var(--google-blue, #1a73e8); }
.locate-btn.is-busy { opacity: .6; cursor: progress; }
.locate-btn.is-denied { color: #c5221f; }

/* The blue dot */

.me-wrap { background: none; border: none; }
.me-dot {
  display: block;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #1a73e8;
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(26, 115, 232, .35), 0 1px 4px rgba(0, 0, 0, .35);
}
.me-halo { fill: #1a73e8; fill-opacity: .13; }

/* Toast for location errors */

.maptoast {
  position: absolute;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  z-index: 1200;
  background: #3c4043;
  color: #fff;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .3);
  max-width: 88%;
}

/* Distance chip on cards */

.card__distance {
  font-size: 12px;
  font-weight: 600;
  color: #1a73e8;
  white-space: nowrap;
}

.card__dir, .popup__dir {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #1a73e8;
  border: 1px solid #1a73e8;
  border-radius: 999px;
  padding: 7px 14px;
  text-decoration: none;
  display: inline-block;
}
.card__dir:hover, .popup__dir:hover { background: #1765cc; border-color: #1765cc; }
.popup__dir { font-size: 12.5px; padding: 5px 12px; }

/* ---------- vibe / occasion filters ---------- */

.tagfilter { position: relative; }
.tagfilter__summary {
  list-style: none;
  font-size: 13px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.tagfilter__summary::-webkit-details-marker { display: none; }
.tagfilter__summary::after { content: ' ▾'; color: var(--ink-faint); }
.tagfilter__summary:hover { border-color: var(--ink-faint); color: var(--ink); }
.tagfilter[open] .tagfilter__summary { border-color: var(--accent); color: var(--accent); }
.tagfilter.has-selection .tagfilter__summary {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.tagfilter__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .14);
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: max-content;
  max-width: 320px;
}

.tagopt {
  font: inherit;
  font-size: 12.5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}
.tagopt:hover { border-color: var(--ink-faint); }
.tagopt.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tagopt__count { opacity: .6; font-size: 11px; }

/* tag chips on cards */

.card__chips--tags { margin-bottom: 7px; }
.chip--vibe { background: #eef3fb; border-color: #d6e4f7; color: #2a5a99; }
.chip--occasion { background: #f2f0fb; border-color: #e0dcf5; color: #56499b; }

.card__headright { display: flex; align-items: center; gap: 9px; }

.popup__actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.popup__actions .popup__dir,
.popup__actions .popup__cta { white-space: nowrap; }

/* ---------- filter bar layout ---------- */

.filterbar__scroll {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 auto;
}

@media (max-width: 899px) {
  /* One scrollable row of chips, the way map apps do it, instead of a
     five-row stack that pushes the map off the screen. */
  .filterbar__row { flex-wrap: nowrap; gap: 8px; }
  .filterbar__scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .filterbar__scroll::-webkit-scrollbar { display: none; }
  .filterbar__scroll > * { flex: 0 0 auto; }
  .search { flex: 0 0 168px !important; min-width: 168px; max-width: 200px; }
  .count { flex: 0 0 auto; margin-left: 8px; font-size: 12px; }
  .toggle { padding: 6px 10px; }

  /* A dropdown inside the scrolling row would be clipped, so pin it to the bar
     instead. The filter bar must be the containing block: with .tagfilter
     static and nothing else positioned, "top: 100%" resolved against the
     viewport and dropped every panel exactly one screen-height down, i.e. just
     off the bottom edge. */
  .filterbar { position: relative; }
  .tagfilter { position: static; }
  .tagfilter__panel {
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    top: 100%;
    max-height: 60vh;
  }

  /* Keep the attribution clear of the floating view toggle. */
  .leaflet-control-attribution { margin-bottom: 62px !important; }
  .leaflet-bottom.leaflet-right { margin-bottom: 78px; }
}

/* ---------- basemap switcher (Google's Map / Terrain control) ---------- */

.basemap-switch {
  display: flex;
  gap: 0;
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
  margin-left: 12px;
  margin-bottom: 12px;
}
.basemap-btn {
  font: inherit;
  font-size: 12.5px;
  font-weight: 550;
  padding: 8px 15px;
  border: none;
  border-right: 1px solid #e6e6e6;
  background: #fff;
  color: #3c4043;
  cursor: pointer;
}
.basemap-btn:last-child { border-right: none; }
.basemap-btn:hover { background: #f1f3f4; }
.basemap-btn.is-on { background: #e8f0fe; color: #1a73e8; font-weight: 650; }

/* ---------- category dropdowns ---------- */

.chips { display: flex; gap: 6px; align-items: center; }

.catfilter .catfilter__summary {
  font-weight: 550;
  color: #fff;
  border-color: transparent;
}
.catfilter--restaurant .catfilter__summary { background: var(--restaurant); }
.catfilter--cafe .catfilter__summary { background: var(--cafe); }
.catfilter--bar .catfilter__summary { background: var(--bar); }

/* Switched off: drop back to a plain outline so it reads as inactive. */
.catfilter:not(.is-active) .catfilter__summary {
  background: var(--surface);
  color: var(--ink-faint);
  border-color: var(--line);
}
.catfilter.is-narrowed .catfilter__summary { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); }

.tagfilter.is-active .tagfilter__summary:not(.catfilter__summary) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.tagfilter__panel { max-height: 320px; overflow-y: auto; }

.tagopt--all {
  width: 100%;
  font-weight: 600;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px;
}

@media (max-width: 899px) {
  /* OpenTopoMap is CC-BY-SA so the credit has to stay, but it should not
     take two lines across the middle of the map. */
  .leaflet-control-attribution {
    font-size: 9.5px !important;
    max-width: 62vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0 !important;
    border-radius: 4px 0 0 0;
  }
  .basemap-switch { margin-bottom: 26px; }
}

@media (max-width: 899px) {
  /* The counter ate ~90px of a 390px bar, pushing Vibe and Occasion off the
     right edge entirely. It lives in the header on mobile instead. */
  .count { display: none; }
  .topbar__sub { display: block; font-size: 11.5px; }

  /* Make it obvious the chip row scrolls — without this the filters that sit
     off-screen are invisible and look missing. */
  .filterbar__row { position: relative; }
  .filterbar__row::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 26px;
    pointer-events: none;
    background: linear-gradient(to right, rgba(255,255,255,0), var(--surface));
  }
}
