/* Final mobile layout: no overlapping result controls or stray search-card footer. */
@media (max-width:760px) {
  /* Keep brand at left, Account at the top right, and menu beside it. */
  html body header.wr-header .wr-nav {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto auto!important;
    align-items:center!important;
    column-gap:clamp(6px,2vw,12px)!important;
    width:100%!important;
    box-sizing:border-box!important;
  }
  html body header.wr-header .wr-nav > a.wr-brand {
    grid-column:1!important;grid-row:1!important;min-width:0!important;
    justify-self:start!important;
  }
  html body header.wr-header .wr-nav > a.wr-account {
    display:inline-flex!important;grid-column:2!important;grid-row:1!important;
    position:static!important;visibility:visible!important;opacity:1!important;
    justify-self:end!important;align-self:center!important;
    width:auto!important;max-width:none!important;min-height:40px!important;
    margin:0!important;padding:8px 6px!important;
    white-space:nowrap!important;font-size:13px!important;
    color:#05083F!important;
  }
  html body header.wr-header .wr-nav > details.mobile-menu {
    display:block!important;grid-column:3!important;grid-row:1!important;
    justify-self:end!important;align-self:center!important;margin:0!important;
  }
  html body header.wr-header .wr-nav > nav.wr-links,
  html body header.wr-header .wr-nav > .wr-language {display:none!important}
  html body header.wr-header .wr-nav > details.mobile-menu > nav {
    right:0!important;left:auto!important;max-width:calc(100vw - 24px)!important;
  }
}
@media (max-width:699px) {
  /* A full-width segmented switch, then a separate Premium action row. */
  html body:has(.home-benefits) .housing-results > .results-header {
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:none!important;
    grid-auto-rows:auto!important;
    gap:12px!important;
    align-items:stretch!important;
  }
  html body:has(.home-benefits) .housing-results > .results-header > .offer-heading,
  html body:has(.home-benefits) .housing-results > .results-header > #count,
  html body:has(.home-benefits) .housing-results > .results-header > .results-views,
  html body:has(.home-benefits) .housing-results > .results-header > .results-alert-link,
  html body:has(.home-benefits) .housing-results > .results-header > .new-only-toggle,
  html body:has(.home-benefits) .housing-results > .results-header > .sort-control,
  html body:has(.home-benefits) .housing-results > .results-header > #coverageNote:not([hidden]) {
    grid-column:1/-1!important;grid-row:auto!important;
    min-width:0!important;max-width:100%!important;
    margin-left:0!important;margin-right:0!important;
    justify-self:stretch!important;
  }
  html body:has(.home-benefits) .housing-results > .results-header > .offer-heading{grid-row:1!important}
  html body:has(.home-benefits) .housing-results > .results-header > #count{grid-row:2!important}
  html body:has(.home-benefits) .housing-results > .results-header > .results-views{grid-row:3!important}
  html body:has(.home-benefits) .housing-results > .results-header > .results-alert-link{grid-row:4!important}
  html body:has(.home-benefits) .housing-results > .results-header > .new-only-toggle{grid-row:5!important}
  html body:has(.home-benefits) .housing-results > .results-header > .sort-control{grid-row:6!important}
  html body:has(.home-benefits) .housing-results > .results-header > #coverageNote:not([hidden]){grid-row:7!important}
  html body:has(.home-benefits) .housing-results > .results-header > .results-views{
    width:100%!important;box-sizing:border-box!important;
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:4px!important;padding:4px!important;
  }
  html body:has(.home-benefits) .housing-results > .results-header > .results-views > :is(#listView,#mapView) {
    box-sizing:border-box!important;width:100%!important;min-width:0!important;
    font-size:14px!important;white-space:nowrap!important;
  }
  html body:has(.home-benefits) .housing-results > .results-header > .results-alert-link {
    box-sizing:border-box!important;width:100%!important;min-height:45px!important;
    text-align:center!important;white-space:normal!important;
    background:#05083F!important;color:#fff!important;-webkit-text-fill-color:#fff!important;
    border:1px solid #05083F!important;
  }
  html body:has(.home-benefits) .housing-results > .results-header > .new-only-toggle {
    width:fit-content!important;max-width:100%!important;justify-self:start!important;box-sizing:border-box!important;
    white-space:normal!important;
  }
  html body:has(.home-benefits) .housing-results > .results-header > .sort-control {
    width:min(100%,240px)!important;max-width:100%!important;justify-self:end!important;
  }
  html body:has(.home-benefits) .housing-results > .results-header > .sort-control select {
    width:100%!important;
  }
  /* Remove the large ivory overhang beneath the navy search button. */
  html body:has(.home-benefits) main#woningzoeken > .search-panel {
    padding-bottom:0!important;
    border-bottom-left-radius:0!important;border-bottom-right-radius:0!important;
  }
  html body:has(.home-benefits) main#woningzoeken > .search-panel .filters > button.primary-search {
    margin-bottom:0!important;
  }
  html body:has(.home-benefits) main#woningzoeken > .search-panel .search-secondary:last-child {
    padding-bottom:0!important;margin-bottom:0!important;
  }
}
