/* Lead chat: scripted, no AI, no third-party code.
   Uses the page's design tokens with fallbacks so it also works on other pages. */
.lc-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 20px 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent, #e8a045);
  color: #0a0a0a;
  font: 600 15px/1 var(--font-body, system-ui, sans-serif);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: background 0.2s, transform 0.2s;
}
.lc-launcher:hover { background: var(--accent2, #c47d1e); }
.lc-launcher svg { width: 24px; height: 24px; flex: none; }
.lc-launcher .lc-close-icon { display: none; }
.lc-open .lc-launcher .lc-chat-icon { display: none; }
.lc-open .lc-launcher .lc-close-icon { display: block; }
.lc-open .lc-launcher .lc-launcher-label { display: none; }
.lc-open .lc-launcher { padding: 0 16px; }
.lc-launcher:focus-visible,
.lc-panel button:focus-visible,
.lc-panel input:focus-visible,
.lc-panel textarea:focus-visible,
.lc-panel a:focus-visible {
  outline: 2px solid var(--accent, #e8a045);
  outline-offset: 2px;
}

.lc-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 120;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: min(600px, calc(100vh - 120px));
  height: min(600px, calc(100dvh - 120px));
  display: flex;
  flex-direction: column;
  background: var(--bg2, #111);
  color: var(--white, #f5f0e8);
  border: 1px solid var(--accent-line, rgba(232, 160, 69, 0.3));
  border-radius: var(--radius, 16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  font-family: var(--font-body, system-ui, sans-serif);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  visibility: hidden;
  transition: opacity 0.2s, transform 0.2s, visibility 0s linear 0.2s;
}
.lc-open .lc-panel {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition: opacity 0.2s, transform 0.2s;
}

.lc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  background: var(--bg3, #181818);
}
.lc-avatar {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent, #e8a045), var(--accent2, #c47d1e));
  color: #0a0a0a;
  font: 800 17px/1 var(--font-head, system-ui, sans-serif);
}
.lc-title { font: 700 15px/1.2 var(--font-head, system-ui, sans-serif); margin: 0; }
.lc-sub { font-size: 12.5px; color: var(--muted, #9a9a90); margin: 2px 0 0; }
.lc-head-actions { margin-left: auto; display: flex; gap: 4px; }
.lc-icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #9a9a90);
  cursor: pointer;
}
.lc-icon-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--white, #f5f0e8); }
.lc-icon-btn svg { width: 18px; height: 18px; }

.lc-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overscroll-behavior: contain;
}
.lc-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.lc-bot {
  align-self: flex-start;
  background: var(--bg3, #181818);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-bottom-left-radius: 4px;
}
.lc-user {
  align-self: flex-end;
  background: var(--accent-soft, rgba(232, 160, 69, 0.1));
  border: 1px solid var(--accent-line, rgba(232, 160, 69, 0.3));
  border-bottom-right-radius: 4px;
}
.lc-msg a { color: var(--accent, #e8a045); }
.lc-links { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }

.lc-summary { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
.lc-summary li { padding: 3px 0; }
.lc-summary b { color: var(--muted, #9a9a90); font-weight: 500; }

.lc-typing { display: inline-flex; gap: 4px; padding: 14px; }
.lc-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted, #9a9a90);
  animation: lc-dot 1s infinite ease-in-out;
}
.lc-typing span:nth-child(2) { animation-delay: 0.15s; }
.lc-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes lc-dot {
  0%, 80%, 100% { opacity: 0.3; transform: none; }
  40% { opacity: 1; transform: translateY(-3px); }
}

.lc-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 14px;
}
.lc-choices:empty { display: none; }
.lc-chip {
  padding: 9px 14px;
  border: 1px solid var(--accent-line, rgba(232, 160, 69, 0.3));
  border-radius: 999px;
  background: transparent;
  color: var(--white, #f5f0e8);
  font: 500 14px/1.2 var(--font-body, system-ui, sans-serif);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.lc-chip:hover { background: var(--accent-soft, rgba(232, 160, 69, 0.1)); border-color: var(--accent, #e8a045); }
.lc-chip.lc-primary { background: var(--accent, #e8a045); border-color: var(--accent, #e8a045); color: #0a0a0a; font-weight: 600; }
.lc-chip.lc-primary:hover { background: var(--accent2, #c47d1e); }
.lc-chip:disabled { opacity: 0.6; cursor: default; }

.lc-input {
  display: none;
  gap: 8px;
  align-items: flex-end;
  padding: 12px 12px 12px 16px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}
.lc-input.lc-show { display: flex; }
.lc-input textarea {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  resize: none;
  padding: 10px 12px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 10px;
  background: var(--bg, #0a0a0a);
  color: var(--white, #f5f0e8);
  font: 15px/1.4 var(--font-body, system-ui, sans-serif);
}
.lc-input textarea::placeholder { color: var(--muted, #9a9a90); }
.lc-send {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--accent, #e8a045);
  color: #0a0a0a;
  cursor: pointer;
}
.lc-send:hover { background: var(--accent2, #c47d1e); }
.lc-send svg { width: 18px; height: 18px; }
.lc-hint {
  display: none;
  margin: -4px 16px 10px;
  font-size: 12.5px;
  color: #f08a7a;
}
.lc-hint.lc-show { display: block; }
.lc-note {
  margin: 0;
  padding: 8px 16px 12px;
  font-size: 11.5px;
  color: var(--muted, #9a9a90);
  text-align: center;
}

/* Attention nudge: two soft ripples + a speech bubble, once per visit */
.lc-launcher::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.lc-launcher.lc-nudge { animation: lc-breath 1.4s ease-in-out 2; }
.lc-launcher.lc-nudge::after { animation: lc-ripple 1.4s ease-out 2; }
@keyframes lc-ripple {
  0% { box-shadow: 0 0 0 0 rgba(232, 160, 69, 0.6); }
  100% { box-shadow: 0 0 0 18px rgba(232, 160, 69, 0); }
}
@keyframes lc-breath {
  0%, 100% { transform: none; }
  30% { transform: scale(1.06); }
}

.lc-bubble {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 120;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  max-width: 300px;
  padding: 4px 4px 4px 0;
  background: var(--bg3, #181818);
  border: 1px solid var(--accent-line, rgba(232, 160, 69, 0.3));
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(8px);
  visibility: hidden;
  transition: opacity 0.25s, transform 0.25s, visibility 0s linear 0.25s;
}
.lc-bubble.lc-show {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition: opacity 0.25s, transform 0.25s;
}
.lc-open .lc-bubble { display: none; }
.lc-bubble-text {
  flex: 1;
  padding: 10px 4px 10px 14px;
  border: 0;
  background: transparent;
  color: var(--white, #f5f0e8);
  font: 500 14.5px/1.4 var(--font-body, system-ui, sans-serif);
  text-align: left;
  cursor: pointer;
}
.lc-bubble-x {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #9a9a90);
  cursor: pointer;
}
.lc-bubble-x:hover { background: rgba(255, 255, 255, 0.06); color: var(--white, #f5f0e8); }
.lc-bubble-x svg { width: 14px; height: 14px; }
.lc-bubble button:focus-visible { outline: 2px solid var(--accent, #e8a045); outline-offset: 2px; }

@media (max-width: 600px) {
  .lc-launcher { right: 16px; bottom: 16px; height: 52px; padding: 0 14px; }
  .lc-launcher .lc-launcher-label { display: none; }
  .lc-panel {
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .lc-open .lc-launcher { display: none; }
  .lc-bubble { right: 16px; bottom: 80px; max-width: calc(100vw - 32px); }
}

@media (prefers-reduced-motion: reduce) {
  .lc-panel, .lc-open .lc-panel, .lc-launcher { transition: none; }
  .lc-typing span { animation: none; opacity: 0.7; }
  .lc-launcher.lc-nudge, .lc-launcher.lc-nudge::after { animation: none; }
  .lc-bubble, .lc-bubble.lc-show { transform: none; transition: none; }
}
