/* Search controls own their geometry; legacy form rules do not size this row. */
#searchForm.search-controls {
  --search-control-height:64px;
  display:grid;
  grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) minmax(0,1.15fr) minmax(0,1.1fr) 140px 124px;
  grid-template-areas:"location type price rooms more search";
  align-items:center;
  gap:0;
  padding:10px;
  border:1px solid var(--line);
  border-radius:18px;
}
#searchForm.search-controls > .filter-menu {
  position:static;
  inset:auto;
  align-self:center;
  justify-self:stretch;
  width:100%;
  max-width:none;
  min-width:0;
  min-height:0;
  margin:0;
  padding:0;
  border:0;
  border-right:1px solid #e8edf3;
}
#searchForm.search-controls > .filter-menu > summary {
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:16px 20px;
  align-content:center;
  align-items:center;
  justify-content:stretch;
  gap:4px;
  height:var(--search-control-height);
  min-height:var(--search-control-height);
  max-height:var(--search-control-height);
  margin:0;
  padding:10px 14px;
  border:0;
  box-shadow:none;
}
#searchForm.search-controls > .filter-menu > summary > span {
  display:block;
  grid-row:1;
  height:16px;
  padding:0 16px 0 0;
  margin:0;
  font-size:12px;
  line-height:16px;
  white-space:nowrap;
}
#searchForm.search-controls > .filter-menu > summary > strong {
  display:block;
  grid-row:2;
  height:20px;
  min-height:20px;
  max-height:20px;
  margin:0;
  padding:0;
  font-size:14px;
  font-weight:450;
  line-height:20px;
  white-space:nowrap;
  overflow:hidden;
  overflow-wrap:normal;
  text-overflow:ellipsis;
  -webkit-line-clamp:unset;
}
#searchForm.search-controls .filter-count {
  position:absolute;
  inset:4px 4px auto auto;
  transform:none;
  display:grid;
  place-items:center;
  width:auto;
  min-width:16px;
  height:16px;
  padding:0 4px;
  margin:0;
  border-radius:8px;
  font-size:10px;
  line-height:16px;
}
#searchForm.search-controls > .more-filter {padding-inline:8px;border:0;}
#searchForm.search-controls > .more-filter > summary {
  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
}
#searchForm.search-controls > .more-filter > summary:hover,
#searchForm.search-controls > .more-filter[open] > summary {background:#f5f7fb;}
#searchForm.search-controls > .more-filter > summary > span {
  height:auto;
  padding:0;
  font-size:14px;
  font-weight:600;
  line-height:20px;
}
#searchForm.search-controls .search-options-icon {display:block;flex:0 0 18px;width:18px;height:18px;}
#searchForm.search-controls > .more-filter > summary > strong {
  position:absolute;
  width:1px;
  height:1px;
  min-height:0;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
}
#searchForm.search-controls > .search-submit {
  position:static;
  inset:auto;
  display:flex;
  align-items:center;
  justify-content:center;
  align-self:center;
  justify-self:stretch;
  height:var(--search-control-height);
  min-height:var(--search-control-height);
  max-height:var(--search-control-height);
  width:100%;
  min-width:0;
  margin:0;
  padding:0 16px;
  border:0;
  border-radius:12px;
  font-size:15px;
  line-height:20px;
  box-shadow:none;
}
@media(min-width:761px) and (max-width:1050px) {
  #searchForm.search-controls {
    grid-template-columns:repeat(3,minmax(0,1fr));
    grid-template-areas:"location type price" "rooms more search";
    row-gap:8px;
  }
  #searchForm.search-controls > .price-filter {border-right:0;}
}
@media(max-width:760px) {
  #searchForm.search-controls {
    --search-control-height:64px;
    grid-template-columns:minmax(0,1fr) 124px;
    grid-template-areas:"location more";
    padding:6px;
    border-radius:16px;
  }
  #searchForm.search-controls > .location-filter {border:0;}
  #searchForm.search-controls > .filter-menu > summary {padding-inline:10px;}
  #searchForm.search-controls > .more-filter {padding:0;border:0;}
  #searchForm.search-controls > .more-filter > summary {height:64px;min-height:64px;max-height:64px;padding:0 10px;}
  #searchForm.search-controls > .more-filter > summary > span {font-size:13px;}
  body.mobile-filters-open .search-band,
  body.map-fullscreen-active.mobile-map-filters-open.mobile-filters-open .search-band {
    padding:16px 16px calc(80px + env(safe-area-inset-bottom));
    border:0;
  }
  body.mobile-filters-open .search-band #searchForm.search-controls {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:none;
    grid-template-rows:none;
    gap:0;
    width:100%;
    margin:0;
    padding:0;
    border:0;
    border-radius:0;
    box-shadow:none;
  }
  body.mobile-filters-open .search-band #searchForm.search-controls > .filter-menu {
    grid-area:auto;
    grid-column:1;
    justify-self:stretch;
    align-self:stretch;
    width:100%;
    max-width:none;
    margin:0;
    padding:0;
    border:0;
    border-bottom:1px solid var(--line);
  }
  body.mobile-filters-open .search-band #searchForm.search-controls > .filter-menu > summary {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:16px 20px;
    align-content:center;
    justify-content:stretch;
    gap:4px;
    height:76px;
    min-height:76px;
    max-height:76px;
    padding:14px 8px;
    border:0;
    border-radius:0;
    background:transparent;
  }
  body.mobile-filters-open .search-band #searchForm.search-controls > .more-filter > summary > span {grid-row:1;height:16px;font-size:12px;line-height:16px;}
  body.mobile-filters-open .search-band #searchForm.search-controls > .more-filter > summary > strong {
    position:static;
    grid-row:2;
    width:auto;
    height:20px;
    min-height:20px;
    margin:0;
    clip:auto;
  }
  body.mobile-filters-open .search-band #searchForm.search-controls .search-options-icon {display:none;}
  body.mobile-filters-open .search-band #searchForm.search-controls > .search-submit {
    position:fixed;
    inset:auto 16px max(16px,env(safe-area-inset-bottom));
    grid-area:auto;
    width:calc(100% - 32px);
    height:48px;
    min-height:48px;
    max-height:48px;
    margin:0;
    padding:0 16px;
    z-index:2;
    box-shadow:0 0 0 16px #fff;
  }
}

/* One search composition, with a single primary action in the selected mode. */
.search-band { z-index:10; }
.search-composer { position:relative; padding:14px 16px 4px; border:1px solid #dce3ed; border-radius:20px; background:#fff; box-shadow:0 5px 22px #18263805; }
.search-mode-tabs { display:flex; align-items:center; gap:4px; width:max-content; max-width:100%; margin:0 0 12px; padding:0; }
.search-mode-tabs > button { display:flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:9px 16px; border:0; border-radius:12px; background:transparent; color:var(--muted); font-size:14px; line-height:20px; font-weight:550; white-space:nowrap; }
.search-mode-tabs > button[aria-selected=true] { background:#edf3fe; color:#214f9e; }
.search-mode-tabs > button:hover { background:#f3f6fb; }
.search-mode-spark { display:inline-flex; width:20px; height:20px; flex:0 0 20px; color:var(--accent); }
.search-mode-spark svg { width:100%; height:100%; transform-origin:center; animation:assistant-sparkle 4.8s ease-in-out infinite; }
.search-composer #searchForm.search-controls { --search-control-height:56px; padding:6px; border-radius:14px; box-shadow:none; background:#fbfcfe; }
.search-composer .search-section-head { margin-bottom:8px; }
.search-composer .deal-tabs { gap:2px; }
.search-composer .deal-tabs button { min-height:36px; padding:7px 14px; font-size:13px; border-radius:20px; }
.search-composer .deal-tabs button.active { background:var(--ink); color:#fff; }
.search-composer #activeSearchFilters { height:36px; min-height:36px; padding:4px 0; gap:6px; }
.search-composer .active-filter-chip-group { display:inline-flex; align-items:center; flex:none; height:28px; border:1px solid #e0e7f1; border-radius:15px; background:#f5f7fb; overflow:hidden; }
.search-composer .active-filter-chip { height:26px; min-height:26px; padding:3px 7px 3px 10px; border:0; border-radius:0; background:transparent; font-size:12px; line-height:20px; color:var(--muted); }
.search-composer .active-filter-remove { width:28px; height:26px; min-height:26px; padding:0; border:0; border-radius:0; background:transparent; color:var(--muted); font-size:18px; }
.search-composer .active-filter-chip:hover,.search-composer .active-filter-remove:hover { background:#eaf0fa; color:var(--ink); }
body.map-fullscreen-active .search-composer,
body.mobile-filters-open .search-composer { padding:0; border:0; border-radius:0; box-shadow:none; background:transparent; }
@media(min-width:1051px) {
  body:not(.map-fullscreen-active):not(.mobile-filters-open) .search-composer .search-section-head { position:absolute; top:16px; right:16px; height:40px; min-height:40px; margin:0; gap:8px; }
  body:not(.map-fullscreen-active):not(.mobile-filters-open) .search-composer .filter-clear-all { min-height:36px; height:36px; padding:7px 10px; }
}
@media(max-width:760px) {
  .search-composer { padding:8px 8px 2px; border-radius:17px; }
  .search-mode-tabs { display:grid; grid-template-columns:1.12fr 1fr; gap:2px; width:100%; margin-bottom:10px; }
  .search-mode-tabs > button { min-height:44px; padding:8px 5px; gap:6px; font-size:12px; border-radius:10px; }
  .search-mode-spark { width:18px; height:18px; flex-basis:18px; }
  .search-composer .search-section-head { min-height:36px; margin-bottom:8px; }
  .search-composer .deal-tabs button { min-height:36px; padding:7px 9px; font-size:12px; }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-composer #searchForm.search-controls { --search-control-height:50px; grid-template-columns:minmax(0,1fr) 78px; grid-template-areas:"location search"; padding:4px; border-radius:12px; }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-composer #searchForm.search-controls > .search-submit { display:flex !important; grid-area:search; width:100%; min-height:50px; height:50px; max-height:50px; margin:0; padding:0 10px; font-size:13px; border-radius:9px; }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-composer #searchForm.search-controls > .location-filter > summary { padding-left:8px; padding-right:24px; }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-composer #searchForm.search-controls > .location-filter > summary::after { right:10px; }
  .search-composer #activeSearchFilters { height:36px; min-height:36px; }
}
@media(prefers-reduced-motion:reduce) { .search-mode-spark svg { animation:none; } }
@media(min-width:761px) and (max-width:1050px) and (max-height:500px) {
  body[data-view=home]:not(.map-fullscreen-active):not(.mobile-filters-open) .search-composer .search-section-head { position:absolute; top:16px; right:16px; height:40px; min-height:40px; margin:0; gap:6px; }
  body[data-view=home]:not(.map-fullscreen-active):not(.mobile-filters-open) .search-composer .filter-clear-all { min-height:36px; height:36px; padding:7px 8px; }
  body[data-view=home]:not(.map-fullscreen-active):not(.mobile-filters-open) .search-composer #searchForm.search-controls { grid-template-columns:minmax(0,1.25fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.3fr) 82px 84px; grid-template-areas:"location type price rooms more search"; gap:0; }
  body[data-view=home]:not(.map-fullscreen-active):not(.mobile-filters-open) #searchForm.search-controls > .filter-menu > summary { padding-left:8px; padding-right:8px; }
  body[data-view=home]:not(.map-fullscreen-active):not(.mobile-filters-open) #searchForm.search-controls > .filter-menu > summary > span { padding-right:0; font-size:11px; }
  body[data-view=home]:not(.map-fullscreen-active):not(.mobile-filters-open) #searchForm.search-controls > .filter-menu > summary > strong { font-size:12px; }
  body[data-view=home]:not(.map-fullscreen-active):not(.mobile-filters-open) #searchForm.search-controls > .more-filter { padding-left:4px; padding-right:4px; }
  body[data-view=home]:not(.map-fullscreen-active):not(.mobile-filters-open) #searchForm.search-controls .search-options-icon { display:none; }
}
