/* Browser zoom reduces the effective viewport. Size the listing columns from
   their available space instead of forcing four narrow cards. */
#ads .quote-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

#ads .quote-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-wrap: anywhere;
}

#ads .quote-card > .toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin-top: auto !important;
  padding-top: 13px;
}

#ads .quote-card > .toolbar > button,
#ads .quote-card > .toolbar > a {
  flex: 1 1 120px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

#ads .listing-card-top {
  grid-template-columns: auto 42px minmax(0, 1fr);
}

#ads .listing-card-top > div,
#ads .listing-group-head > div {
  min-width: 0;
  max-width: 100%;
}

#ads .quote-card .badge {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
}

#ads .listing-group-head,
#ads .listing-bulk-bar,
#ads .listing-filters {
  flex-wrap: wrap;
}

#ads .listing-group-head > div:first-child {
  flex: 1 1 280px;
  overflow-wrap: anywhere;
}

#ads .listing-group-head button,
#ads .listing-bulk-bar button {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

#ads .listing-group-head label,
#ads .listing-bulk-bar > div {
  min-width: 0;
  max-width: 100%;
}

#ads .segmented {
  flex-wrap: wrap;
  max-width: 100%;
}

@media (max-width: 720px) {
  #ads .listing-group-head > div:first-child {
    flex: auto;
  }
}

/* Switch navigation before its links push account/notification buttons offscreen. */
@media (max-width: 1450px) {
  .desktop-nav {
    display: none;
  }
  .nav-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .mobile-menu-trigger {
    display: block;
  }
}
