/* =========================================================
   V269 — final mobile Edit Profile geometry
   The centered editor does not need the full iPhone safe-area inset inside
   its own footer. Keep the form scrollable and the action dock in-frame.
   ========================================================= */

@media (max-width: 640px) {
  .profile-overlay:has(#profileEditSection:not(.hidden)) {
    align-items: center !important;
    justify-content: center !important;
    padding: 10px !important;
    overflow: hidden !important;
  }

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

  .profile-modal:has(#profileEditSection:not(.hidden)) #profileEditSection,
  .profile-modal.profile-editing-active #profileEditSection {
    display: grid !important;
    grid-template-rows: 46px minmax(0, 1fr) auto !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

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

  .profile-modal:has(#profileEditSection:not(.hidden)) .profile-edit-scroll,
  .profile-modal.profile-editing-active .profile-edit-scroll {
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 0 14px 8px !important;
  }

  .profile-modal:has(#profileEditSection:not(.hidden)) .profile-edit-persistent-actions,
  .profile-modal.profile-editing-active .profile-edit-persistent-actions {
    padding: 6px 14px 8px !important;
  }
}
