/* Vici shared composer - the box you ask in.
   The modal is the master copy: rules moved verbatim, in source order, from
   dock/panel/panel.css and then dock/panel/composer-context.css; loaded after
   shared-tokens.css and before the host's own sheet (panel.css here,
   styles.css on the web under /panel/).
   The band under the conversation, the raised surface, the input, Send and
   the mic with every face they wear, + Attach, the line under the box, and
   what rides the next message: compact attachment marks.
   The input's type (font, line height, letter spacing, padding) is the
   editor's metrics: this host's caret and selection rig (.composer-mirror,
   .composer-selection-clone in panel.css) must say the same, and
   dock/test_page_laws.py holds the two together. The rig itself, the
   id-keyed dictation paint, the placeholder and the dock's own chips (effort,
   capture scope, keep awake) are the host's.
   Shared files (dock/HANDOFF.md, "Shared files"): they hold exactly what the
   modal ships; a host need is a selector in the host's own sheet; no
   transition, animation, filter or blur, and no CSS the board's WebKit has
   not already shipped; every rule renders right with no host-toggled class.
   An edit here is a dock landing (live first) that also deploys the web. */

.conversation-composer {
  position: relative;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.using-row {
  display:none; flex-wrap:wrap; justify-content:flex-start; align-content:flex-start;
  gap:6px; max-height:80px; overflow-y:auto; margin-bottom:8px; padding:3px 8px 3px 2px; box-sizing:border-box;
}
.using-row.has-context { display:flex; }
.armed-mark { position:relative; display:inline-flex; align-items:center; flex:0 1 auto; min-width:0; max-width:min(240px,100%); height:34px; padding-right:3px; border:1px solid var(--border); border-radius:8px; background:var(--surface); box-sizing:border-box; }
.armed-mark-body { appearance:none; display:flex; align-items:center; flex:1 1 auto; min-width:0; gap:6px; height:100%; padding:3px 6px; border:0; border-radius:7px; background:transparent; color:var(--text); font-size:12px; line-height:18px; text-align:left; cursor:pointer; }
.armed-mark-media { display:flex; align-items:center; justify-content:center; flex:0 0 24px; width:24px; height:24px; overflow:hidden; border-radius:4px; color:var(--muted); }
.armed-mark-media > svg { width:16px; height:16px; flex:none; }
.armed-mark-media img { display:block; width:100%; height:100%; object-fit:contain; }
.armed-mark-media .context-image-fallback { padding:0; font-size:8px; line-height:10px; }
.armed-mark-media .context-image-fallback-name { display:none; }
.armed-mark-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.armed-mark-x { position:static; flex:0 0 24px; width:24px; height:24px; border:0; border-radius:5px; background:transparent; color:var(--muted); font:inherit; font-size:16px; line-height:20px; padding:0; cursor:pointer; }
button.armed-mark-body:hover,button.armed-mark-body.kb-hover { background:var(--surface-2); }
.armed-mark-x:hover,.armed-mark-x.kb-hover,.armed-mark-x:focus-visible { background:var(--surface-2); color:var(--text); }
.conversation-composer-input {
  width: 100%;
  min-height: 44px;
  /* Start at one line; JS tracks scrollHeight up to this growth cap. */
  max-height: 40vh;
  overflow-y: auto;
  padding: 11px 80px 11px 12px;  /* right: clearance for microphone and send
                                    circle (the mirror reads computed
                                    padding, so the caret math follows) */
  resize: none;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  outline: none;
}
.microphone-btn {
  position: absolute;
  right: 44px;
  bottom: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.microphone-stop-glyph { display: none; width: 12px; height: 12px; border-radius: 2px; background: currentColor; }
.microphone-btn.dictation-stop { color: var(--text); background: var(--surface-2); }
.microphone-btn.dictation-stop .microphone-glyph { display: none; }
.microphone-btn.dictation-stop .microphone-stop-glyph { display: block; }
.microphone-btn svg { width: 18px; height: 18px; }
.microphone-glyph { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.microphone-btn .microphone-cancel-glyph { display: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.microphone-btn .microphone-loading-glyph { display: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; transform-origin: center; }
.microphone-btn.discard { color: var(--muted); }
.microphone-btn.discard .microphone-cancel-glyph { opacity: .7; }
.microphone-btn.discard .microphone-glyph { display: none; }
.microphone-btn.discard .microphone-cancel-glyph { display: block; }
.microphone-btn.transcribing { color: var(--muted); }
.microphone-btn.transcribing .microphone-glyph,
.microphone-btn.transcribing .microphone-cancel-glyph { display: none; }
.microphone-btn.transcribing .microphone-loading-glyph { display: block; }
.microphone-btn:hover, .microphone-btn.kb-hover { background: var(--surface); }
.microphone-btn:disabled, .send-btn:disabled { opacity: .45; cursor: default; }
.microphone-btn.transcribing:disabled { opacity: 1; }
/* Composer actions are inside the box, pinned bottom-right. */
.send-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.send-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.screen-check-glyph {
  display: none;
  font-size: 17px;
  font-weight: 750;
  line-height: 1;
}
.send-btn.screen-check svg { display: none; }
.send-btn.screen-check .screen-check-glyph { display: block; }
.send-btn.ready {
  border-color: var(--accent-link);
  background: var(--accent);
  color: var(--accent-contrast);
}
.send-btn:hover,
.send-btn.kb-hover {
  border-color: var(--accent-link);
  color: var(--accent-link);
}
.send-btn.ready:hover,
.send-btn.ready.kb-hover {
  color: var(--accent-contrast);
  background: var(--accent-hover);
}
/* The held ? (KAN-360): a bare press the mirror holds while a turn
 * streams. The glyph shows and breathes — its opacity is stepped by
 * the native anim tick (panel.js __threadAnimTick), never a keyframe:
 * no CSS animation runs in this occluded window. */
.send-btn.held {
  border-color: var(--accent-link);
  background: var(--accent);
  color: var(--accent-contrast);
}
.send-btn.held svg { display: none; }
.send-btn.held .screen-check-glyph { display: block; }
.conversation-composer-input:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}
/* WKSnapshot never captures the native caret on this offscreen window
   (bench round 15: the glass shows NO caret at all), so the composer
   gets a real DOM one: mirror-measured position, CSS blink. */
.composer-wrap { position: relative; }
/* Under the box (KAN-333): capture scope, model, effort — the levers
 * that shape the NEXT message sit with the composer, not in chrome.
 * The keyboard-hint note keeps the right edge and yields first. */
.conversation-composer-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}
.conversation-composer-note {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: right;
  color: var(--muted);
  font-size: 11px;
}
.add-context-chip {
  appearance: none;
  flex: none;
  height: 22px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-link);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.add-context-chip:hover,
.add-context-chip.kb-hover,
.add-context-chip:focus-visible {
  color: var(--text);
  border-color: var(--accent-link);
  outline: none;
}
.conversation-composer { padding:12px 24px 12px; }
.composer-wrap { border:1px solid var(--control-border); border-radius:12px; background:var(--surface); padding-bottom:48px; min-height:104px; box-sizing:border-box; }
.conversation-composer-input { display:block; min-height:54px; max-height:30vh; border:0; border-radius:12px 12px 0 0; background:transparent; padding:14px; font:400 15px/22px var(--font); letter-spacing:normal; }
.composer-wrap > .add-context-chip { position:absolute; left:10px; bottom:8px; height:32px; background:transparent; border:0; border-radius:8px; padding:0 8px; color:var(--muted); }
.microphone-btn { right:48px; bottom:8px; width:32px; height:32px; border-radius:8px; color:var(--muted); }
.send-btn { right:8px; bottom:8px; width:32px; height:32px; border-radius:8px; }
.send-btn.ready { color:#fff; background:var(--accent); border-color:var(--accent); }
.conversation-composer-footer { align-items:center; gap:4px; padding-top:8px; }
.conversation-composer-note { font-size:11.5px; color:var(--muted); opacity:1; }
.composer-wrap:focus-within { border-color:var(--accent-mark); }
span.armed-mark-body { cursor:default; box-sizing:border-box; }
/* The composer owns ordinary reply cancellation; no per-frame animation. */
.send-btn .answer-stop-glyph { display:none; width:12px; height:12px; border-radius:2px; background:currentColor; }
.send-btn.answer-stop svg,.send-btn.answer-stop .screen-check-glyph { display:none; }
.send-btn.answer-stop .answer-stop-glyph { display:block; }
/* Pending context belongs to the next message. Nothing runs per frame. */
.composer-attachments { padding:0 12px 10px; min-width:0; }
.composer-attachments[hidden] { display:none; }
.composer-attachments .using-row { max-height:92px; margin:0; padding:0 6px 0 0; gap:6px; }
.composer-attachments .armed-mark { height:32px; max-width:min(230px,100%); background:var(--surface-2); border-color:transparent; }
.composer-attachments .armed-mark-media { width:22px; height:22px; flex-basis:22px; }
.composer-attachments .armed-mark-body { padding:3px 5px; font-size:12px; }
.composer-attachments-more { background:transparent; border:0; color:var(--accent-link); font:inherit; font-size:11.5px; padding:6px 0 0; cursor:pointer; }
.composer-attachments-more[hidden],.armed-mark[hidden] { display:none!important; }
