/* Map surfaces are intentionally quiet so listings and search geometry stay legible. */
.bp-map-panel,
.md-map-dialog {
  --bmap-ink: #173f3b;
  --bmap-muted: #5b7670;
  --bmap-accent: #236f66;
  --bmap-line: #d4e3dd;
  --bmap-surface: #ffffff;
  --bmap-shadow: 0 5px 22px #183e3520;
}

:is(.bp-map-panel,.md-map-dialog) .bp-marker-wrap {
  border: 0;
  background: transparent;
}
:is(.bp-map-panel,.md-map-dialog) .bp-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 112px;
  height: 36px;
  padding: 7px 10px;
  border: 1px solid #c2d8ce;
  border-radius: 18px;
  background: var(--bmap-surface);
  color: var(--bmap-ink);
  box-shadow: 0 3px 12px #153d352b, 0 1px 2px #153d3512;
  font: 650 12px/18px var(--fd-body,"Instrument Sans",sans-serif);
  letter-spacing: -.1px;
  white-space: nowrap;
  transition: background .16s, border-color .16s, box-shadow .16s;
}
:is(.bp-map-panel,.md-map-dialog) .bp-marker.is-cluster {
  flex-direction: column;
  min-width: 52px;
  width: 52px;
  height: 48px;
  padding: 5px 6px;
  border: 2px solid #fff;
  border-radius: 24px;
  background: var(--bmap-accent);
  color: #fff;
  box-shadow: 0 0 0 4px #236f6614, 0 4px 14px #153d3530;
}
:is(.bp-map-panel,.md-map-dialog) .bp-marker.is-cluster b {
  display: block;
  font-size: 15px;
  line-height: 18px;
  letter-spacing: -.4px;
}
:is(.bp-map-panel,.md-map-dialog) .bp-marker.is-cluster small {
  display: block;
  margin-top: 1px;
  font-size: 8px;
  line-height: 10px;
  letter-spacing: .03em;
  font-weight: 500;
}
:is(.bp-map-panel,.md-map-dialog) .bp-marker.is-approximate {
  border: 2px dashed #4b7b6c;
  background: #fffef7;
}
:is(.bp-map-panel,.md-map-dialog) .bp-marker:is(.is-selected,.is-hovered,:hover) {
  border-color: #174c41;
  background: #174c41;
  color: #fff;
  box-shadow: 0 0 0 4px #236f6626, 0 5px 16px #153d3540;
}
:is(.bp-map-panel,.md-map-dialog) .bp-marker.is-cluster.is-selected {
  border-color: #fff;
  background: #174c41;
}
:is(.bp-map-panel,.md-map-dialog) .bp-marker-wrap:focus-visible {
  outline: 3px solid #195c50;
  outline-offset: 5px;
  border-radius: 22px;
}

@media (min-width: 900px) {
  .bp-map-panel { background: #f5f7f3; }
  .bp-map-panel .bp-map { background: #f5f7f3; }
  .bp-map-tools {
    display: grid;
    grid-template-columns: auto minmax(0,1fr);
    grid-template-rows: auto auto;
    align-items: start;
    gap: 9px 12px;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 650;
    pointer-events: none;
  }
  .bp-map-tools > .bp-basemap-tools {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    max-width: 270px;
    pointer-events: auto;
  }
  .bp-basemap-tools .bml-choice {
    min-height: 39px;
    padding: 5px 10px 5px 5px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #4d6865;
    box-shadow: none;
    font: 600 11px/1.2 var(--fd-body,sans-serif);
    gap: 8px;
  }
  .bp-basemap-tools .bml-choice:hover { background: #edf5f1; color: #17584c; }
  .bp-basemap-tools .bml-choice[aria-pressed="true"] { background: #e7f3ee; color: #165a4e; border-color: #bfd7cb; }
  .bp-basemap-tools .bml-choice[aria-busy="true"] { border-color: #b3c9c0; }
  .bp-basemap-tools .bml-retry { min-height: 28px; padding: 3px 0; border: 0; background: transparent; color: #246652; box-shadow: none; }
  .bp-map-tools > .bp-map-actions {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    justify-self: end;
    gap: 7px;
    min-width: 0;
    pointer-events: auto;
  }
  .bp-map-tools .bp-map-actions :is(label,button) {
    min-height: 40px;
    border: 1px solid var(--bmap-line);
    border-radius: 12px;
    padding: 0 11px;
    background: #fffffff5;
    color: var(--bmap-ink);
    box-shadow: 0 3px 13px #173b3012;
    backdrop-filter: blur(12px);
    font: 550 11px/1.3 var(--fd-body,sans-serif);
  }
  .bp-map-tools .bp-map-actions button:hover { background: #f2faf6; border-color: #9bbeb0; }
  .bp-map-actions [data-bp="cartography-toggle"] {
    background: #ecf7f1;
    border-color: #bddbcb;
    color: #205c4e;
  }
  .bp-map-follow { gap: 7px; }
  .bp-map-follow input { width: 14px; height: 14px; accent-color: var(--bmap-accent); }
  .bp-map-tools > .bp-zone-toolbar {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    width: auto;
    max-width: 100%;
    pointer-events: auto;
  }
  .bp-map-tools:has(.bz-toolbar.is-editing) { display: grid; }
  .bp-map-tools:has(.bz-toolbar.is-editing) > .bp-zone-toolbar { width: min(470px,100%); }
  .bp-map-tools .bz-toolbar button {
    border-radius: 11px;
    min-height: 39px;
    border-color: var(--bmap-line);
    background: #fffffff7;
    color: var(--bmap-ink);
    box-shadow: 0 3px 13px #173b3012;
    font-size: 11px;
  }
  .bp-map-tools .bz-toolbar button.bz-primary { background: var(--bmap-accent); border-color: var(--bmap-accent); color: #fff; }
  .bp-map-tools .bz-editor {
    width: 100%;
    max-width: 470px;
    padding: 16px;
    border: 1px solid #c8ddd1;
    border-radius: 16px;
    background: #fffffff7;
    color: var(--bmap-ink);
    box-shadow: 0 12px 38px #153d3525;
    backdrop-filter: blur(12px);
  }
  .bp-map-tools .bz-editor .bz-mode { font-size: 12px; }
  .bp-map-tools .bz-editor .bz-instruction { font-size: 11px; line-height: 1.6; }
  .bp-map-tools .bz-editor-actions { gap: 7px; }
  .bp-map-tools .bz-editor-actions button { min-height: 36px; padding: 7px 10px; }

  .bp-map-note {
    bottom: 18px;
    left: 16px;
    max-width: min(460px,calc(100% - 88px));
    border: 1px solid #d5e4dd;
    border-radius: 13px;
    padding: 10px 13px;
    background: #fffffff2;
    color: var(--bmap-ink);
    box-shadow: 0 4px 18px #173b3015;
    backdrop-filter: blur(12px);
  }
  .bp-map-note > span { font-size: 11px; line-height: 1.4; font-weight: 650; }
  .bp-map-note small { color: var(--bmap-muted); font-size: 10px; line-height: 1.5; }
  .bp-map-panel:has(.leaflet-control-scale) .bp-map-note { bottom: 45px; }
  .bp-map-panel .leaflet-control-zoom {
    margin-right: 16px;
    margin-bottom: 38px;
    border: 1px solid #d3e0d8;
    border-radius: 12px;
    box-shadow: 0 4px 18px #173b3020;
  }
  .bp-map-panel .leaflet-control-zoom a { width: 34px; height: 34px; line-height: 34px; color: var(--bmap-ink); }
  .bp-map-panel .leaflet-control-scale { margin-left: 16px; margin-bottom: 12px; }
  .bp-map-panel .leaflet-control-scale-line { border-color: #35685a; background: #ffffffdc; color: #254e42; font-size: 9px; line-height: 12px; }
  .bp-map-panel .leaflet-control-attribution {
    padding: 3px 7px;
    border-top-left-radius: 7px;
    background: #fffffff0;
    color: #4c6559;
    font: 9px/1.4 var(--fd-body,sans-serif);
  }
  .bp-map-panel .leaflet-control-attribution a { color: #315b4a; }
  .bp-map-panel :is(button,input,a):focus-visible { outline: 3px solid #2b7762; outline-offset: 3px; }

  .bp-map-preview {
    bottom: 98px;
    left: 16px;
    width: min(450px,calc(100% - 32px));
    grid-template-columns: 128px minmax(0,1fr);
    border: 1px solid #d0e0d6;
    border-radius: 19px;
    background: var(--fd-surface,#fff);
    box-shadow: 0 16px 55px #123d3633,0 3px 10px #123d3612;
  }
  .bp-map-preview > img,
  .bp-map-preview .bp-preview-placeholder { width: 128px; min-height: 176px; }
  .bp-map-preview > div:not(.bp-group-preview) { min-width: 0; padding: 16px 17px; }
  .bp-map-preview h3 { margin: 8px 0; font-size: 13px; line-height: 1.5; }
  .bp-map-preview p { margin-bottom: 10px; font-size: 11px; line-height: 1.5; }
  .bp-map-preview .bp-preview-location { font-size: 10px; color: #537666; }
  .bp-map-preview .bp-primary { min-height: 36px; border-radius: 10px; }
  .bp-map-preview .bp-preview-close { top: 9px; right: 9px; width: 27px; height: 27px; border: 1px solid #dce7e0; }
  .bp-group-preview { max-height: min(340px,calc(100dvh - 310px)); padding: 17px !important; }
  .bp-group-preview > button { padding: 13px 0; border-color: #e0e9e3; }

  .bp-cartography-header { display: none; }
  .bp-app.is-cartography {
    position: fixed;
    inset: 0;
    z-index: 900;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
  }
  .bp-app.is-cartography > :is(.bp-header,.bp-search) { display: none; }
  .bp-app.is-cartography .bp-workspace { position: relative; display: grid; grid-template-columns: 1fr; height: 100%; min-height: 0; }
  .bp-app.is-cartography .bp-map-panel { display: block; grid-area: 1 / 1; width: 100%; height: 100%; border: 0; }
  .bp-app.is-cartography .bp-map { height: 100%; }
  .bp-app.is-cartography .bp-cartography-header {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 750;
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 64px;
    padding: 11px 14px;
    border: 1px solid #d3e4da;
    border-radius: 18px;
    background: #fffffff5;
    color: var(--bmap-ink);
    box-shadow: 0 8px 28px #193d3219;
    backdrop-filter: blur(15px);
  }
  .bp-cartography-header .bp-logo { flex: none; margin-right: 7px; }
  .bp-cartography-summary { flex: 1; min-width: 140px; }
  .bp-cartography-summary :is(strong,b,h2) { display: block; margin: 0; font-size: 19px; line-height: 1.15; letter-spacing: -.5px; font-weight: 700; }
  .bp-cartography-summary :is(small,p,span) { display: block; max-width: 100%; margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; line-height: 1.4; color: var(--bmap-muted); }
  .bp-cartography-header > button,
  .bp-cartography-header .bp-cartography-actions > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: none;
    min-height: 37px;
    padding: 8px 11px;
    border: 1px solid #d4e3db;
    border-radius: 10px;
    background: #fff;
    color: var(--bmap-ink);
    font: 550 11px/1.25 var(--fd-body,sans-serif);
    white-space: nowrap;
    cursor: pointer;
  }
  .bp-cartography-actions { display: flex; align-items: center; gap: 7px; flex: none; }
  .bp-cartography-header [data-bp="cartography-results"][aria-expanded="true"],
  .bp-cartography-header [data-bp="lia"] { border-color: #bed9cb; background: #eef8f2; color: #205d4d; }
  .bp-cartography-header [data-bp="cartography-toggle"] { background: #f5f7f6; }
  .bp-app.is-cartography .bp-map-tools { top: 96px; }
  .bp-app.is-cartography .bp-map-actions [data-bp="cartography-toggle"] { display: none; }
  .bp-app.is-cartography .bp-results { display: none; }
  .bp-app.is-cartography.is-cartography-list-open .bp-results {
    display: block;
    position: absolute;
    z-index: 600;
    top: 96px;
    bottom: 24px;
    left: 16px;
    width: 380px;
    max-width: calc(100% - 32px);
    padding: 20px 17px 80px;
    border: 1px solid #d5e4da;
    border-radius: 18px;
    background: var(--fd-bg,#f6f8fa);
    box-shadow: 0 10px 40px #143c3126;
  }
  .bp-app.is-cartography.is-cartography-list-open .bp-results .bp-cards { grid-template-columns: 1fr; }
  .bp-app.is-cartography.is-cartography-list-open .bp-results .bp-card-photo { aspect-ratio: 1.7; }
  .bp-app.is-cartography.is-cartography-list-open .bp-results .bp-results-head { flex-wrap: wrap; }
  .bp-app.is-cartography.is-cartography-list-open .bp-results .bp-results-head h2 { font-size: 23px; }
  .bp-app.is-cartography.is-cartography-list-open .bp-results .bp-results-sub { align-items: flex-start; }
  .bp-app.is-cartography.is-cartography-list-open .bp-results .bp-context { max-width: 75%; }
  .bp-app.is-cartography .bp-match-strip:has([data-bp="match-demo"]) { flex-wrap: wrap; }
  .bp-app.is-cartography .bp-match-strip:has([data-bp="match-demo"]) .bp-match-symbol { display: none; }
  .bp-app.is-cartography .bp-match-strip:has([data-bp="match-demo"]) > span:not(.bp-match-symbol) { flex-basis: 100%; }
  .bp-app.is-cartography .bp-match-strip:has([data-bp="match-demo"]) button { flex: 1; justify-content: center; }
  .bp-app.is-cartography.is-cartography-list-open .bp-map-tools,
  .bp-app.is-cartography.is-cartography-list-open .bp-map-note,
  .bp-app.is-cartography.is-cartography-list-open .bp-map-preview { left: 416px; }
  .bp-app.is-cartography.is-cartography-list-open .bp-map-preview { width: min(450px,calc(100% - 448px)); }
  .bp-app.is-cartography.is-cartography-list-open .bp-map-note { max-width: calc(100% - 504px); }
  .bp-app.is-cartography .bp-compare-tray { z-index: 800; max-width: calc(100vw - 40px); }
  .bp-app.is-cartography.is-cartography-list-open .bp-compare-tray { left: calc(50% + 198px); max-width: calc(100vw - 440px); }
  .bp-app:has(.bp-compare-tray:not([hidden])) .bp-map-note { bottom: 104px; }
  .bp-app:has(.bp-compare-tray:not([hidden])) .bp-map-preview { bottom: 176px; }
}

@media (min-width: 900px) and (max-width: 1199px) {
  .bp-map-tools { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .bp-map-tools > .bp-basemap-tools { grid-column: 1; grid-row: 1; }
  .bp-map-tools > .bp-map-actions { grid-column: 1; grid-row: 2; justify-self: start; justify-content: flex-start; }
  .bp-map-tools > .bp-zone-toolbar { grid-column: 1; grid-row: 3; }
  .bp-map-tools:has(.bz-toolbar.is-editing) { grid-template-columns: minmax(0,1fr); }
  .bp-app.is-cartography .bp-map-tools { grid-template-columns: auto minmax(0,1fr); }
  .bp-app.is-cartography .bp-map-tools > .bp-map-actions { grid-column: 2; grid-row: 1; justify-self: end; }
  .bp-app.is-cartography .bp-map-tools > .bp-zone-toolbar { grid-column: 1 / -1; grid-row: 2; }
  .bp-app.is-cartography.is-cartography-list-open .bp-map-tools { grid-template-columns: 1fr; }
  .bp-app.is-cartography.is-cartography-list-open .bp-map-tools > .bp-map-actions { grid-column: 1; grid-row: 2; justify-self: start; }
  .bp-app.is-cartography.is-cartography-list-open .bp-map-tools > .bp-zone-toolbar { grid-column: 1; grid-row: 3; }
  .bp-cartography-header { gap: 10px; }
  .bp-cartography-header .bp-logo { font-size: 26px; margin-right: 0; }
  .bp-cartography-summary { min-width: 116px; }
  .bp-cartography-header > button,
  .bp-cartography-header .bp-cartography-actions > button { padding-inline: 8px; font-size: 10px; }
  .bp-cartography-actions { gap: 5px; }
  .bp-app.is-cartography.is-cartography-list-open .bp-compare-tray { gap: 9px; padding: 10px; }
  .bp-app.is-cartography.is-cartography-list-open .bp-compare-miniatures { display: none; }
}

@media (max-width: 899px) {
  .md-map-dialog { background: #f7faf8; color: #173f3b; }
  .md-map-dialog .md-dialog-head { padding: max(15px,env(safe-area-inset-top)) 16px 13px; border-bottom: 1px solid #e0e9e3; }
  .md-map-dialog .md-dialog-head small { color: #5a7f6b; }
  .md-map-dialog .md-dialog-head h2 { font-size: 23px; }
  .md-map-dialog .md-dialog-head > button { min-width: 40px; min-height: 40px; border-color: #d2e2d8; background: #fff; }
  .md-map-dialog .md-map-message { margin: 0; padding: 10px 16px; background: #f7faf8; color: #567364; font-size: 11px; }
  .md-map-dialog .md-map-stage { min-height: 250px; overflow: hidden; }
  .md-map-dialog .md-basemap-tools { position: absolute; z-index: 850; top: 12px; left: 12px; right: 12px; pointer-events: none; }
  .md-map-dialog .md-basemap-tools > * { pointer-events: auto; }
  .md-map-dialog .md-zone-toolbar { top: 80px; left: 12px; right: 12px; z-index: 820; }
  .md-map-dialog .bml-status { position: fixed; bottom: calc(68px + env(safe-area-inset-bottom,0px)); left: 12px; right: 58px; max-width: none; z-index: 900; }
  .md-map-dialog .bz-editor { padding: 14px; max-width: 100%; border-color: #c8ddd0; border-radius: 15px; background: #fffffff5; box-shadow: 0 10px 35px #173b302b; }
  .md-map-dialog .bz-toolbar button { min-height: 42px; border-radius: 10px; border-color: #d1e1d6; color: #285a46; background: #fffffff5; }
  .md-map-dialog .bz-toolbar button.bz-primary { color: #fff; background: #236f66; border-color: #236f66; }
  .md-map-dialog .md-map-footnote { padding: 10px 16px max(12px,env(safe-area-inset-bottom)); border-top: 1px solid #dce8df; background: #f7faf8; color: #5a7566; font-size: 10px; }
  .md-map-dialog .leaflet-control-zoom { margin-right: 12px; margin-bottom: 30px; border: 1px solid #cedfd3; border-radius: 11px; overflow: hidden; box-shadow: 0 4px 18px #173b3023; }
  .md-map-dialog .leaflet-control-zoom a { width: 35px; height: 35px; line-height: 35px; color: #1d5847; }
  .md-map-dialog .leaflet-control-attribution { padding: 3px 6px; background: #fffffff0; color: #4c6559; font-size: 9px; }
  .md-map-dialog .leaflet-control-attribution a { color: #315b4a; }
}

@media (prefers-reduced-motion: reduce) {
  :is(.bp-map-panel,.md-map-dialog) .bp-marker { transition: none; }
}

@media (min-width: 900px) {
  .bp-header nav { gap: 24px; }
  .bp-disclosure { position: relative; }
  .bp-disclosure > summary { display: flex; align-items: center; gap: 8px; min-height: 40px; list-style: none; cursor: pointer; color: #315b56; font: 550 12px/1.3 var(--fd-body,sans-serif); white-space: nowrap; }
  .bp-disclosure > summary::-webkit-details-marker { display: none; }
  .bp-disclosure > summary:focus-visible { outline: 3px solid #2b7762; outline-offset: 3px; border-radius: 10px; }
  .bp-header .bp-disclosure > summary { padding: 8px 10px; border-radius: 10px; }
  .bp-header .bp-disclosure[open] > summary { background: #edf6f1; }
  .bp-account { gap: 12px; }
  .bp-account .bp-favorites { min-width: 38px; min-height: 38px; padding: 8px; justify-content: center; }
  .bp-disclosure-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 1000; width: 244px; padding: 7px; border: 1px solid #dce7e1; border-radius: 14px; background: #fff; box-shadow: 0 12px 36px #153e3524; }
  .bp-header nav .bp-disclosure-panel a,
  .bp-disclosure-panel > a,
  .bp-disclosure-panel > button { display: flex; align-items: center; gap: 8px; width: 100%; height: auto; min-height: 42px; padding: 11px 12px; border: 0; border-radius: 8px; background: transparent; box-shadow: none; color: #254d46; text-decoration: none; text-align: left; font: 500 12px/1.4 var(--fd-body,sans-serif); }
  .bp-disclosure-panel > :is(a,button):hover { background: #eef6f2; }
  .bp-menu-appearance { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; margin-top: 5px; border-top: 1px solid #e9eeea; color: #62776f; font-size: 11px; }
  .bp-view-switch { min-width: 0; padding: 0; }
  .bp-view-switch select { max-width: 150px; min-height: 32px; padding: 6px 24px 6px 10px; border: 1px solid #dce6e1; border-radius: 9px; background: #fff; color: #526b62; font: 500 10px/1.3 var(--fd-body,sans-serif); cursor: pointer; }
  .bp-map-options > summary { min-height: 42px; padding: 9px 12px; border: 1px solid #d5e3dc; border-radius: 12px; background: #fffffff5; box-shadow: 0 3px 13px #173b3012; font-size: 11px; }
  .bp-map-options[open] > summary { background: #eef7f2; border-color: #a9cbb9; }
  .bp-map-tools .bp-map-options .bp-disclosure-panel { width: 260px; }
  .bp-map-tools .bp-map-options .bp-disclosure-panel > :is(button,label) { display: flex; width: 100%; min-height: 42px; align-items: center; justify-content: flex-start; margin: 0; padding: 11px 12px; border: 0; border-radius: 8px; box-shadow: none; background: transparent; font-size: 11px; }
  .bp-map-tools .bp-map-options .bp-disclosure-panel > :is(button,label):hover { background: #eef6f2; }
  .bp-map-tools:has(.bp-map-options[open]) { z-index: 900; }
}
