/* Ledgrix Assistent – uses the theme colours, works without the theme too. */
#lx-chat {
  --lxc-brand: var(--brand, #2f5d8c);
  --lxc-brand-d: var(--brand-d, #234a70);
  --lxc-navy: var(--navy, #0d1e3a);
  --lxc-text: var(--text, #374151);
  --lxc-alt: var(--alt, #e9eef4);
  --lxc-rule: var(--rule, #d5dfe9);
  --lxc-err: var(--err, #9b1c1c);
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9990;
  font-family: var(--lx-font, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--lxc-text);
}
#lx-chat.lx-rtl { right: auto; left: 20px; }
#lx-chat *, #lx-chat *::before, #lx-chat *::after { box-sizing: border-box; }

#lx-chat .lx-launch {
  display: flex; align-items: center; gap: 10px;
  margin-left: auto;
  padding: 12px 18px;
  border: 0; border-radius: 999px;
  background: var(--lxc-navy); color: #fff;
  font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: 0 8px 24px rgba(13, 30, 58, .25);
}
#lx-chat.lx-rtl .lx-launch { margin-left: 0; margin-right: auto; }
#lx-chat .lx-launch:hover { background: var(--lxc-brand-d); }
#lx-chat .lx-launch:focus-visible, #lx-chat button:focus-visible, #lx-chat textarea:focus-visible,
#lx-chat input:focus-visible, #lx-chat a:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
#lx-chat .lx-launch-icon {
  width: 20px; height: 20px; background: currentColor; flex: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12z'/%3E%3C/svg%3E") center / contain no-repeat;
}
#lx-chat.lx-open .lx-launch-text { display: none; }

#lx-chat .lx-panel {
  display: flex; flex-direction: column;
  width: 380px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 110px);
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid var(--lxc-rule);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(13, 30, 58, .22);
  overflow: hidden;
}
#lx-chat .lx-panel[hidden], #lx-chat [hidden] { display: none !important; }

#lx-chat .lx-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: var(--lxc-navy); color: #fff;
}
#lx-chat .lx-head-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#lx-chat .lx-head strong { font-family: var(--lx-head, inherit); font-size: 16px; }
#lx-chat .lx-badge {
  font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); color: #fff;
}
#lx-chat .lx-close {
  width: 34px; height: 34px; border: 0; border-radius: 8px;
  background: transparent; color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
}
#lx-chat .lx-close:hover { background: rgba(255, 255, 255, .14); }

#lx-chat .lx-log {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  background: #f7f9fc;
}
#lx-chat .lx-msg {
  max-width: 88%; padding: 9px 12px; border-radius: 12px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
#lx-chat .lx-bot { align-self: flex-start; background: #fff; border: 1px solid var(--lxc-rule); }
#lx-chat .lx-user { align-self: flex-end; background: var(--lxc-brand); color: #fff; }
#lx-chat .lx-wait { color: #6b7280; font-style: italic; }
#lx-chat .lx-msg a { color: inherit; text-decoration: underline; }
#lx-chat .lx-note { margin: 0; font-size: 12.5px; color: #4b5563; }
#lx-chat .lx-note a { color: var(--lxc-brand-d); }

#lx-chat .lx-contactbar { padding: 8px 14px 0; background: #fff; border-top: 1px solid var(--lxc-rule); }
#lx-chat .lx-contact {
  width: 100%; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--lxc-brand); background: #fff; color: var(--lxc-brand-d);
  font: inherit; font-weight: 600;
}
#lx-chat .lx-contactbar.lx-highlight .lx-contact { background: var(--lxc-alt); }

#lx-chat .lx-form { display: flex; gap: 8px; padding: 10px 14px 14px; background: #fff; }
#lx-chat textarea, #lx-chat input[type=text], #lx-chat input[type=email] {
  width: 100%; padding: 9px 10px; border: 1px solid #9ca3af; border-radius: 8px;
  font: inherit; color: #111827; background: #fff; resize: none;
}
#lx-chat .lx-send {
  flex: none; padding: 0 16px; min-height: 40px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--lxc-brand); color: #fff; font: inherit; font-weight: 600;
}
#lx-chat .lx-send:hover { background: var(--lxc-brand-d); }
#lx-chat .lx-send:disabled { opacity: .6; cursor: default; }
#lx-chat .lx-secondary {
  min-height: 40px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--lxc-rule); background: #fff; color: var(--lxc-text); font: inherit;
}

#lx-chat .lx-lead { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
#lx-chat .lx-lead h3 { margin: 0 0 4px; font-size: 16px; color: var(--lxc-navy); font-family: var(--lx-head, inherit); }
#lx-chat .lx-field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
#lx-chat .lx-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; }
#lx-chat .lx-check input { margin-top: 4px; flex: none; width: 16px; height: 16px; }
#lx-chat .lx-err { margin: 0; min-height: 1em; color: var(--lxc-err); font-size: 13.5px; }
#lx-chat .lx-lead-btns { display: flex; gap: 8px; justify-content: flex-end; }

#lx-chat .lx-tabs { display: flex; gap: 4px; margin-inline-start: auto; margin-inline-end: 6px; }
#lx-chat .lx-tab {
  padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35);
  background: transparent; color: #fff; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap;
}
#lx-chat .lx-tab.lx-on { background: #fff; color: var(--lxc-navy); font-weight: 600; }
#lx-chat.lx-wide .lx-panel { width: 560px; height: 680px; }
#lx-chat .lx-slog .lx-bot { max-width: 96%; }
#lx-chat .lx-staffnote { background: #fff7e0; border-color: #f2d27a; font-size: 13.5px; }
#lx-chat .lx-msg code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--lxc-alt); padding: 0 4px; border-radius: 4px; }

@media (max-width: 480px) {
  #lx-chat, #lx-chat.lx-rtl { right: 16px; left: 16px; bottom: 16px; }
  #lx-chat .lx-panel, #lx-chat.lx-wide .lx-panel { width: 100%; max-width: none; height: calc(100vh - 100px); }
  #lx-chat .lx-launch-text { display: none; }
  #lx-chat .lx-launch { padding: 14px; }
}
@media (prefers-reduced-motion: no-preference) {
  #lx-chat .lx-panel { animation: lx-in .16s ease-out; }
  @keyframes lx-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* 1.3.0: "is writing" dots, screen-reader text, small privacy link under the input */
#lx-chat .lx-wait { font-style: normal; }
#lx-chat .lx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#lx-chat .lx-dots { display: inline-flex; gap: 5px; padding: 4px 2px; }
#lx-chat .lx-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--lxc-brand); opacity: .3; animation: lx-chat-dot 1.2s infinite ease-in-out; }
#lx-chat .lx-dots i:nth-child(2) { animation-delay: .2s; }
#lx-chat .lx-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes lx-chat-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { #lx-chat .lx-dots i { animation: none; opacity: .7; } }
#lx-chat .lx-foot { margin: 0; padding: 0 14px 10px; background: #fff; font-size: 11.5px; text-align: end; }
#lx-chat .lx-foot a { color: #6b7280; }
#lx-chat .lx-foot:empty { display: none; }
