/* USTA — app-shell behaviour, shared by both portals.
 *
 * Inside a WebView the prototypes are an APP, but WebKit still treats them as a
 * web page: a long press selects a heading, selection handles appear, and the
 * iOS callout menu offers Copy/Look Up over ordinary labels. Nothing in a native
 * app does that, and it makes the product feel like a website in a frame.
 *
 * The rule below is deliberately stated as "nothing is selectable, then hand it
 * back where it matters" rather than the reverse. An allow-list would need every
 * new screen to remember to opt out; this way a new heading is inert by default
 * and only genuine input is interactive.
 */

html,
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* Suppresses the iOS long-press callout (Copy / Look Up / Share). */
  -webkit-touch-callout: none;
  /* Stops the grey flash on tap; the designs have their own pressed states. */
  -webkit-tap-highlight-color: transparent;
}

/* ── the exceptions, and only these ───────────────────────────────────────
 * Anything a user types into must still behave exactly like a text field:
 * place the caret, select, extend the selection with the handles, cut, paste.
 * Turning selection off on an <input> does not just remove the highlight — on
 * iOS it makes the field genuinely awkward to correct a typo in.
 *
 * `[contenteditable]` is included so a future rich-text field is covered
 * without anyone having to remember this file exists. */
input,
textarea,
select,
[contenteditable],
[contenteditable] * {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* An explicit opt-in for anything that should stay selectable in future — a
 * support transcript, a legal document, an address the user may want to copy by
 * hand. Nothing uses it today; it exists so the escape hatch is a class rather
 * than someone reverting the rule above. */
.usta-selectable,
.usta-selectable * {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* Images in an app are illustrations, not assets to drag out of the page. */
img,
svg {
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
}

/* Deliberately NOT disabled here: scrolling, tapping, focus rings, keyboard
 * behaviour and the accessibility tree. `user-select` affects selection only —
 * screen readers still read every one of these elements, and every control
 * keeps its role, label and tab order. */
