/* Agent chat (agent-chat/agent-chat.js; docs/agent-chat.md), in the calm redesign. Loaded after styles.css. The bubbles follow
   the Hub helper's (.hp-* in styles.css). Colours only from the tokens in styles.css (light and dark alike). */

.ac-pick { margin-top: 12px; }
.ac-new { min-height: 44px; }
.ac-thread { display: flex; flex-direction: column; margin-top: 16px; padding: 0; overflow: hidden; }
.ac-list { display: flex; flex-direction: column; gap: 12px; padding: 16px; min-height: 200px; max-height: calc(50 * var(--vh)); overflow-y: auto; overscroll-behavior: contain; }
.ac-intro p { margin: 0 0 12px; color: var(--text-2); }
.ac-starts { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ac-start { min-height: 44px; text-align: left; white-space: normal; }
.ac-msg { display: flex; flex-direction: column; gap: 4px; max-width: 88%; }
.ac-msg p { margin: 0; padding: 10px 14px; border-radius: var(--r-box); white-space: pre-line; overflow-wrap: anywhere; }
.ac-msg.me { align-self: flex-end; align-items: flex-end; }
.ac-msg.me p { background: var(--solid); color: var(--on-solid); }
.ac-msg.bot { align-self: flex-start; }
.ac-msg.bot p { background: var(--surface-2); border: 1px solid var(--border); }
.ac-msg.note { align-self: center; max-width: 100%; }
.ac-msg.note p { color: var(--text-2); font-size: .9rem; text-align: center; background: none; border: 1px solid var(--border); }
.ac-at { font-size: .75rem; color: var(--text-3); padding: 0 4px; }
.ac-msg.draft { align-self: flex-start; align-items: flex-start; }
.ac-msg.draft p { background: none; border: 1px solid var(--border); }
.ac-draft-l { font-size: .75rem; color: var(--text-3); padding: 0 4px; }
.ac-note { min-height: 44px; }
.ac-saved { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--text-2); padding: 0 4px; }
.ac-wait p { display: flex; align-items: center; gap: 8px; color: var(--text-3); }
.ac-dots { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); animation: ac-pulse 1.2s ease-in-out infinite; }
@keyframes ac-pulse { 50% { opacity: .25; } }
.ac-err { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ac-err p, .ac-send-err { margin: 0; color: var(--rt-bad); }
.ac-ask { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--border); }
.ac-ask .meta { margin: 0; }
.ac-row { display: flex; align-items: flex-end; gap: 8px; }
.ac-box { flex: 1; min-height: 48px; max-height: calc(30 * var(--vh)); resize: none; font: inherit; line-height: 1.4; }
.ac-send { min-height: 48px; }
.ac-month { margin-top: 10px; }
@media (min-width: 900px) { .ac-list { max-height: calc(62 * var(--vh)); } }
.ac-history { margin-top: 16px; }
.ac-history summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.ac-chats { display: flex; flex-direction: column; margin: 8px 0 0; padding: 0; list-style: none; }
.ac-chat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 44px; padding: 10px 8px; border: 0; border-top: 1px solid var(--border);
  background: none; color: var(--text); text-align: left; font: inherit; cursor: pointer; border-radius: 0; }
.ac-chat.on { background: var(--surface-2); }
.ac-chat-t { font-weight: 600; overflow-wrap: anywhere; }
.ac-chat-m { font-size: .8rem; color: var(--text-3); }
@media (prefers-reduced-motion: reduce) { .ac-dots { animation: none; } }
@media print { .ac-ask, .ac-history { display: none; } .ac-list { max-height: none; overflow: visible; } }
