/* iPhone/PWA: Dialoge dürfen nie unter der festen unteren Navigation enden. */
@media (max-width:700px) {
  .modal-backdrop { z-index:100; }
  .modal-backdrop .modal { box-sizing:border-box; width:100%; max-width:100%; max-height:calc(100dvh - 8px); overflow-x:hidden; -webkit-overflow-scrolling:touch; }
  .modal-backdrop .modal * { min-width:0; box-sizing:border-box; }

  /* Auftrags- und Angebotsentwürfe: alle Bereiche untereinander statt einer zu breiten Tabelle. */
  .modal.modal-order-draft,.modal:has(.order-draft-form) { padding:16px; border-radius:18px 18px 0 0; }
  .modal.modal-order-draft .order-draft-form,.modal:has(.order-draft-form) .order-draft-form { width:100%; min-width:0; grid-template-columns:minmax(0,1fr)!important; }
  .modal.modal-order-draft .order-draft-main,.modal:has(.order-draft-form) .order-draft-main,
  .modal.modal-order-draft .order-draft-side,.modal:has(.order-draft-form) .order-draft-side,
  .modal.modal-order-draft .order-draft-card,.modal:has(.order-draft-form) .order-draft-card { width:100%; min-width:0; }
  .modal.modal-order-draft .order-draft-heading,.modal:has(.order-draft-form) .order-draft-heading,
  .modal.modal-order-draft .order-draft-side,.modal:has(.order-draft-form) .order-draft-side { display:grid; grid-template-columns:1fr; }
  .modal.modal-order-draft .order-lines-card .product-meta,.modal:has(.order-draft-form) .order-lines-card .product-meta { text-align:left; }
  .modal.modal-order-draft .selected-order-line,.modal:has(.order-draft-form) .selected-order-line { grid-template-columns:1fr!important; gap:10px; }
  .modal.modal-order-draft .selected-order-line label,.modal:has(.order-draft-form) .selected-order-line label { width:100%; }
  .modal.modal-order-draft .order-draft-footer,.modal:has(.order-draft-form) .order-draft-footer { position:sticky; bottom:0; margin:0 -16px; padding:12px 16px calc(14px + env(safe-area-inset-bottom)); background:#fff; box-shadow:0 -8px 18px rgba(17,32,54,.10); z-index:3; }
  .modal.modal-order-draft .order-draft-footer .primary,.modal:has(.order-draft-form) .order-draft-footer .primary,
  .modal.modal-order-draft .order-draft-footer .secondary,.modal:has(.order-draft-form) .order-draft-footer .secondary { width:100%; min-height:48px; }
}
