/* Phone and tablet layout fixes for the search app pages on every site (mobile check, Nov 25, 2026).
   Loaded after app.css. Same look; only sizes, wrapping and rows change. Uses "body" in front so it also wins over
   guide.css, which some pages load later. */

@media (max-width: 760px) {
  /* ZIP and quick-link chip rows scroll sideways on phones: keep each chip its full size (they were squeezed into
     each other and the numbers were cut off) */
  body .chip-row > * { flex-shrink: 0; }
  /* "Neighborhood outline" switch on the listing map: a box big enough to tap */
  body .check.map-hood input[type="checkbox"] { width: 22px; height: 22px; }
}

@media (max-width: 600px) {
  /* Listing page Nearby Schools: on wider phones the three school cards sat 2 + 1 and the "See ratings on GreatSchools"
     pill could not wrap, so the whole page scrolled sideways. One card per row; the pill wraps if it must. */
  body .schools { grid-template-columns: minmax(0, 1fr); }
  body .school { min-width: 0; }
  body .school em { white-space: normal; }
  /* Neighborhood and development guides: the market trend table ran past the screen and cut off the last column.
     Fit it to the screen and let the headings wrap. */
  body .guide table { table-layout: fixed; font-size: 14px; }
  body .guide th, body .guide td { padding: 8px 6px; }
  body .guide th.n { white-space: normal; }
  body .guide th:first-child, body .guide td:first-child { width: 34%; }
  /* six-column tables (market report by price range): narrower first column, tighter cells */
  body .guide table:has(th:nth-child(6)) th:first-child { width: 23%; }
  body .guide table:has(th:nth-child(6)) :is(th, td) { padding: 8px 3px; }
  body .guide table:has(th:nth-child(6)) th { font-size: 12.5px; }
  /* Guide number tiles (homes for sale, median price, pending): two per row, an odd last tile gets the full row */
  body .guide .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body .guide .stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* Market numbers widget: two per row, the fifth number gets the full row */
  body .idxw-mk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  body .idxw-mk-stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  /* Form fields at 16px on phones: iPhones zoom the whole page in when someone taps a field with smaller text,
     and the page stays zoomed after typing. 14 to 15px fields become 16px; nothing else changes. */
  body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]), body select, body textarea { font-size: 16px !important; }
}

@media (max-width: 991px) {
  /* Checkboxes in Advanced search cities and the sign-up form: 13px boxes on tablets (phones already fixed) */
  body label.check input[type="checkbox"] { width: 20px; height: 20px; }
  /* Request a call: the small gray labels were 11px */
  body .rc-k, body .rc-chips small, body label.sms small { font-size: 12px; }
}

@media (min-width: 601px) and (max-width: 991px) {
  /* Search by feature on tablets: sections of 8, 4 and 5 cards ended 3, 3, 2 / 3, 1 / 3, 2. Counts of 3, 6 or 9 sit three
     across, even counts two across, and an odd last card takes the full row. */
  body .feature-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body .feature-cards:has(> :nth-child(3n):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body .feature-cards:not(:has(> :nth-child(3n):last-child)) > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* AI search help boxes (search for you, email alerts, talk it through): three ended 2 + 1; the third takes the row */
  body .ai-help > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* Market report "How to read this report": four tiles ended 3 + 1 on tablets; now two by two */
  body .guide .mr-how, body .mr-how { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Market numbers widget: five numbers in one row instead of 4 + 1 */
  body .idxw-mk-stats:has(> :nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
}
