/* Reading clarity for the support conversation and composer. */
body.staff-app.staff-v4 .thread-message.agent:not(.internal) .message-bubble {
  background: color-mix(in srgb, var(--neom-brand) 10%, var(--neom-raised));
  border-color: color-mix(in srgb, var(--neom-brand) 27%, var(--neom-border));
}
body.staff-app.staff-v4 .thread-message.system .message-bubble {
  background: var(--neom-surface);
  color: var(--neom-muted);
  border-style: dashed;
}
body.staff-app.staff-v4 .message-main { min-width: 0; }
body.staff-app.staff-v4 .message-author { min-width: 0; }
body.staff-app.staff-v4 .message-author strong { min-width: 0; overflow-wrap: anywhere; }
body.staff-app.staff-v4 .message-author time { flex-shrink: 0; }
body.staff-app.staff-v4 .message-bubble { overflow-wrap: anywhere; }
body.staff-app.staff-v4 .message-bubble a { color: inherit; text-decoration: underline; overflow-wrap: anywhere; }
body.staff-app.staff-v4 .message-bubble .rich-document { white-space: normal; }
body.staff-app.staff-v4 .message-bubble .rich-document :is(div,li) { white-space: pre-wrap; }
body.staff-app.staff-v4 .message-bubble .rich-document :is(ul,ol) { margin: 0; padding-left: 1.4em; }
body.staff-app.staff-v4 .composer-rich-preview { max-height:clamp(90px,22dvh,160px); overflow:auto; }
body.staff-app.staff-v4 .composer-rich-preview .rich-document { white-space:normal; }
body.staff-app.staff-v4 .composer-rich-preview .rich-document :is(div,li) { white-space:pre-wrap; }
body.staff-app.staff-v4 .composer-rich-preview .rich-document :is(ul,ol) { margin:0; padding-left:1.4em; }
body.staff-app.staff-v4 .composer:focus-within {
  border-color: color-mix(in srgb, var(--neom-brand) 55%, var(--neom-border));
}
body.staff-app.staff-v4 .composer textarea:focus-visible {
  box-shadow: inset 0 0 0 2px var(--neom-brand) !important;
}
body.staff-app.staff-v4 .composer-tools button:focus-visible,
body.staff-app.staff-v4 .send-actions button:focus-visible,
body.staff-app.staff-v4 .send-actions select:focus-visible {
  outline-offset: -3px;
}
@media (max-width: 620px) {
  body.staff-app.staff-v4 .thread-message.internal { margin-left: 0; }
  body.staff-app.staff-v4 .message-author strong { max-width: min(180px, 48vw); }
  body.staff-app.staff-v4 .composer textarea { scroll-margin-block: 8px; }
}

/* Mobile: a roomier writing field and a quieter, shorter status area. */
@media (max-width: 620px) {
  body.staff-app.staff-v4 .detail-header { min-height:46px; height:46px; padding-block:1px; }
  body.staff-app.staff-v4 .thread-tools { min-height:24px; height:24px; }
  body.staff-app.staff-v4 .v4-attention-row .v4-badge { padding:2px 6px; font-size:11px; line-height:16px; }
  body.staff-app.staff-v4 .composer textarea { height:64px; min-height:64px; max-height:110px; }
  body.staff-app.staff-v4 .composer textarea:focus { height:82px; }
  body.staff-app.staff-v4 .composer textarea:focus-visible { box-shadow:inset 0 0 0 1px var(--neom-brand) !important; }
}

/* Resolved chats on phones: keep the name readable and the actions compact. */
@media (max-width: 620px) {
 body.staff-app.staff-v4 .detail-header:has([data-reopen-conversation]) [data-archive-conversation],
 body.staff-app.staff-v4 .detail-header:has([data-reopen-conversation]) [data-unarchive-conversation] { width:44px; min-width:44px; height:44px; padding:10px; }
 body.staff-app.staff-v4 .detail-header:has([data-reopen-conversation]) :is([data-archive-conversation],[data-unarchive-conversation]) span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
 body.staff-app.staff-v4 .conversation-detail:has([data-reopen-conversation]) #conversation-attention { display:none; }
}

/* Mobile: remove the redundant status strip; keep actionable attention controls. */
@media (max-width:620px){
 body.staff-app.staff-v4 .conversation-detail .thread-tools{display:none}
 body.staff-app.staff-v4 .conversation-detail #conversation-attention:not(:has([data-attention-action])){display:none}
 body.staff-app.staff-v4 .bot-summary{min-height:44px;margin-bottom:10px;padding:7px 10px}
}
