/* Attachment downloads stay distinct from optional video-player actions. */
#tool .direct-videos > .direct-video:first-child { border-top: 0; padding-top: 0; }
#tool .quality-options { display: grid; grid-template-columns: 1fr; gap: 12px; }
#tool .quality-option { min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 2px; }
#tool .quality-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; min-height: 58px; background: var(--accent); border-color: var(--accent); color: #fff; }
#tool .quality-link:hover { background: #383ba1; border-color: #383ba1; }
#tool .quality-label { align-items: flex-start; flex-direction: column; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
#tool .quality-label strong, #tool .quality-action { color: #fff; }
#tool .quality-label > span { color: #eeefff; }
#tool .quality-action { white-space: nowrap; font-weight: 750; }
#tool .quality-open-link { align-self: flex-end; display: inline-flex; align-items: center; min-height: 44px; padding: 7px 3px; color: var(--accent); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
#tool .quality-open-link[aria-disabled=true] { opacity: .5; cursor: default; }
#tool .download-save-hint { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 16px 0 8px; }
#tool .photo-share-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 5px 0 10px; }
#tool .photo-share-actions[hidden] { display: none; }
#tool .photo-share-button { min-height: 44px; border-color: var(--accent); color: var(--accent); font-weight: 700; }
#tool .photo-share-cancel { min-height: 44px; }
#tool .photo-share-status { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
#tool .photo-share-button:disabled { opacity: .65; cursor: default; }
/* Put the iPhone's Photos route before the ordinary file download. */
#tool .save-quality-heading { margin: 3px 0 7px; font-size: 14px; line-height: 1.6; font-weight: 750; overflow-wrap: anywhere; }
#tool .apple-save-options .photo-share-actions { margin: 0 0 10px; }
#tool .apple-save-options .photo-share-button { width: 100%; min-height: 52px; background: var(--accent); border-color: var(--accent); color: #fff; justify-content: center; }
#tool .apple-save-options .photo-share-button:hover:not(:disabled) { background: #383ba1; border-color: #383ba1; }
#tool .apple-save-options .photo-share-actions[data-photo-availability=unsupported] .photo-share-button,
#tool .apple-save-options .photo-share-actions[data-photo-availability=load-error] .photo-share-button { background: #eef0f8; border-color: #d1d6e5; color: #50596c; opacity: 1; }
#tool .apple-save-options .quality-link,
#tool .apple-save-options > #download-link { display: flex; justify-content: center; min-height: 48px; background: #fff; border: 1px solid var(--accent); color: var(--accent); }
#tool .apple-save-options .quality-link .quality-label { display: none; }
#tool .apple-save-options .quality-link .quality-action { color: var(--accent); }
#tool .apple-save-options .quality-open-link { margin-bottom: 5px; }
/* Finger-sized controls for downloader and image results. */
@media (pointer: coarse), (max-width: 680px) {
  #download-form #paste-button { min-width: 44px; min-height: 44px; justify-content: center; margin-right: 3px; }
  #download-form #clear-link { min-height: 44px; min-width: 76px; text-align: left; }
  #download-form #form-feedback { line-height: 1.7; }
  #tool .direct-preview-button, #tool #refresh-links, #tool #preview-file-button,
  #tool #retry-status, #tool #start-over, #thumbnail-results .copy-button,
  #thumbnail-form #thumbnail-clear { min-height: 44px; }
  #tool .quality-link { min-height: 58px; }
  #tool .quality-open-link { min-height: 44px; }
  #tool .direct-media:not(.without-thumbnail) { display: block; }
  #tool .direct-media:not(.without-thumbnail) img { aspect-ratio: 16 / 9; max-height: 220px; object-fit: contain; }
  #tool .direct-media:not(.without-thumbnail) .direct-preview-button { width: 100%; margin-top: 10px; }
  #thumbnail-form .form-actions button[type=submit] { flex: 1; }
}
@media (max-width: 360px) {
  #tool .quality-link { grid-template-columns: 1fr; gap: 7px; }
}
