/* Desktop alignment v2. Eligibility is set before the body is parsed.
 * Unlike v1, secondary touch capability does not disable mouse-based desktops.
 * Apple/Android mobile and tablet devices are explicitly excluded by the guard.
 * Every declaration also requires the scoped root attribute and >=1200px.
 */
@media screen and (min-width: 1200px) {
  /* Specificity keeps these width rules above page-local body stylesheets. */
  html[data-ch-desktop-layout] .ch-header-inner,
  html[data-ch-desktop-layout] .container,
  html[data-ch-desktop-layout] .performance-view .container,
  html[data-ch-desktop-layout] .ea-product,
  html[data-ch-desktop-layout] .cfg-page,
  html[data-ch-desktop-layout] .setup-page,
  html[data-ch-desktop-layout] .get-page,
  html[data-ch-desktop-layout] .get-page.get-offer,
  html[data-ch-desktop-layout] .contact-page,
  html[data-ch-desktop-layout] .footer-top,
  html[data-ch-desktop-layout] .footer-bottom {
    width: min(1280px, 90%);
    max-width: 1280px;
    margin-inline: auto;
  }

  /* Home backgrounds remain full bleed; content follows the header rails. */
  html[data-ch-desktop-layout] body > .hero,
  html[data-ch-desktop-layout] body > section {
    padding-inline: max(5%, calc((100% - 1280px) / 2));
  }

  html[data-ch-desktop-layout] .home-performance-inner,
  html[data-ch-desktop-layout] .performance-digest {
    max-width: 1280px;
  }

  html[data-ch-desktop-layout] .home-access-banner {
    width: min(1280px, 90%);
    max-width: 1280px;
    margin-inline: auto;
  }

  html[data-ch-desktop-layout] .site-links {
    padding-inline: max(5%, calc((100% - 1280px) / 2));
  }

  /* Align Contact's heading with its unchanged 2:1:1 card grid. */
  html[data-ch-desktop-layout] .contact-hero {
    padding-inline: 0;
  }

  /* Keep legal copy readable, but align it with the page title and footer. */
  html[data-ch-desktop-layout] .privacy-policy .container.reading {
    width: min(1280px, 90%);
    max-width: 1280px;
    margin-inline: auto;
  }

  html[data-ch-desktop-layout] .privacy-policy .reading > section,
  html[data-ch-desktop-layout] .privacy-policy .reading > p {
    max-width: 76ch;
  }

  /* Real homepage wrapper and grid targets, not just generic containers. */
  html[data-ch-desktop-layout] body > #performance.home-performance > .home-performance-inner,
  html[data-ch-desktop-layout] body > .home-engines > .home-performance-inner,
  html[data-ch-desktop-layout] body > #community.community > .community-simple {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin-inline: 0;
  }

  html[data-ch-desktop-layout] #settings > .configuration-modes,
  html[data-ch-desktop-layout] #performance > .home-performance-inner > .home-years,
  html[data-ch-desktop-layout] #performance > .home-performance-inner > .home-risk-activity,
  html[data-ch-desktop-layout] .home-engines > .home-performance-inner > .engine-teasers {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  /* Copy retains its original readable line measure inside the full rail. */
  html[data-ch-desktop-layout] #community .community-simple > p {
    max-width: 740px;
  }
}
