/* Site-wide fluid layout — loaded last on marketing, auth, and Press Room */

html {
  overflow-x: clip;
}

body.mb-body,
body.pr-body,
body.mb-auth-body {
  overflow-x: clip;
  max-width: 100%;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

iframe {
  max-width: 100%;
}

table {
  max-width: 100%;
}

pre,
code {
  overflow-x: auto;
  max-width: 100%;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

.mb-container,
.mb-mono-wrap,
.pr-content,
.pr-main,
.mb-auth-overlay,
.mb-auth-modal,
.nr-public__grid {
  max-width: 100%;
  min-width: 0;
}

.mb-header__inner,
.mb-nav,
.mb-header__actions,
.pr-topbar,
.pr-topbar__actions {
  min-width: 0;
}

@media (max-width: 1100px) {
  :root {
    --mb-container: min(1200px, 94vw);
  }

  .mb-logo__tag {
    max-width: 220px;
  }

  .mb-archive-grid,
  .mb-intelligence__cards,
  .mb-service-detail-grid,
  .mb-industries-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --mb-container: min(1200px, 92vw);
  }

  .mb-hero__title-line,
  .mb-hero-pricing__title-line,
  .mb-contact-hero__title,
  .mb-about-hero__title-black,
  .mb-about-hero__title-red {
    white-space: normal;
  }

  .mb-hero-services__grid,
  .mb-home-hero__grid,
  .mb-contact-hero__grid,
  .mb-contact-main__grid,
  .mb-about-hero__grid,
  .mb-about-who__grid,
  .mb-post__layout,
  .mb-post__body-wrap,
  .nr-public__grid,
  .pr-grid-3,
  .pr-grid-dashboard,
  .pr-layout-with-rail,
  .pr-form-grid,
  .ar-main-grid,
  .rv-detail-grid,
  .mp-grid,
  .pb-grid,
  .it-audience-grid,
  .ui-upload-grid-2,
  .ui-upload-grid-3 {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .mb-home-hero__content,
  .mb-hero-services__content {
    max-width: 100%;
  }

  .mb-home-features__grid,
  .mb-home-industries__grid,
  .mb-features,
  .mb-about-do__grid,
  .mb-about-help__grid,
  .mb-contact-cards,
  .mb-industry-card-grid,
  .mb-what-we-do-grid,
  .mb-july-why__grid,
  .mb-july-addons__grid,
  .pr-grid-stats,
  .mp-summary-grid,
  .mp-summary-grid--pitch,
  .ar-suggestions__grid,
  .pb-sidebar,
  .rv-metrics-row,
  .ta-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mb-cta__inner,
  .mb-cta-card,
  .mb-july-cta__card,
  .pr-topbar,
  .ar-header,
  .rv-header {
    flex-wrap: wrap;
  }

  .mb-modal,
  .mb-legal-modal,
  .mb-strategy-modal {
    padding: 0.75rem;
    align-items: flex-start;
  }

  .mb-legal-modal__panel,
  .mb-strategy-modal__dialog,
  .mb-modal__panel {
    width: 100%;
    max-height: min(92dvh, 920px);
  }

  .mb-auth-modal {
    grid-template-columns: 1fr !important;
    width: 100%;
    height: auto;
    max-height: calc(100dvh - 0.75rem);
    min-width: 0;
  }

  .mb-auth-overlay {
    padding: 0.5rem;
    align-items: flex-start;
  }

  .mb-auth__brand {
    display: none;
  }

  .mb-auth__panel,
  .mb-auth__card {
    max-width: 100%;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  :root {
    --mb-container: min(100% - 1.5rem, 94vw);
    --mb-header-h: 64px;
  }

  .mb-header__inner {
    gap: 0.65rem;
    height: var(--mb-header-h);
  }

  .mb-logo__tag {
    display: none;
  }

  .mb-services-grid,
  .mb-home-features__grid,
  .mb-home-industries__grid,
  .mb-features,
  .mb-about-do__grid,
  .mb-about-help__grid,
  .mb-about-approach__grid,
  .mb-contact-cards,
  .mb-industry-card-grid,
  .mb-what-we-do-grid,
  .mb-archive-grid,
  .mb-featured-case,
  .mb-featured-cases,
  .mb-featured-insights__head,
  .mb-intelligence__head,
  .mb-intelligence__cards,
  .mb-service-detail-grid,
  .mb-industries-grid,
  .mb-pricing-global__grid,
  .mb-july-why__grid,
  .mb-july-addons__grid,
  .mb-pricing-builder,
  .mb-complete__details-grid,
  .mb-complete__actions,
  .mb-auth__complete-checks,
  .pr-grid-stats,
  .it-row--2,
  .it-row--3,
  .it-row--bottom,
  .mp-pr-row,
  .mp-summary-grid,
  .mp-summary-grid--pitch,
  .mp-channel-grid,
  .mp-estimate-stats,
  .mp-datetime,
  .pb-main-top,
  .pb-social,
  .pb-sidebar,
  .pb-reach-grid,
  .pb-caption-pair,
  .pb-pair-heads,
  .ar-suggestions__grid,
  .rv-metrics-row,
  .ta-kpi-grid,
  .mb-strategy-actions {
    grid-template-columns: 1fr;
  }

  .mb-hero__actions,
  .mb-home-hero__actions,
  .mb-cta-card__actions,
  .pr-topbar__actions,
  .ar-header__actions,
  .it-footer__right {
    flex-direction: column;
    align-items: stretch;
  }

  .mb-hero__actions .mb-btn,
  .mb-home-hero__actions .mb-btn,
  .mb-cta-card__actions .mb-btn {
    width: 100%;
    justify-content: center;
  }

  .mb-how-step,
  .mb-about-how .mb-how-step {
    flex: 1 1 100%;
    max-width: none;
  }

  .mb-footer__newsletter-perks {
    flex-wrap: wrap;
  }

  .mb-footer__newsletter-form {
    grid-template-columns: 1fr !important;
  }

  .mb-side-rail {
    z-index: 40;
  }

  body.mb-body {
    padding-bottom: 4.5rem;
  }

  .mb-pricing-block__table-wrap,
  .pr-table,
  .pr-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .pr-topbar__title {
    font-size: 1rem;
    line-height: 1.25;
  }

  .mb-pay__method {
    grid-template-columns: auto 1fr auto;
  }
}

@media (max-width: 640px) {
  .mb-home-hero__title,
  .mb-hero-services .mb-hero__title,
  .mb-hero-pricing .mb-hero-services .mb-hero__title,
  .mb-about-hero__title,
  .mb-contact-hero__title {
    font-size: clamp(1.5rem, 7vw, 2.05rem);
  }

  .mb-section,
  .mb-home-features,
  .mb-latest-insights,
  .mb-contact-main,
  .pr-content {
    padding-block: 2.25rem;
  }

  .pr-content {
    padding-inline: 0.85rem;
  }

  .mb-auth-overlay,
  .mb-auth__panel,
  .mb-auth__card,
  .mb-auth-modal {
    max-width: 100%;
    border-radius: 14px;
  }

  .mb-legal-modal__panel,
  .mb-strategy-modal__dialog,
  .mb-modal__panel {
    padding: 1.15rem 1rem 1rem;
    border-radius: 14px;
  }

  .pr-grid-stats,
  .ta-kpi-grid {
    grid-template-columns: 1fr;
  }

  .pb-promo-row,
  .pb-platform {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  :root {
    --mb-container: min(100% - 1rem, 96vw);
  }

  .mb-logo__brand {
    font-size: 1rem;
  }

  .mb-header:not(.is-logged-in) .mb-header__actions[data-mb-actions="guest"] .mb-btn--ghost-nav {
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
  }
}

/* Guest header: logo + Sign In + hamburger from laptop down */
@media (max-width: 1100px) {
  body.mb-nav-open {
    overflow: hidden;
  }

  .mb-header:not(.is-logged-in) .mb-header__inner {
    gap: 0.55rem;
  }

  .mb-header:not(.is-logged-in) .mb-logo {
    min-width: 0;
    flex: 1 1 auto;
  }

  .mb-header:not(.is-logged-in) .mb-logo__tag {
    display: none;
  }

  .mb-header:not(.is-logged-in) .mb-menu-toggle {
    display: flex;
    order: 5;
    flex-shrink: 0;
    z-index: 2;
  }

  .mb-header:not(.is-logged-in) .mb-nav[data-mb-nav="guest"] {
    display: none;
  }

  .mb-header:not(.is-logged-in).is-open .mb-nav[data-mb-nav="guest"]:not([hidden]) {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: var(--mb-header-h, 72px);
    left: 0;
    right: 0;
    z-index: 60;
    background: #ffffff;
    padding: 0.85rem 1.25rem 6.25rem;
    gap: 0;
    max-height: calc(100dvh - var(--mb-header-h, 72px));
    overflow-y: auto;
    border-bottom: 1px solid #ececec;
  }

  .mb-header:not(.is-logged-in).is-open .mb-nav[data-mb-nav="guest"] a,
  .mb-header:not(.is-logged-in).is-open .mb-nav[data-mb-nav="guest"] .mb-nav__trigger {
    display: flex;
    width: 100%;
    text-align: left;
    color: #111;
    font-size: 1.02rem;
    font-weight: 600;
    padding: 0.75rem 0.1rem;
    background: none;
    border: 0;
    white-space: normal;
  }

  .mb-header:not(.is-logged-in).is-open .mb-nav[data-mb-nav="guest"] a::after,
  .mb-header:not(.is-logged-in).is-open .mb-nav[data-mb-nav="guest"] .mb-nav__trigger::after {
    display: none;
  }

  .mb-header:not(.is-logged-in) .mb-header__actions[data-mb-actions="guest"]:not([hidden]),
  .mb-header:not(.is-logged-in).is-open .mb-header__actions[data-mb-actions="guest"]:not([hidden]) {
    display: flex !important;
    position: static;
    flex-wrap: nowrap;
    align-items: center;
    width: auto;
    margin-left: auto;
    padding: 0;
    gap: 0.4rem;
    background: transparent;
    border: 0;
    box-shadow: none;
    bottom: auto;
    left: auto;
    right: auto;
  }

  .mb-header:not(.is-logged-in) .mb-header__actions[data-mb-actions="guest"] .mb-btn--solid {
    display: none;
  }

  .mb-header:not(.is-logged-in).is-open .mb-header__actions[data-mb-actions="guest"] .mb-btn--solid {
    display: inline-flex !important;
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: calc(0.85rem + env(safe-area-inset-bottom));
    z-index: 70;
    justify-content: center;
    width: auto;
    max-width: none;
  }
}
