/* v39 — authoritative mobile shell. Loaded last. */
@media (max-width: 980px) {
  :root {
    --jb-mobile-edge: 16px;
    --jb-mobile-nav-h: 72px;
  }

  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    overflow-x: hidden !important;
  }

  body.jb-fieldguide {
    padding-top: calc(var(--jb-mobile-nav-h) + 12px) !important;
  }

  /* FIXED MOBILE NAV: same visible width as the page container */
  body.jb-fieldguide .site-nav.jb31-site-nav,
  body.jb-fieldguide header.site-nav.jb31-site-nav {
    position: fixed !important;
    top: max(0px, env(safe-area-inset-top)) !important;
    left: var(--jb-mobile-edge) !important;
    right: var(--jb-mobile-edge) !important;
    width: auto !important;
    max-width: none !important;
    height: var(--jb-mobile-nav-h) !important;
    min-height: var(--jb-mobile-nav-h) !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    translate: none !important;
    filter: none !important;
    contain: none !important;
    overflow: visible !important;
    z-index: 2147483000 !important;
    box-sizing: border-box !important;
  }

  body.jb-fieldguide .jb31-nav-inner {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 18px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  body.jb-fieldguide .jb31-brand {
    min-width: 0 !important;
    max-width: calc(100% - 132px) !important;
  }

  body.jb-fieldguide .jb31-brand strong {
    font-size: clamp(20px, 5.6vw, 28px) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body.jb-fieldguide .jb31-brand span {
    display: none !important;
  }

  body.jb-fieldguide .jb31-actions {
    flex: 0 0 auto !important;
    gap: 8px !important;
  }

  body.jb-fieldguide .jb31-mobile-icon,
  body.jb-fieldguide .jb31-mobile-toggle {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 6px !important;
    box-sizing: border-box !important;
  }

  body.jb-fieldguide .jb31-mobile-menu {
    position: fixed !important;
    top: calc(max(0px, env(safe-area-inset-top)) + var(--jb-mobile-nav-h)) !important;
    left: var(--jb-mobile-edge) !important;
    right: var(--jb-mobile-edge) !important;
    width: auto !important;
    max-height: calc(100dvh - var(--jb-mobile-nav-h) - 16px) !important;
    overflow-y: auto !important;
    z-index: 2147482999 !important;
    box-sizing: border-box !important;
  }

  /* ONE WIDTH MODEL FOR THE PAGE */
  body.jb-fieldguide main,
  body.jb-fieldguide .page {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow-x: hidden !important;
  }

  body.page-home .hero-shell,
  body.jb-fieldguide main > .hero,
  body.jb-fieldguide main > .intro,
  body.jb-fieldguide main > .page-hero,
  body.jb-fieldguide .about-hero-v2,
  body.jb-fieldguide .realtor-hero-v2,
  body.jb-fieldguide .about-hero-v22,
  body.jb-fieldguide .cr-hero {
    width: calc(100% - (var(--jb-mobile-edge) * 2)) !important;
    max-width: none !important;
    margin-left: var(--jb-mobile-edge) !important;
    margin-right: var(--jb-mobile-edge) !important;
    box-sizing: border-box !important;
  }

  body.jb-fieldguide .section-inner,
  body.jb-fieldguide footer .section-inner,
  body.jb-fieldguide .resource-switcher > .section-inner,
  body.page-reviews .cr-hero-grid,
  body.page-reviews .cr-reviews-section > .section-inner,
  body.page-reviews .cr-close > .section-inner {
    width: calc(100% - (var(--jb-mobile-edge) * 2)) !important;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  body.page-home .hero-v31,
  body.page-home .hero-v31 .hero-art,
  body.page-home .hero-v31 .hero-layout,
  body.page-home .hero-v31 .hero-v31-grid,
  body.page-home .hero-v31 .hero-v31-copy,
  body.page-home .hero-v31 .hero-v31-aside,
  body.page-home .hero-v31 .hero-v31-stats {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Prevent any old negative/bleed rules from widening the home hero. */
  body.page-home .hero-v31 * {
    min-width: 0 !important;
  }

  body.page-home .hero-v31 {
    margin-top: 0 !important;
    overflow: hidden !important;
  }

  body.page-home .hero-v31 .hero-art {
    width: 100% !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  /* Anchor jumps account for fixed nav. */
  body.jb-fieldguide [id] {
    scroll-margin-top: calc(var(--jb-mobile-nav-h) + 20px) !important;
  }
}

@media (max-width: 520px) {
  :root { --jb-mobile-edge: 10px; }

  body.jb-fieldguide .jb31-nav-inner {
    padding-left: 14px !important;
    padding-right: 12px !important;
  }

  body.jb-fieldguide .jb31-brand strong {
    font-size: clamp(19px, 6.4vw, 25px) !important;
  }
}
