/* Mobile overrides are kept last in the cascade so desktop experiments cannot
   accidentally reintroduce heavy artwork or awkward footer geometry. */
@media (max-width: 700px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden !important; overflow-x: clip !important; scroll-behavior: auto !important; }
  body { touch-action: manipulation; }
  .landing-page .landing-view { width: 100%; max-width: 100%; overflow-x: clip !important; }

  .landing-page .landing-mobile-explainer,
  .landing-page .huntly-hero-photo,
  .landing-page .huntly-setup-robot-image,
  .landing-page .huntly-economics-image { display: none !important; }

  .landing-page .landing-hero-inner { gap: 0 !important; padding: 48px 0 42px !important; }
  .landing-page .landing-how .landing-steps,
  .landing-page .landing-benchmark-contextual { grid-template-columns: minmax(0, 1fr) !important; gap: 0 !important; }
  .landing-page .landing-how { padding-bottom: 64px !important; }
  .landing-page .landing-how .landing-steps { margin-bottom: 0 !important; }
  .landing-page .landing-economics { padding-top: 64px !important; }

  .landing-page .landing-control-grid,
  .landing-page .huntly-control-laptop-image {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: clip !important;
  }
  .landing-page .huntly-control-laptop-image img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    transform: none !important;
  }

  .landing-page .landing-section:not(.landing-problem) {
    content-visibility: auto;
    contain-intrinsic-size: auto 760px;
  }

  .landing-page *, .landing-page *::before, .landing-page *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    backdrop-filter: none !important;
  }

  .landing-page .landing-footer { padding: 38px 0 34px !important; }
  .landing-page .landing-footer .landing-container {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    justify-items: start !important;
    justify-content: stretch !important;
    gap: 16px !important;
  }
  .landing-page .landing-footer .brand { margin: 0 !important; }
  .landing-page .landing-footer p { max-width: 290px; margin: 0 !important; line-height: 1.5; }
  .landing-page .landing-footer > div > div {
    display: grid !important;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    justify-content: stretch !important;
  }
  .landing-page .landing-footer > div > div a { min-width: 0; line-height: 1.35; }
  .landing-page a, .landing-page button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .landing-page .landing-nav { min-height: 58px !important; }
  .landing-page .landing-nav-inner {
    display: flex !important;
    min-height: 58px !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .landing-page .landing-nav nav { display: none !important; }
  .landing-page .landing-nav-actions {
    position: static !important;
    display: flex !important;
    width: auto !important;
    align-items: center;
    gap: 6px;
    border: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .landing-page .landing-login-cta,
  .landing-page .landing-nav-cta {
    display: inline-flex !important;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0 11px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
  }
  .landing-page .landing-login-cta {
    border: 1px solid #dce5e1;
    color: #23332c;
    text-decoration: none;
  }
  .landing-page .landing-nav-cta { min-height: 36px; box-shadow: none; }
  .landing-page.landing-session-active .landing-login-cta { display: none !important; }
}

@media (max-width: 760px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden !important; overflow-x: clip !important; }
  .huntly-app-v2 { max-width: 100%; overflow-x: clip; }
  .huntly-app-v2 *, .huntly-app-v2 *::before, .huntly-app-v2 *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    backdrop-filter: none !important;
  }
  .huntly-app-v2 .huntly-panel:not(.is-active) { display: none !important; }
  .huntly-app-v2 .huntly-desktop-extension-nav,
  .huntly-app-v2 .huntly-desktop-extension-panel { display: none !important; }
  .huntly-app-v2 .huntly-sidebar {
    position: sticky !important;
    transform: none !important;
    transition: none !important;
    box-shadow: none !important;
  }
  .huntly-app-v2 .huntly-sidebar nav {
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }
  .huntly-app-v2 .huntly-sidebar nav button,
  .huntly-app-v2 button,
  .huntly-app-v2 a {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .huntly-app-v2 .huntly-sidebar nav button { min-height: 44px; }
  .huntly-launch-hero .huntly-run-button,
  .huntly-settings-button { min-height: 50px; }
}

/* Mobile cabinet shell: one real header and a stable bottom navigation. */
.huntly-mobile-brand { display: none; }
.huntly-nav-text,.huntly-nav-text em { font: inherit; font-style: normal; }

@media (min-width: 761px) {
  .huntly-launch-hero.is-update-required .huntly-launch-actions,
  .huntly-launch-hero.is-disconnected .huntly-launch-actions {
    grid-template-columns: 254px 196px;
  }
  .huntly-launch-hero.is-update-required .huntly-run-button,
  .huntly-launch-hero.is-disconnected .huntly-run-button {
    gap: 14px;
    padding-right: 24px;
    padding-left: 24px;
  }
}

@media (max-width: 760px) {
  .huntly-app-v2 { display: block !important; min-height: 100dvh; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }

  .huntly-app-v2 .topbar {
    position: sticky !important;
    top: 0;
    z-index: 50;
    display: flex;
    width: 100%;
    height: 60px;
    min-height: 60px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5ebe8;
    padding: 0 16px !important;
    background: rgb(255 255 255 / 97%);
    box-shadow: 0 4px 18px rgb(20 52 40 / 5%);
  }
  .huntly-mobile-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #101716;
    font-size: 18px;
    letter-spacing: -.025em;
    text-decoration: none;
  }
  .huntly-mobile-brand .brand-mark,
  .huntly-mobile-brand .brand-mark img { display: block; width: 28px; height: 28px; }
  .huntly-app-v2 .huntly-profile { min-height: 42px; padding: 4px 7px 4px 4px; }
  .huntly-app-v2 .huntly-profile > span { width: 34px; height: 34px; }
  .huntly-app-v2 .huntly-profile > div { display: none !important; }
  .huntly-app-v2 .huntly-account-menu { position: fixed; top: 54px; right: 12px; width: min(250px, calc(100vw - 24px)); }

  .huntly-app-v2 .huntly-sidebar {
    position: fixed !important;
    inset: auto 0 0 !important;
    z-index: 60;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: calc(64px + env(safe-area-inset-bottom)) !important;
    padding: 5px 8px max(5px, env(safe-area-inset-bottom)) !important;
    border: 0 !important;
    border-top: 1px solid #dfe7e3 !important;
    background: rgb(255 255 255 / 98%) !important;
    box-shadow: 0 -8px 28px rgb(20 52 40 / 8%) !important;
  }
  .huntly-app-v2 .huntly-sidebar > .brand,
  .huntly-app-v2 .huntly-sidebar-bottom,
  .huntly-app-v2 .huntly-nav-label { display: none !important; }
  .huntly-app-v2 .huntly-sidebar nav {
    display: grid !important;
    width: 100%;
    height: 54px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    overflow: visible !important;
  }
  .huntly-app-v2 .huntly-sidebar nav button {
    display: flex;
    width: 100% !important;
    min-width: 0 !important;
    height: 54px !important;
    min-height: 54px !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 10px;
    padding: 4px 2px !important;
    color: #42534c !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
  }
  .huntly-app-v2 .huntly-sidebar nav button span { flex: 0 0 20px; width: 20px; height: 20px; }
  .huntly-app-v2 .huntly-sidebar nav button .huntly-nav-text > em { display: none; }
  .huntly-app-v2 .huntly-sidebar nav button svg { width: 19px; height: 19px; }
  .huntly-app-v2 .huntly-sidebar nav button.active { background: #eaf8f1; color: #078c55; }

  .huntly-app-v2 .app-main { width: 100%; min-width: 0; }
  .huntly-app-v2 .huntly-page { padding-top: 18px !important; padding-bottom: 24px !important; }

  .huntly-launch-hero.is-mobile-control {
    border-color: #d8e9e1 !important;
    background: linear-gradient(145deg, #fff 0%, #f3fbf7 100%) !important;
  }
  .huntly-launch-hero.is-mobile-control .huntly-launch-label { color: #087c57 !important; }
  .huntly-launch-hero.is-mobile-control .huntly-launch-label i { background: #0ca873 !important; box-shadow: 0 0 0 6px rgb(12 168 115 / 10%) !important; }
  .huntly-launch-hero.is-mobile-control .huntly-settings-button[hidden] { display: none !important; }
  .huntly-readiness.is-mobile-note > i { background: #64748b; box-shadow: 0 0 0 5px rgb(100 116 139 / 10%); }
  .huntly-readiness.is-mobile-note strong { color: #334139; }
}
