/* Mobile-only layout repair. Desktop rules and sector-switching behaviour stay intact. */
.iam-mobile-field-label { display: none; }
@media (max-width: 991px) {
  /* The sector-switcher container and hero grid are siblings in a flex row.
     Stack the section itself, not just the inner grid. */
  .iam-home-mobile-fix .hero-section {
    display: block;
    min-height: 0;
    height: auto;
    padding: 28px 0 40px;
    background-position: center top;
  }
  .iam-home-mobile-fix .hero-section > .container {
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
  }
  .iam-home-mobile-fix .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .iam-home-mobile-fix .hero-grid > *,
  .iam-home-mobile-fix .quote-box-card,
  .iam-home-mobile-fix .form-input-wrap { min-width: 0; max-width: 100%; }
  .iam-home-mobile-fix .hero-overlay {
    background: linear-gradient(180deg, rgba(6,27,18,.89), rgba(6,27,18,.97));
  }
  .iam-home-mobile-fix .hero-headline {
    font-size: clamp(2rem, 8.5vw, 3rem);
    line-height: 1.12;
    overflow-wrap: break-word;
    margin-bottom: 18px;
  }
  .iam-home-mobile-fix .hero-headline br { display: none; }
  .iam-home-mobile-fix .hero-eyebrow { gap: 8px; margin-bottom: 16px; }
  .iam-home-mobile-fix .eyebrow-line { flex-shrink: 0; width: 20px; }
  .iam-home-mobile-fix .hero-section .eyebrow-text {
    color: #d1fae5;
    font-size: .7rem;
    letter-spacing: .07em;
  }
  .iam-home-mobile-fix .hero-subtitle { font-size: 1rem; margin-bottom: 22px; }
  .iam-home-mobile-fix .hero-trust-row { gap: 18px; padding-top: 20px; }
  .iam-home-mobile-fix .hero-sector-tabs {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 620px;
    border-radius: 16px;
    margin-bottom: 24px;
  }
  .iam-home-mobile-fix .sector-tab-btn {
    white-space: normal;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    justify-content: center;
    line-height: 1.4;
    font-size: .82rem;
  }
  .iam-home-mobile-fix .sector-tab-btn svg { flex-shrink: 0; }
  .iam-home-mobile-fix .top-bar { font-size: .7rem; padding: 5px 0; }
  .iam-home-mobile-fix .top-bar-inner { gap: 8px; }
  .iam-home-mobile-fix .top-bar-left { min-width: 0; }
  .iam-home-mobile-fix .top-bar-left .rics-tag { display: inline-flex; white-space: nowrap; color: #d1fae5; }
  .iam-home-mobile-fix .top-bar-right { gap: 0; flex-shrink: 0; }
  .iam-home-mobile-fix .top-bar a[href^="mailto:"] { display: none; }
  .iam-home-mobile-fix .top-bar a[href^="tel:"] { white-space: nowrap; padding: 5px 0; }
  .iam-home-mobile-fix #quote-calculator { width: 100%; scroll-margin-top: 90px; }
  .iam-home-mobile-fix .quote-box-card { width: 100%; }
  .iam-home-mobile-fix .form-input { min-width: 0; max-width: 100%; font-size: 16px; }
  .iam-home-mobile-fix .iam-mobile-field-label {
    display: block; font-size: .8rem; line-height: 1.4;
    font-weight: 700; color: #334155; margin-bottom: 5px;
  }
  .iam-home-mobile-fix #heroQuoteForm .form-input-icon { top: calc(100% - 25px); }
  .iam-home-mobile-fix .btn-quote-submit { min-height: 52px; height: auto; padding: 12px; white-space: normal; }
  .iam-home-mobile-fix .services-filter-tabs { gap: 8px; margin: 22px 0 28px; }
  .iam-home-mobile-fix .service-filter-btn { white-space: normal; max-width: 100%; justify-content: center; }
}
@media (max-width: 640px) {
  .iam-home-mobile-fix .header-inner { height: 68px; gap: 8px; }
  .iam-home-mobile-fix .brand-logo-img { height: 38px; max-width: 145px; }
  .iam-home-mobile-fix .header-actions { gap: 6px; }
  .iam-home-mobile-fix .btn-header-quote { padding: 10px 12px; font-size: .75rem; white-space: nowrap; }
  .iam-home-mobile-fix .btn-header-quote svg { display: none; }
  .iam-home-mobile-fix .quote-box-card { padding: 24px 18px; }
  .iam-home-mobile-fix #heroQuoteForm > div[style*="grid-template-columns"],
  .iam-home-mobile-fix #commercialQuoteForm > div[style*="grid-template-columns"],
  .iam-home-mobile-fix #ctaQuoteForm > div[style*="grid-template-columns"] {
    grid-template-columns: minmax(0, 1fr) !important; gap: 0 !important;
  }
  .iam-home-mobile-fix #ctaQuoteForm > div { min-width: 0; }
  .iam-home-mobile-fix #ctaQuoteForm input { min-width: 0 !important; max-width: 100%; }
  .iam-home-mobile-fix #ctaQuoteForm button { width: 100% !important; white-space: normal !important; }
  .iam-home-mobile-fix .services-filter-tabs { flex-direction: column; }
}
@media (max-width: 768px) {
  .iam-home-mobile-fix { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .iam-home-mobile-fix .floating-cta-pill { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); left: 12px; right: 12px; gap: 8px; padding: 8px 12px; }
  .iam-home-mobile-fix .floating-pill-phone { white-space: nowrap; font-size: .78rem; }
  .iam-home-mobile-fix .floating-pill-btn { white-space: nowrap; font-size: .75rem; padding: 10px 13px; }
  .iam-home-mobile-fix :is(input, button, a) { scroll-margin-bottom: 110px; }
}
@media (max-width: 600px) {
  /* Related commercial pages already stack their hero and forms. Prevent
     oversized headings / intrinsic grid widths, and reserve CTA-bar space. */
  .iam-commercial-mobile-fix { padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
  .iam-commercial-mobile-fix .hero h1 { font-size: clamp(2.25rem, 10vw, 3.25rem); overflow-wrap: break-word; }
  .iam-commercial-mobile-fix .hero-grid > *,
  .iam-commercial-mobile-fix .contact-panel > *,
  .iam-commercial-mobile-fix .comm-form-grid-2 > * { min-width: 0; }
  .iam-commercial-mobile-fix .comm-input,
  .iam-commercial-mobile-fix .comm-select,
  .iam-commercial-mobile-fix .comm-textarea { min-width: 0; max-width: 100%; font-size: 16px; }
  .iam-commercial-mobile-fix .contact-direct-item { flex-wrap: wrap; gap: 4px 12px; }
  .iam-commercial-mobile-fix .contact-direct-item a { overflow-wrap: anywhere; }
  .iam-commercial-mobile-fix :is(input, select, textarea, button, a) { scroll-margin-bottom: 100px; }
}
