/* Assistant page: the conversation inside the side panel (the panel itself, .chat, is in components.css, shared with /podcast). */
/* bubble: user = raised neutral fill on the right, assistant = outlined on the left */
.group { position:relative; display:flex; flex-direction:column; gap:var(--s-1); max-width:88%; animation:enter var(--dur-slow) var(--ease); }
.group.user { align-self:flex-end; align-items:flex-end; }
.group.bot { align-self:flex-start; align-items:flex-start; }
.group .who { display:flex; align-items:center; gap:var(--s-2); font-size:var(--fs-xs); color:var(--text-3); }
.group .who b { font-weight:var(--fw-semibold); color:var(--text-2); }
.bubble { position:relative; padding:var(--s-2) var(--s-3); border-radius:var(--r-lg); line-height:var(--lh-base); white-space:pre-wrap; overflow-wrap:anywhere; background:var(--surface-2); border:1px solid var(--border); box-shadow:inset 0 1px 0 var(--hl); }
.group.user .bubble { background:var(--surface-3); border-color:color-mix(in srgb, var(--surface-3) 60%, var(--border-strong)); border-bottom-right-radius:var(--r-sm); }
.group.bot .bubble { background:color-mix(in srgb, var(--surface) 70%, transparent); border-color:var(--border); border-bottom-left-radius:var(--r-sm); }
.bubble .via { display:inline-flex; vertical-align:-3px; margin-right:var(--s-2); color:var(--text-2); }
.bubble .via .ico { width:16px; height:16px; }
.bubble.live::after { content:""; display:inline-block; width:2px; height:1em; margin-left:var(--s-1); vertical-align:-2px; background:currentColor; animation:pulse 1s steps(2) infinite; }
.bubble.cut { opacity:.7; }
.copy { position:absolute; top:0; right:calc(-1 * var(--s-6)); width:var(--s-6); height:var(--s-6); padding:0; display:inline-grid; place-items:center; border:0; border-radius:var(--r-sm); background:transparent; color:var(--text-3); opacity:0; transition:opacity var(--dur), background var(--dur), color var(--dur); }
.copy .ico { width:16px; height:16px; }
.group.bot:hover .copy, .copy:focus-visible { opacity:1; }
.copy:hover { background:var(--surface-2); color:var(--text); }

.composer { display:flex; align-items:flex-end; gap:var(--s-2); flex:none; padding:var(--s-3); border-top:1px solid var(--border); }
.composer-field { position:relative; flex:1; min-width:0; }
.composer textarea { display:block; width:100%; max-height:150px; padding:var(--s-3) var(--s-4); resize:none; overflow-y:auto; line-height:var(--lh-base); border-radius:var(--r-lg); scrollbar-width:thin; scrollbar-color:var(--border-strong) transparent; }
.composer .btn-icon { border-radius:var(--r-lg); }
.composer .count { position:absolute; right:var(--s-3); bottom:calc(-1 * var(--s-4)); font-size:var(--fs-xs); color:var(--text-3); font-variant-numeric:tabular-nums; }
.composer .count.over { color:var(--danger); }
.composer .btn-icon { height:var(--control); width:var(--control); }
.composer .btn-primary:disabled { background:var(--surface-2); color:var(--text-2); opacity:1; border-color:var(--border); }

/* the alert component used as a note inside the log */
.chat-log .alert { align-self:center; width:auto; max-width:94%; margin:0; }
@media (max-width: 899px) {
  .chat-head { padding-top:var(--s-5); }
  .group { max-width:80%; }
  .copy { right:calc(-1 * var(--tap)); width:var(--tap); height:var(--tap); opacity:1; }
  body.chat-open .app { padding-bottom:var(--sheet-h); }
  body.chat-open .orb-space { flex:0 0 clamp(64px, 12dvh, 110px); min-height:0; }
  body.chat-open .readout { margin-top:var(--s-2); }
  body.chat-open .readout .hint, body.chat-open .caption { display:none; }
  body.chat-open .readout h1 { font-size:var(--fs-lg); }
}
@media (prefers-reduced-motion: reduce) { .chat, .chat.open { transition:none; } .group { animation:none; } }
