/* App-wide phone fixes shared by every page (v5 responsive pass, lane R-SHELL).
   Lives apart from output.css (same precedent as gantt.css / spreadsheet.css) so these rules
   need no Tailwind rebuild. Every colour is a theme token from input.css.

   CONTRACT FOR PER-APP LANES
   1. Hover-only controls. A control that is `opacity-0 group-hover:opacity-100` (or
      `hidden group-hover:flex`) is unreachable on a phone. Add ONE attribute and it is
      always shown on touch devices, desktop untouched:
        data-touch-visible            -> opacity:1, pointer-events:auto, visibility:visible
        data-touch-show="flex|inline-flex|block|grid|inline-block"
                                      -> also forces that display value (for `hidden` controls)
      Both apply only under (hover: none), (pointer: coarse).
   2. Listings that use components/listing/table.html stay a real table on phones (horizontal
      scroll inside the table's own wrapper); with no saved choice a phone opens the card view.
   3. Bottom-pinned UI uses the dvh helpers: `.app-shell-h`, `.app-shell-min-h`, and
      `--safe-bottom` (env(safe-area-inset-bottom)).
   4. (All widths, not phone-only.) A paginated listing's {% listing_results %} region shows a
      skeleton while htmx loads its next page -- see the section at the end of this file. */

:root {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --vv-bottom: 0px; /* on-screen keyboard height, written by lib/viewport-inset.js */
}

/* dvh with a vh fallback: 100vh is taller than the visible area while a mobile URL bar shows */
.app-shell-h { height: 100vh; height: 100dvh; }
.app-shell-min-h { min-height: 100vh; min-height: 100dvh; }

/* 1. hover-only controls on touch devices */
@media (hover: none), (pointer: coarse) {
  [data-touch-visible] { opacity: 1 !important; pointer-events: auto !important; visibility: visible !important; }
  [data-touch-show="flex"] { display: flex !important; }
  [data-touch-show="inline-flex"] { display: inline-flex !important; }
  [data-touch-show="block"] { display: block !important; }
  [data-touch-show="inline-block"] { display: inline-block !important; }
  [data-touch-show="grid"] { display: grid !important; }
}

/* 5 + 6. toasts and the jobs tray respect the safe area; below sm the toast column spans the
   16px gutters and stacks ABOVE the tray pill instead of covering it */
#app-snackbar-root { bottom: calc(1rem + var(--safe-bottom)); }
[data-jobs-tray] { bottom: calc(1rem + var(--safe-bottom)); }
@media (max-width: 639.98px) {
  #app-snackbar-root { left: 1rem; right: 1rem; max-width: none; }
  body.shell-jobs-tray #app-snackbar-root { bottom: calc(3.25rem + var(--safe-bottom)); }
  div[data-jobs-panel] { width: calc(100vw - 2rem); }
  /* TeamChat is a full-screen sheet on phones: keep its composer above the on-screen keyboard */
  #teamchat-panel { bottom: var(--vv-bottom); }
}

/* 6b. Team chat composer vs the jobs tray (re-audit 2026-11-13). The tray pill (z-130, bottom-right) sat ON the
   composer's send button: on the full-page team chat (teamchat/full.html) and inside the open floating widget
   (#teamchat-panel, z-50, bottom-right on sm+, full screen on a phone). Same z-layers (docs/BACKGROUND_JOBS.md §8),
   the tray is never hidden; only its POSITION moves while a team chat composer owns that corner:
     - full page, and the widget on a phone (full screen): the pill and the toasts stack above the composer;
     - the widget on sm+: the pill moves to the LEFT of the 380px widget, so it covers nothing inside it.
   --tc-composer-clear = the composer row (26px controls + padding + the reply/attachment strip it can grow) + a gap.
   `shell-tc-panel` is DOUBLED on purpose: it stands for the old `#teamchat-panel.flex` test, which outweighed the Office
   rules of section 7 on the same element, so the open widget still wins on the Office page (a widget on a phone covers it). */
:root { --tc-composer-clear: 5rem; }
body.shell-tc-full [data-jobs-tray],
body.shell-tc-full #app-snackbar-root { bottom: calc(var(--tc-composer-clear) + var(--safe-bottom)); }
@media (min-width: 640px) {
  body.shell-tc-panel.shell-tc-panel:not(.shell-tc-full) [data-jobs-tray] { right: calc(1rem + 380px + 0.75rem); }
}
@media (max-width: 639.98px) {
  body.shell-tc-panel.shell-tc-panel [data-jobs-tray] { bottom: calc(var(--tc-composer-clear) + var(--safe-bottom)); }
  body.shell-tc-full.shell-jobs-tray #app-snackbar-root,
  body.shell-tc-panel.shell-tc-panel.shell-jobs-tray #app-snackbar-root { bottom: calc(var(--tc-composer-clear) + 2.25rem + var(--safe-bottom)); }
}

/* 7. The Office editor page (documents/office_editor.html). The Collabora frame fills the viewport down to
   the bottom edge and ends in its own 33px status bar (zoom controls at the right), which the bottom-right
   floating UI (jobs tray pill z-130, toast column z-2000) used to sit on top of. While the frame is on the
   page both stack above that bar instead. 2.75rem = the bar's 33px + a gap (5.5rem for a workbook, below); the bar height is Collabora's
   (`#toolbar-down`), re-measured on every upgrade (docs/COLLABORA_UPGRADE_CHECKLIST.md). */
:root { --office-statusbar-clear: 2.75rem; }
/* a workbook adds a ~36px sheet-tab row above the status bar; its tabs fill the row on a phone and, with many
   sheets, on a desktop too, so a workbook clears both at every width */
body.shell-office.shell-office-sheet { --office-statusbar-clear: 5.5rem; }
body.shell-office [data-jobs-tray],
body.shell-office #app-snackbar-root { bottom: calc(var(--office-statusbar-clear) + var(--safe-bottom)); }
@media (max-width: 639.98px) {
  body.shell-office.shell-jobs-tray #app-snackbar-root { bottom: calc(var(--office-statusbar-clear) + 2.25rem + var(--safe-bottom)); }
}

/* 2. shared listing (components/listing.html + listing/table.html).
   TABLE VIEW STAYS A TABLE AT EVERY WIDTH (owner, 2026-10-18: "in table view, when it's responsive it
   must still be table view"). The table no longer re-flows into stacked cards below md: it keeps its
   <thead> and columns and scrolls horizontally inside its own `overflow-auto` wrapper, never the page.
   The CARD view is a separate presentation the user picks with the toggle.
   PHONE DEFAULT. A listing with no saved choice and a table desktop default renders BOTH panels with
   [data-view-auto] (listing/services/view_pref.py::ViewPref.auto): below md the cards show, from md up
   the table; the toggle's active button follows. inventory-card-toggle.js strips [data-view-auto] on
   the first explicit choice, which then wins at every width. Pinned by
   listing/tests/test_listing_responsive_contract.py. */
@media (max-width: 767.98px) {
  [data-view-auto][data-view-table] { display: none !important; }
  [data-view-toggle-key][data-view-auto] [data-view-btn="grid"] { background-color: var(--color-surface-200); color: var(--color-foreground); }
  [data-view-toggle-key][data-view-auto] [data-view-btn="table"] { background-color: transparent; color: var(--color-foreground-lighter); }
}
@media (min-width: 768px) {
  [data-view-auto][data-view-grid] { display: none !important; }
}
/* the row menu of a table row is hover-revealed on desktop: always shown on touch devices */
@media (hover: none), (pointer: coarse) {
  table[data-listing-stack] [data-row-action] { opacity: 1; }
}

/* A glyph that must stay small (the 12px seen tick inside a chat bubble) keeps its look but gets a 26px touch target */
[data-msg-seen] { position: relative; }
[data-msg-seen]::after { content: ""; position: absolute; inset: -7px; }

/* Horizontal strips that scroll (tab rows): fade the edge that still has content. Marker: data-scroll-fade-x,
   state written by static/js/lib/scroll-fade.js. */
[data-scroll-fade-x][data-fade-end="1"] { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
[data-scroll-fade-x][data-fade-start="1"] { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); }
[data-scroll-fade-x][data-fade-start="1"][data-fade-end="1"] { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
[data-scroll-fade-x] { scrollbar-width: none; }
[data-scroll-fade-x]::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) { [data-scroll-fade-x] { -webkit-mask-image: none !important; mask-image: none !important; } }

/* Record cards (components/listing/record_card.html): on phones the title wraps instead of being cut
   next to the action cluster. Selector keys on the card's own classes so the golden markup stays unchanged. */
@media (max-width: 639.98px) {
  div[class*="min-h-[70px]"][class*="rounded-[8px]"] .truncate { white-space: normal; overflow-wrap: anywhere; }
}

/* Custom-field cell (components/custom_field_cell.html) touch targets: rating stars and number inputs reach 26px
   on touch/phone only, so desktop density is unchanged. */
@media (max-width: 767.98px), (pointer: coarse) {
  [data-cf-rating] button { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; min-height: 26px; }
  input[data-cf-display][data-keydown="handleCfvNumberKeydown"] { min-height: 26px; }
}

/* v5 item 7 polish: shared record tabs / matrix + cascade pickers reach the 26px touch target on phones only (desktop density untouched) */
@media (max-width: 767.98px) {
  [data-record-tabs] > [role="tablist"] { height: 27px; } /* 26px buttons + the 1px bottom border */
  [data-pf-matrix-cell], [data-cf-matrix-cell] { width: 26px !important; height: 26px !important; }
  [data-cf-cascade-node] { min-height: 26px; }
  [data-dp-grid] > .h-6 { height: 26px; }
  [data-dp-clear] { min-height: 26px; }
  [data-field-box-delete] { width: 26px !important; height: 26px !important; top: -13px !important; right: -13px !important; }
  [data-field-box-signer-chip] { min-height: 26px; line-height: 24px !important; bottom: -13px !important; }
  [data-lead-aside] button[class*="text-[10px]"], [data-lead-aside] button.text-primary.hover\:underline { min-height: 26px; display: inline-flex; align-items: center; }
}

/* Phone calendars scroll as a PAGE (owner ruling 2026-10-15): below sm, a page that renders a calendar marked
   [data-phone-page] lets the document scroll instead of trapping the calendar in the shell's fixed-height content card.
   The shell stays untouched on every other page (kanban / list / Focus keep their own scrollers) because every rule keys
   on body.shell-phone-page, which is on <body> exactly while that marker is on the page (it only exists inside the calendar
   grid partial; the page templates render the class, tasks-board.js re-syncs it after a view switch).
   [data-pps-flow]  an element of the h-full / min-h-0 / overflow chain that must flow at its natural height here
   [data-pps-rows]  a grid whose fixed 1fr row template collapses to 0 height once the chain no longer has a height (year)
   [data-pps-sticky] the single compact paginator row, pinned to the top of the window while the page scrolls */
@media (max-width: 639.98px) {
  body.shell-phone-page .app-shell-h { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
  body.shell-phone-page [data-app-content] { overflow: visible; flex: 1 0 auto; }
  body.shell-phone-page [data-pps-flow] { height: auto !important; min-height: 0 !important; max-height: none !important; overflow: visible !important; flex: none !important; }
  body.shell-phone-page [data-pps-rows] { grid-template-rows: none !important; min-height: 0 !important; }
  body.shell-phone-page [data-pps-sticky] { position: sticky; top: 0; z-index: 30; background-color: var(--color-surface-100); }
}

/* Phone month grid cells (tasks/components/calendar/agenda.html): compact so the day's list gets the page.
   40px on every phone (the owner's cap is 40 on a short 640px handset and 44 otherwise: 40 satisfies both). */
[data-agenda-cell] { height: 40px; }

/* The "Overdue" chip on a phone list row (tasks/partials/calendar_agenda_row.html) sits on whatever colour the task is painted, so it
   carries its OWN background: the destructive token darkened toward black until white text clears WCAG AA (6.5:1; the raw token is 3.6:1). */
/* Phone day view (tasks/components/calendar/day.html): a narrower hour-label column gives the two overlap columns their width. */
@media (max-width: 639.98px) {
  [data-day-hours] { width: 44px !important; }
  [data-day-hours] > div { padding-left: 4px !important; padding-right: 4px !important; }
  /* An overlap column is ~140px wide: the title gets the width (two lines), the status collapses to its icon (its name stays on
     the wrapper's aria-label), a stack of avatars is dropped (one avatar stays) and the card padding tightens. */
  [data-day-lane] [data-cal-card] { padding: 3px 4px; }
  [data-day-lane] [data-cal-card] > div:first-child { gap: 4px; align-items: flex-start; }
  [data-day-lane] [data-cal-title] { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.25; }
  [data-day-lane] [data-cal-status] > span { font-size: 0; gap: 0; padding: 2px; }
  [data-day-lane] [data-cal-avatars] { display: none; }
}

/* Week view (tasks/components/calendar/week.html): every overlap lane is a size container. A day column never goes below
   lanes x 160px (tasks/services/calendar_week_columns.py), and a lane under 220px keeps its TITLE: the status pill collapses to
   its icon (the name stays on the trigger's tooltip + the wrapper's aria-label), a stack of avatars keeps only the first, and
   the row gap tightens. Wider lanes render the card exactly as every other view does. */
[data-week-lane] { container-type: inline-size; }
@container (max-width: 220px) {
  [data-week-lane] [data-cal-card] { padding-left: 6px; padding-right: 6px; }
  [data-week-lane] [data-cal-card] > div:first-child { gap: 4px; }
  [data-week-lane] [data-cal-status] > span { font-size: 0; gap: 0; padding: 2px; }
  [data-week-lane] [data-cal-avatars] > :not(:first-child) { display: none; }
}
/* Its day-column resize handle: a 4px edge for a mouse; on a touch screen a 16px target with a visible grip. */
@media (hover: none), (pointer: coarse) {
  [data-week-col-resize] { width: 16px !important; right: -8px !important; background: transparent !important; }
  [data-week-col-resize]::after { content: ''; position: absolute; top: 50%; left: 50%; width: 4px; height: 20px; transform: translate(-50%, -50%); border-radius: 2px; background-color: var(--color-border-stronger, #555); }
}

[data-agenda-overdue-tag] { background-color: color-mix(in srgb, var(--color-destructive) 70%, black) !important; color: var(--color-primary-foreground) !important; }

/* 4. Pinned (sticky) table cells: [data-row-pin]. A sticky cell must be OPAQUE (columns scroll under it), but it must read as
   part of its row, so it paints exactly what the row shows: the header tint in a thead, the content-card surface in a body
   row, surface-200 on hover, and the selected tint composited over the card (bg-primary/10 is primary at 10% alpha over
   surface-100, i.e. this srgb mix) plus the row's 2px ring edges, which an opaque cell would otherwise hide. Used by the
   contacts table (Name below md, the row-menu column always). Hover comes last: on the row, Tailwind's hover variant also
   wins over the selected tint. */
[data-row-pin] { background-color: var(--color-surface-100); transition: background-color var(--default-transition-duration, 150ms) var(--default-transition-timing-function, cubic-bezier(0.4, 0, 0.2, 1)); } /* same duration + easing as the row's own `transition-colors`, so the opaque pinned cell fades in lockstep with the transparent cells that show the row background (without it the pinned Name cell snapped instantly while the rest faded) */
thead [data-row-pin] { background-color: var(--color-background); }
tbody tr.contact-row-active > [data-row-pin] {
  background-color: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface-100));
  box-shadow: inset 0 2px 0 var(--color-primary), inset 0 -2px 0 var(--color-primary);
}
tbody tr.contact-row-active > [data-row-pin]:first-child { box-shadow: inset 2px 0 0 var(--color-primary), inset 0 2px 0 var(--color-primary), inset 0 -2px 0 var(--color-primary); }
tbody tr.contact-row-active > [data-row-pin]:last-child { box-shadow: inset -2px 0 0 var(--color-primary), inset 0 2px 0 var(--color-primary), inset 0 -2px 0 var(--color-primary); }
tbody tr:hover > [data-row-pin] { background-color: var(--color-surface-200); }
/* The Name cell is pinned (sticky) ONLY below md; from md up it is `md:static` and scrolls with the row, so it must NOT paint an
   opaque layer of its own there: the row's own hover/selected background reaches it exactly like every other cell (owner bug
   2026-11-09, the Name cell hover animated from a different colour/layer than the rest of the row). The row-menu column stays
   sticky at every width, so its [data-row-pin] paint is untouched. md = 48rem, Tailwind's breakpoint. */
@media (min-width: 768px) {
  [data-col-name][data-row-pin],
  thead [data-col-name][data-row-pin],
  tbody tr.contact-row-active > [data-col-name][data-row-pin],
  tbody tr:hover > [data-col-name][data-row-pin] { background-color: transparent; transition: none; }
}

/* 4. Skeleton of a paginated listing while htmx loads its next page (2026-10-18).

   THE MECHANISM IS htmx's OWN: every page link, rows-per-page link and search
   form of a listing names the `{% listing_results %}` region as its
   `hx-indicator` (templates/components/listing/hx_attrs.html), so htmx puts
   its request class (`htmx-request`) on that region for exactly as long as the
   request is in flight. `static/js/fetch-gate.js` keeps `aria-busy="true"` on
   the same region while a refused GET (429/503) waits for its silent retry, so
   the skeleton stays up through that wait too.

   The skeleton is painted ON the rows already on screen instead of swapping
   them for a separate set of placeholder rows: every row keeps its own height
   and every column its own width, so nothing moves when the request starts
   and nothing moves when the answer lands -- the "no layout shift" half of the
   requirement holds by construction, for hand-written tables and card grids
   too. The look is the shared skeleton's (components/skeleton_rows.html): a
   surface-200 bar on a row (border-strong on a card, whose own fill is a surface tone in either theme), pulsing. Theme tokens only, so light and dark
   follow the theme with no rule of their own.

   In this file on purpose (no Tailwind rebuild): unlayered rules beat the layered
   utilities, which is what lets them hide a cell's content whatever its own
   text/visibility classes say. */

[data-listing-results]:is(.htmx-request, [aria-busy="true"]) {
  cursor: progress;
}

/* Rows: each cell keeps its box and shows one bar where its text starts. */
[data-listing-results]:is(.htmx-request, [aria-busy="true"]) tbody > tr {
  pointer-events: none;
  animation: listing-skeleton-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

[data-listing-results]:is(.htmx-request, [aria-busy="true"]) tbody > tr > :is(td, th) {
  color: transparent;
  background-image: linear-gradient(var(--color-surface-200), var(--color-surface-200));
  background-repeat: no-repeat;
  background-origin: content-box;
  background-position: left center;
  background-size: min(10rem, 70%) 0.75rem;
}

[data-listing-results]:is(.htmx-request, [aria-busy="true"]) tbody > tr > :is(td, th) * {
  visibility: hidden;
}

/* Cards (the shared listing's card panel, or a card grid marked with the KEYLESS data-listing-body).
   A KEYED wrapper (`data-listing-body="<key>"`, the empty-state toggle of listing-refresh.js) is NOT a card grid: it wraps
   the whole listing, so it must never match here or the entire listing turns into one pulsing card (broke automations and
   forms 2026-11-07). The keyless form is `[data-listing-body=""]`.
   The card keeps its box and border, its content becomes two bars. */
[data-listing-results]:is(.htmx-request, [aria-busy="true"]) :is([data-listing-panel$=":cards"], [data-listing-body=""]) > * {
  pointer-events: none;
  color: transparent;
  background-image:
    linear-gradient(var(--color-border-strong), var(--color-border-strong)),
    linear-gradient(var(--color-border-strong), var(--color-border-strong));
  background-repeat: no-repeat;
  background-origin: content-box;
  background-position: left 0 top 0, left 0 top 1.25rem;
  background-size: min(10rem, 70%) 0.75rem, min(6rem, 45%) 0.625rem;
  animation: listing-skeleton-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

[data-listing-results]:is(.htmx-request, [aria-busy="true"]) :is([data-listing-panel$=":cards"], [data-listing-body=""]) > * * {
  visibility: hidden;
}

@keyframes listing-skeleton-pulse {
  50% { opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
  [data-listing-results]:is(.htmx-request, [aria-busy="true"]) :is(tbody > tr, [data-listing-panel$=":cards"] > *, [data-listing-body=""] > *) {
    animation: none;
  }
}

/* 7. Listing page header on phones (owner 2026-10-30, docs/DESIGN_SYSTEM.md "Listing page header on phones").
   The page title moves into the app header ({% block mobile_title %}); the toolbar below it is
     [data-list-toolbar]
       [data-list-toolbar-filters]  search pill (w-full) + sort toggle + any filter chips
       [data-list-toolbar-actions]  view toggle + secondary actions + the primary "+ New ..." button
   Below sm both groups dissolve (display: contents) into ONE wrapping row, so the search takes the first line
   and the sort toggle shares the second with the actions, pushed right. Controls that would crowd that line
   carry [data-list-toolbar-secondary] and wrap to a line of their own after it; [data-list-toolbar-compact]
   drops a button's text label (keep an aria-label on it). Desktop (sm and up) is untouched. */
@media (max-width: 639.98px) {
  [data-list-toolbar] { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
  [data-list-toolbar] > :is([data-list-toolbar-filters], [data-list-toolbar-actions]) { display: contents; }
  [data-list-toolbar] [data-list-toolbar-secondary] { order: 1; }
  [data-list-toolbar-actions] > :not([data-list-toolbar-secondary]) { margin-left: auto; }
  [data-list-toolbar-actions] > :not([data-list-toolbar-secondary]) ~ :not([data-list-toolbar-secondary]) { margin-left: 0; }
  [data-list-toolbar] [data-list-toolbar-compact] > span { display: none; }
}

/* 8. Counts and badges are never text (owner 2026-10-30): a tap on a phone must not select the number, open the
   callout or flash the tap highlight. Every badge/count element carries [data-badge]
   (pinned by config/tests/test_badge_not_selectable_ratchet.py). */
[data-badge] {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* 9. Calendar cards are pressed, never text-selected (owner 2026-10-30): a click, drag, double-click or long-press on
   a task/lead card in ANY calendar view (agenda/schedule, month, week, day) selected or highlighted its title instead
   of the card. Every calendar card root carries [data-press-card] (pinned by
   config/tests/test_calendar_card_not_selectable_ratchet.py). The pressed look reuses the cards' own hover tokens
   (border-stronger edge, surface-300 fill on a neutral card); a coloured card rings in its own contrast-safe --task-fg. */
[data-press-card] {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
/* A field inside a pressable card/row (inline rename, quick add) stays an editable, selectable field. */
[data-press-card] :is(input, textarea, select, [contenteditable="true"]) {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
/* The bare marker (value "") is a CARD: it rings when pressed. */
[data-press-card=""]:active {
  border-color: var(--color-border-stronger);
  box-shadow: inset 0 0 0 1px var(--color-border-stronger);
}
[data-press-card=""].bg-surface-200:active { background-color: var(--color-surface-300); }
[data-press-card=""][style*="--task-fg"]:active { border-color: transparent; box-shadow: inset 0 0 0 1px var(--task-fg); }
/* "slot": a positioned slot whose visible bar is its only child (components/calendar/week.html span bars): the slot is
   unselectable, the BAR shows the pressed state. */
[data-press-card="slot"]:active > * { box-shadow: inset 0 0 0 1px var(--color-border-stronger); }
/* "row": a Gantt list row (tasks-gantt-render.js). The whole ROW is the pressed unit: it takes the row's own
   hover/focused fill (gantt.css .gantt-row:hover / .is-focused), on the row and its sticky left cell. */
[data-press-card="row"]:active, [data-press-card="row"]:active > :first-child { background-color: var(--color-surface-200); }
/* "bar": a Gantt bar. Unselectable with no tap highlight; its pressed/drag look is the Gantt's own (.is-dragging) plus
   its row's pressed fill, so it adds no ring of its own. */

/* === 10. TEAM CHAT BUBBLE LONG-PRESS (owner 2026-11-04) - separate section, owned by static/js/teamchat-long-press.js ===
   A held bubble is pressed, never text-selected: while the press is pending (`data-tc-press`) and while the bubble is
   the selected one (`data-tc-selected`) it is non-selectable with no callout and no tap highlight - the same
   non-selectable pattern as [data-press-card] / [data-badge] above, scoped to the moment of the press so a bubble's
   text stays selectable the rest of the time. The selected state is a primary ring on the bubble itself. */
#teamchat-msg-list [data-msg-bubble][data-tc-press],
#teamchat-msg-list [data-msg-bubble][data-tc-selected] {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
#teamchat-msg-list [data-msg-bubble][data-tc-selected] {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}
/* On a phone (touch / coarse pointer, or below sm, which is the widget's full-screen mode) the per-message options
   chevron and reaction buttons are gone: the long-press above replaces them (its menu carries Reaction, Copy text,
   Pin, Reply) and the existing reaction CHIPS stay tappable. `display:none !important` beats Tailwind's `flex` /
   `hidden` display utilities whatever their emit order, takes no space, and keeps the nodes in the DOM so the
   long-press and swipe-to-reply can still find the row's trigger. Desktop (mouse, >= sm) is untouched. */
@media (pointer: coarse), (max-width: 639px) {
  #teamchat-msg-list [data-tc-message-menu],
  #teamchat-msg-list [data-reaction-picker-trigger] { display: none !important; }
}
