/* ═══════════════════════════════════════════════════════════════════════════
   Jack-LM text-selection policy  (2026-09-14)
   ═══════════════════════════════════════════════════════════════════════════
   Why: dragging onto the Drawing Table -- or panning, lassoing, resizing a
   panel -- kept starting a text highlight, and the UI could not tell which
   the user meant. Text selection is therefore OFF by default and ON only
   where people type or copy.

   How it reaches everything: user-select is inherited (Blink/WebKit), and
   `auto` resolves to the parent's value (Firefox), so `none` on html/body
   flows down to every element that does not set its own. The opt-ins in
   section 3 set `text` on a container and their children inherit it, so no
   `X *` selectors are needed.

   Order: each page links this file next to its shared stylesheets, before
   its own <style> block, so page rules for specific classes still apply.
   On several pages header.css loads just before this file; it only sets
   `none` on chrome, the same as the default here, so nothing conflicts.

   One <link> per DOCUMENT: CSS does not cross an iframe, so the app shell
   (app-shell.html) and the page it frames (/head-office, /drawingtable/N,
   /marvin, ...) each include this file. A new page must add the include,
   and the dragselect.js include right after it.

   Hooks:
     .bl-selectable     any element whose text people copy
     .bl-noselect       chrome (buttons, chips) inside a selectable block
     html.bl-dragging   set by static/shared/dragselect.js while ANY drag is
                        in progress. dragselect.js INJECTS the one drag rule
                        itself (none !important on body and on every opt-in
                        selector of section 3), and leaves inputs, textareas,
                        selects and contenteditable editable (Safari will not
                        take a drop or keep a caret in a field set to none).
                        There is deliberately NO drag rule in this file: keep
                        exactly one. When you add a selector to section 3,
                        add it to the list in dragselect.js as well.
   ═══════════════════════════════════════════════════════════════════════════ */

/* 1. Default: no selection, no iOS long-press callout on chrome. */
html,
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* 2. Where people type. Safari will not place a caret or select inside a
      field whose ancestor is unselectable unless the field says so. */
input,
textarea,
select,
[contenteditable]:not([contenteditable="false"]),
[contenteditable]:not([contenteditable="false"]) * {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* 3. Where people copy. Add new surfaces here (and to dragselect.js), or tag
      them .bl-selectable. */
.bl-selectable,
pre, code, kbd, samp,
.ai-msg-user, .ai-msg-assistant,    /* Jack chat, app shell (jack.js renderAll) */
.ai-msg-body,                       /* Head Office + Drawing Table chat panes */
.ai-bubble,                         /* Head Office full-page AI chat */
.det-txt,                           /* RFI question/response, SD notes, SI instruction, calendar description */
.det-text, .msg-body, .chat-bubble, /* /m detail text, message body, chat */
.mf-md-rendered,                    /* My Files markdown viewer */
.dt-md-body,                        /* Drawing Table .md note window (rendered, source, editor) */
.cr-seg-text,                       /* Conference Room transcript text (not the click-to-seek row) */
.log-preview-body {                 /* Head Office log preview */
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* 3b. Chrome inside an opted-in block stays off. Same or higher specificity
       than section 3 and later in source, so it wins. */
.ai-msg-label,
.jack-thoughts-toggle,
.bl-selectable button,
.bl-selectable .btn,
.bl-noselect {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
