/*! touch.css 1.0.1 | DJ2000-UK/app-workbench
 *
 * Taps, long presses and scrolling behave as in an app from the App Store
 * (DJ, 2026-12-01); see docs/TOUCH.md. With zoom/no-zoom.css (no pinch, no
 * double-tap zoom) these are the iPhone and PWA fixes every app takes.
 *
 * - No grey flash on a tap. The highlight colour is inherited, so on html it
 *   reaches every element, including a div or a card with a click handler.
 * - A long press never selects words, opens the callout (Copy, Look Up,
 *   Share) or lifts a link or a picture to drag it. Fields still do all of
 *   that, and so does anything marked .selectable (an address to copy).
 * - The page's own bounce, and nothing more. Up and down, contain: the page
 *   rubber-bands past its top and its foot and springs back, as a list in an
 *   iPhone app does (Android's stretch too), but Chrome on Android pulls
 *   nothing down to reload. none stopped the page dead at its ends (1.0.0),
 *   and DJ disliked it the same day (2026-12-01). The app's own pull to
 *   refresh (refresh/) takes a pull down from the top before the bounce
 *   starts. Sideways, none: the page never wobbles left and right, and a
 *   sideways swipe never goes back a page in Chrome. A box that scrolls inside
 *   the page (a sheet, a list) keeps its own scrolling and bounce, and
 *   overscroll-behavior: contain there keeps a flick at its end from moving
 *   the page behind.
 *
 * Load it straight after zoom/no-zoom.css and fields/fields.css, before every
 * other stylesheet. Its layer, djcns-touch, is then declared early, so it is
 * weak: an app rule that needs something else (a hold's own user-select, a
 * shelf's overscroll-behavior-x) wins over it. The name is its own, not a part
 * of djcns, so it leaves the order of an app's other layers as it was.
 */
@layer djcns-touch {
  html {
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-x: none;
    overscroll-behavior-y: contain;
  }
  body {
    overscroll-behavior-x: none;
    overscroll-behavior-y: contain;
  }
  body,
  body * {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
  a,
  img {
    -webkit-user-drag: none;
  }
  input,
  textarea,
  select,
  [contenteditable]:not([contenteditable="false"]),
  [contenteditable]:not([contenteditable="false"]) *,
  .selectable,
  .selectable * {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
  }
}
