/* R0040 /map/ section. Loaded only on the Map pages. */
.mapv1-preview-banner {
  background: rgba(255, 211, 122, 0.12);
  border-bottom: 1px solid rgba(255, 211, 122, 0.35);
  color: #ffd37a;
  font-size: 0.88rem;
  padding: 8px 16px;
  text-align: center;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.mapv1-page { padding: 0 0 40px; }
.mapv1-shell { padding: 16px 20px 8px; max-width: 1400px; margin: 0 auto; }
.mapv1-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
  gap: 16px 24px;
  align-items: end;
  margin-bottom: 12px;
}
.mapv1-titles h1 { margin: 0 0 6px; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: 0.02em; }
.mapv1-titles .lead { margin: 0; color: var(--muted, #b7c1d1); font-size: 0.95rem; max-width: 58ch; }
.mapv1-titles .kicker { margin: 0 0 4px; letter-spacing: .14em; text-transform: uppercase; font-size: 0.72rem; color: var(--cyan, #2ee8ff); }
.mapv1-search { position: relative; }
.mapv1-search input {
  width: 100%;
  appearance: none;
  background: rgba(5,8,21,0.75);
  color: var(--text, #f4f7fb);
  border: 1px solid var(--line, rgba(255,255,255,0.14));
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
}
.mapv1-search input:focus {
  outline: none;
  border-color: var(--cyan, #2ee8ff);
  box-shadow: 0 0 0 2px rgba(46,232,255,0.2);
}
.mapv1-results {
  position: absolute;
  z-index: 5000;
  left: 0; right: 0; top: calc(100% + 6px);
  margin: 0; padding: 6px 0;
  list-style: none;
  background: #0b1324;
  border: 1px solid var(--line, rgba(255,255,255,0.14));
  border-radius: 14px;
  max-height: 320px;
  overflow: auto;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
}
.mapv1-results button {
  display: block; width: 100%;
  appearance: none; background: transparent; border: 0;
  color: inherit; font: inherit; text-align: left;
  padding: 8px 14px; cursor: pointer;
}
.mapv1-results button:hover, .mapv1-results button.is-on { background: rgba(46,232,255,0.08); }
.mapv1-results .mapv1-res-meta { display: block; color: var(--muted, #b7c1d1); font-size: 0.78rem; }
.mapv1-filters { margin: 0 0 10px; }
.mapv1-filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; align-items: center; }
.mapv1-chip, .mapv1-filter-toggles select, .mapv1-filter-toggles label {
  appearance: none;
  background: rgba(5,8,21,0.7);
  color: var(--text, #f4f7fb);
  border: 1px solid var(--line, rgba(255,255,255,0.12));
  border-radius: 999px;
  padding: 5px 11px;
  font: inherit;
  font-size: 0.84rem;
}
.mapv1-chip { cursor: pointer; }
.mapv1-chip.is-on, .mapv1-chip[aria-pressed="true"] {
  border-color: var(--cyan, #2ee8ff);
  color: var(--cyan, #2ee8ff);
  box-shadow: 0 0 0 1px rgba(46,232,255,0.25);
}
.mapv1-chip[data-cat="tips"].is-on, .mapv1-chip[data-flag="our_pin"][aria-pressed="true"] {
  border-color: #ff4d9a; color: #ff4d9a; box-shadow: 0 0 0 1px rgba(255,77,154,0.25);
}
.mapv1-filter-toggles label { display: inline-flex; gap: 6px; align-items: center; padding-right: 4px; }
.mapv1-filter-toggles select {
  background: transparent;
  border: 0;
  padding: 0 4px 0 0;
  color: inherit;
}
.mapv1-count { margin: 0; color: var(--muted, #b7c1d1); font-size: 0.82rem; }
.mapv1-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: min(72vh, 760px);
}
#mapv1-leaflet {
  width: 100%;
  height: min(72vh, 760px);
  background: #0a1630;
  border: 1px solid var(--line, rgba(255,255,255,0.1));
  border-radius: 16px;
}
.leaflet-container { font: inherit; background: #0a1630; }
.mapv1-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  width: min(380px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  background: rgba(8, 14, 28, 0.94);
  border: 1px solid var(--line, rgba(255,255,255,0.14));
  border-radius: 16px;
  padding: 16px 16px 18px;
  z-index: 1000;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
}
.mapv1-panel[hidden] { display: none !important; }
.mapv1-panel-close {
  position: absolute; top: 8px; right: 8px;
  appearance: none; background: transparent; border: 0;
  color: var(--muted, #b7c1d1); font-size: 1.4rem; line-height: 1;
  cursor: pointer; width: 32px; height: 32px;
}
.mapv1-panel h2 { margin: 0 32px 6px 0; font-size: 1.2rem; }
.mapv1-panel p { margin: 0 0 8px; font-size: 0.92rem; }
.mapv1-meta { color: var(--muted, #b7c1d1); font-size: 0.8rem; margin: 0 0 10px; }
.mapv1-status {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid var(--line, rgba(255,255,255,0.14));
  margin-right: 6px;
}
.mapv1-status.official { color: #2ee8ff; border-color: rgba(46,232,255,0.5); }
.mapv1-status.verified { color: #7dffb3; border-color: rgba(125,255,179,0.45); }
.mapv1-status.reported { color: #ffd37a; border-color: rgba(255,211,122,0.45); }
.mapv1-list { margin: 0 0 10px; padding-left: 1.15em; }
.mapv1-list li { margin: 3px 0; }
.mapv1-src, .mapv1-licence {
  font-size: 0.8rem;
  color: var(--muted, #b7c1d1);
  margin: 8px 0 0;
}
.mapv1-atlas {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed rgba(255,211,122,0.4);
  border-radius: 12px;
  background: rgba(255,211,122,0.06);
}
.mapv1-atlas h3 { margin: 0 0 6px; font-size: 0.86rem; }
.mapv1-credit, .mapv1-link-only p { color: var(--muted, #b7c1d1); font-size: 0.88rem; margin: 10px 0 0; }
.mapv1-credit a, .mapv1-panel a { color: var(--cyan, #2ee8ff); }
.mapv1-link-only { margin: 18px 0 8px; }
.mapv1-link-only h2 { margin: 0 0 6px; font-size: 1.05rem; }
.mapv1-link-only ul { margin: 0; padding-left: 1.15em; }
.mapv1-link-only .mapv1-link-only { color: var(--muted, #b7c1d1); font-size: 0.8rem; }
.mapv1-community { margin: 16px 0 8px; }
.mapv1-community summary { cursor: pointer; font-weight: 600; }
.mapv1-embed {
  position: relative;
  width: 100%;
  min-height: 480px;
  height: min(60vh, 560px);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line, rgba(255,255,255,0.1));
  background: #0a1220;
  margin-top: 10px;
}
.mapv1-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mapv1-cluster {
  background: #2ee8ff;
  color: #050815;
  border-radius: 50%;
  border: 2px solid #fff;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 3px rgba(46,232,255,0.28);
}
.mapv1-pin-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: #8bd3ff;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(139,211,255,0.3);
}
.mapv1-pin-dot.tip {
  width: 18px; height: 18px;
  background: #ff4d9a;
  box-shadow: 0 0 0 3px rgba(255,77,154,0.35);
}
.mapv1-pin-dot.district { background: #2ee8ff; box-shadow: 0 0 0 3px rgba(46,232,255,0.3); }
.mapv1-pin-dot.atlas {
  background: #ffd37a;
  box-shadow: 0 0 0 2px rgba(255,211,122,0.3);
}
@media (max-width: 860px) {
  .mapv1-shell { padding: 8px 12px 16px; }
  .mapv1-top { grid-template-columns: 1fr; gap: 8px; margin-bottom: 8px; }
  .mapv1-titles h1 { font-size: 1.7rem; margin: 0 0 2px; }
  .mapv1-titles .lead { display: none; }
  .mapv1-filter-row#mapv1-cats {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 4px;
  }
  .mapv1-filter-row#mapv1-cats .mapv1-chip { flex: 0 0 auto; }
  .mapv1-stage { min-height: 58vh; }
  #mapv1-leaflet { height: 58vh; min-height: 320px; }
  .mapv1-panel {
    top: auto; right: 8px; left: 8px; bottom: 8px;
    width: auto;
    max-height: 48%;
  }
}

/* ---- map_v2 ---- */
/* map_v2 (Phase 1): our palette navy #000627, pink #ff2d7b, cyan #2ee8ff, sunset #ff7a3d */
.mapv2-page { --m2-navy: #000627; --m2-pink: #ff2d7b; --m2-cyan: #2ee8ff; --m2-sunset: #ff7a3d; }
.mapv2-page #mapv1-leaflet, .mapv2-page .leaflet-container { background: #2b67a5; }
.mapv2-ourcats { gap: 6px; }
.mapv2-cat {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: rgba(0, 6, 39, 0.75); color: #e9eef8; font: inherit; font-size: 0.84rem;
  border: 1px solid rgba(255, 45, 123, 0.35); border-radius: 999px; padding: 5px 11px 5px 8px;
}
.mapv2-cat:hover { border-color: var(--m2-pink); }
.mapv2-cat.is-on { background: var(--m2-pink); border-color: var(--m2-pink); color: #fff; }
.mapv2-cat.is-on svg { stroke: #fff !important; }
.mapv2-cat.is-empty { opacity: 0.45; }
.mapv2-cat-ico { display: inline-flex; }
.mapv2-n { font-size: 0.74rem; opacity: 0.8; font-variant-numeric: tabular-nums; }
.mapv2-row-label { font-size: 0.72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted, #b7c1d1); margin-right: 2px; }
.mapv2-page #mapv1-cats .mapv1-chip { font-size: 0.8rem; padding: 4px 10px; opacity: 0.9; }

/* our branded marker */
.mapv2-pin-wrap { background: none; border: 0; }
.mapv2-pin { position: relative; width: 34px; height: 42px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55)); cursor: pointer; transition: transform .12s ease; transform-origin: 50% 100%; }
.mapv2-pin:hover { transform: scale(1.12); }
.mapv2-pin-shape { position: absolute; inset: 0; }
.mapv2-pin-shape path { fill: var(--m2-navy, #000627); stroke: var(--m2-pink, #ff2d7b); stroke-width: 2.6; }
.mapv2-pin.is-district .mapv2-pin-shape path { stroke: var(--m2-cyan, #2ee8ff); stroke-dasharray: 4 3; fill: rgba(0, 6, 39, 0.88); }
.mapv2-pin-glyph { position: absolute; left: 8px; top: 7px; width: 18px; height: 18px; display: flex; }
.mapv2-pin-n {
  position: absolute; top: -6px; right: -7px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: var(--m2-sunset, #ff7a3d); color: #000627; font-size: 11px; font-weight: 800;
  line-height: 18px; text-align: center; border: 1.5px solid #000627;
}
.mapv2-cluster { background: rgba(10, 22, 48, 0.72); border: 1px solid rgba(255, 255, 255, 0.35); color: #dfe8f5; font-size: 11px; }
.mapv2-legend { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; font-size: 0.82rem; }
.mapv2-legend-pin { width: 12px; height: 12px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #000627; border: 2px solid #ff2d7b; }
.mapv2-legend-pin.district { border-color: #2ee8ff; border-style: dashed; }
.mapv2-legend-dot { width: 8px; height: 8px; border-radius: 50%; background: #8fb3c7; border: 1px solid #0b1530; }

/* panel */
.mapv2-panel { background: rgba(0, 6, 39, 0.96); border-color: rgba(255, 45, 123, 0.35); }
.mapv2-panel h2 { font-size: 1.18rem; line-height: 1.25; }
.mapv2-panel h3 { font-size: 0.8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--m2-cyan, #2ee8ff); margin: 14px 0 6px; }
.mapv2-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 34px 10px 0; }
.mapv2-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 700; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.2); color: #e9eef8; }
.mapv2-badge.cat { border-color: rgba(255, 45, 123, 0.55); }
.mapv2-badge.approx { color: var(--m2-cyan, #2ee8ff); border-color: rgba(46, 232, 255, 0.5); border-style: dashed; }
.mapv2-badge.reported { color: #ffd37a; border-color: rgba(255, 211, 122, 0.45); }
.mapv2-badge.verified { color: #9dffa8; border-color: rgba(157, 255, 168, 0.5); }
.mapv2-badge.spoiler { color: var(--m2-sunset, #ff7a3d); border-color: rgba(255, 122, 61, 0.5); }
.mapv2-badge.gtadb { color: #b7c1d1; }
.mapv2-summary { font-size: 0.95rem !important; line-height: 1.5; }
.mapv2-steps { margin: 0 0 8px; padding-left: 1.3em; font-size: 0.9rem; line-height: 1.45; }
.mapv2-steps li { margin: 4px 0; }
.mapv2-steps li::marker { color: var(--m2-pink, #ff2d7b); font-weight: 700; }
.mapv2-clip { display: flex; gap: 10px; align-items: center; margin: 12px 0 4px; padding: 8px; border-radius: 12px; background: rgba(46, 232, 255, 0.06); border: 1px solid rgba(46, 232, 255, 0.22); text-decoration: none; color: #e9eef8 !important; font-size: 0.86rem; }
.mapv2-clip img, .mapv2-clip-ph { width: 96px; height: 54px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; background: #0a1630; display: flex; align-items: center; justify-content: center; }
.mapv2-clip small { display: block; color: var(--m2-cyan, #2ee8ff); font-size: 0.7rem; letter-spacing: .08em; text-transform: uppercase; }
.mapv2-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.mapv2-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: inherit; font-size: 0.86rem; font-weight: 700; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.25); background: transparent; color: #fff !important; text-decoration: none; }
.mapv2-btn.primary { background: var(--m2-pink, #ff2d7b); border-color: var(--m2-pink, #ff2d7b); }
.mapv2-btn:hover { border-color: var(--m2-cyan, #2ee8ff); }
.mapv2-more { list-style: none; margin: 0; padding: 0; }
.mapv2-more button { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; font: inherit; font-size: 0.88rem; color: #e9eef8; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; padding: 7px 9px; margin: 0 0 6px; cursor: pointer; }
.mapv2-more button:hover { border-color: var(--m2-pink, #ff2d7b); }
.mapv2-more svg { flex: 0 0 auto; }
.mapv2-empty { color: var(--muted, #b7c1d1); font-size: 0.88rem; }
.mapv2-sources { margin: 12px 0 6px; font-size: 0.8rem; color: var(--muted, #b7c1d1); }
.mapv2-sources summary { cursor: pointer; }
.mapv2-sources ul { margin: 6px 0 0; padding-left: 1.1em; }
.mapv2-spoiler { position: relative; }
.mapv2-spoiler.is-hidden .mapv2-spoiler-body { filter: blur(7px); user-select: none; pointer-events: none; max-height: 140px; overflow: hidden; }
.mapv2-reveal { position: absolute; z-index: 2; top: 40px; left: 50%; transform: translateX(-50%); font: inherit; font-weight: 700; font-size: 0.85rem; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--m2-sunset, #ff7a3d); background: #000627; color: #fff; cursor: pointer; }
.mapv2-res-ico { display: inline-flex; vertical-align: -2px; margin-right: 6px; }

@media (max-width: 860px) {
  .mapv2-ourcats { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .mapv2-ourcats .mapv2-cat { flex: 0 0 auto; }
  .mapv2-page #mapv1-cats { display: none; }
  .mapv2-page .mapv1-filter-toggles { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .mapv2-page .mapv1-filter-toggles > * { flex: 0 0 auto; }
  /* bottom sheet */
  .mapv2-panel { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 62%; border-radius: 18px 18px 0 0; padding-top: 22px; }
  .mapv2-panel::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); }
}

/* map_popups_v2 — richer our-pin popups. Only staged when the flag is on or in preview. */
.mapv2-hero {
  margin: 0 0 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(46, 232, 255, 0.22);
  background: rgba(0, 0, 0, 0.25);
  aspect-ratio: 16 / 9;
  max-height: 160px;
}
.mapv2-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mapv2-source-line {
  margin: 8px 0 10px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #b7c1d1;
}
.mapv2-source-label {
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 0.68rem;
  margin-right: 4px;
}
.mapv2-source-line a { color: #2ee8ff; }
.mapv2-src-status {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
}
.mapv2-src-status[data-status="official"] { color: #5ee0a0; border-color: #5ee0a0; }
.mapv2-src-status[data-status="verified"] { color: #2ee8ff; border-color: #2ee8ff; }
.mapv2-src-status[data-status="community"] { color: #ffd37a; border-color: #ffd37a; }
.mapv2-btn.share[data-copied="1"] { border-color: #2ee8ff; color: #2ee8ff; }

/* ---- map_v3 ---- */
/* map_v3 enhancements: found-tracking controls, progress badges, popup checkbox, smooth transitions */
.mapv3-tracker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(0, 6, 39, 0.72);
  border: 1px solid rgba(46, 232, 255, 0.22);
}
.mapv3-progress-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  min-width: 150px;
}
.mapv3-progress-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: #eef4ff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mapv3-progress-bar {
  width: 84px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  flex: 0 0 auto;
}
.mapv3-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff2d7b, #2ee8ff);
  transition: width 0.2s ease;
}
.mapv3-next-btn {
  border-color: rgba(46, 232, 255, 0.45);
  color: #2ee8ff;
}
.mapv3-next-btn:hover {
  background: rgba(46, 232, 255, 0.14);
}
.mapv3-reset-btn {
  border-color: rgba(255, 122, 61, 0.4);
  color: #ffd37a;
}
.mapv3-reset-btn:hover {
  border-color: #ff7a3d;
}
.mapv3-undo-btn {
  border-color: #2ee8ff;
  background: rgba(46, 232, 255, 0.16);
  color: #fff;
}
.mapv3-undo-btn[hidden] {
  display: none;
}

/* category progress badge */
.mapv2-cat.is-complete {
  border-color: rgba(94, 224, 160, 0.6);
}
.mapv2-cat.is-complete .mapv2-n {
  color: #5ee0a0;
  opacity: 1;
  font-weight: 700;
}

/* found state on our pins */
.mapv2-pin.is-found {
  opacity: 0.46;
  filter: grayscale(0.35) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}
.mapv2-pin.is-found .mapv2-pin-shape path {
  stroke: #5ee0a0;
}
.mapv2-pin-check {
  position: absolute;
  bottom: 4px;
  right: -5px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #5ee0a0;
  color: #000627;
  font-size: 10px;
  font-weight: 900;
  line-height: 15px;
  text-align: center;
  border: 1.5px solid #000627;
}

/* found checkbox inside popup panel */
.mapv3-found-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 6px 12px;
  margin: 0 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #eef4ff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.mapv3-found-toggle:hover {
  border-color: #2ee8ff;
}
.mapv3-found-toggle.is-checked {
  border-color: rgba(94, 224, 160, 0.7);
  background: rgba(94, 224, 160, 0.14);
  color: #7dffb3;
}
.mapv3-found-chk {
  width: 18px;
  height: 18px;
  accent-color: #5ee0a0;
  cursor: pointer;
  margin: 0;
}

@media (max-width: 860px) {
  .mapv3-tracker {
    padding: 7px 10px;
    gap: 6px;
  }
  .mapv3-progress-wrap {
    width: 100%;
    margin-right: 0;
  }
  .mapv3-progress-bar {
    flex: 1 1 auto;
    width: auto;
  }
  .mapv3-tracker .mapv1-chip {
    font-size: 0.8rem;
    padding: 6px 10px;
    min-height: 36px;
  }
  .mapv3-found-toggle {
    min-height: 44px;
    width: 100%;
    justify-content: flex-start;
  }
}

/* R0166: places dots — larger visible disc, 44px invisible hit target */
.leaflet-marker-icon.mapv3-place-wrap,
.mapv3-place-wrap {
  background: transparent !important;
  border: none !important;
  width: 44px !important;
  height: 44px !important;
  margin-left: -22px;
  margin-top: -22px;
}
.mapv3-place-hit {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  pointer-events: auto;
}
.mapv3-place-dot {
  display: block;
  border-radius: 50%;
  box-sizing: border-box;
  border: 2px solid #071018;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9), 0 1px 2px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.mapv3-place-hit.is-found .mapv3-place-dot {
  border-color: #5ee0a0;
  opacity: 0.8;
  box-shadow: 0 0 0 1px rgba(94, 224, 160, 0.85), 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* ---- R0277 map compact + sticky panel ---- */
/* Compact first screen: toolbar + remaining viewport for the canvas. */
.mapv3-page { padding-bottom: 0; }
.mapv3-page .mapv1-shell {
  max-width: none;
  margin: 0;
  padding: 0;
  height: calc(100dvh - var(--header-h, 64px));
  min-height: calc(100dvh - var(--header-h, 64px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mapv3-page .mapv1-top,
.mapv3-page .mapv1-filters,
.mapv3-page .mapv1-toolbar {
  flex: none;
  padding: 8px 12px 0;
}
.mapv3-page .mapv1-titles h1 { font-size: clamp(1.15rem, 2.4vw, 1.7rem); margin: 0; }
.mapv3-page .mapv1-titles .lead { display: none; }
.mapv3-page .mapv1-titles .kicker { margin: 0; }
.mapv3-page .mapv1-toolbar-primary,
.mapv3-page .mapv1-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 6px;
}
.mapv3-page .mapv1-search { flex: 1 1 220px; min-width: 0; }
.mapv3-page .mapv1-view-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mapv3-page .mapv3-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 6px;
  padding: 0 12px;
}
.mapv3-page details.mapv3-group {
  background: rgba(5, 8, 21, 0.7);
  border: 1px solid var(--line, rgba(255,255,255,0.12));
  border-radius: 12px;
  padding: 4px 8px 6px;
}
.mapv3-page details.mapv3-group > summary {
  cursor: pointer;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan, #2ee8ff);
  padding: 4px 2px;
  list-style: none;
}
.mapv3-page details.mapv3-group > summary::-webkit-details-marker { display: none; }
.mapv3-page .mapv1-count {
  padding: 0 12px 8px;
  margin: 0;
}
.mapv3-page .mapv1-count .mapv1-count-bits { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.mapv3-page .mapv1-stage {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.mapv3-page .mapv1-stage.is-open {
  /* desktop side panel kicks in below */
}
.mapv3-page #mapv1-leaflet {
  height: 100%;
  min-height: 280px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}
/* Sticky panel chrome */
.mapv3-page .mapv1-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.mapv3-page .mapv1-panel-head {
  flex: none;
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  align-items: start;
  padding: 12px 16px 10px;
  background: rgba(8, 14, 28, 0.96);
  border-bottom: 1px solid var(--line, rgba(255,255,255,0.14));
}
.mapv3-page .mapv1-panel-head h2 { margin: 0; font-size: 1.05rem; line-height: 1.25; text-wrap: pretty; font-family: var(--font, inherit); font-weight: 700; letter-spacing: 0; text-transform: none; }
.mapv3-page .mapv1-panel-head .mapv1-panel-close { flex: none; }
.mapv3-page .mapv1-panel-head .mapv2-badges { grid-column: 1 / -1; }
.mapv3-page .mapv1-panel-close {
  position: static;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}
.mapv3-page #mapv1-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px 16px 16px;
}
.mapv3-page .mapv1-panel-foot {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line, rgba(255,255,255,0.14));
  background: rgba(8, 14, 28, 0.96);
}
@media (min-width: 961px) {
  .mapv3-page .mapv3-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mapv3-page .mapv1-stage.is-open #mapv1-leaflet { border-right: 0; }
  .mapv3-page .mapv1-panel {
    position: fixed;
    top: var(--header-h, 64px);
    right: 0;
    bottom: 0;
    left: auto;
    width: min(400px, 38vw);
    max-height: none;
    height: auto;
    border-radius: 0;
    z-index: 1100;
  }
}
@media (max-width: 960px) {
  .mapv3-page .mapv1-titles .kicker { display: none; }
  .mapv3-page .mapv1-titles h1 { font-size: 1.05rem; }
  .mapv3-page .mapv3-groups { grid-template-columns: 1fr; padding: 0 12px; }
  .mapv3-page .mapv1-panel {
    position: fixed;
    top: auto; right: 0; left: 0; bottom: 0;
    width: auto;
    max-height: 62dvh;
    height: auto;
    border-radius: 16px 16px 0 0;
    z-index: 1100;
  }
  .mapv3-page .mapv2-ourcats,
  .mapv3-page .mapv1-filter-toggles { flex-wrap: wrap; overflow: visible; }
}
.mapv3-page .mapv1-credit {
  flex: none;
  margin: 0;
  padding: 4px 12px 6px;
  font-size: 0.7rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (min-width: 961px) {
  .mapv3-page .mapv1-shell {
    height: 100dvh;
    min-height: 100dvh;
  }
}
/* ---- /R0277 map compact + sticky panel ---- */

/* R0281 ladder badges. Safe to append; does not replace R0277 rules. */
.mapv2-badge.official { color: #2ee8ff; border-color: rgba(46, 232, 255, 0.5); }
.mapv2-badge.verified { color: #9dffa8; border-color: rgba(157, 255, 168, 0.5); }
.mapv2-badge.reported { color: #ffd37a; border-color: rgba(255, 211, 122, 0.45); }
.mapv2-badge.lead { color: #ff7a3d; border-color: rgba(255, 122, 61, 0.5); }
.mapv2-badge.debunked { color: #ff6b8a; border-color: rgba(255, 107, 138, 0.5); }
.mapv2-legend-status { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0.35rem 0; }
.mapv2-src-status { text-transform: none; }
.mapv2-src-status[data-status="reported"] { color: #ffd37a; border-color: #ffd37a; }
.mapv2-src-status[data-status="lead"] { color: #ff7a3d; border-color: #ff7a3d; }
.mapv2-src-status[data-status="debunked"] { color: #ff6b8a; border-color: #ff6b8a; }
/* Legend stays readable: wrap/scroll, and clear the desktop side panel. */
.mapv3-page .mapv1-credit {
  white-space: normal;
  overflow-x: auto;
  overflow-y: hidden;
  text-overflow: unset;
}
@media (min-width: 961px) {
  .mapv3-page .mapv1-stage.is-open ~ .mapv1-credit {
    padding-right: calc(min(400px, 38vw) + 16px);
  }
}

/* R0279/R0306: filter summary line + hide empty tip-category chips */
.mapv1-filter-summary { margin: 4px 0 0; font: 400 13px/1.45 system-ui,sans-serif; color: #c8c3b8; }
.mapv1-filter-summary button { margin-left: 8px; }
.mapv2-cat.is-empty { display: none; }

/* R0311 (R0318) map panel UX — Erdmann 24/11 15:10 + follow-up 15:26 */

/* 1. Clickable-looking Filters / Layers / Progress summaries */
.mapv3-page details.mapv3-group > summary.mapv3-group-toggle,
.mapv3-page details.mapv3-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  background: rgba(46, 232, 255, 0.12);
  border: 1px solid rgba(46, 232, 255, 0.4);
  border-radius: 8px;
  padding: 7px 10px;
  margin: 0 0 6px;
  color: #f4f1ea;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  list-style: none;
}
.mapv3-page details.mapv3-group > summary::-webkit-details-marker { display: none; }
.mapv3-page details.mapv3-group > summary::after {
  content: "▾";
  font-size: 0.85rem;
  color: #2ee8ff;
  line-height: 1;
}
.mapv3-page details.mapv3-group:not([open]) > summary::after { content: "▸"; }
.mapv3-page details.mapv3-group > summary:hover,
.mapv3-page details.mapv3-group > summary:focus-visible {
  background: rgba(46, 232, 255, 0.2);
  outline: 2px solid #2ee8ff;
  outline-offset: 1px;
}

/* 5–6. Narrower Layers and Progress; Filters takes the leftover space */
@media (min-width: 961px) {
  .mapv3-page .mapv3-groups {
    grid-template-columns: minmax(140px, 1fr) minmax(120px, 170px) minmax(220px, 270px);
    align-items: start;
  }
  /* When Filters is closed, don't spend the leftover column on an empty box. */
  .mapv3-page .mapv3-groups:has(.mapv3-group-filters:not([open])) {
    grid-template-columns: minmax(128px, 200px) minmax(128px, 180px) minmax(250px, 1fr);
  }
}

/* 6. Progress: row (a) count+bar, row (b) action buttons */
#mapv3-tracker,
.mapv3-group-progress .mapv3-tracker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
#mapv3-tracker .mapv3-progress-wrap,
.mapv3-group-progress .mapv3-progress-wrap {
  flex: 1 1 100%;
  min-width: 0;
}
#mapv3-tracker > button,
.mapv3-group-progress .mapv3-tracker > button {
  flex: 0 1 auto;
  white-space: nowrap;
  padding: 4px 8px;
  font-size: 0.72rem;
}

/* 3–4. Places block: All is the master places toggle; District sits under Places */
#mapv1-cats button[data-cat="all"][aria-pressed="false"],
#mapv1-cats button[data-cat="all"]:not(.is-on) {
  opacity: 0.7;
}
.mapv3-places-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
/* Hide the old Mapped places chip; Places "All" is the toggle. */
.mapv3-page .mapv1-chip[data-layer="places"] { display: none; }

/* 7. Corner control that hides Filter/Layers/Progress */
#mapv3-chrome-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1200;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(232, 195, 106, 0.7);
  background: rgba(8, 14, 28, 0.92);
  color: #f4f1ea;
  font: 650 12px/1.2 system-ui, sans-serif;
  cursor: pointer;
}
#mapv3-chrome-toggle:hover,
#mapv3-chrome-toggle:focus-visible {
  outline: 2px solid #e8c36a;
  outline-offset: 1px;
}
.mapv1-stage { position: relative; }
@media (min-width: 961px) {
  .mapv3-page .mapv1-stage.is-open #mapv3-chrome-toggle {
    right: calc(min(400px, 38vw) + 8px);
  }
}
.map-chrome-hidden .mapv3-groups,
.map-chrome-hidden .mapv1-count,
.map-chrome-hidden .mapv1-filter-summary {
  display: none !important;
}

/* Tips on/off sits with the tip chips */
.mapv3-tips-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
}
.mapv3-tips-head .mapv3-sublabel,
.mapv3-sublabel {
  margin: 0;
  font: 650 11px/1.2 system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c8c3b8;
}

/* When the R0277 fixed side panel is open, keep Layers/Progress out from under it. */
@media (min-width: 961px) {
  .mapv3-page .mapv1-shell:has(.mapv1-stage.is-open) .mapv3-groups,
  .mapv3-page .mapv1-shell:has(.mapv1-stage.is-open) .mapv1-count,
  .mapv3-page .mapv1-shell:has(.mapv1-stage.is-open) .mapv1-filter-summary {
    padding-right: calc(min(400px, 38vw) + 16px);
  }
}

.mapv3-progress-row-b {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  width: 100%;
}
.mapv3-progress-row-b > button {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
}


/* Follow-up: tip title takes the full panel width; location/meta on the next row. */
.mapv3-page .mapv1-panel-head h2 {
  grid-column: 1 / -1;
}
.mapv3-page .mapv1-panel-head .mapv1-meta {
  grid-column: 1 / -1;
  margin: 0;
}

/* Follow-up: keep Fullscreen / Reset view out from under the open desktop side panel. */
@media (min-width: 961px) {
  .mapv3-page .mapv1-shell:has(.mapv1-stage.is-open) .mapv1-top {
    padding-right: calc(min(400px, 38vw) + 16px);
  }
}

/* Erdmann 24/11 15:26: show Tips and Places chips (incl. Places All) on mobile too.
   Overrides the pre-existing max-width 860px rule that hid #mapv1-cats. */
@media (max-width: 860px) {
  .mapv2-page .mapv1-filter-row#mapv1-cats,
  .mapv3-page .mapv1-filter-row#mapv1-cats,
  .mapv2-page #mapv1-cats,
  .mapv3-page #mapv1-cats {
    display: flex !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
    gap: 6px;
  }
  .mapv3-page .mapv2-ourcats {
    flex-wrap: wrap !important;
    overflow: visible !important;
  }
  .mapv3-progress-row-b { flex-wrap: wrap; }
}
