/* Responsive discovery panes; the search is retained when panes reflow. */
body:has(#search-page:not([hidden])) main{max-width:1840px}
.discovery-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:24px;align-items:start}
.homes-pane{min-width:0}
.map-pane {
  display:none;
  position:relative;
  isolation:isolate;
  min-width:0;
  height:clamp(340px,calc(100dvh - 205px - var(--search-dock-height,0px)),1000px);
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:var(--brand-radius,12px);
  background:#e5eef0;
}
.discovery-layout[data-layout=map] .homes-pane{display:none}
.discovery-layout[data-layout=map] .map-pane,.discovery-layout[data-layout=split] .map-pane{display:block}
.map-view-switch{display:flex;gap:4px;background:var(--paper);border-radius:9px;padding:4px}
.map-view-switch button{min-height:40px;padding:7px 14px;border-color:transparent;background:transparent;font-size:14px}
.map-view-switch button[aria-pressed=true]{background:var(--accent);color:#fff}
.map-pane > .search-map { position:absolute; inset:0; }
.map-controls {
  position:absolute;
  z-index:2;
  inset:12px 58px auto 12px;
  display:flex;
  flex-wrap:wrap;
  align-items:start;
  gap:6px;
  margin:0;
  pointer-events:none;
}
.map-controls > * { pointer-events:auto; }
.map-controls button,
.map-options > summary {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  min-width:44px;
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  box-shadow:0 2px 8px #17243b22;
  color:var(--ink);
  font-size:13px;
  font-weight:650;
}
.map-controls #map-search-area:not(:disabled) { background:var(--accent); color:#fff; border-color:var(--accent); }
.map-options > summary { cursor:pointer; list-style:none; }
.map-options > summary::-webkit-details-marker { display:none; }
.map-options-content {
  position:absolute;
  inset:calc(100% + 8px) auto auto 0;
  width:min(310px,100%);
  max-height:235px;
  overflow:auto;
  overscroll-behavior:contain;
  padding:12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  box-shadow:0 6px 18px #17243b26;
}
.map-options-content p { margin:6px 0 0; }
.map-options-content p:empty { display:none; }
.map-options-content .map-coverage {
  margin:0;
  color:var(--ink);
  font-size:14px;
  font-weight:650;
  line-height:1.4;
}
.map-boundary-note { margin-top:4px; }
.map-boundary-note summary {
  min-height:38px;
  padding:8px 0;
  cursor:pointer;
  font-size:13px;
  font-weight:650;
}
.map-boundary-note p { margin:0; }
#map-browse-pins { margin-top:8px; box-shadow:none; }
.map-pin-navigation {
  position:sticky;
  inset-block-end:0;
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:6px;
  align-items:center;
  padding:6px 9px;
  border-top:1px solid var(--line);
  background:#fff;
  color:var(--muted);
  font-size:13px;
  text-align:center;
}
.map-pin-navigation button { min-height:44px; padding:6px 9px; font-size:13px; }
.map-status {
  position:absolute;
  z-index:1;
  inset:auto 12px 36px;
  width:fit-content;
  max-width:calc(100% - 24px);
  margin:0;
  padding:8px 12px;
  border-radius:8px;
  background:#fff;
  color:var(--ink);
  font-size:13px;
  box-shadow:0 2px 8px #17243b22;
  pointer-events:none;
}
.map-selection {
  position:absolute;
  z-index:1;
  inset:auto auto 36px 12px;
  width:min(398px,calc(100% - 24px));
  max-height:calc(100% - 112px);
  overflow:auto;
  overscroll-behavior:contain;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  box-shadow:0 6px 25px #17243b35;
}
#map-selection-close {
  position:absolute;
  z-index:1;
  top:4px;
  right:4px;
  width:44px;
  min-height:44px;
  padding:0;
  border:0;
  background:#fff;
  color:var(--ink);
  font-size:25px;
  line-height:1;
}
.map-selection-message { margin:0; padding:15px 53px 12px 12px; font-size:14px; }
.map-cluster-list { display:grid; gap:5px; margin:0; padding:0 12px 12px; list-style:none; }
.map-cluster-list button { width:100%; min-height:44px; padding:7px 10px; text-align:left; }
.map-pane .active-property-pin { background:#171717; box-shadow:0 3px 12px #0005; }
.map-pane:has(.map-selection:not([hidden])) .map-status { bottom:auto; inset-block-start:70px; }
#map-search-actions .search-actions {
  display:flex;
  align-items:center;
  justify-content:start;
  flex-direction:row;
  gap:6px;
  margin-top:8px;
  padding-top:8px;
  border-top:1px solid var(--line);
}
#map-search-actions .search-actions button { box-shadow:none; }
#search-page:has(.discovery-layout[data-layout=map]) .results-toolbar { display:none; }
#search-page:has(.discovery-layout[data-layout=map]) .browse-layout { margin:0 0 12px; }
@media(max-width:650px){
 body[data-controls=bottom] #search-page:has(.discovery-layout[data-layout=map]) .results-display-controls { display:none; }
}
.filter-hint{color:var(--muted);font-size:13px;line-height:1.6;margin:12px 0}
.filter-panel-heading{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:14px}
.more-filters .popover-content{width:min(560px,calc(100vw - 40px));max-height:min(78dvh,820px);overflow:auto;overscroll-behavior:contain}
.filter-group{border-top:1px solid var(--line);padding:14px 0}
.filter-group>summary{font-size:15px;font-weight:600;cursor:pointer;padding-bottom:12px;min-height:44px}
.advanced-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
#amenity-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.preferred-facts{font-size:14px;color:var(--accent);margin:8px 0}
.comparison-tray{position:sticky;bottom:12px;z-index:8;display:flex;gap:12px;align-items:center;flex-wrap:wrap;background:#fff;padding:14px 18px;margin:16px 0;border:1px solid var(--line);border-radius:12px;box-shadow:0 4px 20px #17243b10}
.comparison-tray>span{margin-right:auto}
.comparison-scroll{overflow:auto;max-width:100%}.comparison-table{width:100%;border-collapse:collapse;min-width:480px}
.comparison-table th,.comparison-table td{text-align:left;vertical-align:top;border-bottom:1px solid var(--line);padding:14px;min-width:140px;max-width:260px;overflow-wrap:anywhere}
.comparison-table tbody th{font-weight:500;color:var(--muted)}
#comparison{width:min(1070px,calc(100% - 24px));max-width:none}
#comparison-content{min-width:0}
.comparison-insights{display:grid;grid-template-columns:repeat(auto-fit,minmax(164px,1fr));gap:8px;margin:0 0 12px}
.comparison-insight{display:grid;gap:3px;padding:11px 12px;border:1px solid var(--line);border-radius:10px;background:#edf3ef}
.comparison-insight>span,.comparison-insight small{color:#43554d;font-size:.78rem}
.comparison-insight strong{color:#203e32;font-size:1rem;line-height:1.3}
#comparison label.comparison-differences{display:flex;flex-direction:row;width:max-content;max-width:100%;min-height:44px;align-items:center;justify-content:flex-start;gap:7px;font-weight:650;font-size:.87rem}
.comparison-differences input{flex:none;width:18px;height:18px;min-height:0;margin:0;accent-color:#294a3c}
.comparison-scroll{border:1px solid var(--line);border-radius:10px}
.comparison-table{min-width:calc(95px + 154px * var(--compare-properties,2));width:100%;table-layout:fixed;border-spacing:0}
.comparison-table[data-count="3"]{--compare-properties:3}
.comparison-table[data-count="4"]{--compare-properties:4}
.comparison-table th,.comparison-table td{width:auto;min-width:0;padding:10px 12px}
.comparison-table tr>:first-child{position:sticky;left:0;z-index:1;width:clamp(95px,14vw,140px);min-width:0;background:var(--paper);font-size:.82rem}
.comparison-table thead th{background:var(--surface,#fff);color:var(--ink)}
.comparison-table tbody tr:nth-child(even) td{background:var(--paper)}
.comparison-property{display:grid;align-content:start;gap:4px;color:var(--ink);font-weight:650;text-decoration:none}
.comparison-property:hover strong{text-decoration:underline;text-underline-offset:3px}
.comparison-property strong{font-size:.88rem;line-height:1.3;overflow-wrap:anywhere}
.comparison-property>span:last-child{font-size:.8rem;font-weight:500;color:var(--muted)}
.comparison-photo{display:grid;place-items:center;height:clamp(90px,16vw,158px);overflow:hidden;border-radius:7px;background:var(--wash,#eef0ed);color:var(--muted);font-size:.77rem}
.comparison-photo img{display:block;width:100%;height:100%;object-fit:cover}
.comparison-remove{font-size:.72rem;min-height:37px;margin-top:3px;padding:4px 0;color:var(--muted);background:transparent;box-shadow:none;border:0;text-decoration:underline;text-underline-offset:3px}
.comparison-note{margin-top:10px}
@media(max-width:480px){
 .comparison-insights{grid-template-columns:minmax(0,1fr)}
 .comparison-insight{grid-template-columns:minmax(0,1fr) auto;gap:1px 7px}
 .comparison-insight small{grid-column:1/-1}
 .comparison-insight strong{font-size:.84rem}
 .comparison-table{min-width:calc(74px + 92px * var(--compare-properties,2))}
 .comparison-table tr>:first-child{width:74px}
 .comparison-table th,.comparison-table td{padding:8px}
 .comparison-table td{font-size:.85rem}
 .comparison-photo{height:78px}
}
.map-selection .map-property-card {
  display:grid;
  grid-template-columns:clamp(80px,25%,112px) minmax(0,1fr);
  align-items:start;
  gap:0;
  border:0;
  border-radius:0;
  box-shadow:none;
}
.map-selection .map-property-no-photo { grid-template-columns:minmax(0,1fr); }
.map-selection .map-property-card .card-media { margin:10px 0 10px 10px; border-radius:7px; position:relative; }
.map-selection .map-property-card .card-photo { width:100%; height:auto; min-height:0; aspect-ratio:1; }
.map-selection .map-property-card .photo-tag { font-size:10px; }
.map-selection .map-property-card .card-body { padding:10px; min-width:0; }
.map-selection .map-property-card .card-meta { padding-inline-end:40px; }
.map-selection .map-property-card .card-title { overflow-wrap:anywhere; font-size:15px; }
.map-selection .map-property-card .card-price-row { gap:5px; align-items:center; }
.map-selection .map-property-card .card-price { font-size:19px; }
.map-selection .map-property-card .save-home { position:static; padding:0; width:44px; height:44px; }
.map-selection .map-property-card .attribution { columns:auto; margin:8px 0; }
.map-selection .map-property-card .card-actions { justify-content:start; flex-wrap:wrap; margin:0; }
.card-actions>button[data-compare-key]{padding:8px 10px;font-size:13px}
#bathroom-filter{flex:0 1 130px}
@media(min-width:800px){
 .discovery-layout[data-layout=split]{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
 .discovery-layout[data-layout=split] .results[data-density]{grid-template-columns:repeat(2,minmax(0,1fr))}
 .discovery-layout[data-layout=split] .map-pane{position:sticky;top:12px;height:clamp(360px,calc(100dvh - var(--search-dock-height,0px) - 36px),1000px)}
}
@media(max-width:799px){
 .map-view-switch [data-layout=split],.discovery-layout[data-layout=split] .map-pane{display:none}
 .map-view-switch{margin-right:auto}
 .browse-layout{flex-wrap:wrap}
}
@media(min-width:1500px){.discovery-layout[data-layout=split] .results[data-density="4"],.discovery-layout[data-layout=split] .results[data-density="5"]{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:560px){.map-selection{bottom:52px}.browse-layout{gap:10px}.map-view-switch button{padding:7px 11px}.map-view-switch{flex-shrink:0}.more-filters .popover-content{position:fixed;inset:auto 12px max(12px,env(safe-area-inset-bottom));width:auto;max-width:none;max-height:85dvh;z-index:40;box-shadow:0 0 0 100vmax #17243b35,0 12px 36px #17243b25}.advanced-filters,#amenity-filters{grid-template-columns:minmax(0,1fr)}.filter-panel-heading{position:sticky;top:-16px;background:#fff;z-index:1;padding:12px 0}.comparison-tray{bottom:max(12px,env(safe-area-inset-bottom))}#bathroom-filter{flex:1;min-width:110px}}
@media(max-width:360px){.map-controls{inset-inline-start:8px;gap:4px}.map-controls button,.map-options > summary{padding-inline:7px;font-size:12px}}
@media(max-height:500px) and (orientation:landscape){.more-filters .popover-content{max-height:72dvh}.site-header{min-height:52px;height:52px}.map-pane{height:300px}}
@media(horizontal-viewport-segments:2) and (min-width:800px){.discovery-layout[data-layout=split]{column-gap:max(24px,calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0) + 40px))}.discovery-layout[data-layout=split] .map-pane{position:static}.discovery-layout[data-layout=split] .results[data-density]{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.search-map *{transition:none!important}}

@media(max-width:560px){.results-toolbar{align-items:stretch;flex-direction:column}.result-actions{justify-content:space-between}.result-actions label{flex:1}.map-controls button:focus-visible,.map-view-switch button:focus-visible{outline:3px solid var(--accent);outline-offset:3px}}

.maplibregl-ctrl-attrib{font-size:11px!important}.maplibregl-canvas:focus-visible{outline:3px solid var(--accent);outline-offset:-3px}
