.cm-compose { flex-wrap: wrap; }
.ca-tools { flex-basis:100%; min-width:0; }
.ca-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
.ca-actions small,.ca-file small { color:var(--muted); font-size:11px; }
#ca-pending { display:flex; flex-wrap:wrap; gap:6px; }
.ca-chip { display:inline-flex; gap:8px; align-items:center; border:1px solid var(--line); padding:5px 8px; max-width:100%; overflow-wrap:anywhere; font-size:12px; }
.ca-chip img { width:54px; height:40px; object-fit:cover; }
.ca-chip button { color:inherit; background:transparent; border:0; cursor:pointer; font-size:20px; }
#ca-status { font-size:12px; color:var(--gold); padding-top:4px; }
#ca-picker { padding:12px; border:1px solid var(--line); margin-bottom:8px; max-height:240px; overflow:auto; }
.ca-gifs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:8px 0; }
.ca-gifs button { border:1px solid var(--line); background:var(--surface); cursor:pointer; padding:0; }
.ca-gifs img { width:100%; height:80px; object-fit:cover; }
.ca-image { display:block; max-width:100%; width:auto; max-height:300px; border-radius:8px; margin:6px 0; }
.ca-file { display:grid; gap:8px; min-width:0; padding:10px 0; overflow-wrap:anywhere; }
.ca-file .btn { justify-self:start; }
.ca-file audio { width: min(280px,100%); }
.bubble:has(.ca-file), .bubble:has(.ca-image) { max-width:min(380px,100%); }
.ca-chip audio { max-width:220px; width:100%; }
.ca-chip video { max-width:180px; }
.cm-compose textarea { flex:1; min-width:0; }
.ca-tools button:focus-visible,.ca-file button:focus-visible { outline:2px solid var(--gold); outline-offset:3px; }

.cm-message-actions { display:flex; flex-wrap:wrap; gap:4px; margin:5px 0 9px; }
.cm-message-actions button { font:inherit; font-size:11px; padding:5px 8px; border:1px solid var(--line, #dedbd3); border-radius:14px; background:transparent; color:var(--muted); cursor:pointer; }
.cm-message-actions button:hover, .cm-message-actions button[aria-pressed="true"] { background:var(--gold); color:#26221b; border-color:var(--gold); }
.cm-message-actions button:focus-visible { outline:2px solid var(--gold); outline-offset:2px; }
.cm-quote, #cm-reply { border-left:3px solid var(--gold); padding:6px 10px; margin:0 0 8px; font-size:12px; }
.cm-quote span, #cm-reply span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:55ch; }
#cm-reply { flex-basis:100%; min-width:0; }
#cm-reply[hidden] { display:none; }
#cm-action-status { margin:0; padding:0 12px 4px; }
@media (pointer:coarse) { .cm-message-actions button { min-height:36px; } }

/* Reaction choices appear only after a deliberate message action. */
.cm-message-actions:empty { display:none; }
.bubble[data-chat-message] { -webkit-touch-callout:none; }
.bubble[data-chat-message]:focus-visible { outline:2px solid var(--gold); outline-offset:3px; }
#cm-reaction-picker { width:min(340px, calc(100vw - 32px)); padding:0; border:1px solid var(--line, #dedbd3); border-radius:18px; background:var(--surface, #faf8f3); color:var(--fg, #26221b); box-shadow:0 16px 48px #18140e33; }
#cm-reaction-picker::backdrop { background:#18140e55; }
.cm-reaction-panel { padding:20px; }
.cm-reaction-panel > strong { display:block; margin-bottom:14px; font-size:14px; }
.cm-reaction-options { display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; margin-bottom:14px; }
.cm-reaction-options button { min-height:44px; padding:8px 4px; font:inherit; font-size:13px; border:1px solid var(--line, #dedbd3); border-radius:12px; color:inherit; background:transparent; cursor:pointer; }
.cm-reaction-options button:hover, .cm-reaction-options button[aria-pressed="true"] { background:var(--gold); color:#26221b; border-color:var(--gold); }
.cm-reaction-options button:focus-visible { outline:2px solid var(--gold); outline-offset:2px; }
