/* ══ The team chat layer (@gemboss/ui, 20/10/2026) ═══════════════════════════════════════════════════════════════════
   GemCare's channel chat (public/assets/inbox.css, origin/main 20/10/2026), moved here so GemCare and GemCommunity draw
   one chat. The markup is a contract: README "The team chat layer" has the HTML of every part, and the React components
   (team-chat.tsx) render exactly that (team-chat-contract.test.tsx). Every colour is a --gemboss-* token, so the dark
   palette (theme-dark.css) applies unchanged; no rule on :root, html or body. Reused, not redrawn: the avatar
   (.gb-avatar, portal.css), reactions (reactions.css), the kit's ui-btn / ui-check (components.css).

   Layout. `.gb-tc` is a grid, rail | conversation | right panel, and a size CONTAINER: the screen decides by its own
   width, not the window's (in an app shell the chat is the window minus the shell's rail).
     > 1100px  the panel is a third column: a thread 380px, the people panel its own width (260, or 56 collapsed).
     ≤ 1100px  the panel is a drawer over the conversation from the right, with a scrim; a 380px thread beside a 300px
               conversation leaves neither readable (GemCare measured it, 05/10/2026).
     ≤ 760px   a phone: the channel list OR the conversation (`data-view`), a back button in the conversation's head, and
               the panel is a sheet over the whole chat.
   The message list is a container too: where IT is narrow (the thread panel, a docked window) the action bar drops the
   quick reactions. Under a finger every control is 44px; under a mouse the rail and the action bar are 32px. */

/* ── The screen ─────────────────────────────────────────────────────────────────────────────────────────────────── */
.gb-tc {
  container: gb-tc / inline-size;
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr);
  height: 100%; min-height: 0; overflow: hidden; box-sizing: border-box;
  background: var(--gemboss-surface); color: var(--gemboss-text); font-size: var(--gemboss-fs-body);
}
.gb-tc > .gb-tc-rail { grid-column: 1; grid-row: 1; }
.gb-tc > .gb-tc-main { grid-column: 2; grid-row: 1; }
.gb-tc > .gb-tc-thread, .gb-tc > .gb-tc-people { grid-column: 3; grid-row: 1; height: auto; }
/* The columns are flex columns: a head and a foot at their height, the one scrolling part (`.gb-tc-body`, the rail's and
   the people panel's lists) takes the rest. A slot the app adds (an error line) does not shift a grid template. */
.gb-tc-main, .gb-tc-rail, .gb-tc-thread, .gb-tc-people { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.gb-tc-main { position: relative; }
.gb-tc-main > *, .gb-tc-rail > *, .gb-tc-thread > *, .gb-tc-people > * { flex: none; }
.gb-tc-main > .gb-tc-body, .gb-tc-thread > .gb-tc-body, .gb-tc-rail > .gb-tc-rail__scroll, .gb-tc-people > .gb-tc-people__body { flex: 1 1 0; min-height: 0; }
/* A one-column grid says its column is the box's width: an `auto` track grows to the min-content of a `white-space:
   nowrap` line (a long channel name) and pushes out sideways (measured at 1366: the rail's list 432px in a 224px rail). */
.gb-tc-body, .gb-tc-composer, .gb-tc-rail__list, .gb-tc-people__list { grid-template-columns: minmax(0, 1fr); }
.gb-tc-scrim { display: none; }
/* `hidden` hides, whatever the layout rules set (a page without React toggles the attribute: GemCare #376 only worked
   because of a global [hidden] rule of its own). (0,3,0): above `.gb-tc > .gb-tc-scrim` and the drawer's rules. */
.gb-tc :is(.gb-tc-thread, .gb-tc-people, .gb-tc-scrim, .gb-tc-replying, .gb-tc-jump, .gb-tc-composer__files, .gb-tc-composer__picker)[hidden] { display: none; }
/* Text only a screen reader reads (its own rule: a surface may take this layer without the kit's .ui-sr-only). */
.gb-tc-sr { position: absolute; left: 0; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── The rail ───────────────────────────────────────────────────────────────────────────────────────────────────── */
.gb-tc-rail {
  width: var(--gb-tc-rail-w, 240px); box-sizing: border-box;
  border-right: 1px solid var(--gemboss-divider); background: var(--gemboss-rail-bg);
}
.gb-tc-rail__head, .gb-tc-head, .gb-tc-panel-head {
  display: flex; align-items: center; gap: 8px; min-height: 56px; min-width: 0; box-sizing: border-box;
  border-bottom: 1px solid var(--gemboss-divider);
}
.gb-tc-rail__head { justify-content: space-between; padding: 8px 8px 8px 16px; }
.gb-tc-rail__title, .gb-tc-panel-head__title {
  margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--gemboss-fs-h3); font-weight: 650; line-height: 1.3; color: var(--gemboss-text-strong);
}
.gb-tc-rail__actions, .gb-tc-head__actions, .gb-tc-panel-head__actions { flex: none; display: flex; align-items: center; gap: 4px; }
.gb-tc-rail__scroll { overflow-y: auto; overscroll-behavior: contain; padding: 8px 8px 16px; }
.gb-tc-rail__section + .gb-tc-rail__section { margin-top: 16px; }
.gb-tc-rail__heading, .gb-tc-people__heading {
  margin: 0 8px 4px; font-size: var(--gemboss-fs-caption); font-weight: 650; line-height: 20px; color: var(--gemboss-text-muted);
}
.gb-tc-rail__list, .gb-tc-people__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.gb-tc-channel {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 32px; padding: 0 8px; box-sizing: border-box;
  border: 0; border-radius: var(--gemboss-radius-md); background: none; cursor: pointer; text-align: left; text-decoration: none;
  font: inherit; font-size: var(--gemboss-fs-body); color: var(--gemboss-text-muted);
}
@media (hover: hover) { .gb-tc-channel:hover { background: var(--gemboss-hover); color: var(--gemboss-text-strong); } }
.gb-tc-channel:focus-visible { outline: 2px solid var(--gemboss-accent); outline-offset: -2px; }
/* Unread: the name in the strong ink and bold (Slack), the count beside it. */
.gb-tc-channel--unread { color: var(--gemboss-text-strong); font-weight: 650; }
.gb-tc-channel[aria-current] { background: var(--gemboss-accent-soft); color: var(--gemboss-accent-strong); font-weight: 650; }
.gb-tc-channel__glyph { position: relative; flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; }
.gb-tc-channel__glyph > .gb-tc-presence { right: -3px; bottom: -2px; width: 7px; height: 7px; border-color: var(--gemboss-rail-bg); }
/* A DM's picture (21/10/2026): the kit's Avatar in the glyph's 20px box (two classes: wins over .gb-avatar--24 whatever
   order the entries load in); the presence dot sits on its corner as on the glyph. */
.gb-avatar.gb-tc-channel__av { width: 20px; height: 20px; font-size: 8px; }
.gb-tc-channel__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The count does not shrink: without `flex: none` a long name pushes it out of the row on the noisiest channel. */
.gb-tc-badge {
  flex: none; min-width: 20px; height: 18px; padding: 0 6px; box-sizing: border-box; border-radius: var(--gemboss-radius-full);
  background: var(--gemboss-accent); color: var(--gemboss-on-primary);
  font-size: var(--gemboss-fs-micro); font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}
/* Being called by name is another meaning, so another colour (amber, GemCare's), and an "@" for whoever cannot tell
   colours apart. It comes BEFORE the count: forty unread can wait, a name called cannot. */
.gb-tc-badge--mention { background: var(--gemboss-warning-soft); color: var(--gemboss-warning); box-shadow: inset 0 0 0 1px var(--gemboss-warning-border); }

/* ── The conversation's head ────────────────────────────────────────────────────────────────────────────────────── */
.gb-tc-head { padding: 8px 12px 8px 16px; }
/* Under .gb-tc (0,2,0) wherever a rule sets what .ui-btn also sets (display, padding, background…): the app decides the
   order of its sheets, not this file. Measured 20/10 in GemCommunity: Next put components.css AFTER team-chat.css and
   `.ui-btn { display: inline-flex }` showed the phone-only back button on a 1440px desktop. */
.gb-tc .gb-tc-head__back { display: none; }
.gb-tc-head__text, .gb-tc-panel-head__text { flex: 1 1 auto; min-width: 0; }
.gb-tc-head__title {
  margin: 0; display: flex; align-items: center; gap: 6px; min-width: 0;
  font-size: var(--gemboss-fs-h3); font-weight: 650; line-height: 1.3; color: var(--gemboss-text-strong);
}
.gb-tc-head__glyph { flex: none; display: inline-flex; color: var(--gemboss-text-muted); }
/* A DM's head: the person's picture left of the name (the kit's Avatar, 24px), in place of the glyph. */
.gb-avatar.gb-tc-head__av { flex: none; margin-right: 2px; }
.gb-tc-head__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-tc-head__sub, .gb-tc-panel-head__sub {
  margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--gemboss-fs-caption); line-height: 16px; color: var(--gemboss-text-muted);
}
.gb-tc .gb-tc-head__members { gap: 6px; padding: 0 8px; }
.gb-tc .gb-tc-head__members[aria-expanded="true"] { background: var(--gemboss-accent-soft); color: var(--gemboss-accent-strong); }
.gb-tc-head__count { font-variant-numeric: tabular-nums; }

/* ── The message list ───────────────────────────────────────────────────────────────────────────────────────────── */
.gb-tc-body { position: relative; display: grid; grid-template-rows: minmax(0, 1fr); min-width: 0; min-height: 0; }
.gb-tc-log { container: gb-tc-log / inline-size; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.gb-tc-log:focus-visible { outline: 2px solid var(--gemboss-accent); outline-offset: -2px; }
.gb-tc-list { list-style: none; margin: 0; padding: 8px 0 16px; display: flex; flex-direction: column; }
/* A row in a scrolling flex column must not shrink (GemCare's bug of 10/10/2026: lines laid over the next row). */
.gb-tc-list > * { flex-shrink: 0; }
.gb-tc-older, .gb-tc-empty, .gb-tc-status { display: flex; justify-content: center; padding: 8px 16px; color: var(--gemboss-text-muted); font-size: var(--gemboss-fs-caption); }
.gb-tc-empty { padding-block: 32px; font-size: var(--gemboss-fs-body); }
.gb-tc-status { justify-content: flex-start; padding-left: 60px; }
/* The day stays on top while its messages scroll under it. */
/* Sticky on a band of the list's own background, full width: the day separators are siblings in one scroller, so every
   passed day stays stuck at the top; the band of the newest one covers the older pills whole (GemCare #376: a wider
   "Yesterday" showed its outline around "Today"). At rest the band is the list's colour, so it is not seen. */
.gb-tc-day { position: sticky; top: 0; z-index: 1; display: flex; justify-content: center; margin: 4px 0 0; padding: 4px 0;
  background: var(--gemboss-surface); pointer-events: none; }
.gb-tc-day__label {
  padding: 1px 12px; border: 1px solid var(--gemboss-divider); border-radius: var(--gemboss-radius-full);
  background: var(--gemboss-surface); box-shadow: var(--gemboss-shadow-resting);
  font-size: var(--gemboss-fs-caption); font-weight: 600; line-height: 20px; color: var(--gemboss-text);
}
/* "New messages": the unread count's colour (one meaning), the words in the middle (a colour alone is not read out). */
.gb-tc-new { display: flex; align-items: center; gap: 8px; margin: 6px 16px; color: var(--gemboss-accent); }
.gb-tc-new::before, .gb-tc-new::after { content: ""; flex: 1; height: 1px; background: currentColor; }
.gb-tc-new__label { font-size: var(--gemboss-fs-caption); font-weight: 650; line-height: 16px; }

/* ── A message ──────────────────────────────────────────────────────────────────────────────────────────────────── */
/* Two columns: the avatar (or, in a turn, the time on hover), then everything else. `minmax(0, 1fr)`: a long URL
   does not push the column out. Placement is explicit, so no third child ever falls into the 36px column. */
.gb-tc-msg {
  position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 8px; align-items: start;
  padding: 8px 16px 4px;
}
/* The row takes focus on a tap (tabindex="-1"); a ring only when the app moved focus there from the keyboard. */
.gb-tc-msg:focus { outline: none; }
.gb-tc-msg:focus-visible { outline: 2px solid var(--gemboss-accent); outline-offset: -2px; }
.gb-tc-msg--grouped { padding-block: 2px; }
.gb-tc-msg > .gb-avatar, .gb-tc-msg > .gb-tc-msg__hover-time { grid-column: 1; grid-row: 1; }
.gb-tc-msg > .gb-tc-msg__main { grid-column: 2; grid-row: 1; min-width: 0; }
/* The package's Avatar at 36px here (two classes: wins over .gb-avatar--32 whatever order the entries load in). */
.gb-avatar.gb-tc-msg__av { width: 36px; height: 36px; font-size: 13px; margin-top: 2px; }
.gb-tc-msg--active, .gb-tc-msg--editing { background: var(--gemboss-divider-soft); }
@media (hover: hover) { .gb-tc-msg:hover { background: var(--gemboss-divider-soft); } }
.gb-tc-msg:has(:focus-visible) { background: var(--gemboss-divider-soft); } /* its own rule: a browser without :has keeps the one above */
.gb-tc-msg__hover-time {
  justify-self: end; opacity: 0; white-space: nowrap; font-variant-numeric: tabular-nums;
  font-size: var(--gemboss-fs-micro); line-height: 20px; color: var(--gemboss-text-muted);
}
.gb-tc-msg:hover > .gb-tc-msg__hover-time, .gb-tc-msg:focus-within > .gb-tc-msg__hover-time { opacity: 1; }
.gb-tc-msg__who { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; min-width: 0; line-height: 20px; }
.gb-tc-msg__name { font-weight: 650; color: var(--gemboss-text-strong); overflow-wrap: anywhere; }
.gb-tc-msg__time { font-size: var(--gemboss-fs-caption); color: var(--gemboss-text-muted); font-variant-numeric: tabular-nums; }
.gb-tc-msg__body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 20px; color: var(--gemboss-text); }
.gb-tc-msg__edited { margin-left: 4px; font-size: var(--gemboss-fs-caption); color: var(--gemboss-text-muted); white-space: nowrap; }
.gb-tc-msg__status { margin: 2px 0 0; font-size: var(--gemboss-fs-caption); color: var(--gemboss-text-muted); }
.gb-tc-msg--failed .gb-tc-msg__status { color: var(--gemboss-danger); }
.gb-tc-msg--sending > .gb-tc-msg__main { opacity: .6; }
.gb-tc-msg__files, .gb-tc-msg__extra { margin-top: 4px; min-width: 0; }
.gb-tc-msg__editor { display: grid; gap: 6px; margin-top: 2px; }
/* Calls the viewer by name: a bar on the left, not a fill (a fill makes the words harder to read and fights every
   other state of the row). An inset shadow: nothing moves. */
.gb-tc-msg--mention { box-shadow: inset 2px 0 0 var(--gemboss-warning); }
.gb-tc-msg--highlight { background: var(--gemboss-accent-soft); }
/* The reply quote: a real button (it jumps to the message or opens its thread), so a control's height. */
.gb-tc-quote {
  display: flex; align-items: baseline; gap: 6px; max-width: 100%; min-height: 28px; margin: 0 0 4px; padding: 4px 8px; box-sizing: border-box;
  border: 0; border-left: 2px solid var(--gemboss-divider); border-radius: 0 var(--gemboss-radius-sm) var(--gemboss-radius-sm) 0;
  background: none; cursor: pointer; text-align: left; font: inherit; font-size: var(--gemboss-fs-caption); color: var(--gemboss-text-muted);
}
@media (hover: hover) { .gb-tc-quote:hover { background: var(--gemboss-hover); } }
.gb-tc-quote:focus-visible { outline: 2px solid var(--gemboss-accent); outline-offset: 1px; }
.gb-tc-quote[aria-busy="true"] { opacity: .55; cursor: progress; }
.gb-tc-quote__who { flex: none; font-weight: 650; color: var(--gemboss-text); }
/* One line: a 120-character quote that wraps is taller than the reply under it. */
.gb-tc-quote__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Reactions are the package's; here only their place in a message, and the picker's ceiling: the LIST's width, not the
   message's (a short message would give the picker seven columns). */
.gb-tc-msg .ui-reactions { margin-top: 2px; }
.gb-tc-msg .ui-reaction-picker { margin: 4px 0; max-width: calc(100cqi - 64px); }
/* The thread under its message: "3 replies · Last reply 2 hours ago" (Slack). */
.gb-tc-threadprev {
  display: flex; align-items: center; gap: 8px; max-width: 100%; min-height: 32px; margin-top: 4px; padding: 4px 8px 4px 4px; box-sizing: border-box;
  border: 1px solid transparent; border-radius: var(--gemboss-radius-md); background: none; cursor: pointer; text-align: left;
  font: inherit; font-size: var(--gemboss-fs-caption);
}
@media (hover: hover) { .gb-tc-threadprev:hover { border-color: var(--gemboss-divider); background: var(--gemboss-surface); } }
.gb-tc-threadprev:focus-visible { outline: 2px solid var(--gemboss-accent); outline-offset: 1px; }
.gb-tc-threadprev__faces { flex: none; display: flex; gap: 2px; }
.gb-tc-threadprev__faces > .gb-avatar { width: 22px; height: 22px; font-size: 9px; border-radius: var(--gemboss-radius-xs); }
.gb-tc-threadprev__count { flex: none; font-weight: 650; color: var(--gemboss-accent-strong); }
.gb-tc-threadprev__last { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gemboss-text-muted); }
/* Read by: a ring, a slice per share, filled and ticked when everyone has read it. */
.gb-tc-receipt { display: inline-flex; margin-left: 6px; vertical-align: -2px; color: var(--gemboss-text-muted); }
.gb-tc-receipt--all { color: var(--gemboss-success); }
.gb-tc-receipt__tick { stroke: var(--gemboss-surface); }

/* ── The action bar ─────────────────────────────────────────────────────────────────────────────────────────────── */
/* It floats at the row's top right and adds no height. Hidden, it takes no click (`pointer-events: none`: a clear
   button that still answers is a trap, GemCare #82). Keyboard focus inside it shows it. */
.gb-tc-acts {
  position: absolute; top: -14px; right: 16px; z-index: 2; display: flex; align-items: center; gap: 0; padding: 2px;
  border: 1px solid var(--gemboss-divider); border-radius: var(--gemboss-radius-md); background: var(--gemboss-surface);
  box-shadow: var(--gemboss-shadow-raised); white-space: nowrap; opacity: 0; pointer-events: none;
}
.gb-tc-list > .gb-tc-msg:first-child > .gb-tc-acts { top: 2px; }
.gb-tc-msg:hover > .gb-tc-acts, .gb-tc-msg--active > .gb-tc-acts, .gb-tc-acts:focus-within { opacity: 1; pointer-events: auto; }
.gb-tc-act {
  display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; box-sizing: border-box;
  border: 0; border-radius: var(--gemboss-radius-sm); background: transparent; cursor: pointer;
  font: inherit; font-size: 16px; line-height: 1; color: var(--gemboss-text-muted);
}
@media (hover: hover) { .gb-tc-act:hover { background: var(--gemboss-hover); color: var(--gemboss-text-strong); } }
.gb-tc-act:focus-visible { outline: 2px solid var(--gemboss-accent); outline-offset: -2px; }
.gb-tc-act[aria-pressed="true"], .gb-tc-act[aria-expanded="true"] { background: var(--gemboss-accent-soft); color: var(--gemboss-accent-strong); }
/* Where the LIST is narrow (the thread panel, a docked window), the bar keeps the four that matter: the picker still
   holds every emoji. A container query: the list decides, not the window. */
@container gb-tc-log (max-width: 560px) {
  .gb-tc-act--quick { display: none; }
  .gb-tc-acts { right: 8px; }
  .gb-tc-msg { padding-inline: 12px; }
  .gb-tc-status { padding-left: 56px; }
}
/* No hover (a phone, a tablet; a question about the device, not the width): one tap away. A tap focuses the row
   (tabindex="-1") and the bar shows; it does not cost a row of buttons under every message. */
@media (hover: none) {
  .gb-tc-msg:focus-within { background: var(--gemboss-divider-soft); }
  .gb-tc-msg:focus-within > .gb-tc-acts { opacity: 1; pointer-events: auto; }
  .gb-tc-act--quick { display: none; }
  .gb-tc-acts { top: -22px; }
}

/* ── Jump to the latest ─────────────────────────────────────────────────────────────────────────────────────────── */
.gb-tc-jump {
  position: absolute; right: 16px; bottom: 16px; z-index: 3; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--gemboss-divider); border-radius: 50%; background: var(--gemboss-surface); color: var(--gemboss-text-strong);
  box-shadow: var(--gemboss-shadow-raised); cursor: pointer;
}
.gb-tc-jump[hidden] { display: none; }
@media (hover: hover) { .gb-tc-jump:hover { background: var(--gemboss-hover); } }
.gb-tc-jump:focus-visible { outline: 2px solid var(--gemboss-accent); outline-offset: 2px; }
.gb-tc-jump__n {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 4px; box-sizing: border-box; border-radius: var(--gemboss-radius-full);
  background: var(--gemboss-accent); color: var(--gemboss-on-primary);
  font-size: var(--gemboss-fs-micro); font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums;
}

/* ── The composer ───────────────────────────────────────────────────────────────────────────────────────────────── */
.gb-tc-composer { display: grid; gap: 6px; min-width: 0; padding: 8px 16px 16px; }
.gb-tc-composer__box {
  position: relative; display: flex; align-items: flex-end; gap: 4px; min-width: 0; padding: 4px; box-sizing: border-box;
  border: 1px solid var(--gemboss-field-line); border-radius: var(--gemboss-radius-lg); background: var(--gemboss-field-bg);
}
@media (hover: hover) { .gb-tc-composer__box:hover { border-color: var(--gemboss-field-line-hover); } }
.gb-tc-composer__box:focus-within { border-color: var(--gemboss-field-line-active); box-shadow: 0 0 0 1px var(--gemboss-field-line-active); }
/* Grows with its text up to its cap (the component caps it in JS where `field-sizing` is missing). */
.gb-tc-composer__input {
  flex: 1 1 auto; min-width: 0; min-height: 32px; max-height: 40vh; margin: 0; padding: 6px 4px; box-sizing: border-box;
  border: 0; background: transparent; resize: none; outline: none; field-sizing: content;
  font: inherit; font-size: var(--gemboss-fs-body); line-height: 20px; color: var(--gemboss-field-ink);
}
.gb-tc-composer__input::placeholder { color: var(--gemboss-field-placeholder); }
.gb-tc-composer__input:disabled { cursor: not-allowed; }
.gb-tc-composer__box > .ui-btn--icon { width: 32px; height: 32px; }
.gb-tc .gb-tc-composer__attach, .gb-tc .gb-tc-composer__emoji, .gb-tc .gb-tc-composer__send, .gb-tc .gb-tc-panel-head__close, .gb-tc .gb-tc-people__toggle { flex: none; }
.gb-tc .gb-tc-composer__send:disabled { opacity: .35; }
.gb-tc .gb-tc-composer__emoji[aria-expanded="true"] { background: var(--gemboss-accent-soft); color: var(--gemboss-accent-strong); }
/* The emoji button's picker (21/10/2026): the reactions' own (reactions.css), over the box at its right edge, above the
   button; where the box is narrower than the picker's 420px (a phone) it is the box's whole width, a sheet over the
   composer. A layer, not a row in flow: the composer sits at the bottom of a column whose list must not jump. Its list
   is shorter on a short screen, so the search stays on it. Under the drawer's scrim (4, later in the markup) and the
   drawer (5); over the list's "jump to the latest" (3). */
.gb-tc-composer__emoji-pop { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 4; }
.gb-tc-composer__emoji-pop .ui-reaction-picker__body { max-height: min(300px, 40vh); }
/* "Replying to …" sits RIGHT ABOVE the field: the writer looks at the field, so a sign anywhere else is not seen. */
.gb-tc-replying {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 2px 2px 2px 8px; box-sizing: border-box;
  border-left: 2px solid var(--gemboss-accent); border-radius: var(--gemboss-radius-sm); background: var(--gemboss-accent-soft);
}
.gb-tc-replying__text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--gemboss-fs-caption); color: var(--gemboss-text); }
.gb-tc-composer__files, .gb-tc-composer__picker { min-width: 0; }
.gb-tc-composer__picker { max-height: 240px; overflow-y: auto; overscroll-behavior: contain; }
.gb-tc-composer__also { justify-self: start; }
.gb-tc-composer__error { margin: 0; font-size: var(--gemboss-fs-caption); color: var(--gemboss-danger); }

/* ── The right panels: thread, people ───────────────────────────────────────────────────────────────────────────── */
.gb-tc-thread, .gb-tc-people {
  height: 100%; box-sizing: border-box;
  border-left: 1px solid var(--gemboss-divider); background: var(--gemboss-surface); color: var(--gemboss-text);
}
.gb-tc-thread:focus, .gb-tc-people:focus { outline: none; }
.gb-tc-panel-head { padding: 8px 8px 8px 16px; }
.gb-tc-thread { width: var(--gb-tc-thread-w, 380px); }
.gb-tc-thread__note { margin: 8px 16px 0; font-size: var(--gemboss-fs-caption); color: var(--gemboss-text-muted); }
.gb-tc-thread__note--error { color: var(--gemboss-danger-strong, var(--gemboss-danger)); }
.gb-tc-thread__count { display: flex; align-items: center; gap: 8px; margin: 8px 16px 4px; font-size: var(--gemboss-fs-caption); color: var(--gemboss-text-muted); }
.gb-tc-thread__count::after { content: ""; flex: 1; border-top: 1px solid var(--gemboss-divider); }
.gb-tc-people { width: var(--gb-tc-people-w, 260px); }
.gb-tc-people__body { overflow-y: auto; overscroll-behavior: contain; padding: 8px 8px 16px; }
.gb-tc-people__section + .gb-tc-people__section { margin-top: 16px; }
.gb-tc-person {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 40px; padding: 4px 8px; box-sizing: border-box;
  border: 0; border-radius: var(--gemboss-radius-md); background: none; text-align: left; text-decoration: none;
  font: inherit; color: inherit;
}
:is(a, button).gb-tc-person { cursor: pointer; }
@media (hover: hover) { :is(a, button).gb-tc-person:hover { background: var(--gemboss-hover); } }
.gb-tc-person:focus-visible { outline: 2px solid var(--gemboss-accent); outline-offset: -2px; }
.gb-tc-person__av { position: relative; flex: none; display: inline-flex; }
.gb-tc-person__text { flex: 1 1 auto; min-width: 0; display: grid; }
.gb-tc-person__name, .gb-tc-person__sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-tc-person__name { font-weight: 550; line-height: 20px; color: var(--gemboss-text-strong); }
.gb-tc-person__sub { font-size: var(--gemboss-fs-caption); line-height: 16px; color: var(--gemboss-text-muted); }
.gb-tc-person__role {
  flex: none; padding: 0 6px; border: 1px solid var(--gemboss-divider); border-radius: var(--gemboss-radius-full);
  font-size: var(--gemboss-fs-micro); font-weight: 650; line-height: 18px; color: var(--gemboss-text-muted);
}
.gb-tc-person--offline .gb-tc-person__name { color: var(--gemboss-text-muted); }
.gb-tc-person--offline .gb-avatar { opacity: .55; }
/* Presence: a dot on the avatar, ringed in the surface so it reads on any picture. Online green, away amber, offline a
   hollow ring (not a grey dot: a grey dot looks like a broken green one). */
.gb-tc-presence {
  position: absolute; right: -1px; bottom: -1px; width: 8px; height: 8px; border-radius: 50%;
  border: 2px solid var(--gemboss-surface); background: var(--gemboss-success);
}
.gb-tc-presence--away { background: var(--gemboss-warning); }
.gb-tc-presence--offline { background: var(--gemboss-surface); box-shadow: inset 0 0 0 1.5px var(--gemboss-text-muted); }
.gb-tc-presence--online { background: var(--gemboss-success); }
/* Collapsed: a 56px strip of avatars. The names stay for screen readers (clipped, not removed). */
.gb-tc-people[data-collapsed] { width: 56px; }
.gb-tc-people[data-collapsed] .gb-tc-panel-head { justify-content: center; padding: 8px 0; }
.gb-tc-people[data-collapsed] .gb-tc-panel-head__actions { display: none; }
.gb-tc-people[data-collapsed] :is(.gb-tc-panel-head__text, .gb-tc-people__heading, .gb-tc-person__text, .gb-tc-person__role) {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.gb-tc-people[data-collapsed] .gb-tc-people__body { padding: 8px 4px; }
.gb-tc-people[data-collapsed] .gb-tc-people__section + .gb-tc-people__section { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--gemboss-divider); }
.gb-tc-people[data-collapsed] .gb-tc-person { justify-content: center; padding: 4px 0; }

/* ── Under a finger, and at phone width: every control 44px ─────────────────────────────────────────────────────── */
@media (pointer: coarse), (max-width: 47.9975em) {
  .gb-tc-channel, .gb-tc-person, .gb-tc-quote, .gb-tc-threadprev { min-height: 44px; }
  .gb-tc-act { min-width: 44px; height: 44px; }
  .gb-tc-jump { width: 48px; height: 48px; }
  .gb-tc-composer__input { font-size: 16px; min-height: 44px; padding-block: 12px; } /* 16px: iOS zooms the page under it */
  .gb-tc-composer__box > .ui-btn--icon { width: 44px; height: 44px; }
}

/* ── The screen at its widths (container queries on .gb-tc) ────────────────────────────────────────────────────── */
/* ≤ 1100px: the panel is a drawer over the conversation, which keeps its whole width. */
@container gb-tc (max-width: 1100px) {
  /* `grid-area: 1 / 1 / -1 / -1`: an absolutely placed grid child's containing block is its grid AREA, and column 3 is
     0px wide once the panel leaves the flow (measured: a 1px drawer). The whole grid it is. */
  .gb-tc > .gb-tc-thread, .gb-tc > .gb-tc-people, .gb-tc > .gb-tc-scrim { grid-area: 1 / 1 / -1 / -1; }
  .gb-tc > .gb-tc-thread, .gb-tc > .gb-tc-people {
    position: absolute; top: 0; right: 0; bottom: 0; z-index: 5; width: min(var(--gb-tc-thread-w, 380px), 100%);
    box-shadow: var(--gemboss-shadow-overlay);
  }
  .gb-tc > .gb-tc-people { width: min(var(--gb-tc-people-w, 260px) + 40px, 100%); }
  /* A collapsed people panel is a CLOSED drawer here: a strip over the conversation would cover its text. */
  .gb-tc > .gb-tc-people[data-collapsed] { display: none; }
  .gb-tc > .gb-tc-scrim { display: block; position: absolute; inset: 0; z-index: 4; background: color-mix(in srgb, var(--gemboss-dark-bg) 32%, transparent); }
}
/* ≤ 760px: a phone. The list OR the conversation; the panel is a sheet over the whole chat. */
@container gb-tc (max-width: 760px) {
  .gb-tc > .gb-tc-rail { grid-column: 1 / -1; width: auto; border-right: 0; }
  .gb-tc > .gb-tc-main { grid-column: 1 / -1; }
  .gb-tc:not([data-view="list"]) > .gb-tc-rail, .gb-tc[data-view="list"] > :is(.gb-tc-main, .gb-tc-scrim, .gb-tc-thread, .gb-tc-people) { display: none; }
  .gb-tc > .gb-tc-thread, .gb-tc > .gb-tc-people { left: 0; width: auto; border-left: 0; box-shadow: none; }
  .gb-tc > .gb-tc-scrim { display: none; }
  .gb-tc .gb-tc-head__back { display: inline-flex; margin-left: -8px; }
  .gb-tc-head { padding-left: 12px; }
  .gb-tc-composer { padding: 8px 12px 12px; }
}
/* < 360px (a 320 phone): the box's three 44px buttons (paperclip, emoji, send) touch, so the field keeps 150px and more.
   Their icons are 20px in a 44px target: 24px of their own padding still lies between two icons. */
@container gb-tc (max-width: 359px) {
  .gb-tc-composer__box { gap: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .gb-tc-msg { transition: background-color .15s linear; }
  .gb-tc-acts { transition: opacity .1s linear; }
}
