/* Phase 14ax: overlay sizing + scroll stability fixes */

/* Make generic overlay respect sticky top header + bottom nav on mobile. */
#sv-ov{
  box-sizing: border-box;
  padding-top: calc(var(--sv-ov-top, 0px) + env(safe-area-inset-top, 0px) + 10px);
  padding-bottom: calc(var(--sv-ov-bot, 0px) + env(safe-area-inset-bottom, 0px) + 10px);
}

/* Ensure messenger panel never sits underneath header/bottom bars */
#sv-ov .sv-msgPanel{
  height: auto !important;
  max-height: calc(100dvh - var(--sv-ov-top, 0px) - var(--sv-ov-bot, 0px) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px) !important;
}

/* When the overlay is used on small screens, keep it comfortably within the visible area */
@media (max-width: 920px){
  #sv-ov{ align-items: flex-start !important; justify-content: center !important; }
  #sv-ov .sv-msgPanel{ width: min(96vw, 520px) !important; }
}
