/* Touch controls and form sizing shared by the mobile and tablet editions. */
@media (max-width: 1100px) {
  .utility .icon-button,
  .utility .search-link,
  .save-button,
  .reader-control {
    min-width: 44px;
    min-height: 44px;
  }

  .utility .search-link { align-items: center; justify-content: center; }
  .edition,
  .footer-sections a,
  .footer-bottom a,
  .article-breadcrumb a,
  .studio-breadcrumb a,
  .studio-flow-actions > .text-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .desk-search button { min-height: 44px; }

  /* Keep the larger writing type; raise only the small metadata controls. */
  .collection-sort select,
  .desk-filters select,
  .desk-search input,
  .copy-link-panel input,
  #editor-form .studio-field-grid input,
  #editor-form .studio-field-grid select,
  #editor-form .studio-photo-panel select {
    font-size: 16px;
  }

  .copy-link-panel input { min-height: 44px; }
  .toast { bottom: max(16px, env(safe-area-inset-bottom)); }
}

/* Native dialogs remain reachable with a short landscape viewport or keyboard. */
dialog {
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-width: 400px) {
  .dialog-actions { flex-direction: column; }
  .dialog-actions .button { width: 100%; min-height: 44px; }
}
