/* =========================================================
   V268 — mobile spacing pass
   Remove iPhone safe-area padding from centered cards and make the profile
   editor/header visibly shorter. Desktop remains untouched.
   ========================================================= */

@media (max-width: 640px) {
  /* The centered conversation card already sits inside the safe area. */
  #dmModal:has(#dmConversationPanel:not(.hidden)) .dm-composer {
    padding-bottom: 8px !important;
  }

  #dmModal:has(#dmConversationPanel:not(.hidden)) .dm-security-note {
    padding: 3px 12px 4px !important;
    margin-bottom: 0 !important;
    line-height: 1.2 !important;
  }

  /* The contact-info screen had the same safe-area strip below its security
     card, and its compact header should not reserve a full toolbar row. */
  #dmModal.dm-showing-contact-info .dm-contact-info-header {
    min-height: 52px !important;
    padding: 6px 12px 4px !important;
  }

  #dmModal.dm-showing-contact-info .dm-contact-info-scroll {
    padding: 8px 10px 8px !important;
  }

  /* Make Edit Profile unmistakably shorter while retaining its grid dock. */
  .profile-modal:has(#profileEditSection:not(.hidden)),
  .profile-modal.profile-editing-active,
  .profile-modal.plus-profile-shell-active.profile-editing-active {
    height: min(74dvh, 640px) !important;
    max-height: calc(100dvh - 40px) !important;
    padding: 0 !important;
  }

  .profile-modal:has(#profileEditSection:not(.hidden)) #profileEditSection > h2,
  .profile-modal.profile-editing-active #profileEditSection > h2 {
    min-height: 48px !important;
    margin: 0 !important;
    padding: 8px 60px 4px 16px !important;
    font-size: 20px !important;
    line-height: 1.05 !important;
  }
}
