/* Keep scrolling app content outside the iOS status bar and sensor area.
   Browser tabs without an inset retain their existing layout. */
:root {
  --app-safe-top: env(safe-area-inset-top, 0px);
  --app-safe-bottom: env(safe-area-inset-bottom, 0px);
  scroll-padding-top: calc(var(--app-safe-top) + 12px);
}
body { padding-top: var(--app-safe-top); }
/* Padding alone scrolls away. An opaque fixed surface protects the status bar. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: var(--app-safe-top);
  background: #fff;
  pointer-events: none;
  z-index: 2147483647;
}
.chat-panel { top: var(--app-safe-top); }
@media (max-width: 700px) {
  /* The panel itself now starts below the safe area; don't count it twice. */
  .chat-panel .chat-head { padding-top: 10px; }
}
dialog {
  position: fixed;
  top: calc(var(--app-safe-top) + 12px);
  bottom: auto;
  margin: 0 auto;
  overscroll-behavior: contain;
  max-height: calc(100dvh - var(--app-safe-top) - var(--app-safe-bottom) - 24px);
}
.call-panel {
  max-height: calc(100dvh - var(--app-safe-top) - var(--app-safe-bottom) - 32px);
}
