/* Andaz R1.5-D6: mobile map first, compact LoopNet-inspired controls and teaser. */
@media (max-width:1023px){
  /* Pricing-map selection: a deliberately shallow dock, always above safe-area/navigation. */
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing {
    border-radius:16px!important;
    border:1px solid #c9ddd4!important;
    background:#fff!important;
    box-shadow:0 8px 24px rgba(16,45,37,.16)!important;
    inset-inline:8px!important;
    bottom:calc(7px + env(safe-area-inset-bottom,0px))!important;
    width:calc(100vw - 16px)!important;
    max-width:560px!important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing[data-detent="peek"] {
    height:128px!important;max-height:38dvh!important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-panel-header {
    background:#fff!important;border-radius:16px!important;
    border-bottom:1px solid #edf2ef!important;
    padding:3px 12px 7px!important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-grip {
    height:17px!important;min-height:17px!important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-grip span {width:37px;height:4px;background:#bac7c1;}
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-heading {
    min-height:43px!important;gap:9px!important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-kicker {
    font-size:10px!important;margin:0!important;color:#71887e!important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-heading h2 {
    font-size:15px!important;line-height:1.3!important;max-width:68vw!important;
    white-space:nowrap!important;text-overflow:ellipsis!important;overflow:hidden!important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-brand {width:32px!important;height:32px!important;}
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-close {width:37px!important;height:37px!important;min-width:37px!important;}
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-head-actions {
    display:flex!important;gap:8px!important;margin:3px 0 0!important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing[data-detent="peek"] .mw-public-head-actions .mw-public-action {display:none!important;}
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-expand {
    flex:1!important;min-height:37px!important;border-radius:9px!important;
    border:1px solid #dce9e3!important;background:#f4faf7!important;
    font-size:12px!important;color:#086e52!important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-panel-body {
    background:#fff!important;overscroll-behavior:contain!important;
  }
  /* Keep names/symbols, not numeric benchmark rows, on the map itself. */
  html[data-mh-shell="public"] .mw-project-label .az-map-price-row {display:none!important;}
  html[data-mh-shell="public"] [data-map-layout="framed"] [data-testid="market-map-filters"] > div:first-child {
    display:flex!important;gap:6px!important;overflow-x:auto!important;flex-wrap:nowrap!important;
    scrollbar-width:none!important;-webkit-overflow-scrolling:touch;
  }
  html[data-mh-shell="public"] [data-map-layout="framed"] [data-testid="market-map-filters"] > div:first-child::-webkit-scrollbar {display:none!important;}
  html[data-mh-shell="public"] [data-map-layout="framed"] [data-testid="market-map-filters"] > div:first-child button {
    flex:0 0 auto!important;width:auto!important;max-width:54vw!important;
    white-space:nowrap!important;min-height:41px!important;padding-inline:12px!important;
  }

  /* Sale/rent: a compact search + chips + result-count toolbar above the map. */
  .lx-surface .lx-map-frame {border-radius:18px!important;overflow:visible!important;background:#fff!important;}
  .lx-surface .lx-toolbar {
    display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-areas:'search search' 'tabs tabs' 'count list'!important;
    align-items:center!important;gap:8px 10px!important;
    padding:10px 12px 8px!important;background:#fff!important;
    border-bottom:0!important;
  }
  .lx-surface .lx-search {grid-area:search!important;width:100%!important;max-width:none!important;min-width:0!important;}
  .lx-surface .lx-search input {
    min-height:45px!important;border-radius:13px!important;
    background:#f7faf8!important;border:1px solid #d6e4dd!important;
    font-size:14px!important;
  }
  .lx-surface .lx-tabs {
    grid-area:tabs!important;min-width:0!important;display:flex!important;gap:7px!important;
    flex-wrap:nowrap!important;overflow-x:auto!important;scrollbar-width:none!important;
  }
  .lx-surface .lx-tabs::-webkit-scrollbar {display:none!important;}
  .lx-surface .lx-tabs button {
    min-width:0!important;flex:1 1 0!important;min-height:41px!important;
    border-radius:999px!important;border:1px solid #ccdcd4!important;
    background:#fff!important;padding:7px 10px!important;font-size:12px!important;
    line-height:1.2!important;white-space:nowrap!important;
  }
  .lx-surface .lx-tabs button[aria-pressed="true"] {
    color:#fff!important;background:#08785b!important;border-color:#08785b!important;
    box-shadow:0 2px 6px rgba(4,83,60,.12)!important;
  }
  .lx-surface .lx-result-count {grid-area:count!important;justify-self:start!important;font-size:12px!important;font-weight:700!important;color:#334f43!important;}
  .lx-surface .lx-d6-list-action {
    display:inline-flex!important;grid-area:list!important;justify-self:end!important;
    align-items:center;justify-content:center;gap:6px;padding:6px 12px;
    min-height:36px;border:1px solid #dae6df;border-radius:9px;
    background:#fff;color:#08775c;font-size:12px;font-weight:750;cursor:pointer;
  }
  .lx-surface .lx-d6-list-action svg {width:15px;height:15px;}
  .lx-surface .lx-filters {background:#fff!important;padding:0 12px 7px!important;}
  .lx-surface .lx-filters>summary {
    width:max-content!important;min-height:33px!important;border:1px solid #dbe8e1!important;
    background:#f9fcfa!important;border-radius:999px!important;padding:3px 13px!important;
    font-size:12px!important;font-weight:650!important;color:#2d6f59!important;
  }
  .lx-surface .lx-map-wrap {
    height:clamp(405px,68dvh,700px)!important;
    border-radius:0!important;overflow:hidden!important;touch-action:pan-y;
    contain:layout paint;
  }
  /* Native touch delivery to MapLibre in move-map mode; page gestures only in page mode. */
  .lx-surface .lx-map:not(.lx-d5-scroll-mode),
  .lx-surface .lx-map:not(.lx-d5-scroll-mode) .maplibregl-canvas-container,
  .lx-surface .lx-map:not(.lx-d5-scroll-mode) canvas {touch-action:none!important;}
  .lx-surface .lx-map.lx-d5-scroll-mode,
  .lx-surface .lx-map.lx-d5-scroll-mode .maplibregl-canvas-container,
  .lx-surface .lx-map.lx-d5-scroll-mode canvas {touch-action:pan-y!important;}
  .lx-surface .lx-d5-scroll-toggle.lx-d6-gesture-toggle {
    position:absolute!important;top:80px!important;
    inset-inline-end:12px!important;inset-inline-start:auto!important;
    transform:none!important;width:46px!important;height:46px!important;min-width:46px!important;
    min-height:46px!important;max-width:46px!important;
    display:grid!important;place-items:center!important;
    padding:0!important;border-radius:50%!important;border:1px solid #d6e5dd!important;
    color:#276a55!important;background:rgba(255,255,255,.98)!important;
    box-shadow:0 3px 14px rgba(9,37,27,.16)!important;
    font-size:0!important;touch-action:manipulation!important;
  }
  .lx-surface .lx-d5-scroll-toggle.lx-d6-gesture-toggle::before {
    content:'✋';font-size:23px;line-height:1;display:block;
  }
  .lx-surface .lx-d5-scroll-toggle.lx-d6-gesture-toggle[data-mode="page"]::before {
    content:'↕';font-size:28px;font-weight:700;color:#077d5b;
  }
  .lx-surface .lx-d5-scroll-toggle.lx-d6-gesture-toggle:focus-visible,
  .lx-surface .lx-d6-list-action:focus-visible,
  .lx-surface .lx-d6-teaser-main:focus-visible {outline:3px solid #0b9472!important;outline-offset:2px;}

  /* The LoopNet-style preview remains shallow enough to reveal most of the map. */
  .lx-mobile-selection.az-d5-offers-sheet.az-d6-offers {
    border-radius:15px!important;border:1px solid #d8e3dd!important;
    background:#fff!important;box-shadow:0 8px 28px rgba(17,43,31,.19)!important;
    inset-inline:8px!important;width:calc(100vw - 16px)!important;max-width:560px!important;
    bottom:calc(7px + env(safe-area-inset-bottom,0px))!important;
  }
  .lx-mobile-selection.az-d6-offers[data-detent="peek"] {height:135px!important;max-height:38dvh!important;}
  .lx-mobile-selection.az-d6-offers[data-detent="peek"] .lx-mobile-selection-head {display:none!important;}
  .lx-mobile-selection.az-d6-offers .lx-d5-grip {
    min-height:16px!important;flex:0 0 16px!important;
    background:#fff!important;
  }
  .lx-mobile-selection.az-d6-offers .lx-d5-grip span {width:37px;height:4px;background:#bccac3;}
  .lx-mobile-selection.az-d6-offers .lx-d5-teaser.az-d6-teaser {
    position:relative!important;padding:2px 10px 10px!important;
    display:flex!important;align-items:stretch!important;flex:1 1 auto!important;min-height:0!important;
  }
  .lx-mobile-selection.az-d6-offers .lx-d6-teaser-main {
    display:grid!important;grid-template-columns:93px minmax(0,1fr)!important;gap:10px!important;
    align-items:center!important;width:100%!important;height:100%!important;
    padding:0!important;padding-inline-end:31px!important;border:0!important;border-radius:9px!important;
    text-align:start!important;background:#fff!important;color:inherit!important;font:inherit!important;cursor:pointer;
  }
  .lx-mobile-selection.az-d6-offers .lx-d6-teaser-main img,
  .lx-mobile-selection.az-d6-offers .lx-d6-teaser-main .lx-d5-no-photo {
    width:93px!important;height:91px!important;border-radius:9px!important;object-fit:cover!important;
  }
  .lx-mobile-selection.az-d6-offers .lx-d5-teaser-copy {gap:5px!important;padding-inline:2px!important;}
  .lx-mobile-selection.az-d6-offers .lx-d5-teaser-copy strong {font-size:13px!important;line-height:1.38!important;}
  .lx-mobile-selection.az-d6-offers .lx-d5-teaser-copy small {font-size:12px!important;color:#087b5b!important;}
  .lx-mobile-selection.az-d6-offers .lx-d6-peek-close {
    position:absolute;inset-inline-end:10px;top:11px;z-index:3;width:29px;height:29px;
    border:0;border-radius:50%;display:grid;place-items:center;
    background:#eff6f2;color:#496b5b;cursor:pointer;
  }
  .lx-mobile-selection.az-d6-offers .lx-d6-teaser-empty {
    width:100%;border:0;text-align:start;background:transparent;color:#526d5f;font:inherit;
    padding:8px 32px!important;cursor:pointer;
  }
  .lx-mobile-selection.az-d6-offers:not([data-detent="peek"]) .lx-d6-peek-close {display:none!important;}
  .lx-mobile-selection.az-d6-offers:not([data-detent="peek"]) .lx-d5-teaser {display:none!important;}
  .lx-mobile-selection.az-d6-offers .lx-mobile-selection-head {background:#fff!important;}
  .lx-mobile-selection.az-d6-offers .lx-d5-selection-content {overflow:auto!important;overscroll-behavior:contain!important;}
}
/* Buttons added to desktop DOM remain hidden unless the mobile layout applies. */
@media (min-width:1024px){.lx-d6-list-action,.lx-d6-peek-close{display:none!important;}}
@media (max-width:1023px) and (orientation:landscape) and (max-height:560px){
  .lx-mobile-selection.az-d6-offers[data-detent="peek"]{height:116px!important;}
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing[data-detent="peek"]{height:116px!important;}
  .lx-surface .lx-map-wrap{height:clamp(260px,67dvh,390px)!important;}
  .lx-mobile-selection.az-d6-offers .lx-d6-teaser-main img{height:74px!important;}
}
@media (prefers-reduced-motion:reduce){
 .lx-mobile-selection.az-d6-offers,
 html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing {transition:none!important;}
}
