/* Mobile browsing uses two clear states: full map and full-height results. */
body.eh9:has(#eh9-map) .eh9-map-control-dock {
  position:absolute; z-index:30; top:10px; left:10px; right:10px;
  display:flex; align-items:flex-start; justify-content:space-between; gap:8px;
  max-width:calc(100vw - 20px); box-sizing:border-box; pointer-events:none;
}
body.eh9:has(#eh9-map) .eh9-map-control-dock > * { pointer-events:auto; }
body.eh9:has(#eh9-map) .eh9-map-control-primary { display:flex; align-items:center; gap:8px; min-width:0; max-width:calc(100% - 52px); flex-wrap:wrap; }
body.eh9:has(#eh9-map) .eh9-map-tools-menu { position:relative; flex:0 0 auto; }
body.eh9:has(#eh9-map) .eh9-map-tools-menu > summary {
  display:flex; align-items:center; justify-content:center; min-height:42px; padding:0 12px;
  border:1px solid #d6dce4; border-radius:9px; background:#fff; color:#263445;
  box-shadow:0 2px 8px #17223425; font-size:13px; font-weight:700; white-space:nowrap; cursor:pointer; list-style:none;
}
body.eh9:has(#eh9-map) .eh9-map-tools-menu > summary::-webkit-details-marker { display:none; }
body.eh9:has(#eh9-map) .eh9-map-tools-menu[open] .eh9-map-tools-content {
  position:absolute; top:calc(100% + 8px); right:0; z-index:50; width:min(310px,calc(100vw - 24px));
  max-height:min(68dvh,560px); overflow:auto; padding:12px; border:1px solid #d6dce4;
  border-radius:12px; background:#fff; box-shadow:0 8px 28px #17223435;
}
body.eh9:has(#eh9-map) .eh9-map-icon-action { min-height:42px; border-radius:9px; font-weight:700; }
body.eh9:has(#eh9-map) .eh9-map-control-primary .eh9-restore-results { position:static; white-space:nowrap; }
body.eh9:has(#eh9-map) .ehqc-map-launch-moved { position:fixed !important; z-index:35 !important; right:max(14px,env(safe-area-inset-right)) !important; bottom:max(14px,env(safe-area-inset-bottom)) !important; left:auto !important; top:auto !important; }
body.eh9:has(#eh9-map) .eh9-sheet-handle { display:none !important; }
body.eh9:has(#eh9-map) .eh9-results-heading #eh9-collapse { display:none !important; }
.eh9-card-photo { position:relative; }
.eh9-card-photo > .eh9-card-save-overlay {
  position:absolute !important; z-index:8 !important; top:10px !important; right:10px !important;
  display:inline-flex !important; align-items:center !important; justify-content:center !important;
  width:42px !important; height:42px !important; min-width:42px !important; min-height:42px !important;
  max-width:42px !important; max-height:42px !important; padding:0 !important; border:1px solid #fff !important;
  border-radius:50% !important; background:#fff !important; color:#a81031 !important;
  box-shadow:0 2px 10px #17223445 !important; font-size:0 !important; line-height:1 !important; overflow:hidden !important;
}
.eh9-card-photo > .eh9-card-save-overlay::after { content:'♡'; font-size:24px !important; line-height:1 !important; }
.eh9-card-photo > .eh9-card-save-overlay[aria-pressed='true'] { background:#a81031 !important; color:#fff !important; }
.eh9-card-photo > .eh9-card-save-overlay[aria-pressed='true']::after { content:'♥'; }
.eh9-card-actions { align-items:center; }
.eh9-card-actions .eh92-save { min-height:40px; }
.eh92-save[data-saved='true'] { color:#a81031; }
.eh-map-return-link {
  display:inline-flex; align-items:center; gap:8px; min-height:42px; margin:14px 0 10px;
  padding:0 14px; border:1px solid #a81031; border-radius:8px; background:#fff; color:#a81031;
  font:inherit; font-size:14px; font-weight:700; line-height:1.2; text-decoration:none; box-shadow:0 2px 8px #17223412;
}
.eh-map-return-link:hover,.eh-map-return-link:focus-visible { background:#fff3f5; }
@media (max-width:800px) {
  body.eh9:has(#eh9-map) .eh9-view-switch { display:flex !important; }
  body.eh9:has(#eh9-map) .eh9-map-control-dock { top:8px; left:8px; right:8px; max-width:calc(100vw - 16px); }
  body.eh9:has(#eh9-map) .eh9-map-control-primary { gap:6px; max-width:calc(100% - 48px); }
  body.eh9:has(#eh9-map) .eh9-map-control-primary .eh9-map-icon-action { min-width:42px; padding:0 10px; }
  body.eh9:has(#eh9-map) .eh9-split { position:relative; display:block; height:calc(100dvh - 225px); min-height:340px; overflow:hidden; }
  body.eh9:has(#eh9-map) .eh9-map-column { position:absolute; inset:0; visibility:visible !important; }
  body.eh9:has(#eh9-map) .eh9-results { display:none !important; }
  body.eh9:has(#eh9-map) .eh9-split.is-list-only .eh9-map-column { visibility:hidden !important; }
  body.eh9:has(#eh9-map) .eh9-split.is-list-only .eh9-results {
    position:absolute; inset:0; display:flex !important; height:100%; max-height:none; overflow:hidden;
    border-radius:0; box-shadow:none; visibility:visible !important;
  }
  body.eh9:has(#eh9-map) .eh9-split.is-list-only .eh9-results-heading { flex:0 0 auto; padding:12px 14px; }
  body.eh9:has(#eh9-map) .eh9-split.is-list-only .eh9-results-scroll {
    display:block; flex:1 1 auto; min-height:0; height:auto; overflow-y:auto; overflow-x:hidden;
    padding:10px 12px calc(86px + env(safe-area-inset-bottom)); overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch; touch-action:pan-y;
  }
  body.eh9:has(#eh9-map) .eh9-split.is-list-only .eh9-cards { grid-template-columns:1fr; }
  body.eh9:has(#eh9-map) .eh9-split.is-list-only .eh9-map-column,
  body.eh9:has(#eh9-map) .eh9-split.is-list-only .eh9-results { min-height:0; }
  body.eh9:has(#eh9-map) .eh9-split > .eh9-restore-results {
    position:fixed; z-index:40; display:inline-flex; align-items:center; justify-content:center;
    left:50%; right:auto; top:auto; bottom:calc(14px + env(safe-area-inset-bottom));
    min-height:48px; max-width:calc(100vw - 32px); padding:0 22px; transform:translateX(-50%);
    border:0; border-radius:24px; background:#a81031; color:#fff; box-shadow:0 4px 18px #17223438;
    font-size:15px; font-weight:750; white-space:nowrap;
  }
  body.eh9:has(#eh9-map) .eh9-split.is-map-only > .eh9-restore-results { display:inline-flex; }
  body.eh9:has(#eh9-map) .eh9-split.is-list-only > .eh9-restore-results { display:inline-flex; }
  body.eh9:has(#eh9-map) .eh9-map-message { bottom:calc(72px + env(safe-area-inset-bottom)); max-width:calc(100vw - 30px); }
  body.eh9:has(#eh9-map) .ehqc-map-launch-moved { right:max(12px,env(safe-area-inset-right)) !important; bottom:calc(74px + env(safe-area-inset-bottom)) !important; }
  body.eh9:has(#eh9-map) .ehqc-map-launch-moved .ehqc-panel:not([hidden]) {
    position:fixed !important; z-index:2000 !important; top:0 !important; right:0 !important; bottom:0 !important; left:0 !important;
    width:100vw !important; height:100dvh !important; max-width:none !important; max-height:none !important; margin:0 !important;
    overflow:auto !important; border-radius:0 !important; padding-top:env(safe-area-inset-top) !important; padding-bottom:env(safe-area-inset-bottom) !important;
  }
  body.eh9:has(#eh9-map) .ehqc-map-launch-moved .ehqc-panel > header {
    position:sticky !important; top:0 !important; z-index:5 !important; display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important; align-items:center !important; gap:8px !important;
    min-height:60px !important; padding:8px 12px !important; background:#fff !important; border-bottom:1px solid #e1e5eb !important;
  }
  body.eh9:has(#eh9-map) .ehqc-map-launch-moved .ehqc-panel > header h2 { margin:0 !important; font-size:18px !important; line-height:1.2 !important; }
  body.eh9:has(#eh9-map) .ehqc-map-launch-moved .ehqc-window-actions { display:flex !important; gap:6px !important; }
  body.eh9:has(#eh9-map) .ehqc-map-launch-moved .ehqc-minimize { min-width:108px !important; min-height:42px !important; font-size:0 !important; white-space:nowrap !important; }
  body.eh9:has(#eh9-map) .ehqc-map-launch-moved .ehqc-minimize::after { content:'Back to map'; font-size:13px !important; }
  body.eh9:has(#eh9-map) .ehqc-map-launch-moved .ehqc-close { min-width:44px !important; min-height:42px !important; }
}


/* 1.0.7: one stable control row above the map in both map and list modes. */
body.eh9:has(#eh9-map) .eh9-split > .eh9-map-control-dock {
  position:absolute!important; z-index:60!important; top:8px!important; left:calc(var(--eh-left,42%) + 8px)!important; right:8px!important;
  display:flex!important; width:auto!important; max-width:none!important; box-sizing:border-box!important; align-items:center!important;
  justify-content:space-between!important; gap:8px!important; padding:0!important; overflow:visible!important; pointer-events:none!important;
}
body.eh9:has(#eh9-map) .eh9-split.is-map-only > .eh9-map-control-dock { left:8px!important; }
body.eh9:has(#eh9-map) .eh9-split > .eh9-map-control-dock > * { pointer-events:auto!important; }
body.eh9:has(#eh9-map) .eh9-map-control-primary { display:flex!important; flex:1 1 auto!important; align-items:center!important; gap:8px!important; min-width:0!important; max-width:none!important; flex-wrap:nowrap!important; overflow:visible!important; }
body.eh9:has(#eh9-map) .eh9-split .eh9-restore-results {
  position:static!important; display:inline-flex!important; flex:0 0 auto!important; align-items:center!important; justify-content:center!important;
  width:auto!important; min-width:138px!important; max-width:calc(100vw - 140px)!important; height:auto!important; min-height:42px!important;
  margin:0!important; padding:0 14px!important; transform:none!important; border:1px solid #a81031!important; border-radius:9px!important;
  background:#a81031!important; color:#fff!important; box-shadow:0 2px 8px #17223430!important; font-size:14px!important;
  font-weight:700!important; line-height:1.2!important; white-space:nowrap!important;
}
body.eh9:has(#eh9-map) .eh9-map-tools-menu { position:relative!important; flex:0 0 auto!important; min-width:0!important; max-width:none!important; margin-left:auto!important; }
body.eh9:has(#eh9-map) .eh9-map-tools-menu > summary {
  display:inline-flex!important; box-sizing:border-box!important; align-items:center!important; justify-content:center!important;
  width:auto!important; min-width:112px!important; max-width:160px!important; min-height:42px!important; padding:0 12px!important;
  overflow:visible!important; border:1px solid #a81031!important; border-radius:9px!important; background:#fff!important; color:#a81031!important;
  box-shadow:0 2px 8px #17223425!important; font-size:14px!important; font-weight:700!important; line-height:1.15!important;
  white-space:nowrap!important; cursor:pointer!important; list-style:none!important;
}
body.eh9:has(#eh9-map) .eh9-map-tools-menu > summary::-webkit-details-marker { display:none!important; }
body.eh9:has(#eh9-map) .eh9-map-tools-content > #eh9-search-area {
  display:flex!important; width:100%!important; min-height:42px!important; margin:0 0 8px!important; padding:0 12px!important;
  align-items:center!important; justify-content:center!important; border:1px solid #d6dce4!important; border-radius:8px!important;
  background:#fff!important; color:#a81031!important; font:inherit!important; font-weight:700!important; cursor:pointer!important;
}
@media(max-width:800px) {
  body.eh9:has(#eh9-map) .eh9-split > .eh9-map-control-dock { top:8px!important; left:8px!important; right:8px!important; gap:8px!important; }
  body.eh9:has(#eh9-map) .eh9-map-control-primary { flex:1 1 auto!important; }
  body.eh9:has(#eh9-map) .eh9-split .eh9-restore-results { min-width:136px!important; max-width:calc(100vw - 144px)!important; padding:0 12px!important; font-size:13px!important; }
  body.eh9:has(#eh9-map) .eh9-map-tools-menu > summary { min-width:112px!important; max-width:136px!important; padding:0 9px!important; font-size:13px!important; }
  body.eh9:has(#eh9-map) .eh9-map-tools-menu[open] .eh9-map-tools-content { right:0!important; width:min(310px,calc(100vw - 24px))!important; }
  body.eh9:has(#eh9-map) .eh9-split.is-list-only > .eh9-map-control-dock { display:flex!important; }
  body.eh9:has(#eh9-map) .eh9-split.is-list-only .eh9-results-heading { padding-top:58px!important; }
}

/* 1.0.8: keep Map tools inside the phone viewport and restore the comparison minimize state. */
body.eh9:has(#eh9-map) .eh9-map-tools-menu > summary {
  width:44px!important; min-width:44px!important; max-width:44px!important; padding:0!important;
  font-size:0!important; line-height:0!important; overflow:hidden!important;
}
body.eh9:has(#eh9-map) .eh9-map-tools-menu > summary::before {
  content:'☷'; display:block; font-size:22px!important; line-height:1!important; font-weight:700;
}


.eh9-compare-tray { gap:8px; max-width:calc(100vw - 24px); white-space:normal; flex-wrap:wrap; }
.eh9-compare-minimize { min-height:36px; padding:0 12px; border:1px solid #a81031; border-radius:18px; background:#fff; color:#a81031; font:inherit; font-weight:700; cursor:pointer; }
.eh9-compare-tray.is-minimized { padding:0; border:0; background:transparent; box-shadow:none; }
.eh9-compare-tray.is-minimized > :not(.eh9-compare-minimize) { display:none!important; }
.eh9-compare-tray.is-minimized .eh9-compare-minimize { min-height:44px; padding:0 17px; border-color:#a81031; background:#a81031; color:#fff; box-shadow:0 4px 16px #17223435; }
@media(max-width:800px) {
  body.eh9:has(#eh9-map) .eh9-map-tools-menu[open] .eh9-map-tools-content {
    position:fixed!important; z-index:10000!important; top:clamp(150px,25vh,220px)!important; right:10px!important; left:10px!important;
    width:auto!important; max-width:none!important; max-height:calc(100dvh - clamp(166px,25vh,236px))!important; overflow:auto!important;
    overscroll-behavior:contain!important; -webkit-overflow-scrolling:touch!important; box-sizing:border-box!important;
  }
  .eh9-compare-tray { left:50%; bottom:calc(74px + env(safe-area-inset-bottom)); width:max-content; max-width:calc(100vw - 24px); justify-content:center; }
  .eh9-compare-tray.is-minimized { left:12px; right:auto; bottom:calc(74px + env(safe-area-inset-bottom)); }
}
