/* The shell is painted in its final state; only deliberate hover/toggle actions animate. */
html:not(.theme-ready) .modern-navbar,
html:not(.theme-ready) .modern-navbar * {
  transition: none !important;
  animation: none !important;
}
.modern-bottom-nav { animation: none; }

.pwa-status-spacer { display: none; }
/* The system area reveals the page itself. A separate fixed blur turns light
   content into an opaque-looking strip and flattens the chat wallpaper. */
.pwa-status-glass { display: none !important; }

/* viewport-fit also affects Safari tabs in landscape, not just installed PWAs. */
html:not(.pwa-standalone) body {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
html:not(.pwa-standalone) .modern-bottom-nav {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* iOS supplies the actual insets. Desktop and ordinary browser tabs remain unchanged. */
html.pwa-standalone {
  --app-safe-top: env(safe-area-inset-top, 0px);
  --app-safe-bottom: env(safe-area-inset-bottom, 0px);
}
html.pwa-standalone .pwa-status-spacer {
  display: block;
  height: var(--app-safe-top);
}
html.pwa-standalone .modern-navbar,
html.pwa-standalone .marquee-container {
  top: var(--app-safe-top);
}
html.pwa-standalone body {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
html.pwa-standalone .modern-bottom-nav {
  bottom: 0;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
html.pwa-standalone .mobile-nav-menu-panel {
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
}
html.pwa-standalone .modal {
  padding-top: var(--app-safe-top);
  padding-bottom: var(--app-safe-bottom);
}
@media (max-width: 767px) {
  /* Initial controls respect the safe area; scrolling content can pass below it. */
  html.pwa-standalone .modern-navbar { position: relative; top: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .modern-navbar *, .modern-bottom-nav, .modern-bottom-nav * {
    animation: none !important;
    transition: none !important;
  }
}
