/* CPBDHost V20: Mobile-only INNER PAGE edge spacing correction.
   HOME, DESKTOP, NAVIGATION, DATABASE & JS ARE NOT TOUCHED.
   Root cause: the old .wrap had a 12-13px margin AND an extra 18px horizontal padding,
   leaving ~31px on either edge of the inner grids. Keep card padding; remove double inset. */
@media screen and (max-width:800px) {
  /* detail pages include Services, Packages, Projects, Builder, How We Work, Contact,
     all Service details, Package Categories/Subcategories, About and Blog. */
  html[data-cp-page="detail"] main.cpbd-v18-page .wrap:not(.cpbd-page-bottom-cta > .wrap),
  html[data-cp-page="detail"] main .cpbd-v18-page .wrap,
  html[data-cp-page="detail"] main > section:not(.cpbd-page-bottom-cta) > .wrap,
  html[data-cp-page="detail"] main section.cpbd-page-hero > .wrap,
  html[data-cp-page="detail"] main section.cpbd-page-section > .wrap,
  html[data-cp-page="detail"] main section.cpbd-contact-hero > .wrap,
  html[data-cp-page="detail"] main section.cpbd-v18-hero > .wrap,
  html[data-cp-page="detail"] main section.cpbd-v18-section > .wrap,
  html[data-cp-page="detail"] main > .wrap {
    box-sizing:border-box!important;
    width:calc(100% - 14px)!important;
    max-width:none!important;
    min-width:0!important;
    margin-inline:7px!important;
    padding-inline:0!important;
  }
  /* CTA is deliberately a colored card: narrow the OUTER gutter, retain its own padding. */
  html[data-cp-page="detail"] main section.cpbd-page-bottom-cta > .wrap {
    box-sizing:border-box!important;
    width:calc(100% - 14px)!important;
    max-width:none!important;
    margin-inline:7px!important;
    padding-inline:16px!important;
  }
  /* Never let card/grid fixed widths force horizontal overflow. */
  html[data-cp-page="detail"] main :is(.cpbd-v18-hero-grid,.cpbd-v18-service-grid,.cpbd-v18-type-grid,.cpbd-v18-package-grid,.cpbd-v18-project-grid,.cpbd-v18-simple-grid,.cpbd-v9-hero-layout,.cpbd-v9-pricing-grid,.cpbd-card-grid,.cpbd-contact-grid,.cpbd-form-grid) {
    max-width:100%!important;
    min-width:0!important;
  }
  html[data-cp-page="detail"] main :is(.cpbd-v18-service-card,.cpbd-v18-package-card,.cpbd-v18-project-card,.cpbd-page-card,.cpbd-quote-form) {
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  html[data-cp-page="detail"] main :is(h1,h2,h3,p,a,strong,small) {
    overflow-wrap:break-word;
  }
  /* Terms uses a separate shell, so give its hero and article the same phone gutter. */
  html[data-cp-page="terms"] #terms-main :is(.cpbd-terms-hero,.cpbd-terms-content) > .wrap {
    box-sizing:border-box!important;
    width:calc(100% - 14px)!important;
    max-width:none!important;
    min-width:0!important;
    margin-inline:7px!important;
    padding-inline:0!important;
  }
  html[data-cp-page="terms"] .cpbd-terms-article {
    box-sizing:border-box!important;
    max-width:100%!important;
    min-width:0!important;
    padding-inline:clamp(12px,3vw,17px)!important;
  }
}
@media screen and (min-width:801px) {
  /* PC remains exactly as it was. */
}
