/* Scrollers keep single-finger panning and exclude pinch zoom. Zero-specificity
   defaults let ink, text and image gestures keep their component touch actions. */
@media (any-pointer: coarse) {
  :where(html, html *) {
    touch-action: pan-x pan-y;
  }
}

:where(html.touch-zoom-locked, html.touch-zoom-locked *) {
  touch-action: pan-x pan-y;
}

/* These direct manipulation surfaces must retain their pointer streams instead
   of being cancelled when a browser mistakes a drag for page scrolling. */
html.touch-zoom-locked :where(
  #drawing,
  .text-box-surface.is-create-mode,
  .text-box:not(.is-editing),
  .text-box-handle,
  .text-box-toolbar [data-text-action="move"],
  .paper-images-enabled .paper-image,
  .paper-images-enabled .paper-image-resize,
  .paper-image-rotate,
  .paper-image-recover,
  .paper-image-controls
) {
  touch-action: none;
}

html.touch-zoom-locked :where(.paper-image-opacity input) {
  touch-action: pan-x;
}
