/* Application surfaces only: HUD and toolbar are mounted outside #cm-root.
 * manipulation removes double-tap zoom while retaining pan/pinch. Do not set
 * touch-action on descendants: canvases keep their narrower gesture contracts.
 */
:where(#cm-root, #cm-title, .cm-status-bar, .cm-toolbar, .cm-dialog, .cm-sheet, .cm-settings) {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Native text editing, manual copy/paste, help and diagnostic text remain
 * selectable. data-selectable also gives future room codes an explicit opt-in.
 * touch-action is deliberately unchanged: these surfaces still allow pinch.
 */
:where(#cm-root, #cm-title, .cm-status-bar, .cm-toolbar, .cm-dialog, .cm-sheet, .cm-settings)
:is(input, textarea, [contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"],
    [data-selectable="true"], .cm-help-shell, .cm-dialog__message, .cm-vs5-entry-notice,
    .cm-vs5-exchange-steps, .cm-title__note, .int-rh2-field-fallback,
    [role="alert"], [role="status"]) {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* A help panel or live-status container can contain ordinary game buttons. */
:where(#cm-root, #cm-title, .cm-status-bar, .cm-toolbar, .cm-dialog, .cm-sheet, .cm-settings)
:is(button, [role="button"]),
:where(#cm-root, #cm-title, .cm-status-bar, .cm-toolbar, .cm-dialog, .cm-sheet, .cm-settings)
:is(button, [role="button"]) * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
