/* Chat panel + recording indicator. Uses the viewer's design tokens
   (--bg, --surface, --accent, ...) with fallbacks so it also works alone. */
.lc-chat { width: 340px; flex: 0 0 340px; display: flex; flex-direction: column; min-height: 0;
  border-left: 1px solid var(--border, #dfe2e7); background: var(--bg, #fff); }
.lc-chat[hidden] { display: none !important; }
.lc-chat-head { display: flex; align-items: baseline; gap: 8px; padding: 14px 16px 10px; }
.lc-chat-title { font-weight: 700; letter-spacing: -.01em; }
.lc-chat-sub { font-size: 12px; color: var(--muted, #6a707c); }
.lc-chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.lc-chat-empty { margin: auto 12px; text-align: center; color: var(--muted, #6a707c); font-size: 14px; }
.lc-notice { align-self: center; margin: 10px 0 6px; font-size: 12px; color: var(--muted, #6a707c);
  background: var(--surface, #f4f5f7); padding: 4px 10px; border-radius: 999px; text-align: center; }
.lc-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 100%; margin-top: 10px; }
.lc-msg.cont { margin-top: 2px; }
.lc-msg.mine { align-items: flex-end; }
.lc-msg-meta { display: flex; align-items: center; gap: 7px; margin: 0 4px 4px; font-size: 12px; color: var(--muted, #6a707c); }
.lc-msg-name { font-weight: 600; color: var(--text, #17181a); }
.lc-avatar { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700;
  background: color-mix(in srgb, var(--accent, #0078d4) 18%, transparent); color: var(--accent, #0078d4); }
.lc-msg.customer .lc-avatar { background: var(--surface-2, #e9ebef); color: var(--text, #17181a); }
.lc-bubble { max-width: 85%; padding: 8px 12px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--surface, #f4f5f7); color: var(--text, #17181a); font-size: 14px; line-height: 1.4; }
.lc-msg:not(.mine) .lc-bubble { border-top-left-radius: 6px; }
.lc-msg.mine .lc-bubble { background: var(--accent, #0078d4); color: var(--on-accent, #fff); border-top-right-radius: 6px; }
.lc-msg.customer .lc-bubble { background: var(--surface-2, #e9ebef); }
.lc-chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--border, #dfe2e7); }
.lc-chat-form textarea { flex: 1; resize: none; font: inherit; font-size: 14px; line-height: 1.4; padding: 9px 14px; max-height: 140px;
  border-radius: 18px; border: 1px solid var(--border, #dfe2e7); background: var(--bg, #fff); color: var(--text, #17181a); outline: none; }
.lc-chat-form textarea:focus { border-color: var(--accent, #0078d4); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #0078d4) 25%, transparent); }
.lc-chat-form .lc-chat-send { width: 38px; height: 38px; padding: 0; border-radius: 50%; display: grid; place-items: center; flex: 0 0 38px; }

/* Toolbar bits */
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; font-size: 11px; line-height: 18px;
  background: var(--err, #c62828); color: #fff; text-align: center; }
.badge[hidden] { display: none; }
.pill.rec { color: var(--err, #c62828); font-weight: 600; }
.pill.rec::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--err, #c62828);
  margin-right: 7px; vertical-align: 0; animation: lc-rec 1.6s ease-in-out infinite; }
button.ghost.recording { color: var(--err, #c62828); }
@keyframes lc-rec { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .pill.rec::before { animation: none; } }
@media (max-width: 820px) { .lc-chat { position: absolute; right: 0; top: 0; bottom: 0; width: min(340px, 100%); box-shadow: var(--shadow); z-index: 2; } }
.split { flex: 1; min-height: 0; display: flex; position: relative; }
.split .stage { flex: 1; min-width: 0; }
