/* Mobile presentation layer. Keep rules contained to phone/tablet widths. */
.mobile-bottom-nav { display: none; }
@media screen and (max-width: 900px) {
  :root {
    --mobile-gutter: clamp(18px, 5vw, 26px);
    --mobile-section-space: clamp(52px, 10vw, 72px);
    --mobile-target: 48px;
    --mobile-reading-width: 44rem;
    --space: var(--mobile-gutter);
  }

  html { scroll-padding-top: calc(var(--header-height, 74px) + 16px); }
  body { font-size: 16px; line-height: 1.65; }
  .wrap, main .wrap { width: min(var(--max), calc(100% - var(--mobile-gutter) * 2)); }
  main .section { padding-block: var(--mobile-section-space); }
  main.premium-interior .section { padding-block: var(--mobile-section-space); }
  main .section-heading > p:last-child,
  main .page-intro .intro-copy-text { max-width: var(--mobile-reading-width); font-size: 16px; line-height: 1.65; }
  main .section-heading h2 { font-size: clamp(30px, 7.2vw, 38px); line-height: 1.12; }
  main .button { min-height: var(--mobile-target); font-size: 14px; }
  main .text-link { min-height: 44px; align-items: center; padding-block: 8px; font-size: 14px; }
  main :is(button, [role="button"], input[type="submit"], input[type="button"], select, summary) { min-height: 44px; }
  main img { max-width: 100%; }
  main :is(.editorial-article, .technical-guide-content, .policy-body) { max-width: var(--mobile-reading-width); }
  main :is(.editorial-article, .technical-guide-content, .policy-body) { margin-inline: auto; }
  main :is(.v13-offers, .v13-plans, .v13-models, .v13-resource-grid, .assessment-score-grid, .comparison-cards, .selector-controls) { grid-template-columns: minmax(0, 1fr); }
  main :is(.v13-offer, .v13-plan, .v13-models article, .v13-resource-grid article, .assessment, .comparison-card) { min-width: 0; padding: 20px; }
  main :is(.service-anchor-nav, .assessment-controls, .form-actions, .contact-actions) { gap: 8px; }
  main .table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
  main .technical-guide-content .table-scroll { width: 100%; min-width: 0; }
  main .technical-guide-layout, main .technical-guide-content { min-width: 0; max-width: 100%; }
  main table { width: max-content; min-width: 100%; }
  main th, main td { padding: 10px 12px; }
  main form :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea) { width: 100%; min-height: 48px; font-size: 16px; }
  main form textarea { min-height: 120px; }
  main form :is(input[type="checkbox"], input[type="radio"]) { width: 22px; height: 22px; flex: none; accent-color: #762c38; }
  main :is(.assessment-option, .form-option, label:has(input[type="checkbox"]), label:has(input[type="radio"])) { min-height: 48px; }
  .site-footer .footer-top { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .site-footer .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
  .site-footer .footer-bottom { display: grid; gap: 8px; }

  .header-inner { gap: 12px; }
  .menu-toggle { min-width: 80px; min-height: var(--mobile-target); padding-inline: 14px; }
  #navigation.is-open { max-height: calc(100svh - var(--header-height, 74px)); overflow-y: auto; overscroll-behavior: contain; }
  #navigation.is-open > a,
  #navigation.is-open .resource-trigger,
  #navigation.is-open .resource-submenu a { min-height: var(--mobile-target); }
  #navigation.is-open .resource-menu { width: 100%; }
  #navigation.is-open .resource-trigger { width: 100%; justify-content: space-between; }

  .site-footer .footer-nav a { min-height: 44px; display: flex; align-items: center; }

  .client-problems .problem-grid p { font-size: 15px; line-height: 1.55; }
  .home-service-card p,
  .home-engagement-grid p,
  .home-stages p,
  .home-value-grid p { font-size: 15px; line-height: 1.55; }
  .home-industry-copy li { font-size: 14px; line-height: 1.5; }
}

@media screen and (min-width: 701px) and (max-width: 900px) {
  .home-industry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-stages h3,
  .home-engagement-grid h3 { font-size: 17px; }
}

@media screen and (max-width: 700px) {
  :root { --mobile-section-space: clamp(52px, 12vw, 64px); }

  .header-inner { min-height: 72px; }
  .site-header nav.is-open { padding-bottom: 10px; }
  .site-header nav.is-open > a,
  .site-header nav.is-open .resource-trigger,
  .site-header nav.is-open .resource-submenu a { font-size: 15px; }

  .hero-editorial .hero-description { font-size: 16px; line-height: 1.6; }
  .hero-editorial .button { min-height: var(--mobile-target); font-size: 14px; }
  .hero-system-steps li { font-size: 12px; line-height: 1.45; }
  .hero-system-steps span { font-size: 10px; }

  /* The six approved Challenge examples remain unchanged; only their layout and readability change. */
  .client-problems .problem-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .client-problems .problem-grid article { padding: 16px; row-gap: 7px; }
  .client-problems .problem-grid h3 { font-size: 17px; line-height: 1.35; }
  .client-problems .problem-grid p { font-size: 15px; line-height: 1.55; }

  .home-service-card { padding: 18px; }
  .home-service-card h3 { font-size: 18px; line-height: 1.35; }
  .home-service-card p,
  .home-service-card .text-link,
  .home-engagement-grid p,
  .home-stages p { font-size: 15px; line-height: 1.55; }
  .home-service-card .text-link { min-height: 44px; }
  .home-industry-copy li { font-size: 14px; line-height: 1.5; }
  .home-stages h3 { font-size: 17px; line-height: 1.35; }
  .home-engagement-grid h3 { font-size: 18px; }
  .home-pricing-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .home-price-card { padding: 18px; }
  .home-price-card h3 { font-size: 18px; }
  .home-value-grid p { font-size: 15px; line-height: 1.55; }
  main :is(.v13-method, .v13-models, .home-industry-grid, .home-stages) { grid-template-columns: minmax(0, 1fr); }
  .site-footer .footer-nav { grid-template-columns: minmax(0, 1fr); }
  main :is(.assessment-controls, .form-actions) { align-items: stretch; flex-direction: column; }
  main :is(.assessment-controls, .form-actions) > * { width: 100%; }
}

@media screen and (max-width: 380px) {
  .hero-editorial .button-row { align-items: stretch; flex-direction: column; }
  .hero-editorial .button-row > * { width: 100%; justify-content: space-between; }
  .hero-pillar-key { gap: 0; flex-wrap: nowrap; }
  .hero-pillar-key li { padding-inline: 3px; font-size: 8px; letter-spacing: .06em; }
}

/* Persistent mobile navigation and compact advisor access. */
@media screen and (max-width: 900px) {
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  /* backdrop-filter creates a fixed-position containing block in Safari/Chromium;
     keep the mobile drawer anchored to the viewport instead of the sticky header. */
  .site-header { z-index: 700; backdrop-filter: none; }
  .header-inner:has(#navigation.is-open) { flex-wrap: nowrap; }
  .menu-toggle,
  .menu-toggle:not([hidden]) {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    flex: 0 0 auto; min-width: 86px; min-height: 48px; padding: 8px 6px;
    border: 0 !important; border-radius: 0; background: transparent !important;
    box-shadow: none !important; color: #f2ebe4; font: 650 12px/1 var(--sans);
    letter-spacing: .1em; text-transform: uppercase;
  }
  .menu-toggle:hover, .menu-toggle:focus-visible { border: 0 !important; color: #efadb6; }
  .menu-toggle-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
  .menu-toggle:focus-visible { outline: 2px solid #e4a1aa; outline-offset: 1px; }

  body.mobile-menu-open::before {
    content: ""; position: fixed; inset: 0 0 calc(68px + env(safe-area-inset-bottom));
    z-index: 600; background: rgb(0 0 0 / 66%); backdrop-filter: blur(2px);
  }
  #navigation.is-open {
    position: fixed; z-index: 710; inset: var(--mobile-menu-top, 70px) 0 auto;
    display: flex; flex-direction: column; align-items: stretch; gap: 0; width: 100%; max-height: min(28rem, calc(100dvh - var(--mobile-menu-top, 70px) - 84px));
    margin: 0; padding: 10px var(--mobile-gutter) 18px; overflow: auto; overscroll-behavior: contain;
    border: 0; border-top: 1px solid #ffffff20; background: #0c0d10; box-shadow: 0 18px 36px #0008;
  }
  #navigation.is-open > a,
  #navigation.is-open .resource-trigger,
  #navigation.is-open .resource-submenu a {
    display: flex; align-items: center; width: 100%; min-height: 54px; padding: 12px 4px;
    border-bottom: 1px solid #ffffff1a; color: #f0e9e2; font-size: 16px; text-align: left;
  }
  #navigation.is-open .resource-menu { width: 100%; }
  #navigation.is-open .resource-trigger { justify-content: space-between; background: transparent; border: 0; }
  #navigation.is-open .resource-submenu { position: static; display: none; width: 100%; min-width: 0; padding: 0 0 8px 14px; border: 0; background: #0c0d10; box-shadow: none; }
  #navigation.is-open .resource-menu.is-open .resource-submenu { display: grid; }
  #navigation.is-open .resource-submenu a { min-height: 48px; color: #d9cbd0; font-size: 15px; }
  #navigation.is-open .nav-cta { justify-content: center; min-height: 50px; margin-top: 16px; padding: 12px 16px; border: 1px solid #ad4054 !important; border-radius: 3px; background: #762c38 !important; color: #fff !important; }
  body.mobile-menu-open .bc-advisor-launcher { visibility: hidden; pointer-events: none; }

  .mobile-bottom-nav {
    position: fixed; z-index: 550; inset: auto 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 68px; padding: 5px max(10px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-top: 1px solid #ffffff20; background: rgb(9 10 12 / 97%); box-shadow: 0 -8px 24px #0005;
    backdrop-filter: blur(18px);
  }
  .mobile-bottom-link {
    position: relative; display: flex; min-width: 0; min-height: 54px; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border-radius: 2px; color: #bdb5b0; font: 600 11px/1.15 var(--sans); text-decoration: none; letter-spacing: .01em;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-bottom-link svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-bottom-link.is-active { color: #f0a7b1; }
  .mobile-bottom-link.is-active::before { content: ""; position: absolute; top: -5px; left: 25%; right: 25%; height: 2px; background: #a9344d; }
  .mobile-bottom-link:focus-visible { outline: 2px solid #e4a1aa; outline-offset: -2px; }

  .bc-advisor-launcher {
    position: fixed; z-index: 560; right: max(16px, env(safe-area-inset-right)); bottom: calc(78px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding: 0; background: transparent;
  }
  .bc-advisor-launcher button {
    min-height: 46px; padding: 10px 15px; gap: 8px; border: 1px solid #a9344d; border-radius: 999px;
    background: #762c38; color: #fff; font-size: 12px; letter-spacing: .015em; box-shadow: 0 6px 20px #0009;
  }
  .bc-advisor-launcher button:hover { background: #8a3341; }
  .bc-advisor-launcher svg { width: 17px; height: 17px; }
  .bc-advisor-launcher-status { max-width: min(19rem, calc(100vw - 32px)); margin: 0; }
  body.advisor-open .mobile-bottom-nav,
  body.advisor-open .bc-advisor-launcher { display: none !important; }
}
