/* =========================================================
   V266 — compact conversation and profile editor surfaces
   Keep both menus centered with breathing room around the viewport while
   preserving their internal scroll regions and the profile action dock.
   ========================================================= */

/* Phones only: leave a clear margin above and below both menus. */
@media (max-width: 640px) {
  .dm-modal:has(#dmConversationPanel:not(.hidden)) {
    height: min(80dvh, 680px) !important;
    max-height: calc(100dvh - 32px) !important;
  }

  /* The conversation is centered, so the home-indicator safe-area inset is
     already outside the card. Do not turn it into a blank strip under the
     security note. */
  #dmModal:has(#dmConversationPanel:not(.hidden)) .dm-security-note {
    padding: 3px 12px 4px !important;
    line-height: 1.2 !important;
  }

  .profile-modal:has(#profileEditSection:not(.hidden)),
  .profile-modal.profile-editing-active,
  .profile-modal.plus-profile-shell-active.profile-editing-active {
    height: min(80dvh, 680px) !important;
    max-height: calc(100dvh - 32px) !important;
  }

  /* Compact the heading without removing the close button or the dock. */
  .profile-modal:has(#profileEditSection:not(.hidden)) #profileEditSection > h2,
  .profile-modal.profile-editing-active #profileEditSection > h2 {
    min-height: 52px !important;
    padding: 10px 64px 6px 18px !important;
    font-size: 21px !important;
    line-height: 1.05 !important;
  }
}
