/* Mobile discovery: clear reading order and controls sized for touch. */
.card-gallery,
[data-detail-gallery-frame],
.detail-image-stage {
  touch-action:pan-y pinch-zoom;
  user-select:none;
  -webkit-user-select:none;
}
.card-gallery > img,
[data-detail-gallery-frame] > img,
.detail-image-stage > img { -webkit-user-drag:none; }
.gallery-swiping > img {
  transform:translateX(var(--gallery-drag-x,0px));
  transition:none !important;
  cursor:grabbing;
}
@media (max-width:760px) {
  :root { --page-gutter:16px; }
  .topbar { padding:10px 16px; min-height:66px; }
  .topbar .brand { min-height:44px; }
  .topbar .mobile-top-controls { gap:6px; }
  .topbar .mobile-top-control { width:44px; height:44px; min-width:44px; min-height:44px; border-color:transparent; color:var(--ink); background:var(--soft); }
  .topbar .mobile-top-control::before { font-weight:650; }
  .topbar .mobile-top-control:focus-within { outline:2px solid var(--accent); outline-offset:2px; }
  .topbar .mobile-top-control select { width:100%; height:100%; }
  body.mobile-filters-open .search-section-head { grid-template-columns:minmax(0,1fr) 44px; grid-template-rows:44px 30px; }
  body.mobile-filters-open .search-section-head .deal-tabs button { padding-inline:6px; }
  body.mobile-filters-open .search-band .search-section-head > .mobile-filter-close { width:44px; height:44px; min-width:44px; min-height:44px; }
  .market-hero-cities { display:none; }
  .market-hero-cities button { min-height:44px; padding:8px 4px; }
  .market-hero-content { gap:6px; }
  .market-hero { padding-bottom:10px; }
  .market-hero h1 { font-size:26px; line-height:1.2; letter-spacing:-.7px; }
  .hero-subtitle { display:none; }
  .search-assistant { padding:14px; }
  .assistant-intro { display:flex; gap:12px; margin-bottom:10px; }
  .assistant-intro > div:not(.assistant-modes) { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
  .assistant-intro .assistant-modes { width:auto; margin-left:auto; gap:4px; }
  .assistant-intro .assistant-modes button { min-height:44px; padding:8px 12px; font-size:12px; }
  .assistant-examples button { min-height:32px; }
  .assistant-footer { min-height:32px; margin-top:8px; }
  body:not(.mobile-filters-open):not(.mobile-map-filters-open) .active-search-filters { height:36px; min-height:36px; padding-top:4px; padding-bottom:0; }
  #searchAssistantHost { margin-top:6px; }
  .promo-carousel-head { gap:8px; }
  .promo-carousel-head > strong { line-height:1.4; }
  .collection-arrows { gap:2px; }
  .collection-arrows button { width:44px; height:44px; flex:0 0 44px; border-color:transparent; }
  .promo-carousel { gap:0; }
  .promo-carousel-head { display:none; }
  .promo-track { scroll-snap-type:x proximity; scroll-padding:0; }
  .promo-banner { scroll-snap-align:start; }
  .results-toolbar { display:grid !important; grid-template-columns:minmax(0,1fr) 160px; gap:12px; align-items:end; }
  .results-toolbar .results-heading { grid-column:1; width:100%; margin:0; }
  .results-toolbar .search-sort { min-width:0; width:100%; }
  .results-toolbar .sort-filter { margin:0; padding:0; width:100%; min-width:0; max-width:none; align-items:flex-start; }
  .results-toolbar .sort-filter span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
  .results-toolbar .sort-filter select { width:100%; min-width:0; min-height:44px; height:44px; padding:0 18px 0 0; font-size:16px; text-overflow:ellipsis; }
  .results-mode-switch { display:none; }
  .results-mode-switch > button { min-height:44px; padding:10px 12px; }
  .content-grid { padding-bottom:24px; }
  .content-grid:not(.map-open):not(.map-expanded) > .filters { display:none; }
  #results.results { margin-top:0; }
  body #results .estate-card .listing-body { padding:16px; gap:8px; }
  body #results .estate-card .card-price { font-size:24px; min-height:0; }
  body #results .estate-card .card-tools { top:10px; right:10px; gap:6px; }
  body #results .estate-card .card-tools .icon-action { width:44px; height:44px; min-width:44px; }
  body #results .estate-card .gallery-step { width:44px; height:44px; }
  body #results .estate-card .gallery-prev { left:10px; }
  body #results .estate-card .gallery-next { right:10px; }
  body #results .estate-card .card-more-menu { max-width:min(230px,calc(100vw - 64px)); }
  .detail-redesign .detail-page-navigation { gap:8px; }
  .detail-redesign .back-button,.detail-redesign .detail-text-action { min-height:44px; }
  .detail-redesign .detail-top-actions { gap:12px; }
  .detail-redesign .detail-heading h1 { font-size:25px; line-height:1.24; }
  .detail-redesign .detail-gallery-nav { width:44px; height:44px; }
  .detail-redesign .detail-gallery-count { min-height:44px; }
  .detail-redesign .detail-thumbs { scroll-snap-type:x proximity; }
  .detail-redesign .detail-thumbs button { scroll-snap-align:start; }
  .detail-redesign .detail-summary { padding:20px; }
  .detail-redesign .detail-price-block .price-main { font-size:28px; line-height:1.25; }
  .detail-redesign .detail-messengers .messenger-action { width:44px; min-height:44px; }
  .detail-redesign .detail-read-more summary { min-height:44px; align-items:center; }
  .detail-redesign .detail-location-head a { min-height:44px; display:inline-flex; align-items:center; }
  .detail-redesign .detail-contact-actions { padding-left:16px; padding-right:16px; }
  .detail-image-overlay .detail-image-close,.detail-image-overlay .detail-image-modal-nav { width:44px; height:44px; min-width:44px; min-height:44px; }
  .detail-redesign .detail-table > div { min-width:0; }
  .detail-redesign .detail-table span,.detail-redesign .option-tags .tag { overflow-wrap:anywhere; }
  body.map-fullscreen-active .map-panel.map-fullscreen .map-toolbar { min-height:68px; height:auto; padding:10px; flex-wrap:nowrap; gap:6px; }
  body.map-fullscreen-active .map-panel .map-toolbar .segmented { display:flex; flex:1 1 auto; min-width:0; width:auto; gap:2px; padding:2px; justify-content:stretch; }
  body.map-fullscreen-active .map-panel .map-toolbar .segmented button { flex:1 1 0; width:auto; min-width:0; min-height:44px; height:44px; padding:6px 4px; font-size:12px; }
  .map-panel .map-actions { flex:0 0 auto; gap:4px; }
  body.map-fullscreen-active .map-panel .map-actions #closeMap,
  body.map-fullscreen-active .map-panel .map-actions #mapBackLevel { width:44px; height:44px; min-height:44px; flex:0 0 44px; }
  .map-panel .leaflet-control-zoom a { width:44px; height:44px; line-height:44px; }
  .map-area-controls button { min-height:44px; }
  .map-panel .leaflet-popup-content { margin:12px; max-width:calc(100vw - 64px); }
  .mobile-bottom-nav { padding-left:8px; padding-right:8px; gap:2px; }
  .mobile-bottom-nav button { font-size:10px; font-weight:600; }
  body.mobile-filters-open .mobile-bottom-nav { visibility:hidden; }
  /* The bottom navigation owns Filters and Map on phones. Keep the page's
     location field compact; the complete controls remain in the filter sheet. */
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) #searchForm.search-controls {
    --search-control-height:50px;
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:"location";
    padding:4px;
    border-radius:14px;
  }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) #searchForm.search-controls > .more-filter { display:none !important; }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) #searchForm.search-controls > .location-filter { border:0; }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) #searchForm.search-controls > .location-filter > summary { padding:5px 36px 5px 12px; gap:2px; }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) #searchForm.search-controls > .location-filter > summary::after {
    content:"";
    display:block;
    position:absolute;
    top:20px;
    right:16px;
    width:7px;
    height:7px;
    border:0;
    border-right:1.5px solid var(--muted);
    border-bottom:1.5px solid var(--muted);
    transform:rotate(45deg);
  }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) #searchForm.search-controls > .location-filter > summary > .filter-count { display:none; }
  body.map-fullscreen-active.mobile-map-filters-open.mobile-filters-open .search-band { inset:0 !important; width:100%; height:100dvh; max-height:100dvh; padding:20px 16px 96px; border:0; border-radius:0; overflow:auto; }
  body.map-fullscreen-active.mobile-map-filters-open.mobile-filters-open #mobileFilterToggle { display:none !important; }
  body.map-fullscreen-active.mobile-map-filters-open.mobile-filters-open #searchForm { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:none; grid-template-areas:none; gap:0; width:100%; margin:0; padding:0; }
  body.map-fullscreen-active.mobile-map-filters-open.mobile-filters-open #searchForm > .filter-menu { grid-area:auto; grid-column:1; width:100%; margin:0; position:static; }
  body.map-fullscreen-active.mobile-map-filters-open.mobile-filters-open #searchForm > .filter-menu > summary { height:76px; min-height:76px; max-height:76px; }
  body.map-fullscreen-active.mobile-map-filters-open.mobile-filters-open #searchForm > .search-submit { position:fixed; grid-area:auto; left:16px; right:16px; bottom:max(16px,env(safe-area-inset-bottom)); width:calc(100% - 32px); height:48px; min-height:48px; margin:0; }
  body.map-fullscreen-active.mobile-map-filters-open.mobile-filters-open #searchForm > .filter-menu[open] { inset:auto; height:auto; max-height:none; padding:0; overflow:visible; background:transparent; border:0; border-radius:0; box-shadow:none; }
  body.map-fullscreen-active.mobile-map-filters-open.mobile-filters-open #searchForm > .filter-menu[open] > summary { visibility:hidden; }
  body.map-fullscreen-active.mobile-map-filters-open.mobile-filters-open #searchForm > .filter-menu[open] > .filter-dialog { position:fixed !important; inset:12px !important; transform:none !important; width:calc(100vw - 24px) !important; height:calc(100dvh - 24px); max-height:calc(100dvh - 24px) !important; min-height:0; margin:0; padding:0 18px; overflow:hidden; border:1px solid var(--line); border-radius:16px; background:white; }
}
@media (max-width:900px) {
  .search-band .search-form .filter-popover input:not([type="checkbox"]):not([type="radio"]),
  .search-band .search-form .filter-popover select { font-size:16px; }
  .assistant-form #assistantQuery { font-size:16px; }
  body #results .estate-card .card-tools .icon-action { width:44px; height:44px; min-width:44px; }
  body #results .estate-card .gallery-step { width:44px; height:44px; }
  .detail-redesign .detail-gallery-nav { width:44px; height:44px; }
}
@media (max-width:359px) {
  .topbar .brand .brand-word { font-size:20px; }
  .topbar .brand { gap:5px; }
  .results-toolbar { grid-template-columns:minmax(0,1fr); gap:8px; }
  .results-toolbar .search-sort { flex-direction:row; align-items:center; justify-content:space-between; gap:12px; }
  .results-toolbar .sort-filter span { white-space:nowrap; }
  .results-toolbar .sort-filter select { width:auto; max-width:175px; }
  .results-mode-switch { justify-self:start; }
  .detail-redesign .detail-top-actions { gap:8px; }
  .detail-redesign .detail-text-action { gap:5px; font-size:11px; }
  .detail-redesign .detail-summary { padding:16px; }
  .detail-redesign .detail-price-block .price-main { font-size:25px; }
  body #results .estate-card .card-price { font-size:22px; }
  body.map-fullscreen-active .map-panel.map-fullscreen .map-toolbar { gap:4px; padding:8px; }
  body.map-fullscreen-active .map-panel .map-toolbar .segmented button { font-size:11px; padding:6px 2px; }
}
@media (min-width:761px) and (max-width:900px) {
  .market-hero { padding-top:22px; padding-bottom:18px; }
  .hero-eyebrow,.market-hero-cities { display:none; }
  .hero-subtitle { font-size:14px; }
  .active-search-filters { height:36px; min-height:36px; padding-top:4px; padding-bottom:0; }
  #searchAssistantHost { margin-top:6px; }
  .promo-carousel { padding-top:16px; }
  .promo-carousel-head { display:none; }
  .content-grid:not(.map-open):not(.map-expanded) > .filters { display:none; }
  .detail-redesign .detail-hero { grid-template-columns:minmax(0,1fr); }
  .detail-redesign .detail-gallery,.detail-redesign .detail-summary,.detail-redesign .detail-content-column { grid-column:1; grid-row:auto; }
  .detail-redesign .detail-summary { position:static; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-rows:auto; min-height:0; gap:24px; }
  .detail-redesign .contact-box { border:0; border-left:1px solid #e7ebf0; padding:0 0 0 24px; }
  .detail-redesign .detail-contact-actions button { min-height:48px; }
}
