/* Annotation pass: a clear app shell and the existing Discover cards on the map. */
.site-header .header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  max-width: none;
  margin: 0;
  padding: 20px 24px;
  gap: 24px;
}
.site-header .brand { justify-self: start; width: fit-content; }
.site-header .brand img, .map-is-active .site-header .brand img { width: 146px; height: auto; }
.map-is-active .site-header .brand { padding: 12px 14px; border-radius: 20px; }
.site-header .search-tools {
  min-width: 0;
  height: 60px;
  padding: 7px;
  gap: 12px;
  border-radius: 22px;
  border: 1px solid #fff9;
}
.floating-view-toggle {
  position: fixed;
  right: 24px;
  bottom: calc(30px + env(safe-area-inset-bottom));
  z-index: 1100;
  width: 58px;
  height: 58px;
  min-height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fffefaf2;
  color: var(--ink);
  border: 1px solid #fff9;
  box-shadow: 0 2px 6px #25282112, 0 8px 24px #25282126;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.floating-view-toggle .icon { width: 25px; height: 25px; }
.floating-view-toggle:hover { background: #eeede7; }
.floating-view-toggle:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
body:has(dialog[open]) .floating-view-toggle { visibility: hidden; }
.search-form { gap: 6px; }
.search-symbol { display: flex; }
.search-form input { font-size: 15px; }
.search-form .filter-button {
  position: relative;
  width: 40px;
  min-width: 40px;
  min-height: 44px;
  padding: 0;
  border: 0;
  box-shadow: none;
  border-radius: 12px;
}
.search-form .filter-button #filter-count { display: flex; right: -1px; top: -2px; }
.search-form .search-submit { display: inline-flex; height: 40px; min-height: 40px; width: 40px; border-radius: 14px; }
.site-header .header-end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 24px;
  background: var(--paper);
  border: 1px solid #fff9;
}
.map-is-active .site-header .header-end,
.map-is-active .site-header .search-tools,
.map-is-active .site-header .brand {
  background: #fffefaf2;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 6px #2528210a, 0 8px 24px #25282112;
}
.site-header .header-end .saved-plans {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 9px;
  border: 0;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: transparent;
  box-shadow: none;
}
.header-end .saved-plans .icon { width: 19px; height: 19px; }
.header-end .saved-plans.active { background: var(--blush); }
.header-end .saved-plans .my-count { position: static; width: 18px; height: 18px; margin: 0; }
.header-divider { width: 1px; height: 24px; background: #deded7; }
.map-is-active .header-end .profile-button, .header-end .profile-button {
  width: 44px; height: 44px; min-height: 44px; background: #eeede7; box-shadow: none;
}
.map-is-active .header-end .profile-button:hover { background: #e2e2d9; }

/* The map keeps its familiar geography; its controls sit on quieter materials. */
.map-is-active #neighbourhood-map, .map-is-active .map-stage { background: #ecefe9; }
.map-is-active .leaflet-tile-pane { filter: none; opacity: 1; }
.map-is-active .map-controls { top: 112px; right: 24px; border-radius: 19px; background: #fffefaf2; }
.map-compass {
  position: absolute;
  right: 24px;
  top: 278px;
  z-index: 500;
  width: 52px;
  height: 66px;
  border: 1px solid #fff9;
  border-radius: 19px;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  background: #fffefaf2;
  box-shadow: 0 2px 6px #0000000a, 0 6px 20px #00000012;
  pointer-events: auto;
  padding: 0;
  cursor: pointer;
}
.map-compass:hover { background: #fffefa; }
.map-compass:focus-visible { outline: 3px solid #52664b; outline-offset: 3px; }
#neighbourhood-map .maplibregl-canvas.is-rotating { cursor: grabbing; }
.compass-label { font-size: 11px; line-height: 12px; font-weight: 700; color: #515652; }
.map-compass svg { width: 26px; height: 36px; transform-origin: center; }
.map-is-active .map-load-status { top: 112px; left: 448px; right: 100px; }

/* Discover reuses the full cards and photo decks from the existing list view. */
.map-is-active .map-sheet {
  --sheet-inset: 8px;
  --drawer-material: #f9f8f4;
  left: var(--sheet-inset);
  right: auto;
  top: 112px;
  bottom: 24px;
  width: 360px;
  max-height: calc(100dvh - 136px);
  height: calc(100dvh - 136px);
  transform: translateX(0);
  transition: transform 280ms cubic-bezier(.2,.7,.2,1);
  overflow: visible;
  border-radius: 24px;
  background: transparent;
  border: 0;
  box-shadow: none;
  filter: drop-shadow(0 2px 3px #2528210a) drop-shadow(0 8px 14px #25282120);
}
.map-sheet-surface {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: inherit;
  background: var(--drawer-material);
}
.map-is-active .map-sheet.sheet-open { height: calc(100dvh - 136px); }
.map-is-active .map-sheet:not(.sheet-open) {
  height: calc(100dvh - 136px);
  transform: translateX(calc(-100% - var(--sheet-inset) + 1px));
}
.map-is-active .map-sheet:not(.sheet-open) .map-inspector { visibility: visible; }
.map-is-active .map-sheet.is-dragging { transform: translateX(var(--sheet-drag-x)); transition: none; }
.map-sheet-pull {
  position: absolute;
  left: calc(100% - 1px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 40px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-radius: 0 16px 16px 0;
  background: var(--drawer-material);
  border: 0;
  box-shadow: none;
  touch-action: none;
  cursor: grab;
}
.map-sheet-pull, .map-sheet-toggle { user-select: none; -webkit-user-select: none; touch-action: none; }
.map-sheet-pull span { writing-mode: vertical-rl; font-size: 12px; font-weight: 600; }
.map-sheet-pull .icon { width: 20px; height: 20px; }
.sheet-open .map-sheet-pull .icon { transform: rotate(180deg); }
.map-sheet-pull:hover { color: var(--red-dark); }
.map-sheet-pull:active, .map-sheet-toggle:active { cursor: grabbing; }
.map-sheet-pull:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.map-dialog-open .map-sheet-pull { visibility: hidden; }
.map-is-active .map-sheet-heading { min-height: 76px; background: transparent; border-bottom: 1px solid #dcded47a; }
.map-is-active .map-sheet-toggle {
  min-height: 76px;
  height: 76px;
  padding: 16px 16px 15px 20px;
  background: transparent;
}
.map-is-active .sheet-toggle-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.map-is-active .sheet-toggle-copy strong { font-size: 23px; letter-spacing: -.55px; font-weight: 700; }
.map-is-active .sheet-toggle-copy small { font-size: 12px; line-height: 16px; color: #74766e; }
.map-is-active .map-sheet .sheet-chevron, .map-is-active .map-sheet .sheet-grip { display: none; }
.sheet-back { margin-left: 12px; background: #e9eae3; flex: none; }
.sheet-back .icon { rotate: 180deg; }
.map-is-active .map-sheet .map-inspector {
  background: transparent;
  padding: 16px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding: 16px;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
  scrollbar-color: #c7c9c0 transparent;
}
.map-is-active .map-sheet .map-inspector.is-discover { padding: 12px 12px 20px; }
.map-discover-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 13px; }
:is(.map-discover-card,.place-plan-card) { padding: 16px 16px 10px; border-radius: 18px; }
:is(.map-discover-card,.place-plan-card) .meetup-content { grid-template-columns: 118px minmax(0, 1fr); gap: 12px; margin-top: 12px; }
:is(.map-discover-card,.place-plan-card) .profile-deck { --photo-width: 78px; --photo-height: 118px; }
:is(.map-discover-card,.place-plan-card) .profile-deck:has(.profile-card:only-child) { --photo-width: calc(100% - 12px); --photo-height: 132px; }
:is(.map-discover-card,.place-plan-card) .meetup-heading .plan-title { font-size: 19px; line-height: 1.25; }
:is(.map-discover-card,.place-plan-card) .meetup-fact { font-size: 12px; gap: 6px; }
:is(.map-discover-card,.place-plan-card) .meetup-fact small, :is(.map-discover-card,.place-plan-card) .payment-fact { font-size: 11px; }
:is(.map-discover-card,.place-plan-card) .plan-authored-title { font-size: 12px; line-height: 1.5; }
:is(.map-discover-card,.place-plan-card) .meetup-facts { gap: 10px; }
:is(.map-discover-card,.place-plan-card) .meetup-actions .capacity { font-size: 12px; }
:is(.map-discover-card,.place-plan-card).map-card-selected { box-shadow: 0 0 0 2px var(--venue-color); background: var(--venue-tint); }
:is(.map-discover-card,.place-plan-card).map-card-selected .plan-title { color: var(--venue-color); }
:is(.map-discover-card,.place-plan-card) .detail-link { border-radius: 50%; }
:is(.map-discover-card,.place-plan-card) .detail-link:hover { background: #00000008; }
.map-inspector.is-discover .empty-state { padding: 30px 18px; background: transparent; }
.map-inspector.is-discover .empty-state h3 { font-size: 18px; margin-bottom: 18px; }

/* Shape and symbol both communicate category, without relying on colour alone. */
.map-is-active .venue-pin {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  rotate: 0deg;
  border-radius: 14px;
  background: transparent;
  color: white;
  box-shadow: none;
  filter: drop-shadow(0 2px 3px #00000026);
}
.marker-face {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--venue-color); border: 2px solid #fffefa; border-radius: 13px;
}
.marker-face .icon { width: 23px; height: 23px; stroke-width: 1.8; }
.pin-round .marker-face { border-radius: 50%; }
.pin-diamond .marker-face { border-radius: 12px; transform: rotate(45deg) scale(.88); }
.pin-diamond .marker-face .icon { transform: rotate(-45deg); }
.pin-triangle .marker-face { clip-path: polygon(50% 0, 100% 89%, 0 89%); border: 0; border-radius: 0; }
.pin-triangle .marker-face .icon { width: 22px; height: 22px; margin-top: 7px; }
.map-is-active .venue-pin.pin-selected { outline: 3px solid var(--venue-color); outline-offset: 5px; box-shadow: none; }
.map-is-active .pin-count {
  rotate: 0deg;
  right: -7px;
  top: -7px;
  width: 21px;
  height: 21px;
  background: #fffefa;
  border: 1.5px solid var(--venue-color);
  color: var(--venue-color);
  font-size: 11px;
  box-shadow: 0 1px 3px #0002;
}
.map-is-active .pin-name { font-size: 11px; font-weight: 650; margin-top: 7px; background: #fffefae8; border: 1px solid #fff8; padding: 2px 5px; }
.map-is-active .place-symbol, .map-is-active .venue-large-icon { color: var(--venue-color); background: var(--venue-tint); }

@media (max-width: 1100px) {
  .site-header .header-inner { grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; }
  .site-header .brand img, .map-is-active .site-header .brand img { width: 128px; }
  .header-end .action-label { display: none; }
  .site-header .header-end .saved-plans { padding-inline: 9px; }
  .search-tools .search-symbol { display: none; }
  .map-is-active .map-sheet { width: 352px; }
  :is(.map-discover-card,.place-plan-card) .meetup-content { grid-template-columns: 118px minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 800px) {
  .site-header, .map-is-active .site-header { height: calc(150px + env(safe-area-inset-top)); }
  .site-header .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-rows: 54px 58px;
    gap: 12px;
    padding: calc(12px + env(safe-area-inset-top)) 16px 14px;
  }
  .site-header .brand, .map-is-active .site-header .brand { display: flex; margin: 0; padding: 10px 12px; grid-column: 1; grid-row: 1; }
  .site-header .brand img, .map-is-active .site-header .brand img { width: 132px; }
  .site-header .header-end { grid-column: 2; grid-row: 1; padding: 5px 7px; gap: 6px; }
  .site-header .header-end .saved-plans { width: auto; height: 44px; min-height: 44px; padding: 0 8px; }
  .header-end .action-label { display: inline; }
  .site-header .header-end .profile-button { width: 40px; height: 40px; min-height: 40px; }
  .site-header .search-tools { grid-column: 1/-1; grid-row: 2; width: 100%; height: 58px; gap: 7px; padding: 6px; }
  .floating-view-toggle { right: 16px; bottom: calc(22px + env(safe-area-inset-bottom)); }
  .search-form { gap: 1px; }
  .search-form input { font-size: 14px; }
  .search-form .filter-button { width: 36px; min-width: 36px; }
  .search-form .search-submit { display: flex; width: 36px; min-width: 36px; height: 38px; min-height: 38px; }
  .map-is-active .map-controls { top: calc(162px + env(safe-area-inset-top)); right: 16px; }
  .map-is-active .map-controls button { width: 40px; height: 44px; min-height: 44px; }
  .map-compass { top: calc(320px + env(safe-area-inset-top)); right: 16px; width: 48px; height: 58px; }
  .map-compass svg { height: 30px; }
  .map-is-active .map-load-status { top: 158px; left: 16px; right: 78px; }
  .map-is-active .map-sheet {
    left: var(--sheet-inset); right: auto; top: auto; bottom: calc(94px + env(safe-area-inset-bottom));
    width: min(352px, calc(100% - 56px)); max-height: calc(100dvh - 252px - env(safe-area-inset-bottom) - env(safe-area-inset-top));
  }
  .map-is-active .map-sheet.sheet-open { height: 39dvh; min-height: 230px; }
  .map-is-active .map-sheet:not(.sheet-open) { top: auto; bottom: calc(94px + env(safe-area-inset-bottom)); min-height: 230px; height: 39dvh; }
  .map-is-active .map-sheet .map-inspector.is-discover { padding: 10px 12px 20px; }
  .map-is-active .map-sheet-heading, .map-is-active .map-sheet-toggle { height: 76px; min-height: 76px; }
  .map-is-active .map-sheet-toggle { padding-top: 20px; }
  .map-is-active .sheet-toggle-copy strong { font-size: 22px; }
  :is(.map-discover-card,.place-plan-card) .meetup-content { grid-template-columns: clamp(88px, 28vw, 110px) minmax(0, 1fr); gap: 12px; }
  .map-is-active .leaflet-bottom.leaflet-right { top: auto; bottom: 0; }
  .map-is-active .leaflet-control-attribution { font-size: 9px !important; }
}
@media (max-width: 420px) {
  .header-end .action-label { display: none; }
  :is(.map-discover-card,.place-plan-card) { padding: 14px 12px 10px; }
  :is(.map-discover-card,.place-plan-card) .meetup-content { grid-template-columns: clamp(88px, 28vw, 110px) minmax(0, 1fr); gap: 12px; }
  :is(.map-discover-card,.place-plan-card) .profile-deck { --photo-width: 68px; --photo-height: 114px; }
  :is(.map-discover-card,.place-plan-card) .profile-deck:has(.profile-card:only-child) { --photo-height: 128px; }
  :is(.map-discover-card,.place-plan-card) .meetup-heading .plan-title { font-size: 18px; }
  :is(.map-discover-card,.place-plan-card) .meetup-fact { font-size: 12px; }
}
@media (max-width: 800px) and (max-height: 650px) {
  .map-is-active .map-controls { display: flex; }
  .map-is-active .map-controls button:last-child { border-top: 0; border-left: 1px solid var(--line); margin-top: 0; border-radius: 0 14px 14px 0; }
  .map-compass { top: 226px; }
}
@media (max-width: 800px) and (orientation: landscape) {
  .site-header, .map-is-active .site-header { height: 84px; }
  .site-header .header-inner { display: flex; padding: 12px 16px; gap: 12px; }
  .site-header .brand, .map-is-active .site-header .brand { display: none; }
  .site-header .search-tools { flex: 1; }
  .header-end .action-label { display: none; }
  .map-is-active .map-sheet { top: 94px; bottom: 20px; left: var(--sheet-inset); right: auto; width: 336px; max-width: 52vw; max-height: calc(100dvh - 114px); }
  .map-is-active .map-sheet.sheet-open, .map-is-active .map-sheet.sheet-large { min-height: 0; height: calc(100dvh - 114px); }
  .map-is-active .map-sheet:not(.sheet-open) { top: 94px; bottom: 20px; min-height: 0; height: calc(100dvh - 114px); }
  .map-is-active .map-controls { top: 94px; }
  .map-compass { top: 156px; }
  :is(.map-discover-card,.place-plan-card) .meetup-content { grid-template-columns: 102px minmax(0, 1fr); gap: 10px; }
}
@media (prefers-reduced-transparency: reduce) {
  .map-is-active .site-header .brand, .map-is-active .site-header .search-tools,
  .map-is-active .site-header .header-end, .map-is-active .map-sheet, .map-compass {
    background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .map-is-active .map-sheet { background: transparent; }
}
@media (prefers-contrast: more) {
  .map-is-active .map-sheet, .map-compass, .site-header .search-tools, .site-header .header-end { border: 1px solid #62655d; }
  .map-is-active .leaflet-tile-pane { opacity: 1; filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .map-is-active .map-sheet { transition: none; }
}

/* Colour vector map and compact drawer control. */
.map-sheet-heading[hidden]{display:none!important}
.map-sheet-pull{justify-content:center;gap:0;color:var(--ink)}
.map-sheet-pull>span{display:flex;align-items:center;justify-content:center;writing-mode:horizontal-tb}
.map-sheet-pull .icon{width:20px;height:20px}
#neighbourhood-map.maplibregl-map{font-family:inherit;background:#f1efe9}
#neighbourhood-map .maplibregl-canvas{outline:none}
#neighbourhood-map .maplibregl-ctrl-bottom-right{right:4px;bottom:2px}
#neighbourhood-map .maplibregl-ctrl-attrib{font-size:10px;background:#fffefae6}
#neighbourhood-map .maplibregl-ctrl-attrib a{color:#4f554d}
#neighbourhood-map .dumpl-map-marker{padding:0;min-height:0;border:0;background:transparent;font:inherit;overflow:visible;transition:none}
#neighbourhood-map .dumpl-map-marker:active{scale:1}
#neighbourhood-map .dumpl-map-marker:focus-visible{outline:3px solid var(--red);outline-offset:7px;border-radius:14px}

/* Show only the place facts actually present in the OSM snapshot. */
.osm-place-details{margin:18px 0 24px}
.osm-place-details dl{margin:0}
.venue-fact{display:grid;grid-template-columns:104px minmax(0,1fr);gap:12px;padding:10px 0;border-top:1px solid var(--line);font-size:13px;line-height:1.55}
.venue-fact dt{color:var(--muted)}
.venue-fact dd{margin:0;overflow-wrap:anywhere}
.venue-contact{display:flex;flex-wrap:wrap;gap:12px 20px;margin:14px 0}
.venue-contact a{font-size:13px;font-weight:600;text-underline-offset:4px}
.venue-source{display:inline-block;margin-top:6px;font-size:11px;color:var(--muted);text-underline-offset:3px}
