/* Map markers: white=wees de eerste · gold=jouw · green=CrossPath · blue=leden · purple diamond=partner */
.cpm-root, .cpm-frame {
  --cpm-bg: #0a0b10;
  --cpm-mine: #f2c46d;
  --cpm-cp: #5cff4a;
  --cpm-cp-hot: #b8ff3a;
  --cpm-members: #4aa3ff;
  --cpm-disc: #f4f1ea;
  --cpm-explore: #f4f1ea;
  --cpm-panel: rgba(16, 16, 22, 0.92);
  --cpm-frame-grad: #151826;
  --cpm-vignette: rgba(7, 7, 8, 0.55);
  --cpm-teaser-fade: rgba(7, 7, 8, 0.7);
  --cpm-border: rgba(244, 241, 234, 0.07);
  --cpm-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(212, 165, 116, 0.05);
  --cpm-tile-filter: saturate(0.75) brightness(0.92) contrast(1.05);
}
html[data-theme="light"] .cpm-root,
html[data-theme="light"] .cpm-frame {
  --cpm-bg: var(--map-fallback, #e8eef1);
  /* Jouw plaatsen = goud; wees de eerste = wit (niet dezelfde kleur) */
  --cpm-mine: #e8b84a;
  --cpm-disc: #ffffff;
  --cpm-explore: #ffffff;
  --cpm-panel: rgba(255, 255, 255, 0.96);
  --cpm-frame-grad: #f5f8fa;
  --cpm-vignette: rgba(255, 255, 255, 0.2);
  --cpm-teaser-fade: rgba(255, 255, 255, 0.85);
  --cpm-border: var(--line);
  --cpm-shadow: 0 20px 50px -36px rgba(23, 25, 28, 0.28);
  --cpm-tile-filter: none;
}

html[data-theme="light"] .cpm-marker--discover .cpm-marker__dot,
html[data-theme="light"] .cpm-marker--explore .cpm-marker__dot,
html[data-theme="light"] .cpm-marker--discover.is-suggested .cpm-marker__dot {
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #f0f3f6 55%, #c5ccd3 100%);
  border: 1.5px solid #8a929a;
  box-shadow: 0 1px 6px rgba(23, 25, 28, 0.28);
  opacity: 1;
}

html[data-theme="light"] .cpm-marker--mine .cpm-marker__dot {
  background: radial-gradient(circle at 35% 35%, #fff4d6 0%, var(--cpm-mine) 50%, #c8913a 100%);
  border-color: transparent;
  box-shadow: 0 0 12px 3px rgba(232, 184, 74, 0.55), 0 0 24px 6px rgba(232, 184, 74, 0.2);
}

html[data-theme="light"] .cpm-key--discover,
html[data-theme="light"] .cpm-dot--discover,
html[data-theme="light"] .cpm-key--explore,
html[data-theme="light"] .cpm-dot--explore {
  background: #ffffff;
  border: 1px solid #8a929a;
  box-shadow: none;
}

html[data-theme="light"] .cpm-key--mine,
html[data-theme="light"] .cpm-dot--mine {
  background: var(--cpm-mine);
  box-shadow: 0 0 8px rgba(232, 184, 74, 0.55);
}
.cpm-root { margin: 0 0 1.5rem; }
.cpm-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}
.cpm-title {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
.cpm-root--teaser .cpm-title { font-size: 1.25rem; }
.cpm-sub { margin: 0.2rem 0 0; color: var(--ink-soft); }
.cpm-stats { margin: 0.25rem 0 0; color: var(--ink-muted); font-size: 0.85rem; min-height: 1.1em; }
.cpm-back { margin: 0 0 0.75rem; font-size: 0.9rem; }
.cpm-back a, .cpm-note a { color: var(--accent); }
.cpm-note { margin: 0.6rem 0 0; color: var(--ink-muted); font-size: 0.85rem; }

.cpm-frame {
  position: relative;
  height: min(68vh, 620px);
  border-radius: var(--radius, 18px);
  overflow: hidden;
  background: radial-gradient(120% 90% at 30% 20%, var(--cpm-frame-grad) 0%, var(--cpm-bg) 60%);
  border: 1px solid var(--cpm-border);
  box-shadow: var(--cpm-shadow);
  transition: inset 0.32s var(--ease), border-radius 0.32s var(--ease), box-shadow 0.32s var(--ease);
  isolation: isolate; /* Leaflet panes (z 400+) never cover page modals */
}
.cpm-root--teaser .cpm-frame { height: 220px; cursor: pointer; }
.cpm-canvas { position: absolute; inset: 0; background: transparent; }
.cpm-frame .leaflet-container { background: transparent; font-family: var(--font-body); }
.cpm-frame.has-tiles .leaflet-tile { filter: var(--cpm-tile-filter); }
/* soft vignette over the map */
.cpm-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 450;
  background: radial-gradient(130% 100% at 50% 40%, transparent 55%, var(--cpm-vignette) 100%);
}
.cpm-root--teaser .cpm-frame::after {
  background: linear-gradient(180deg, transparent 55%, var(--cpm-teaser-fade) 100%);
}

/* expanded overlay (near fullscreen) */
body.cpm-lock { overflow: hidden; }
.cpm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: rgba(4, 4, 6, 0.72);
  backdrop-filter: blur(4px);
  animation: cpm-fade 0.25s var(--ease);
}
.cpm-frame.cpm-frame--expanded {
  position: fixed;
  inset: 2.5vh 2.5vw;
  height: auto;
  z-index: 100000;
  border-radius: 22px;
  animation: cpm-pop 0.32s var(--ease);
}
@keyframes cpm-fade { from { opacity: 0; } }
@keyframes cpm-pop { from { opacity: 0; transform: scale(0.97); } }

/* tools, legend, filter */
.cpm-tools { position: absolute; top: 12px; right: 12px; z-index: 800; display: flex; gap: 0.4rem; }
.cpm-tool, .cpm-filter__btn {
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--cpm-panel);
  border: 1px solid rgba(244, 241, 234, 0.12);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.cpm-tool:hover, .cpm-filter__btn:hover { border-color: rgba(212, 165, 116, 0.55); }
.cpm-tool:focus-visible, .cpm-filter__btn:focus-visible, .cpm-sheet :focus-visible, .cpm-marker:focus-visible {
  outline: 2px solid var(--accent-hot);
  outline-offset: 3px;
}
.cpm-filter { display: inline-flex; gap: 0.3rem; padding: 0.25rem; border-radius: 999px; background: rgba(244, 241, 234, 0.04); border: 1px solid var(--line); }
.cpm-filter__btn { background: transparent; border-color: transparent; }
.cpm-filter__btn.is-active { background: rgba(212, 165, 116, 0.16); border-color: rgba(212, 165, 116, 0.45); color: var(--ink); }
.cpm-legend {
  position: absolute; left: 12px; bottom: 26px; z-index: 800;
  display: flex; gap: 0.85rem; margin: 0; padding: 0.45rem 0.8rem; list-style: none;
  font-size: 0.78rem; color: var(--ink-soft);
  background: var(--cpm-panel); border: 1px solid var(--line); border-radius: 999px;
}
.cpm-legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.cpm-key, .cpm-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.cpm-key--mine, .cpm-dot--mine { background: var(--cpm-mine); box-shadow: 0 0 8px var(--cpm-mine); }
.cpm-key--cp, .cpm-dot--cp, .cpm-key--crosspaths, .cpm-dot--crosspaths { background: var(--cpm-cp); box-shadow: 0 0 8px var(--cpm-cp); }
.cpm-key--members, .cpm-dot--members { background: var(--cpm-members); box-shadow: 0 0 8px var(--cpm-members); }
.cpm-key--discover, .cpm-dot--discover,
.cpm-key--explore, .cpm-dot--explore {
  background: var(--cpm-explore);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 8px rgba(244, 241, 234, 0.55);
}
.cpm-status {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 790;
  margin: 0; padding: 0.4rem 0.9rem; border-radius: 999px; font-size: 0.82rem;
  background: var(--cpm-panel); border: 1px solid var(--line); color: var(--ink-soft); max-width: 80%;
}
.cpm-retry { margin-left: 0.4rem; font: inherit; color: var(--accent-hot); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.cpm-root.is-loading .cpm-frame { cursor: progress; }
.cpm-cta {
  display: inline-flex; margin-top: 0.75rem; font-weight: 600; color: var(--accent-hot); text-decoration: none;
}
.cpm-cta:hover { text-decoration: underline; }

/* markers */
.cpm-marker { background: none; border: 0; }
.cpm-marker__dot {
  position: relative; display: block; width: 100%; height: 100%; border-radius: 50%;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
/* Green: jouw CrossPath aanwezig */
.cpm-marker--cp .cpm-marker__dot {
  background: radial-gradient(circle at 35% 35%, #d9ffd0 0%, var(--cpm-cp) 45%, #1fbf2e 100%);
  box-shadow: 0 0 12px 3px rgba(92, 255, 74, 0.7), 0 0 28px 8px rgba(92, 255, 74, 0.28);
}
.cpm-marker--cp.is-top .cpm-marker__dot {
  box-shadow: 0 0 14px 4px rgba(92, 255, 74, 0.85), 0 0 36px 10px rgba(184, 255, 58, 0.35);
}
.cpm-marker--cp.is-mine .cpm-marker__dot::before {
  content: ""; position: absolute; inset: 30%; border-radius: 50%; background: #0a1f0c; opacity: 0.5;
}
.cpm-marker--cp .cpm-marker__dot::after {
  content: ""; position: absolute; inset: -2px; border-radius: 50%;
  border: 2px solid var(--cpm-cp); opacity: 0;
  animation: cpm-pulse 3.2s ease-out infinite;
}
/* Blue: leden aanwezig, nog geen CrossPath voor jou */
.cpm-marker--members .cpm-marker__dot,
.cpm-marker--crosspaths .cpm-marker__dot {
  background: radial-gradient(circle at 35% 35%, #d6ecff 0%, var(--cpm-members) 45%, #1a6fd4 100%);
  box-shadow: 0 0 10px 2px rgba(74, 163, 255, 0.55), 0 0 26px 6px rgba(74, 163, 255, 0.2);
}
.cpm-marker--members.is-top .cpm-marker__dot,
.cpm-marker--crosspaths.is-top .cpm-marker__dot {
  box-shadow: 0 0 12px 3px rgba(74, 163, 255, 0.7), 0 0 34px 10px rgba(74, 163, 255, 0.28);
}
/* Gold: jouw plaatsen (zonder CrossPath) */
.cpm-marker--mine .cpm-marker__dot {
  background: radial-gradient(circle at 35% 35%, #fff4d6 0%, var(--cpm-mine) 50%, #c8913a 100%);
  box-shadow: 0 0 12px 3px rgba(242, 196, 109, 0.6), 0 0 30px 8px rgba(242, 196, 109, 0.2);
}
.cpm-marker--mine .cpm-marker__dot::before {
  content: ""; position: absolute; inset: 30%; border-radius: 50%; background: #2a1d08; opacity: 0.55;
}
/* White: wees de eerste */
.cpm-marker--discover .cpm-marker__dot {
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, var(--cpm-disc) 50%, #d8d2c6 100%);
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 10px 2px rgba(244, 241, 234, 0.45), 0 0 22px 4px rgba(244, 241, 234, 0.18);
  opacity: 0.95;
}
.cpm-marker--mine .cpm-marker__dot::after,
.cpm-marker.is-top .cpm-marker__dot::after {
  content: ""; position: absolute; inset: -2px; border-radius: 50%;
  border: 2px solid currentColor; opacity: 0;
  animation: cpm-pulse 3.2s ease-out infinite;
}
.cpm-marker--mine .cpm-marker__dot::after { color: var(--cpm-mine); }
.cpm-marker.is-top .cpm-marker__dot::after { color: var(--cpm-cp-hot); }
@keyframes cpm-pulse {
  0% { transform: scale(1); opacity: 0.55; }
  70%, 100% { transform: scale(2.4); opacity: 0; }
}
.cpm-marker:hover .cpm-marker__dot, .cpm-marker:focus .cpm-marker__dot { transform: scale(1.3); }
.cpm-marker.is-selected { z-index: 1000 !important; }
.cpm-marker.is-selected .cpm-marker__dot {
  transform: scale(1.45);
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 3px;
}

/* clusters */
.cpm-cluster { background: none; }
.cpm-cluster span {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 50%;
  font-weight: 700; font-size: 0.85rem; color: #ffffff;
  background: radial-gradient(circle at 35% 30%, #3d7ec4 0%, #1f4f8a 58%, #163a68 100%);
  border: 1px solid rgba(14, 40, 78, 0.55);
  box-shadow: 0 2px 12px rgba(12, 32, 64, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  transition: transform 0.2s var(--ease);
}
.cpm-cluster--mine span {
  color: #1a1410;
  background: radial-gradient(circle at 35% 30%, #f0c85e 0%, #e8b84a 55%, #c9982e 100%);
  border-color: rgba(140, 100, 20, 0.45);
  box-shadow: 0 2px 12px rgba(120, 80, 10, 0.35), 0 0 0 2px rgba(232, 184, 74, 0.35);
}
.cpm-cluster--cp span {
  color: #0a1a08;
  background: radial-gradient(circle at 35% 30%, #7dff6a 0%, #3fd92e 55%, #28a81a 100%);
  border-color: rgba(20, 100, 20, 0.5);
  box-shadow: 0 2px 12px rgba(20, 90, 20, 0.4);
}
.cpm-cluster--members span {
  background: radial-gradient(circle at 35% 30%, #2f6eb8 0%, #184a82 58%, #12365f 100%);
  border-color: rgba(10, 35, 70, 0.65);
  box-shadow: 0 2px 14px rgba(10, 30, 60, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}
.cpm-cluster:hover span { transform: scale(1.08); }

/* Light map tiles: solid darker clusters for contrast */
html[data-theme="light"] .cpm-cluster span {
  color: #ffffff;
  background: radial-gradient(circle at 35% 30%, #2a649e 0%, #163d6e 55%, #0f2c50 100%);
  border-color: rgba(8, 28, 55, 0.7);
  box-shadow: 0 3px 14px rgba(8, 24, 48, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}
html[data-theme="light"] .cpm-cluster--mine span {
  color: #1a1410;
  background: radial-gradient(circle at 35% 30%, #e8b84a 0%, #d4a030 55%, #a67c1a 100%);
  border-color: rgba(100, 70, 10, 0.5);
}
html[data-theme="light"] .cpm-cluster--cp span {
  color: #062008;
  background: radial-gradient(circle at 35% 30%, #5ae04a 0%, #2fb820 55%, #1f8a14 100%);
  border-color: rgba(15, 80, 15, 0.55);
}
html[data-theme="light"] .cpm-cluster--members span {
  background: radial-gradient(circle at 35% 30%, #245a92 0%, #14365f 55%, #0d2748 100%);
  border-color: rgba(6, 24, 48, 0.75);
}

/* sheet: floating card on desktop, bottom sheet on mobile */
.cpm-sheet {
  position: absolute; z-index: 900; top: 64px; right: 14px; width: min(320px, calc(100% - 28px));
  padding: 1.05rem 1.1rem 1rem; border-radius: 18px;
  background: var(--cpm-panel); color: var(--ink);
  border: 1px solid rgba(74, 163, 255, 0.22);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  opacity: 0; transform: translateY(8px) scale(0.98);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.cpm-sheet.cpm-sheet--mine { border-color: rgba(242, 196, 109, 0.35); }
.cpm-sheet.cpm-sheet--cp { border-color: rgba(92, 255, 74, 0.4); }
.cpm-sheet.cpm-sheet--members { border-color: rgba(74, 163, 255, 0.4); }
.cpm-sheet__state.is-cp { color: var(--cpm-cp); }
.cpm-sheet.is-open { opacity: 1; transform: none; }
.cpm-sheet__x {
  position: absolute; top: 8px; right: 10px; width: 32px; height: 32px; border-radius: 50%;
  font-size: 1.3rem; line-height: 1; color: var(--ink-soft); background: transparent; border: 0; cursor: pointer;
}
.cpm-sheet__x:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.cpm-sheet__eyebrow { margin: 0 0 0.2rem; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.cpm-sheet__title { margin: 0 2rem 0.15rem 0; font-family: var(--font-display); font-size: 1.15rem; outline: none; }
.cpm-sheet__meta { margin: 0 0 0.6rem; color: var(--ink-soft); font-size: 0.88rem; }
.cpm-sheet__count { margin: 0 0 0.5rem; display: flex; align-items: center; gap: 0.45rem; font-weight: 600; }
.cpm-sheet__state { margin: 0 0 0.8rem; color: var(--ink-soft); font-size: 0.9rem; }
.cpm-sheet__state.is-mine { color: var(--cpm-mine); font-weight: 600; }
.cpm-sheet__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cpm-sheet__msg { margin: 0.6rem 0 0; min-height: 1.1em; font-size: 0.85rem; color: var(--cpm-cp); }
.cpm-sheet[hidden], .cpm-sheet [hidden], .cpm-frame [hidden] { display: none !important; }

/* leaflet chrome */
.cpm-frame .leaflet-control-zoom a {
  background: var(--cpm-panel); color: var(--ink); border-color: var(--line);
}
.cpm-frame .leaflet-control-zoom { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cpm-frame .leaflet-control-attribution {
  background: var(--cpm-panel); color: var(--ink-muted); font-size: 10px; border-top-left-radius: 8px;
}
.cpm-frame .leaflet-control-attribution a { color: var(--ink-soft); }
.cpm-root.is-nomap .cpm-frame { display: none; }

@media (max-width: 640px) {
  .cpm-frame { height: 64vh; }
  .cpm-frame.cpm-frame--expanded { inset: 0; border-radius: 0; }
  .cpm-head { align-items: flex-start; }
  .cpm-filter { width: 100%; justify-content: space-between; }
  .cpm-filter__btn { flex: 1; padding: 0.5rem 0.4rem; }
  .cpm-root--public .cpm-legend,
  .cpm-frame--public .cpm-legend { bottom: auto; top: 12px; left: auto; right: 12px; gap: 0.55rem; font-size: 0.7rem; padding: 0.35rem 0.6rem; }
  .cpm-root--public .cpm-tools,
  .cpm-frame--public .cpm-tools { top: auto; bottom: 26px; right: 12px; }
  .cpm-sheet {
    top: auto; left: 0; right: 0; bottom: 0; width: auto;
    border-radius: 20px 20px 0 0; padding: 0.9rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom));
    transform: translateY(100%);
  }
  .cpm-sheet::before {
    content: ""; display: block; width: 40px; height: 4px; margin: 0 auto 0.6rem; border-radius: 4px; background: rgba(255, 255, 255, 0.2);
  }
  .cpm-sheet.is-open { transform: none; }
  .cpm-sheet__actions .btn { flex: 1; justify-content: center; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .cpm-marker__dot::after { animation: none !important; display: none; }
  .cpm-frame, .cpm-sheet, .cpm-marker__dot, .cpm-cluster span { transition: none !important; }
  .cpm-frame--expanded, .cpm-backdrop { animation: none !important; }
}

/* existing relation-to-place modal (place-modals partial) above the map and its fullscreen overlay */
.page-map .modal, body.cpm-lock .modal { z-index: 100050; }

/* ---------------------------------------------------------------- public homepage map (hero background) */
.hero--map .hero__bg { z-index: 1; }            /* animated lines stay above the map */
.cpm-root--public { margin: 0; }
.cpm-frame--public { background: #0b0b0e; }
.cpm-frame--public::after { display: none; }
.cpm-poster {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1.5px 1.5px at 68% 38%, rgba(63, 224, 204, 0.55), transparent 60%),
    radial-gradient(2px 2px at 74% 52%, rgba(63, 224, 204, 0.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 81% 44%, rgba(63, 224, 204, 0.45), transparent 60%),
    radial-gradient(2px 2px at 63% 60%, rgba(63, 224, 204, 0.4), transparent 60%),
    radial-gradient(60% 70% at 72% 48%, #141722 0%, #0b0b0e 70%);
}
.cpm-frame--public .cpm-canvas { z-index: 1; opacity: 0; transition: opacity 0.9s var(--ease); }
.cpm-frame--public.is-ready .cpm-canvas, .cpm-frame--public.is-live .cpm-canvas { opacity: 1; }
.cpm-frame--public:not(.is-live) .cpm-canvas { pointer-events: none; }
.cpm-frame--public:not(.is-live) .leaflet-control-container { display: none; }
.cpm-shade {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(11, 11, 14, 0.75) 100%);
}
.cpm-frame--public .cpm-tools { z-index: 820; }
.cpm-tool--open { background: rgba(212, 165, 116, 0.95); color: #1a1208; border-color: transparent; font-weight: 700; }
.cpm-tool--open:hover { background: var(--accent-hot, #e6b885); }
.cpm-tool--label { cursor: default; pointer-events: none; }
.cpm-pubhead {
  position: absolute; z-index: 810; top: 12px; left: 12px; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.35rem 0.5rem 0.35rem 0.9rem; border-radius: 999px; background: var(--cpm-panel); border: 1px solid var(--line);
}
.cpm-pubhead__title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; }
.cpm-frame--public.is-live .cpm-shade, .cpm-frame--public.is-live .cpm-poster { display: none; }
.cpm-frame--public.is-live .cpm-tools { top: 12px; right: 12px; bottom: auto; }

/* mobile + tablet: card under the CTA */
.hero--map { display: flex; flex-direction: column; }
.hero--map > .hero__content { order: 1; }
.hero--map > .cpm-root--public { order: 2; position: relative; z-index: 2; width: 100%; max-width: var(--max); margin: 1.75rem auto 0; }
.cpm-root--public .cpm-frame--public:not(.cpm-frame--expanded) { height: 300px; border-radius: 18px; }
.cpm-root--public .cpm-tools { top: auto; bottom: 14px; right: 14px; left: 14px; justify-content: space-between; }
.cpm-root--public.is-nomap .cpm-frame { display: block; }

@media (min-width: 1024px) {
  .hero--map { display: block; }
  .hero--map > .cpm-root--public { position: absolute; inset: 0; z-index: 0; max-width: none; margin: 0; }
  .cpm-root--public .cpm-frame--public:not(.cpm-frame--expanded) {
    position: absolute; inset: 0; height: auto; border: 0; border-radius: 0; box-shadow: none;
  }
  .cpm-root--public:not(.is-expanded) .cpm-shade {
    background:
      linear-gradient(90deg, #0b0b0e 0%, rgba(11, 11, 14, 0.97) 40%, rgba(11, 11, 14, 0.82) 54%, rgba(11, 11, 14, 0.3) 76%, rgba(11, 11, 14, 0.4) 100%),
      linear-gradient(180deg, rgba(11, 11, 14, 0.55) 0%, transparent 22%, transparent 72%, #0b0b0e 100%);
  }
  .cpm-root--public .cpm-tools { left: auto; top: auto; right: 4%; bottom: 9%; justify-content: flex-end; }
  /* the text column stays readable/clickable; the map behind only takes clicks on its button */
  .hero--map .hero__content, .hero--map .hero__content * { pointer-events: none; }
  .hero--map .hero__content :is(a, button, input, select, textarea, label, summary) { pointer-events: auto; }
}
.cpm-frame--public.cpm-frame--expanded .cpm-shade { display: none; }
body.cpm-lock .world-modal { z-index: 100060; }
@media (prefers-reduced-motion: reduce) {
  .cpm-frame--public .cpm-canvas { transition: none; }
}
.cpm-frame--public:not(.is-live) .cpm-cluster span { font-size: 0; }  /* background: glow only, no numbers */
@media (max-width: 640px) {
  .cpm-frame--public.is-live .cpm-pubhead { right: 108px; border-radius: 18px; }
  .cpm-frame--public.is-live .cpm-pubhead .cpm-filter { width: 100%; }
  .cpm-frame--public.is-live .cpm-legend { top: auto; bottom: 26px; left: 12px; right: auto; }
}
@media (max-width: 480px) { .cpm-root--public .cpm-tool--label { display: none; } .cpm-root--public .cpm-tools { justify-content: flex-end; } }

/* ---------------------------------------------------------------- mobile: map card peeks above the fold
 * Tighter hero copy so more of the map sits in the first viewport. */
@media (max-width: 1023px) {
  .hero.hero--map {
    --cpm-hdr: 72px;
    --cpm-peek: 110px;
    --cpm-gap: 0.45rem;
    --cpm-card: 280px;
    padding-top: 0.35rem;
    padding-bottom: 1.25rem;
  }
  .hero--map .brand-hero { margin-bottom: 0.35rem; line-height: 1.15; }
  .hero--map h1 { margin-bottom: 0.55rem; }
  .hero--map .hero__sub { margin-bottom: 0.7rem; line-height: 1.45; }
  .hero--map .hero__cta { gap: 0.5rem; margin-bottom: 0; }
  .hero--map .promise { margin-top: 0.65rem; }
  .hero--map > .hero__content {
    min-height: calc(100vh - var(--cpm-hdr) - 0.35rem - var(--cpm-gap) - var(--cpm-peek));
    min-height: calc(100svh - var(--cpm-hdr) - 0.35rem - var(--cpm-gap) - var(--cpm-peek));
  }
  .hero--map > .cpm-root--public { margin-top: var(--cpm-gap); }
  .hero--map .cpm-root--public .cpm-frame--public:not(.cpm-frame--expanded) { height: var(--cpm-card); }
}
@media (max-width: 1023px) and (max-height: 780px) {
  .hero.hero--map {
    --cpm-peek: 95px;
    --cpm-card: 260px;
    padding-bottom: 5.5rem;
  }
  .hero--map .brand-hero { margin-bottom: 0.25rem; }
  .hero--map h1 { margin-bottom: 0.45rem; font-size: clamp(1.85rem, 7vw, 2.6rem); }
  .hero--map .hero__sub { margin-bottom: 0.55rem; font-size: 0.98rem; }
  .hero--map .hero__cta { gap: 0.45rem; }
  .hero--map .hero__cta .btn { padding-top: 0.72rem; padding-bottom: 0.72rem; }
  /* Early Member note below the card so it never pushes the map down */
  .hero--map .promise {
    position: absolute; left: 0; right: 0; margin: 0;
    top: calc(100% + var(--cpm-gap) + var(--cpm-card) + 0.85rem);
  }
}
@media (max-width: 1023px) and (max-height: 700px) {
  .hero.hero--map { --cpm-peek: 85px; --cpm-card: 240px; }
  .hero--map h1 { margin-bottom: 0.35rem; }
  .hero--map .hero__sub { margin-bottom: 0.45rem; }
  .hero--map .hero__cta .btn { padding-top: 0.65rem; padding-bottom: 0.65rem; }
}

/* Round 23: partners — premium dark diamond with a platinum ring and a soft rose glow; own layer, never clustered */
.cpm-marker--partner .cpm-marker__dot {
  border-radius: 4px;
  transform: rotate(45deg) scale(0.78);
  background: radial-gradient(circle at 35% 35%, #3a2a3c 0%, #121018 70%);
  border: 2px solid #f4ecff;
  box-shadow: 0 0 0 2px rgba(255, 122, 184, 0.55), 0 0 14px 4px rgba(255, 122, 184, 0.5), 0 0 30px 8px rgba(164, 140, 255, 0.25);
}
.cpm-marker--partner .cpm-marker__dot::before {
  content: ""; position: absolute; inset: 32%; border-radius: 1px; background: #ffd9ec;
  box-shadow: 0 0 6px #ff7ab8;
}
.cpm-marker--partner.is-mine .cpm-marker__dot { border-color: var(--cpm-mine); }
.cpm-marker--partner:hover .cpm-marker__dot, .cpm-marker--partner:focus .cpm-marker__dot { transform: rotate(45deg) scale(1); }
.cpm-marker--partner.is-selected .cpm-marker__dot { transform: rotate(45deg) scale(1.05); }
/* White explore dots: unclaimed neighbourhood suggestions (never clustered) */
.cpm-marker--discover.is-suggested .cpm-marker__dot,
.cpm-marker--explore .cpm-marker__dot {
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, var(--cpm-explore) 50%, #d8d2c6 100%);
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 12px 3px rgba(244, 241, 234, 0.65), 0 0 28px 6px rgba(244, 241, 234, 0.22);
  opacity: 1;
}
.cpm-marker--discover.is-suggested.is-selected .cpm-marker__dot,
.cpm-marker--explore.is-selected .cpm-marker__dot {
  box-shadow: 0 0 14px 4px rgba(244, 241, 234, 0.85), 0 0 0 2px rgba(255, 255, 255, 0.95);
}
.cpm-key--partner, .cpm-dot--partner {
  border-radius: 2px; transform: rotate(45deg); background: #121018; border: 1.5px solid #f4ecff;
  box-shadow: 0 0 6px rgba(255, 122, 184, 0.8);
}
.cpm-sheet--partner .cpm-sheet__eyebrow { color: #ffb3d6; }
.cpm-legend li[hidden], .cpm-filter__btn[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .cpm-marker--partner .cpm-marker__dot { transition: none !important; }
}

/* Round 24: place search in the opened public map (replaces the 'Alles' filter chip) */
.cpm-search { position: relative; flex: 1 1 260px; min-width: 0; }
.cpm-search__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cpm-search__input {
  width: 100%; min-width: 0; height: 38px; padding: 0 0.95rem; border-radius: 999px;
  background: rgba(244, 241, 234, 0.06); border: 1px solid var(--line); color: var(--ink);
  font: inherit; font-size: 16px; /* >=16px: no iOS zoom on focus */
}
.cpm-search__input:focus { outline: none; border-color: rgba(212, 165, 116, 0.65); box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.18); }
.cpm-search__list {
  position: absolute; z-index: 950; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 0.3rem; list-style: none;
  max-height: min(320px, 45vh); max-height: min(320px, 45dvh); overflow-y: auto; overscroll-behavior: contain;
  background: var(--cpm-panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 24px 50px -18px rgba(0, 0, 0, 0.9); backdrop-filter: blur(12px);
}
.cpm-search__item { display: block; width: 100%; text-align: left; padding: 0.55rem 0.7rem; border-radius: 10px; cursor: pointer; color: var(--ink); background: none; border: 0; font: inherit; }
.cpm-search__item small { display: block; color: var(--muted, #a9a49a); font-size: 0.78rem; }
.cpm-search__item:hover, .cpm-search__item.is-active { background: rgba(212, 165, 116, 0.14); }
.cpm-search__empty { padding: 0.6rem 0.7rem; font-size: 0.88rem; }
.cpm-search__empty .btn { margin-top: 0.5rem; }

/* Jouw wereld: zoekbalk op de kaart, volledig scherm rechtsboven, legende en zoom onderaan */
.cpm-frame--full .cpm-search--map {
  position: absolute;
  z-index: 810;
  top: 12px;
  left: 12px;
  width: min(420px, calc(100% - 11.5rem));
}
.cpm-frame--full .cpm-search__input {
  background: var(--cpm-panel);
  backdrop-filter: blur(8px);
}
.cpm-frame--full .cpm-search__list { max-height: min(280px, calc(68vh - 130px)); }
.cpm-frame--full .cpm-tools { top: 12px; right: 12px; bottom: auto; left: auto; }
.cpm-frame--full .cpm-legend {
  top: auto;
  bottom: 26px;
  left: 12px;
  right: auto;
  max-width: calc(100% - 4.75rem);
  flex-wrap: wrap;
}
.cpm-frame--full .cpm-status { top: 62px; }
@media (max-width: 640px) {
  .cpm-frame--full .cpm-search--map { width: min(420px, calc(100% - 4.6rem)); }
  .cpm-frame--full .cpm-tool { padding: 0.45rem 0.7rem; }
  .cpm-frame--full .cpm-tool__label { display: none; }
}
.cpm-frame--public.is-live .cpm-pubhead { flex-wrap: nowrap; }
@media (min-width: 641px) { .cpm-frame--public.is-live .cpm-pubhead { width: min(520px, calc(100% - 260px)); } }
@media (max-width: 640px) {
  .cpm-frame--public.is-live .cpm-pubhead { padding: 0.35rem; }
  .cpm-frame--public.is-live .cpm-pubhead__title { display: none; }
}

/* Round 28 (mobile): the map repaints in its own compositor layer. Without this, tile/marker repaints invalidated the
 * whole page layer and Chrome/Safari briefly showed it un-rastered (dark page background) while only the separately
 * composited header (backdrop-filter) stayed bright. No grey tap flash on the map containers either. */
.cpm-root, .cpm-frame { -webkit-tap-highlight-color: transparent; }
.cpm-frame { will-change: transform; contain: paint; }

/* Round 29: app.css has a global .is-loading { opacity: .6; pointer-events: none } for forms/buttons. The map root gets
 * .is-loading during every bbox fetch after a pan, so the whole map card (title + text) dimmed. The map has its own
 * (cursor) loading cue; never dim or block it. */
.cpm-root.is-loading { opacity: 1; pointer-events: auto; }
