@media (max-width: 1100px) {
  footer { grid-template-columns: minmax(0, 1fr); }
  /* Once the footer is a single column the copyright line has no room to stay on one line,
     and holding it there widens the page instead of wrapping. */
  .footer-legal { text-align: left; white-space: normal; }
}

/* The header keeps one row and the hero keeps its example beside the form on a laptop; both
   stack only once the example card would be narrower than the result it shows. */
@media (max-width: 960px) {
  :root { --header-height: 120px; }
  .topbar { height: auto; min-height: 104px; flex-wrap: wrap; gap: 0; padding-block: 8px; }
  .topbar nav { flex-basis: 100%; gap: 0 24px; }
  .topbar nav a { max-width: 100%; overflow-wrap: anywhere; }
  /* The account sits beside the brand once the navigation takes a row of its own. */
  .account { order: 1; margin-inline-start: auto; }
  .topbar nav { order: 2; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: auto; padding-top: 40px; gap: 40px; }
  .family-links, .provider-showcase { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .provider-directory-list { grid-template-columns: minmax(0, 1fr); }
  .directory-primary, .directory-advanced { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory-primary > label:first-child { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .topbar { padding: 8px 16px; }
  .topbar .brand { min-width: 0; }
  .topbar .brand { min-height: 44px; gap: 8px; }
  .topbar .brand img { width: 32px; height: 32px; flex: none; }
  .topbar .brand span { overflow-wrap: anywhere; font-size: .875rem; letter-spacing: .02em; }
  .topbar .brand b { font-size: inherit; }
  .topbar nav { gap: 0 16px; }
  .brand small { display: none; }
  .key { padding: 8px 12px; }
  .hero { padding: 24px 16px 32px; gap: 32px; }
  .hero .eyebrow { margin: 0 0 16px; }
  .hero h1 { overflow-wrap: anywhere; font-size: clamp(2.25rem, 11vw, 3rem); }
  .hero .lede { margin: 16px 0 24px; font-size: 1rem; }
  /* The h1 already breaks anywhere at this width; the prose around it must too, or a single
     long token sets the column's minimum and the page scrolls sideways. */
  .hero-copy, .hero-copy p, .eyebrow, .kicker, .lede { overflow-wrap: anywhere; }
  footer .brand span, footer p, .footer-legal { overflow-wrap: anywhere; }
  .input-row { grid-template-columns: minmax(0, 1fr); }
  .input-row .input-icon { display: none; }
  .input-row button { width: 100%; }
  .samples > span { flex-basis: 100%; }
  .result { margin: 16px 16px 48px; padding: 16px; }
  .account-profile span { max-width: 8rem; }
  .live-card-main { gap: .75rem; }
  .live-avatar, .live-item { width: 64px; height: 64px; }
  .live-preview { width: 80px; height: 80px; }
  /* A wide header image (games, packages, bundles) goes above the text; beside it, its 100%
     width would resolve against an auto column and collapse to nothing. */
  .live-app .live-card-main, .live-package .live-card-main, .live-bundle .live-card-main { grid-template-columns: minmax(0, 1fr); }
  .live-header { width: 100%; max-width: 460px; }
  .live-stats > div { flex: 1 1 7.5rem; min-width: 0; }
  .result-head { padding: .5rem .75rem; border-inline-start-width: 4px; }
  .match-definitions > div { grid-template-columns: minmax(0, 1fr); }
  .provider-showcase a { grid-template-columns: minmax(0, 1fr); gap: .6rem; }
  .section h2 { overflow-wrap: anywhere; font-size: clamp(1.8rem, 12vw, 2.4rem); }
  .section { padding: 3rem 1rem; }
  .public-page { padding: 24px 16px 48px; }
  .provider-directory > .eyebrow { margin: 0 0 8px; }
  .provider-directory > h1 { margin: 8px 0 16px; font-size: 2rem; line-height: 1.1; }
  .provider-directory > .lede { margin: 16px 0; font-size: 1rem; }
  .provider-filters { gap: 8px; margin: 16px 0; }
  .directory-primary, .directory-advanced { gap: 8px 16px; }
  .provider-directory-list { margin-top: 16px; }
  .provider-directory-card { gap: 8px 16px; padding: 16px; }
  .provider-detail dl div { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
  .provider-card-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .help-example-list { padding-inline-start: 16px; }
  footer { padding: 2rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* Native selects need room for translated option labels. WebKit can propagate
   their intrinsic text width beyond a narrow grid track even when the control
   itself fits; stack the filters before those tracks become too narrow. */
@media (max-width: 480px) {
  .directory-primary, .directory-advanced { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 359px) {
  .family-links, .provider-showcase { grid-template-columns: minmax(0, 1fr); }
  .provider-showcase a { grid-template-columns: 40px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .step:last-child { border-bottom: 0; }
  /* Stacked, each step's number sits beside its heading rather than above it. */
  .step { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; }
  .step-number { margin: 0; }
  .step > :not(.step-number, h3) { grid-column: 1 / -1; }
  .demo-card { max-width: 620px; }
}

@media (max-width: 680px) {
  .domain-swap { gap: 8px; }
  .demo-content { padding: 24px 16px; }
  .section-head { display: block; }
  .section-note { margin-top: 14px; }
}

/* Two columns do not fit a phone, so each row of the similar-sites table stacks: the site, then
   what it is best for. The header row stays for assistive technology. */
@media (max-width: 680px) {
  .provider-compare, .provider-compare tbody, .provider-compare tr, .provider-compare th, .provider-compare td { display: block; width: auto; }
  .provider-compare thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
  .provider-compare tbody tr { padding: .9rem 0; border-top: 1px solid var(--line); }
  .provider-compare tbody tr:last-child { border-bottom: 1px solid var(--line); }
  .provider-compare th, .provider-compare td { padding: 0; border: 0; }
  .provider-compare tbody tr:last-child > * { border-bottom: 0; }
  .provider-compare th:first-child, .provider-compare td:last-child { width: auto; padding-inline: 0; }
  .provider-compare td { margin-top: .4rem; }
}
