/* Responsive acceptance fixes: remove legacy icon-only actions and cramped grids. */
.search-form .filter-actions .filter-reset,
.search-form .filter-actions .filter-apply { text-indent:0; overflow:visible; white-space:normal; }
.search-form .filter-actions .filter-reset::before,
.search-form .filter-actions .filter-apply::before { content:none; display:none; }
.search-form .filter-popover.advanced-popover { grid-template-columns:minmax(0,1fr); }
.search-form .advanced-popover .option-checks { grid-template-columns:repeat(3,minmax(0,1fr));gap:10px; }
.search-form .filter-popover .quick-input {display:flex;flex-wrap:wrap;height:auto;min-height:46px;gap:7px;padding:0;border:0;background:transparent;overflow:visible;}
.search-form .filter-popover .quick-input input {flex:1 1 100%;min-width:0;}
.search-form .filter-popover .quick-input .quick-tiles {width:100%;display:flex;flex-wrap:wrap;gap:5px;}
.search-form .filter-popover .quick-input .quick-tiles button {min-height:28px;min-width:28px;flex:1;padding:4px 6px;border-radius:7px;font-size:11px;}
.search-form .filter-popover .compact-advanced-grid label,
.search-form .filter-popover .compact-advanced-grid .filter-field {grid-template-rows:auto;align-content:start;height:auto;min-width:0;}
.search-form .filter-popover .field-label {overflow:visible;white-space:normal;text-overflow:clip;}
.search-form .filter-popover .option-checks .check-row {height:auto;min-height:46px;padding:10px;overflow-wrap:anywhere;}
.search-form .filter-popover .option-checks .check-row input {flex:none;}
.search-form .filter-popover .option-checks .check-row span {white-space:normal;overflow:visible;text-overflow:clip;}
@media(max-width:760px) {
  .topbar .brand {display:flex;gap:7px;width:auto;min-width:0;padding:0;}
  .topbar .brand .brand-word {display:block;color:#2563eb;font-size:22px;letter-spacing:-1px;}
  .topbar .brand .brand-mark {display:grid;width:29px;height:32px;}
  .topbar .mobile-top-controls {grid-column:3;}
  .topbar .mobile-top-control {box-shadow:none;}
  .search-assistant {padding:16px;}
  .assistant-intro {margin-bottom:10px;}
  .assistant-intro p {font-size:11px;}
  .assistant-form {padding:8px;}
  .assistant-form textarea {min-height:44px;}
  .assistant-examples {flex-wrap:nowrap;overflow:auto;scrollbar-width:none;padding-bottom:2px;}
  .assistant-examples::-webkit-scrollbar {display:none;}
  .assistant-examples button {flex:0 0 auto;max-width:230px;}
  body .search-form > .filter-menu[open] > .filter-popover {position:fixed !important;inset:12px 12px auto !important;width:calc(100vw - 24px) !important;max-width:calc(100vw - 24px) !important;max-height:calc(100dvh - 24px) !important;grid-template-columns:minmax(0,1fr);transform:none !important;overflow:auto;}
  body .search-form > .filter-menu[open] > .filter-popover:not(.advanced-popover) {grid-template-columns:repeat(2,minmax(0,1fr));}
  body .search-form > .filter-menu[open] .compact-advanced-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 12px;}
  body .search-form > .filter-menu[open] .option-checks {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
  body .search-form > .filter-menu[open] .filter-actions {position:sticky !important;inset:auto 0 0 !important;display:flex;justify-content:space-between;gap:8px;padding:14px 0 !important;margin:10px 0 0;background:#fff;border:0;border-top:1px solid #dce3ed;border-radius:0;box-shadow:none;backdrop-filter:none;}
  body .search-form > .filter-menu[open] .filter-actions button {text-indent:0;font-size:13px;min-height:46px;width:auto;max-width:none;min-width:0;padding:10px 14px;}
  body .search-form > .filter-menu[open] .filter-actions .filter-apply {flex:1;max-width:240px;}
  body.search-panel-open .mobile-bottom-nav {visibility:hidden;}
  body.search-panel-open .search-band {z-index:1600;}
  body.mobile-filters-open .search-band {z-index:1600 !important;}
  body.mobile-filters-open .search-form:has(.filter-menu[open]) > .search-submit {visibility:hidden;}
  .search-form .location-filter > .filter-popover .quick-city-picker {grid-column:1/-1;}
  .search-form .filter-popover .price-popover-head,.search-form .filter-popover .price-suggestions {grid-column:1/-1;}
  .search-form .filter-popover .filter-inline-tiles {gap:6px;}
  .search-form .filter-popover .filter-inline-tiles button {white-space:normal;}
}
.search-form .filter-actions .filter-apply {display:inline-flex !important;align-items:center;justify-content:center;color:#fff;background:#2563eb;}
@media(min-width:761px) and (max-width:1050px) {
  .topbar {display:flex;flex-wrap:wrap;gap:14px 20px;padding-top:16px;padding-bottom:14px;}
  .topbar > .brand {order:0;}
  .topbar > .account {order:1;margin-left:auto;}
  .topbar > .main-nav {order:2;flex-basis:100%;justify-content:center;}
  .search-band .search-form.search-form-compact {grid-template-columns:repeat(3,minmax(0,1fr));grid-template-areas:"location type price" "rooms more search";gap:4px;}
  .search-form > .filter-menu > summary > strong {font-size:13px;}
  .search-form > .more-filter summary > strong {font-size:14px;}
}
@media(max-width:760px) {
  body:has(.search-form > .filter-menu[open]) .mobile-bottom-nav {visibility:hidden;}
  body:has(.search-form > .filter-menu[open]) .search-band {z-index:1600;}
}
@media(max-width:760px) {
  body:not(.mobile-filters-open) .search-form > .location-filter {grid-column:auto;}
  body:not(.mobile-filters-open) .search-form > .filter-menu > summary {min-height:58px;}
}
/* Mobile starts with a compact location / filters row; the full controls live
   in the dedicated sheet, keeping discovery content within easy reach. */
@media(max-width:760px) {
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-form > .filter-menu:not(.location-filter):not(.more-filter),
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-form > .search-submit,
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-form > .filter-clear-all {display:none !important;}
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-form.search-form-compact {grid-template-columns:minmax(0,1fr) 105px;padding:5px;}
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-form > .location-filter {grid-column:1;}
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-form > .more-filter {grid-column:2;border-left:1px solid #e8edf3;}
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-form > .more-filter summary {min-height:58px;align-items:center;}
  .assistant-intro p {display:none;}
  .assistant-form {flex-wrap:nowrap;align-items:center;gap:6px;}
  .assistant-form textarea {width:auto;flex:1 1 0;min-width:0;min-height:48px;max-height:100px;}
  .assistant-form .assistant-submit {flex:0 0 44px;width:44px;height:44px;min-height:44px;margin:0;padding:0;gap:0;font-size:0;}
  .assistant-form .assistant-submit span {font-size:20px;}
  .assistant-form .assistant-clear {width:24px;flex:0 0 24px;align-self:center;}
  .assistant-form .assistant-clear[hidden] {display:none;}
}
@media(max-width:760px) {
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-form > .location-filter,
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-form > .more-filter {grid-row:1;width:auto;max-width:none;margin:0;justify-self:stretch;}
}
.results-mode-switch #mapSearchToggle {display:inline-flex !important;align-items:center;justify-content:center;}

/* Explicit slots keep search actions still when values, counts or scope change. */
.search-section-head {gap:12px;min-height:40px;}
.search-section-head > .filter-clear-all {display:inline-flex !important;align-items:center;justify-content:center;flex:none;visibility:hidden;min-width:88px;height:36px;min-height:36px;margin:0;padding:7px 10px;border:0;border-radius:10px;background:transparent;color:var(--muted);font-size:13px;text-indent:0;white-space:nowrap;box-shadow:none;}
.search-section-head > .filter-clear-all::before {display:none;}
.search-band:has(.active-filter-chip) .search-section-head > .filter-clear-all {visibility:visible;}
.search-section-head > .filter-clear-all:hover {background:var(--soft);color:var(--ink);}
.search-band .search-form > .location-filter {grid-area:location;}
.search-band .search-form > .filter-menu:nth-of-type(2) {grid-area:type;}
.search-band .search-form > .price-filter {grid-area:price;}
.search-band .search-form > .rooms-filter {grid-area:rooms;}
.search-band .search-form > .more-filter {grid-area:more;}
.search-band .search-form > .search-submit {grid-area:search;justify-self:stretch;}
.search-form > .filter-menu > summary {height:76px;min-height:76px;max-height:76px;}
.search-form > .filter-menu > summary > strong {flex:0 1 auto;max-height:36px;line-height:18px;}
.search-form > .filter-menu > summary > span {flex:none;}
.search-form .filter-popover.filter-dialog {height:min(650px,calc(100dvh - 80px));max-height:calc(100dvh - 80px);padding:0 24px;gap:0;overflow:hidden;}
.search-form .filter-popover.advanced-popover.filter-dialog {height:min(780px,calc(100dvh - 80px));}
.search-form > .filter-menu[open] > .filter-popover.filter-dialog {display:flex !important;flex-direction:column;}
.search-form .filter-dialog > .filter-panel-heading {position:static;flex:none;min-height:80px;padding:20px 0;gap:16px;}
.search-form .filter-dialog > .filter-panel-body {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;flex:1 1 auto;min-height:0;min-width:0;gap:20px 18px;padding:22px 2px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;}
.search-form .filter-dialog > .filter-panel-body > * {min-width:0;}
.search-form .filter-dialog > .filter-panel-body > .filter-inline-tiles {grid-column:1/-1;}
.search-form .filter-menu:nth-of-type(2) .filter-panel-body,
.search-form .advanced-popover .filter-panel-body {grid-template-columns:minmax(0,1fr);}
.search-form .filter-dialog > .filter-actions {position:static;flex:0 0 auto;inset:auto;min-height:82px;padding:18px 0;margin:0;gap:12px;}
.search-form .filter-dialog > .filter-actions button {height:46px;white-space:nowrap;}
.search-form .filter-dialog > .filter-actions .filter-apply {flex:0 1 240px;}

@media(max-width:760px) {
  .search-section-head {gap:8px;}
  .search-section-head .deal-tabs {min-width:0;}
  .search-section-head .deal-tabs button {padding:8px;font-size:12px;min-width:0;}
  .search-section-head > .filter-clear-all {display:none !important;}
  body.mobile-filters-open .search-section-head {display:grid;grid-template-columns:minmax(0,1fr) 34px;grid-template-rows:40px 30px;gap:6px 8px;}
  body.mobile-filters-open .search-section-head .deal-tabs {grid-column:1;grid-row:1;min-width:0;gap:1px;}
  body.mobile-filters-open .search-section-head .deal-tabs button {padding:8px;font-size:12px;}
  body.mobile-filters-open .search-section-head > .filter-clear-all {display:inline-flex !important;grid-column:1/-1;grid-row:2;justify-self:end;height:30px;min-height:30px;padding:4px 8px;}
  body.mobile-filters-open .search-section-head > .mobile-filter-close {grid-column:2;grid-row:1;margin:0;}
  .search-form.search-form-compact {grid-template-areas:"location type" "price rooms" "more search";}
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-form.search-form-compact {grid-template-areas:"location more";}
  body .search-form > .filter-menu > summary {height:68px;min-height:68px;max-height:68px;}
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-form > .location-filter,
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-form > .more-filter {grid-row:1;}
  body.mobile-filters-open .search-form.search-form-compact {grid-template-columns:minmax(0,1fr);grid-template-areas:"location" "type" "price" "rooms" "more";padding:0;border:0;box-shadow:none;}
  body.mobile-filters-open .search-form > .filter-menu {grid-column:1;width:100%;max-width:none;margin:0;border-bottom:1px solid var(--line);}
  body.mobile-filters-open .search-form > .filter-menu > summary {height:76px;min-height:76px;max-height:76px;padding:12px 4px;}
  body.mobile-filters-open .search-form > .more-filter summary > span {display:block;}
  body.mobile-filters-open .search-form > .search-submit {grid-area:auto;}
  body.mobile-filters-open #activeSearchFilters {height:48px;}
  body .search-form > .filter-menu[open] > .filter-popover.filter-dialog {height:calc(100dvh - 24px);max-height:calc(100dvh - 24px) !important;padding:0 18px;overflow:hidden;}
  body .search-form .filter-dialog > .filter-panel-heading {min-height:72px;padding:16px 0;}
  body .search-form .filter-dialog > .filter-panel-body {gap:18px 12px;padding:18px 1px;}
  body .search-form > .filter-menu[open] > .filter-dialog > .filter-actions {position:static !important;inset:auto !important;flex:0 0 auto;min-height:78px;margin:0;padding:15px 0 !important;}
  body .search-form > .filter-menu[open] > .filter-dialog > .filter-actions .filter-apply {max-width:none;flex:1;}
  /* Retire the legacy nested bottom sheet; the dialog owns the viewport. */
  .search-band #searchForm > .filter-menu[open] {position:static;inset:auto;display:block;height:auto;max-height:none;padding:0;overflow:visible;border:0;border-radius:0;background:transparent;box-shadow:none;}
  .search-band #searchForm > .filter-menu[open] > summary {visibility:hidden;}
  .search-band #searchForm > .filter-menu[open] > .filter-dialog {position:fixed !important;inset:12px !important;transform:none !important;z-index:1700;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:#fff;box-shadow:0 22px 100px #18263840;}
  .search-band #searchForm > .filter-menu[open] .filter-dialog > .filter-actions {position:static !important;inset:auto !important;min-height:78px;margin:0;padding:15px 0 !important;border:0;border-top:1px solid var(--line);border-radius:0;box-shadow:none;backdrop-filter:none;}
}
