/* CoreInto live chat box. Uses the template's colour tokens when it has them. */
#ci-chat { position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 90; font: inherit; }
#ci-chat .chat-fab { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent, #0d9488); color: var(--accent-ink, #fff); font-weight: 600; box-shadow: 0 8px 24px rgba(15, 23, 42, .22); }
#ci-chat .chat-fab svg { width: 20px; height: 20px; }
#ci-chat.is-open .chat-fab span { display: none; }
#ci-chat .chat-panel { position: absolute; inset-inline-end: 0; bottom: 64px; width: min(360px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 110px));
  display: flex; flex-direction: column; background: var(--surface, #fff); color: var(--ink, #111827); border: 1px solid var(--line, #e5e7eb);
  border-radius: 16px; box-shadow: 0 18px 48px rgba(15, 23, 42, .25); overflow: hidden; }
#ci-chat .chat-panel[hidden] { display: none; }
#ci-chat .chat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; background: var(--accent, #0d9488); color: var(--accent-ink, #fff); }
#ci-chat .chat-head strong { display: block; }
#ci-chat .chat-sub { opacity: .85; font-size: 12px; }
#ci-chat .chat-x { background: transparent; border: 0; color: inherit; font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }
#ci-chat .chat-log { flex: 1 1 auto; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; background: var(--surface-2, #f8fafc); }
#ci-chat .chat-log:empty { display: none; }
#ci-chat .chat-msg { max-width: 85%; padding: 8px 11px; border-radius: 12px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
#ci-chat .chat-msg.visitor { align-self: flex-end; background: var(--accent, #0d9488); color: var(--accent-ink, #fff); border-end-end-radius: 4px; }
#ci-chat .chat-msg.staff { align-self: flex-start; background: var(--surface, #fff); border: 1px solid var(--line, #e5e7eb); border-end-start-radius: 4px; }
#ci-chat .chat-msg.system { align-self: center; background: transparent; color: var(--muted, #6b7280); font-size: 12px; text-align: center; }
#ci-chat .chat-who { display: block; font-size: 11px; font-weight: 600; opacity: .75; margin-bottom: 2px; }
#ci-chat .chat-form { padding: 12px 14px 14px; display: grid; gap: 8px; border-top: 1px solid var(--line, #e5e7eb); }
#ci-chat .chat-intro { margin: 0; font-size: 13px; color: var(--muted, #6b7280); }
#ci-chat .chat-field { display: grid; gap: 4px; font-size: 13px; }
#ci-chat input, #ci-chat textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line, #d1d5db); border-radius: 8px; font: inherit; background: var(--surface, #fff); color: inherit; resize: vertical; }
#ci-chat .chat-row { display: flex; gap: 8px; align-items: flex-end; }
#ci-chat .chat-row textarea { flex: 1; }
#ci-chat .chat-send { padding: 9px 14px; border: 0; border-radius: 8px; background: var(--accent, #0d9488); color: var(--accent-ink, #fff); font-weight: 600; cursor: pointer; }
#ci-chat .chat-end { justify-self: start; background: transparent; border: 0; padding: 0; color: var(--muted, #6b7280); font-size: 12px; text-decoration: underline; cursor: pointer; }
#ci-chat .chat-err { margin: 0 14px; color: #dc2626; font-size: 13px; }
#ci-chat .chat-err:empty { display: none; }
@media (max-width: 600px) { #ci-chat { inset-inline-end: 12px; bottom: 12px; } #ci-chat .chat-fab span { display: none; } }
@media print { #ci-chat { display: none; } }
