/*
 * The assistant's chat PIECES the package draws — @gemboss/ui 0.29.0 (src/assistant/chat.tsx imports this file; its own
 * entry, not in gemboss-ui.css). chat.css and chat-composer.css stay what they were (the body every surface had); this is
 * only what the components add on top of them, which every surface used to write inline or in its own sheet:
 *
 *   .gb-chat               the column: thread over composer, filling the frame's body (partner-radar `.asst`, GemFeedback
 *                          `.gf-asst`); transparent at full screen, where the reading column sits on the page (820px).
 *   .gb-chat-starter       a starter that WRAPS (radius 12, left-aligned): partner-radar, gemwatcher and GemFeedback each
 *                          undid the pill's nowrap inline, because a long question as a nowrap pill is cut in 400px.
 *   .gb-chat-meta          the line under an answer: Copy · engine · seconds · cost (partner-radar, GemFeedback).
 *   .gb-chat-error/-cmd    a failed turn with its fix: the sentence, the command, Copy, the original error folded.
 *   .gb-chat-note          a quiet centred line in the stream.
 *   .gemboss-ec-attach-btn the paperclip in the composer (the admin's ghost circle, moved here with the component).
 *
 * Numbers are the kit's (caption 12px, 8px steps). Targets: §9.1 (controls 44 under touch; the Copy button is a kit
 * button, 28 with a mouse and 44 under a coarse pointer through the kit's own rule).
 */
.gb-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; background: var(--gemboss-surface, #fff); }
.gemboss-assistant-layout:not(.is-dock) .gb-chat { background: transparent; }
.gb-chat > .gemboss-ec-scroll { flex: 1 1 auto; }
/* The chat's own heading: where the frame has no title bar (full screen, or no frame at all). It and the log make room for
   the frame's floated full-screen buttons by the amount AssistantChat measured (--gb-chat-chrome-w / -h). */
.gb-dock:not(.gb-dock-full) .gb-chat-head { display: none; }
.gb-chat-head { flex: none; box-sizing: border-box; justify-content: center; }
.gb-chat[data-chrome] > .gb-chat-head { padding-right: var(--gb-chat-chrome-w); min-height: var(--gb-chat-chrome-h); }
.gb-chat[data-chrome]:not(:has(> .gb-chat-head)) > .gemboss-ec-scroll { padding-top: var(--gb-chat-chrome-h); }

.gemboss-ec-starter.gb-chat-starter { white-space: normal; border-radius: 12px; text-align: left; overflow-wrap: anywhere; }
.gb-chat-starter-hint { display: block; margin-bottom: 4px; color: var(--gemboss-text-muted); font-size: var(--gemboss-fs-caption, 12px); }
/* Starter CARDS (0.49): a starter with a `sub` line or an icon is a row of its own (icon, label, one line on what it
   does), so "what can I do here" is scanned, not read. Each card is taller than the 44px target overlay the pills need a
   16px row gap for, so the cards keep the kit's 8px. */
.gemboss-ec-starters.gb-chat-starters-cards { flex-direction: column; flex-wrap: nowrap; row-gap: 8px; }
.gb-chat-starters-cards .gb-chat-starter { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.gb-chat-starter-icon { flex: none; width: 32px; height: 32px; border-radius: var(--gemboss-radius-md, 8px); display: grid; place-items: center; background: var(--gemboss-accent-soft, #eef0fe); color: var(--gemboss-accent, #5661f5); }
.gb-chat-starter-icon svg { width: 20px; height: 20px; fill: currentColor; }
.gb-chat-starter-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gb-chat-starter-label { font-weight: 600; }
.gb-chat-starter-sub { color: var(--gemboss-text-muted); font-size: var(--gemboss-fs-caption, 12px); }
.gb-chat-label { margin: 0; color: var(--gemboss-text-muted); font-size: var(--gemboss-fs-caption, 12px); }
.gb-chat-target { color: var(--gemboss-text-muted); }

.gb-chat-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--gemboss-text-muted); font-size: var(--gemboss-fs-caption, 12px); }
.gb-chat-copy { flex: none; }
.gb-chat-note { margin: 0; align-self: center; text-align: center; color: var(--gemboss-text-muted); font-size: var(--gemboss-fs-caption, 12px); }

.gb-chat-notice { margin: 0; }
.gb-chat-error { display: grid; gap: 8px; margin: 0; overflow-wrap: anywhere; }
.gb-chat-cmd {
  display: block; padding: 6px 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.05); color: var(--gemboss-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 16px; overflow-wrap: anywhere; user-select: all;
}
.gb-chat-original > summary { cursor: pointer; min-height: 24px; display: flex; align-items: center; }

/* The paperclip (ChatAttach, a surface's `tools`; the admin's chats use the "+" menu since 0.70.0): a ghost circle the size of
   the send circle it sits beside, 28px under a mouse at 768 and wider, 44px under a finger or below 768. */
.gemboss-ec-input .gemboss-ec-attach-btn {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background-color: transparent; color: var(--gemboss-text-muted); cursor: pointer;
}
@media (hover: hover) { .gemboss-ec-input .gemboss-ec-attach-btn:hover:not(:disabled) { background-color: var(--gemboss-hover, rgba(0, 0, 0, 0.05)); color: var(--gemboss-text); } }
.gemboss-ec-input .gemboss-ec-attach-btn:focus-visible { outline: 2px solid var(--ui-focus, #5661f5); outline-offset: 2px; }
.gemboss-ec-input .gemboss-ec-attach-btn:disabled { opacity: 0.5; cursor: default; }
.gemboss-ec-input .gemboss-ec-attach-btn svg { width: 16px; height: 16px; }

/* The engine chip in a composer (a surface that still puts EnginePicker in `leading`) has no 44px overlay under a mouse since
   0.70.0: the toolbar row is 28px tall there (send is), and an overlay would reach 8px into the text box above. The chip is
   28px, above WCAG 2.5.8's 24 (§9.1's mouse tier); it is 44 under a finger (assistant-engine.css). */
@media (pointer: coarse), (max-width: 47.9975em) {
  .gb-chat-original > summary { min-height: 44px; }
  /* A 44px box, drawn at its mouse 28 (chat.css, "vẽ 28, khối 44", 14/11/2026). */
  .gemboss-ec-input .gemboss-ec-attach-btn { min-width: 44px; min-height: 44px; }
}
/* (The ≤ 560px rule that gave an icon-less full-screen button back its words went 30/10/2026: on a phone those buttons
   are rows in the chrome's ⋯ now, labels shown, host.tsx COMPACT_CHROME_QUERY.) */

/* ONE ROW while the words fit one line (12/11/2026, ChatComposer `composerRows`, chat-plain.js `rowsFor`): the toolbar's parts
   stand in the box's own row, the lead ("+", ✦, a chip) first, then the text, then the tools and send. Only the layout changes:
   the text box is the same element, so typing past the line keeps the caret, the focus and the selection. Two rows
   (`data-rows="2"`) is the layout before. Here, not chat-composer.css: that one rides in gemboss-ui.css, whose weight only goes
   down, and this is the sheet both the components and a plain page (gemcare) bring. */
.gemboss-ec-input[data-rows="1"] > .gemboss-ec-toolbar { display: contents; }
.gemboss-ec-input[data-rows="1"] > textarea { flex: 1 1 0; order: 2; }
.gemboss-ec-input[data-rows="1"] .gemboss-ec-toolbar-lead { flex: none; order: 1; }
.gemboss-ec-input[data-rows="1"] .gemboss-ec-toolbar > :not(.gemboss-ec-toolbar-lead) { order: 3; }
/* What a host puts under the text box (`under`) stays under the row. */
.gemboss-ec-input[data-rows="1"] > textarea ~ :not(.gemboss-ec-toolbar) { order: 4; }
.gemboss-ec-input[data-rows="1"] > textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* A question waiting on the person: its box, and since 15/11/2026 its place (the foot of the thread's scroll), are ChatDecide's own
   sheet, chat-cards.css (one sheet owns its look, §9.3). */
/* The heartbeat is GemHolo (11/11/2026). A page that has not linked gem-holo.css (a plain page, a bundle that drops CSS imports)
   still shows a pulsing dot (chat.css' star beat) instead of nothing: zero specificity, and gem-holo.css' `.ui-holo` takes the box
   back. Here, not chat.css: that one rides in gemboss-ui.css, the shared shell, whose weight only goes down. */
:where(.gemboss-ec-pending-star) { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
/* A thought's mark (ChatStepMark, 11/11/2026): the 16px box on the 20px first line (a glyph sat on the baseline; an icon is a box).
   Here, not chat.css: that one rides in gemboss-ui.css, the shared shell, whose weight only goes down. */
.gemboss-narr-row.thinking .gemboss-narr-dot { margin-top: 2px; }
/* chat.css' markdown colours without color-mix() (13/11/2026). chat.css gives every message's markdown its colours from its own text
   (`--gemboss-ec-md-ink/-line/-fill`, color-mix of currentColor). An engine without color-mix() (Safari before 16.2) keeps those
   as text and drops them where they are used: fills went transparent, lines took the text's full colour. A fallback written before
   them in the same rule cannot help (a custom property takes any tokens, so the later one always wins), so it is this @supports.
   Mid-grey with alpha, not a kit token: every kit neutral is opaque and made for one ground, and these sit on the light answer, the
   seller's dark fill and dark theme alike. The ink needs none: unusable, `color` falls back to the message's own text colour.
   Here, not chat.css: that one rides in gemboss-ui.css, the shared shell, whose weight only goes down. One class more than
   chat.css' rule, so it wins whichever sheet loads last. */
@supports not (color: color-mix(in srgb, currentColor 14%, transparent)) {
  .gemboss-ec-msg .gemboss-ec-bubble.gemboss-ec-bubble { --gemboss-ec-md-line: #80808052; --gemboss-ec-md-fill: #80808024; }
}
