/**
 * NUM2BEST как приложение: нижние вкладки на телефоне, вырезы экрана (safe-area),
 * карточка установки. Подключается через partials/app-head.php.
 */

/* ---------- Вырез экрана сверху (iPhone «на экран Домой», статус-бар поверх) ---------- */
.site-topbar {
  padding-top: env(safe-area-inset-top, 0px);
}

@media (max-width: 719px) {
  .app-nav-panel.site-nav,
  .app-nav-panel.nx-nav {
    top: calc(3.35rem + env(safe-area-inset-top, 0px));
  }
}

/* В приложении не даём странице «резиново» тянуться и подсвечивать касания */
.nx-standalone body {
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Нижние вкладки ---------- */
.nx-tabbar {
  display: none;
}

@media (max-width: 719px) {
  .nx-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    padding: 0 max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px));
    background: rgba(12, 8, 22, 0.94);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(196, 181, 253, 0.22);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
  }

  .nx-tab {
    flex: 1 1 0;
    min-width: 0;
    min-height: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px 5px;
    color: rgba(214, 199, 240, 0.72);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    -webkit-tap-highlight-color: transparent;
    position: relative;
  }

  .nx-tab svg {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
  }

  .nx-tab span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .nx-tab.is-active {
    color: #fde68a;
  }

  .nx-tab.is-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 28%;
    right: 28%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, #c084fc, #f472b6);
  }

  .nx-tab:active {
    background: rgba(192, 132, 252, 0.1);
  }

  /* место под панель внизу страницы */
  .nx-has-tabbar body {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }

  /* кнопка ИИ-консультанта отчёта — над панелью */
  .nx-has-tabbar .nx-report-ai {
    bottom: calc(58px + 12px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .nx-has-tabbar .nx-report-ai-panel {
    max-height: min(520px, calc(100vh - 58px - 7rem - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px))) !important;
  }

  /* меню-«гамбургер» не уходит под панель */
  .nx-has-tabbar .app-nav-panel.site-nav,
  .nx-has-tabbar .app-nav-panel.nx-nav {
    max-height: calc(100vh - 3.5rem - 58px - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px));
  }
}

/* ---------- Карточка «Приложение NUM2BEST» ---------- */
.nx-install[hidden],
.nx-install [hidden] {
  display: none !important;
}

.nx-install-row {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.nx-install-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  flex: 0 0 auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.nx-install-title {
  margin: 0 0 0.2rem;
}

.nx-install-lede {
  margin: 0;
  font-size: 0.92rem;
}

.nx-install-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.nx-install-actions .btn {
  flex: 1 1 14rem;
  text-align: center;
}

.nx-install-ios,
.nx-install-android,
.nx-install-note {
  margin: 0.75rem 0 0;
  font-size: 0.86rem;
}
