/* Andaz R1.5-D5 — mobile map-first bottom sheets; loads AFTER R1.5-D4. */
@media (max-width: 1023px) {
  html[data-mh-shell="public"] [data-testid="market-map"][data-map-layout="framed"] {
    --mulk-map-height: clamp(410px, 75dvh, 730px);
  }
  /* Selection node remains in the app-owned Vue tree, but the sheet is visually
     docked to the viewport. This preserves Vue ownership and all data flows. */
  html[data-mh-shell="public"] [data-testid="market-map"] > .mulk-public-selection-host {
    grid-area: 6 / 1 !important;
    position: relative !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow: visible !important;
    isolation: auto !important;
    z-index: 510 !important;
    pointer-events: none !important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing {
    position: fixed !important;
    inset: auto !important;
    inset-inline: 10px !important;
    bottom: calc(9px + env(safe-area-inset-bottom, 0px)) !important;
    width: calc(100vw - 20px) !important;
    max-width: 560px !important;
    margin: 0 auto !important;
    min-height: 0 !important;
    border: 1px solid #b6d9ca !important;
    border-radius: 22px !important;
    box-shadow: 0 12px 44px rgba(4,39,30,.21) !important;
    background: #fff !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    pointer-events: auto !important;
    z-index: 520 !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transition: height .22s ease !important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing[data-detent="peek"] {
    height: 145px !important; max-height: 42dvh !important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing[data-detent="half"] {
    height: min(48dvh, 480px) !important; max-height: 72dvh !important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing[data-detent="full"] {
    height: min(83dvh, 760px) !important; max-height: calc(100dvh - 55px - env(safe-area-inset-top, 0px)) !important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-panel-header {
    padding: 4px 12px 9px !important; border-radius: 20px 20px 0 0 !important;
    border-bottom: 1px solid #dcebe5 !important;
    background: linear-gradient(112deg, #e5f8f0, #fbfefa) !important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-grip {
    display: grid !important;place-items:center;width:100%;height:22px!important;
    min-height:22px!important; padding:0!important; border:0!important;
    background:transparent!important;touch-action:none;cursor:ns-resize;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-grip span {
    width:42px;height:5px;border-radius:50px;background:#9eaea9;display:block;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-heading h2 {
    white-space: nowrap !important;overflow:hidden !important;text-overflow:ellipsis !important;
    -webkit-line-clamp: unset !important;font-size:clamp(15px,4.3vw,19px)!important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-heading {
    gap:7px!important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-brand {
    width:34px;height:34px;
  }
  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-top:7px!important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-head-actions > * {
    min-height:40px!important;border-radius:10px!important;font-size:12px!important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-expand {
    display:inline-flex!important;min-width:44px!important;padding:7px 12px!important;
    align-items:center;justify-content:center;gap:5px; border:1px solid #b8d9ca!important;
    background:#f7fffb!important;color:#136a53!important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing .mw-public-panel-body {
    min-height:0!important;height:auto!important;max-height:none!important;
    flex:1 1 auto!important;overflow-x:hidden!important;overflow-y:auto!important;
    overscroll-behavior:contain!important;padding:12px!important;touch-action:pan-y!important;
  }
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing[data-detent="peek"] .mw-public-panel-body {
    display:none!important;visibility:hidden!important;height:0!important;min-height:0!important;
  }
  /* Native page scroll outside the sheet remains available. */
  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 button {
    min-height:42px!important;white-space:nowrap!important;line-height:1.2!important;
    font-size:clamp(10px,2.6vw,12px)!important;
  }
  html[data-mh-shell="public"] [data-map-layout="framed"] [data-testid="market-map-filters"] > div:first-child button > span {
    display:block;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;
  }

  /* Sale/rent map: one finger pans smoothly; an explicit toggle allows scrolling
     the document from the canvas. Neither mode displays MapLibre's warning. */
  .lx-map-frame {position:relative;overflow:visible!important;}
  .lx-map-wrap {height:clamp(390px,69dvh,700px)!important;position:relative;overflow:hidden;border-radius:15px;}
  .lx-map .maplibregl-cooperative-gesture-screen{display:none!important;}
  .lx-map.lx-d5-scroll-mode,.lx-map.lx-d5-scroll-mode canvas {touch-action:pan-y!important;}
  .lx-d5-scroll-toggle {
    position:absolute;z-index:35;top:12px;left:50%;transform:translateX(-50%);
    min-height:42px;max-width:50%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
    border-radius:24px;padding:8px 14px;border:1px solid #c0ded1;
    background:rgba(255,255,255,.95);box-shadow:0 4px 20px #153c3825;
    font-size:12px;font-weight:750;color:#0f7057;cursor:pointer;
    touch-action:manipulation;
  }
  /* The toggle must be unreachable on non-touch/desktop canvases. */
  .lx-mobile-selection.az-d5-offers-sheet {
    position:fixed!important;inset:auto!important;inset-inline:10px!important;
    bottom:calc(8px + env(safe-area-inset-bottom,0px))!important;
    width:calc(100vw - 20px)!important;max-width:560px!important;
    margin:0 auto!important;z-index:550!important;overflow:hidden!important;
    display:flex!important;flex-direction:column!important;
    border:1px solid #abd7c6!important;border-radius:21px!important;
    background:#fff!important;box-shadow:0 12px 44px rgba(5,41,32,.24)!important;
    transition:height .22s ease!important;
    min-height:0!important;
  }
  .lx-mobile-selection.az-d5-offers-sheet[data-detent="peek"] {height:164px!important;max-height:44dvh!important;}
  .lx-mobile-selection.az-d5-offers-sheet[data-detent="half"] {height:min(48dvh,460px)!important;max-height:70dvh!important;}
  .lx-mobile-selection.az-d5-offers-sheet[data-detent="full"] {height:min(83dvh,740px)!important;max-height:calc(100dvh - 55px - env(safe-area-inset-top,0px))!important;}
  .lx-d5-grip {
    display:grid!important;place-items:center;flex:0 0 22px;min-height:22px;
    padding:0;border:0;background:linear-gradient(120deg,#e4f7ed,#f7fcf8);
    color:#285747;touch-action:none;cursor:ns-resize;
  }
  .lx-d5-grip span {display:block;width:42px;height:5px;border-radius:40px;background:#9aaaa4;}
  .lx-mobile-selection.az-d5-offers-sheet .lx-mobile-selection-head {
    flex:0 0 auto!important;min-height:59px;padding:8px 12px!important;
    border-bottom:1px solid #e2eee8!important;
  }
  .lx-mobile-selection.az-d5-offers-sheet .lx-mobile-selection-title h3 {
    font-size:clamp(15px,4.1vw,18px)!important;line-height:1.32!important;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal;
  }
  .lx-mobile-selection.az-d5-offers-sheet .lx-mobile-selection-logo{width:33px;height:33px;}
  .lx-mobile-selection.az-d5-offers-sheet .lx-mobile-selection-close{width:40px;height:40px;border-radius:12px;}
  .lx-d5-teaser {padding:9px 12px;flex:1;min-height:0;}
  .lx-d5-teaser-link {display:grid;grid-template-columns:82px minmax(0,1fr);gap:10px;align-items:center;}
  .lx-d5-teaser-link img,.lx-d5-no-photo {width:82px;height:70px;object-fit:cover;border-radius:10px;background:#edf5f1;}
  .lx-d5-no-photo{display:grid;place-items:center;color:#447767;}
  .lx-d5-teaser-copy{min-width:0;display:grid;gap:5px;}
  .lx-d5-teaser-copy strong{font-size:13px;line-height:1.45;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;}
  .lx-d5-teaser-copy small{color:#11795c;font-weight:700;font-size:12px;}
  .lx-d5-teaser-note{color:#5a736b;font-size:13px;display:block;padding:13px 0;}
  .lx-mobile-selection.az-d5-offers-sheet[data-detent="peek"] .lx-d5-selection-content {display:none!important;}
  .lx-mobile-selection.az-d5-offers-sheet:not([data-detent="peek"]) .lx-d5-teaser {display:none;}
  .lx-d5-selection-content{min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;flex:1;}
  .lx-mobile-selection.az-d5-offers-sheet .lx-mobile-selection-cards{display:grid;padding:10px;gap:10px;}
  .lx-mobile-selection.az-d5-offers-sheet .lx-mobile-selection-cards .lx-card{border:1px solid #e1eee7;box-shadow:none;border-radius:13px;}
  .lx-mobile-selection.az-d5-offers-sheet .lx-mobile-selection-cards .lx-card-image{max-height:150px;aspect-ratio:16/7;}
  .lx-mobile-selection.az-d5-offers-sheet .lx-mobile-selection-profile{min-height:46px;margin:6px 10px 14px;}
  .lx-map-frame .lx-map-wrap .maplibregl-control-container {pointer-events:auto;}
  .lx-tabs{gap:6px!important;}
  .lx-tabs button {min-height:42px!important;font-size:clamp(11px,3vw,13px)!important;}
  .lx-toolbar{padding:8px!important;}
  .lx-search{min-width:0;}
  .lx-map-wrap,.lx-d5-scroll-toggle{touch-action:pan-y;}
  .lx-map-wrap .lx-map:not(.lx-d5-scroll-mode){touch-action:none;}
}
@media (max-width:1023px) and (pointer:fine){
  .lx-d5-scroll-toggle{display:none!important;}
}
@media (max-width:1023px) and (orientation:landscape) and (max-height:560px){
  html[data-mh-shell="public"] [data-testid="market-map"][data-map-layout="framed"]{--mulk-map-height:clamp(270px,72dvh,390px);}
  .lx-map-wrap{height:clamp(270px,72dvh,390px)!important;}
  .lx-mobile-selection.az-d5-offers-sheet[data-detent="peek"]{height:130px!important;}
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing[data-detent="peek"]{height:124px!important;}
  .lx-mobile-selection.az-d5-offers-sheet .lx-d5-teaser-link img{height:44px;}
}
@media (prefers-reduced-motion: reduce){
  .lx-mobile-selection.az-d5-offers-sheet,
  html[data-mh-shell="public"] [data-testid="market-map"] .mw-public-panel.az-d5-pricing {transition:none!important;}
}
