/* PWA «Домой»: flex-оболочка — меню всегда внизу (iPhone 15 Pro Max и др.) */
body.is-standalone-pwa {
  overflow: hidden;
  height: 100%;
  height: 100dvh;
  height: -webkit-fill-available;
}

body.is-standalone-pwa .ml-shell {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: var(--sat, env(safe-area-inset-top, 59px)) var(--sar, env(safe-area-inset-right, 0px))
    var(--sab, env(safe-area-inset-bottom, 34px)) var(--sal, env(safe-area-inset-left, 0px));
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  pointer-events: none;
}

body.is-standalone-pwa .ml-shell__main {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
  pointer-events: auto;
}

body.is-standalone-pwa .ml-shell__main > #app,
body.is-standalone-pwa .ml-shell__main > #screenAi,
body.is-standalone-pwa .ml-shell__main > #screenWork,
body.is-standalone-pwa .ml-shell__main > #screenCommunity,
body.is-standalone-pwa .ml-shell__main > #screenProfile {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

body.is-standalone-pwa .ml-shell__main > #app.app-shell:not(.hidden) {
  display: block;
  position: absolute;
  inset: 0;
  padding: 8px 14px 10px;
  min-height: 0;
  height: auto;
  max-height: none;
}

body.is-standalone-pwa .ml-shell #tabBar {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  flex: 0 0 auto;
  margin: 0;
  z-index: 2;
  padding: 6px 8px 2px !important;
  pointer-events: auto;
  background: linear-gradient(
    180deg,
    transparent 0%,
    color-mix(in srgb, var(--theme-bg) 94%, transparent) 40%,
    var(--theme-bg) 100%
  ) !important;
}

body.is-standalone-pwa[data-screen="community"] .ml-shell #tabBar {
  display: none !important;
}

body.is-standalone-pwa .header h1 {
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

body.is-standalone-pwa .header-brand-logo.splash-logo {
  font-size: clamp(0.44rem, 3vw, 0.62rem);
  max-width: min(48vw, 176px);
}

body.is-standalone-pwa .header p,
body.is-standalone-pwa .header p#subtitle {
  font-size: 0.74rem;
  margin-top: 4px;
  padding: 5px 8px;
}

body.is-standalone-pwa .pro-badge {
  font-size: 0.56rem;
  padding: 2px 6px;
}

body.is-standalone-pwa .ml-shell__main > .screen-profile.is-active {
  padding: 12px 16px calc(var(--ml-tab-bar-h, 72px) + var(--sab, env(safe-area-inset-bottom, 34px)) + 20px);
  box-sizing: border-box;
}

body.is-standalone-pwa .ml-shell__main > .screen-ai.is-active,
body.is-standalone-pwa .ml-shell__main > .screen-work.is-active {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
}
