/* Пояснение: Последние уточнения мобильной нижней панели и отступов у края экрана.
   Порядок подключения смотрите в index.html: при равном приоритете побеждает более позднее правило.
   @media ограничивает правило размером/режимом экрана; @media print относится к печати. */
/* SMK Tool 0.7.2 · P7 · Android gesture-bar integration.
   Purely visual: styles only the existing mobile #smkPrimaryNav.
   Supports Chrome 135+ edge-to-edge; older browsers keep a matching dark fallback.
*/
@media screen and (max-width: 900px) {
  :root {
    --smk-gesture-dock-color: #100e1d;
    /* Prefer the fixed maximum inset, avoiding dynamic padding reflow
       when Chrome's lower toolbar retracts. Fallback for older browsers. */
    --smk-gesture-max-bottom: env(safe-area-max-inset-bottom, env(safe-area-inset-bottom, 0px));
  }

  html, body { background-color: var(--smk-gesture-dock-color); }

  /* The original dock stays at the viewport bottom. Its background alone
     extends under Android's system gesture indicator when allowed. */
  body > #smkPrimaryNav.smk-mobile-dock {
    bottom: calc(env(safe-area-inset-bottom, 0px) - var(--smk-gesture-max-bottom)) !important;
    padding-bottom: calc(7px + var(--smk-gesture-max-bottom)) !important;
    background: linear-gradient(180deg,
      rgba(29, 25, 44, .77) 0%,
      rgba(17, 15, 31, .92) 70%,
      rgba(16, 14, 29, .98) 100%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(120%) !important;
    backdrop-filter: blur(24px) saturate(120%) !important;
  }

  /* Keep the bottom result actions above the real dock including its safe area.
     No change to the existing action buttons or their behavior. */
  body.smk-unified-active.smk-view-routes #controlsWrap.show {
    bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media screen and (max-width: 370px) {
  body.smk-unified-active.smk-view-routes #controlsWrap.show {
    bottom: calc(81px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media print {
  body > #smkPrimaryNav.smk-mobile-dock { display: none !important; }
}

/* P7.1 · Restore the original mobile background.
   The Android navigation fallback colours html/body, while .bg has z-index:-1.
   Keep that negative layer inside body's stacking context so it is painted
   above the body background, without changing the dock or other UI layers.
   Use the mobile wallpaper whenever the responsive mobile layout is active
   (also when testing at high browser zoom in landscape orientation). */
@media screen and (max-width: 900px) {
  body {
    isolation: isolate;
  }
  body > .bg {
    opacity: 1 !important;
    background:
      linear-gradient(180deg, rgba(5, 5, 11, .57), rgba(4, 4, 10, .78)),
      url('gallery/main-bg-mobile.png') center / cover no-repeat !important;
  }
}
