/* IntellX chat widget. Uses theme colours when present, brand fallbacks otherwise. */
#intellx-chat-root {
  --ixc-navy: var(--wp--preset--color--navy, #1f3a59);
  --ixc-sky: var(--wp--preset--color--sky, #55b8e7);
  --ixc-bg: var(--wp--preset--color--base, #ffffff);
  --ixc-text: var(--wp--preset--color--contrast, #14263b);
  --ixc-soft: var(--wp--preset--color--surface, #f2f7fb);
  --ixc-line: var(--wp--preset--color--line, #d6e2ec);
  position: fixed; right: 16px; bottom: 16px; z-index: 9999;
  font: 15px/1.45 var(--wp--preset--font-family--body, system-ui, -apple-system, "Segoe UI", sans-serif);
}
.ixc-launch {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--ixc-navy); color: #fff; padding: 12px 18px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(20, 38, 59, .25); font: inherit; font-weight: 600;
}
.ixc-launch:hover { background: #18304a; }
.ixc-launch[hidden] { display: none; }
.ixc-launch:focus-visible, .ixc-panel button:focus-visible, .ixc-panel textarea:focus-visible, .ixc-panel input:focus-visible {
  outline: 3px solid var(--ixc-sky); outline-offset: 2px;
}
.ixc-panel {
  width: min(380px, calc(100vw - 32px)); height: min(580px, calc(100vh - 32px));
  display: flex; flex-direction: column; background: var(--ixc-bg); color: var(--ixc-text);
  border: 1px solid var(--ixc-line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 16px 48px rgba(20, 38, 59, .28);
}
.ixc-panel[hidden] { display: none; }
.ixc-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--ixc-navy); color: #fff; }
.ixc-close { background: none; border: 0; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }
.ixc-note { margin: 0; padding: 8px 16px; font-size: 12.5px; background: var(--ixc-soft); border-bottom: 1px solid var(--ixc-line); }
.ixc-note a { color: inherit; }
.ixc-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.ixc-msg { max-width: 88%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.ixc-assistant { align-self: flex-start; background: var(--ixc-soft); border: 1px solid var(--ixc-line); border-bottom-left-radius: 4px; }
.ixc-user { align-self: flex-end; background: var(--ixc-navy); color: #fff; border-bottom-right-radius: 4px; }
.ixc-wait { opacity: .7; font-style: italic; }
.ixc-err { border-color: #e2b4ad; }
.ixc-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--ixc-line); }
.ixc-form textarea { flex: 1; resize: none; font: inherit; padding: 8px 10px; border: 1px solid var(--ixc-line); border-radius: 10px; background: var(--ixc-bg); color: var(--ixc-text); }
.ixc-send, .ixc-hand button { border: 0; border-radius: 10px; padding: 0 16px; background: var(--ixc-navy); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.ixc-send:disabled, .ixc-hand button:disabled { opacity: .6; cursor: default; }
.ixc-human { margin: 0 12px 12px; padding: 8px; border: 1px solid var(--ixc-line); background: transparent; color: var(--ixc-text); border-radius: 10px; cursor: pointer; font: inherit; }
.ixc-human:hover { border-color: var(--ixc-sky); }
.ixc-hand { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--ixc-line); border-radius: 12px; }
.ixc-hand p { margin: 0; }
.ixc-hand label { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; font-weight: 600; }
.ixc-hand input:not([type=checkbox]), .ixc-hand textarea { font: inherit; font-weight: 400; padding: 7px 9px; border: 1px solid var(--ixc-line); border-radius: 8px; background: var(--ixc-bg); color: var(--ixc-text); }
.ixc-hand .ixc-check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
.ixc-hand button { padding: 10px; }
.ixc-hp, .ixc-contact .ixc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.ixc-status { font-size: 13.5px; min-height: 1em; }
.ixc-ts:empty { display: none; }
.ixc-ts { padding: 0 12px; }

/* Contact form shortcode */
.ixc-contact label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.ixc-contact input:not([type=checkbox]), .ixc-contact textarea {
  font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--wp--preset--color--line, #d6e2ec);
  border-radius: 10px; background: var(--wp--preset--color--base, #fff); color: var(--wp--preset--color--contrast, #14263b);
}
.ixc-contact .ixc-consent label { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; }

@media (prefers-color-scheme: dark) {
  #intellx-chat-root:not(.ixc-light) { --ixc-bg: #0f1d2d; --ixc-text: #e8f1f8; --ixc-soft: #16283d; --ixc-line: #2a4562; }
}
@media (max-width: 480px) {
  #intellx-chat-root { right: 12px; bottom: 12px; }
  .ixc-panel { width: calc(100vw - 24px); height: calc(100vh - 24px); height: calc(100dvh - 24px); }
  .ixc-launch span { display: none; }
  .ixc-launch { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
