/* Shared mobile navigation and floating-action behavior. */
@media (max-width: 850px) {
  body.jmd-mobile-nav-open {
    overflow: hidden !important;
  }

  .site-header .nav-links.open,
  .jmd-shell-header .jmd-shell-links.open {
    max-height: calc(100dvh - 82px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    touch-action: pan-y;
    scrollbar-width: thin;
    scrollbar-color: #c8951e #f1ede2;
  }

  .site-header .nav-links.open::-webkit-scrollbar,
  .jmd-shell-header .jmd-shell-links.open::-webkit-scrollbar {
    width: 7px;
  }

  .site-header .nav-links.open::-webkit-scrollbar-thumb,
  .jmd-shell-header .jmd-shell-links.open::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #c8951e;
  }

  .site-header .nav-menu:not(.open) > .mega-menu,
  .site-header .nav-menu:not(.open) > .contact-popover {
    display: none !important;
  }

  .site-header .nav-menu.open > .mega-menu {
    display: flex !important;
    position: static !important;
    width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 4px 0 12px;
    flex-direction: column;
    overflow: visible !important;
    border-radius: 10px;
    box-shadow: none;
  }

  .site-header .nav-menu.open > .contact-popover {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin: 4px 0 12px;
    box-shadow: none;
  }

  .site-header .division-list,
  .site-header .service-panel,
  .jmd-shell-header .jmd-shell-divisions,
  .jmd-shell-header .jmd-shell-panel {
    width: 100% !important;
  }

  .site-header .service-panel,
  .jmd-shell-header .jmd-shell-panel {
    padding: 20px 16px !important;
  }

  .site-header .service-columns,
  .jmd-shell-header .jmd-shell-columns {
    grid-template-columns: 1fr !important;
  }

  .jmd-shell-header .jmd-shell-mega {
    max-height: none !important;
    overflow: visible !important;
  }

  /* Keep one universal pair of compact mobile actions. */
  .jmd-fabs {
    left: auto !important;
    right: 14px !important;
    bottom: max(72px, calc(72px + env(safe-area-inset-bottom))) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    transform: none !important;
    z-index: 70 !important;
  }

  .jmd-fabs button {
    display: grid !important;
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    padding: 0 !important;
    place-items: center;
    overflow: hidden;
    border: 1px solid #ffffff70 !important;
    border-radius: 50% !important;
    font-size: 0 !important;
    line-height: 1 !important;
    box-shadow: 0 12px 30px #14181c4a !important;
  }

  .jmd-fabs button::before {
    font: 700 22px/1 Manrope, Arial, sans-serif;
  }

  .jmd-fabs button[data-open-book]::before { content: "📅"; }
  .jmd-fabs button[data-open-ai]::before { content: "✦"; color: #f5d56f; }

  .ai-mobile-cta,
  .sticky-refer {
    display: none !important;
  }

  .back-top,
  .ai-back-top {
    right: 14px !important;
    bottom: max(18px, env(safe-area-inset-bottom)) !important;
    width: 42px !important;
    height: 42px !important;
    z-index: 55 !important;
  }

  .jmd-ai {
    right: 14px !important;
    bottom: 190px !important;
    width: min(300px, calc(100vw - 28px)) !important;
  }
}

@media (max-width: 420px) {
  .site-header .nav-links.open,
  .jmd-shell-header .jmd-shell-links.open {
    left: 10px !important;
    right: 10px !important;
  }
}
