/* SiteWright site assistant. Uses the theme's design tokens (with fallbacks). */
.cfc-chat {
  --cc-accent: var(--accent, #6D4AFF);
  --cc-accent-hover: var(--accent-hover, #5B36F5);
  --cc-bg: var(--bg-secondary, #fff);
  --cc-bg-2: var(--bg-primary, #f5f5f7);
  --cc-text: var(--text-primary, #08080b);
  --cc-muted: var(--text-secondary, #55556a);
  --cc-border: var(--border-strong, rgba(8, 8, 11, 0.16));
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 150; /* above header (100), below mobile menu (200) */
  font-family: var(--font-sans, system-ui, sans-serif);
  color: var(--cc-text);
}
.cfc-chat__launcher {
  display: inline-flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 20px 0 16px;
  margin-left: auto;
  border: 0; border-radius: 999px;
  background: var(--cc-accent); color: #fff;
  font: 500 15px/1 var(--font-sans, system-ui, sans-serif);
  box-shadow: 0 16px 40px -12px rgba(91, 54, 245, 0.6);
  cursor: pointer;
  transition: background-color .2s, transform .2s;
}
.cfc-chat__launcher:hover { background: var(--cc-accent-hover); transform: translateY(-2px); }
.cfc-chat__launcher:focus-visible, .cfc-chat button:focus-visible, .cfc-chat a:focus-visible, .cfc-chat__input:focus-visible { outline: 2px solid var(--cc-accent); outline-offset: 3px; }
.cfc-chat__launcher svg { width: 24px; height: 24px; flex: none; }
.cfc-chat.is-open .cfc-chat__launcher { width: 56px; padding: 0; justify-content: center; }
.cfc-chat { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }

.cfc-chat__panel {
  width: min(400px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 120px));
  height: min(620px, calc(100dvh - 120px));
  display: flex; flex-direction: column;
  background: var(--cc-bg);
  border: 1px solid var(--cc-border);
  border-radius: 24px;
  box-shadow: 0 40px 80px -24px rgba(8, 8, 11, 0.45);
  overflow: hidden;
  animation: cfc-in .22s cubic-bezier(.2, .8, .2, 1);
}
.cfc-chat__panel[hidden] { display: none; }
@keyframes cfc-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.cfc-chat__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 14px 20px; border-bottom: 1px solid var(--cc-border); }
.cfc-chat__title { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.cfc-chat__sub { margin: 2px 0 0; font-size: 12px; color: var(--cc-muted); }
.cfc-chat__close { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--cc-border); border-radius: 999px; background: transparent; color: inherit; cursor: pointer; }
.cfc-chat__close svg { width: 18px; height: 18px; }

.cfc-chat__log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.cfc-chat__msg { max-width: 86%; padding: 11px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.cfc-chat__msg p { margin: 0; }
.cfc-chat__msg p + p, .cfc-chat__msg ul, .cfc-chat__msg p + ul, .cfc-chat__msg ul + p { margin-top: 8px; }
.cfc-chat__msg ul { margin-bottom: 0; padding-left: 18px; }
.cfc-chat__msg li + li { margin-top: 4px; }
.cfc-chat__msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }
.cfc-chat__msg--assistant { align-self: flex-start; background: var(--cc-bg-2); border: 1px solid var(--cc-border); border-bottom-left-radius: 6px; }
.cfc-chat__msg--assistant a { color: var(--cc-accent); }
.cfc-chat__msg--user { align-self: flex-end; background: var(--cc-accent); color: #fff; border-bottom-right-radius: 6px; }
.cfc-chat__msg--error { border-color: #d63638; }

.cfc-chat__typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.cfc-chat__typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--cc-muted); animation: cfc-dot 1.1s infinite ease-in-out; }
.cfc-chat__typing span:nth-child(2) { animation-delay: .15s; }
.cfc-chat__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cfc-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.cfc-chat__chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 10px; }
.cfc-chat__chips[hidden] { display: none; }
.cfc-chat__chip { padding: 8px 12px; border: 1px solid var(--cc-border); border-radius: 999px; background: transparent; color: inherit; font: 13px/1.2 var(--font-sans, system-ui, sans-serif); cursor: pointer; text-align: left; }
.cfc-chat__chip:hover { border-color: var(--cc-accent); color: var(--cc-accent); }

.cfc-chat__form { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 16px; border: 1px solid var(--cc-border); border-radius: 22px; background: var(--cc-bg-2); }
.cfc-chat__form:focus-within { border-color: var(--cc-accent); }
.cfc-chat__input { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; color: inherit; font: 15px/1.4 var(--font-sans, system-ui, sans-serif); padding: 9px 0; max-height: 120px; }
.cfc-chat__input:focus-visible { outline: none; }
.cfc-chat__send { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 999px; background: var(--cc-accent); color: #fff; cursor: pointer; }
.cfc-chat__send:disabled { opacity: .5; cursor: default; }
.cfc-chat__send svg { width: 18px; height: 18px; }
.cfc-chat__note { margin: 8px 16px 12px; font-size: 11.5px; color: var(--cc-muted); text-align: center; }
.cfc-chat__note a { color: inherit; text-decoration: underline; }
.cfc-chat__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 767px) {
  .cfc-chat__launcher-label { display: none; }
  .cfc-chat__launcher { width: 56px; padding: 0; justify-content: center; }
  .cfc-chat.is-open { left: 0; right: 0; bottom: 0; gap: 0; }
  .cfc-chat.is-open .cfc-chat__launcher { display: none; }
  .cfc-chat__panel { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; border: 0; }
  .cfc-chat__input { font-size: 16px; } /* stops iOS zooming into the field */
}
body.menu-open .cfc-chat, html.menu-open .cfc-chat { display: none; }
/* Lead form (shown before the first chat) */
.cfc-chat [hidden] { display: none !important; }
.cfc-chat__lead { flex: 1; overflow-y: auto; padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.cfc-chat__lead > * { flex: none; }
.cfc-chat__lead-intro { margin: 0 0 4px; font-size: 14.5px; line-height: 1.5; color: var(--cc-text); }
.cfc-chat__field { display: grid; gap: 6px; }
.cfc-chat__field label { font-size: 12.5px; font-weight: 500; color: var(--cc-muted); }
.cfc-chat__field input, .cfc-chat__field select {
  width: 100%; min-width: 0; height: 44px; padding: 0 14px;
  border: 1px solid var(--cc-border); border-radius: 12px;
  background: var(--cc-bg-2); color: var(--cc-text);
  font: 15px/1.2 var(--font-sans, system-ui, sans-serif);
}
.cfc-chat__field input:focus, .cfc-chat__field select:focus { outline: none; border-color: var(--cc-accent); box-shadow: 0 0 0 3px rgba(109, 74, 255, 0.18); }
.cfc-chat__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cfc-chat__lead-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(214, 54, 56, 0.1); color: #b32d2e; font-size: 13px; }
.cfc-chat__lead-btn { height: 48px; margin-top: 4px; border: 0; border-radius: 999px; background: var(--cc-accent); color: #fff; font: 500 15px/1 var(--font-sans, system-ui, sans-serif); cursor: pointer; }
.cfc-chat__lead-btn:hover { background: var(--cc-accent-hover); }
.cfc-chat__lead-btn:disabled { opacity: .6; cursor: default; }
.cfc-chat__lead-note { margin: 0; font-size: 11.5px; color: var(--cc-muted); text-align: center; }
.cfc-chat__lead-note a { color: inherit; text-decoration: underline; }
@media (max-width: 767px) { .cfc-chat__field input, .cfc-chat__field select { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { .cfc-chat__panel, .cfc-chat__typing span { animation: none; } .cfc-chat__launcher { transition: none; } }
@media print { .cfc-chat { display: none; } }
