:root {
  --ai-chat-navy: #0c1e2e;
  --ai-chat-navy-mid: #16324a;
  --ai-chat-steel: #5c7388;
  --ai-chat-mist: #e8eef3;
  --ai-chat-panel: #f7f9fb;
  --ai-chat-white: #ffffff;
  --ai-chat-accent: #ed7435;
  --ai-chat-accent-hover: #d65d24;
  --ai-chat-accent-soft: rgba(237,116,53,.12);
  --ai-chat-border: rgba(12, 30, 46, 0.1);
  --ai-chat-shadow: 0 18px 48px rgba(12, 30, 46, 0.22);
  --ai-chat-radius: 16px;
  --ai-chat-font: "Manrope", "Segoe UI", sans-serif;
  --ai-chat-font-display: "Libre Baskerville", Georgia, serif;
}

.ai-chat-root,
.ai-chat-root * {
  box-sizing: border-box;
}

.ai-chat-root {
  all: initial;
  font-family: var(--ai-chat-font);
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  color: var(--ai-chat-navy);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.ai-chat-launcher {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.18), transparent 45%),
    linear-gradient(145deg, var(--ai-chat-navy-mid), var(--ai-chat-navy));
  color: var(--ai-chat-white);
  box-shadow: var(--ai-chat-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ai-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(12, 30, 46, 0.28);
}

.ai-chat-launcher:focus-visible {
  outline: 2px solid var(--ai-chat-accent);
  outline-offset: 3px;
}

.ai-chat-launcher svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-chat-launcher-close svg {
  width: 22px;
  height: 22px;
}

.ai-chat-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: min(392px, calc(100vw - 28px));
  height: min(580px, calc(100vh - 110px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--ai-chat-radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 249, 251, 0.98)),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 11px,
      rgba(12, 30, 46, 0.015) 11px,
      rgba(12, 30, 46, 0.015) 12px
    );
  border: 1px solid var(--ai-chat-border);
  box-shadow: var(--ai-chat-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.98);
  transform-origin: bottom right;
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    visibility 0.28s ease;
  pointer-events: none;
}

.ai-chat-panel.ai-chat-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ai-chat-header {
  flex: 0 0 auto;
  padding: 18px 18px 16px;
  background:
    linear-gradient(135deg, var(--ai-chat-navy) 0%, var(--ai-chat-navy-mid) 100%);
  color: var(--ai-chat-white);
  position: relative;
  overflow: hidden;
}

.ai-chat-header::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 134, 11, 0.28), transparent 70%);
  pointer-events: none;
}

.ai-chat-brand {
  position: relative;
  font-family: var(--ai-chat-font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 4px;
}

.ai-chat-subtitle {
  position: relative;
  margin: 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
}

.ai-chat-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-chat-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ecf8e;
  box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.55);
  animation: ai-chat-pulse 2s ease infinite;
}

@keyframes ai-chat-pulse {
  0% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(62, 207, 142, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0); }
}

.ai-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.ai-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(12, 30, 46, 0.18);
  border-radius: 999px;
}

.ai-chat-msg {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  white-space: pre-wrap;
  word-break: break-word;
  animation: ai-chat-fade-in 0.28s ease;
}

@keyframes ai-chat-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-chat-msg-bot {
  align-self: flex-start;
  background: var(--ai-chat-white);
  border: 1px solid var(--ai-chat-border);
  color: var(--ai-chat-navy);
  border-bottom-left-radius: 4px;
}

.ai-chat-msg-user {
  align-self: flex-end;
  background: linear-gradient(145deg, var(--ai-chat-navy-mid), var(--ai-chat-navy));
  color: var(--ai-chat-white);
  border-bottom-right-radius: 4px;
}

.ai-chat-msg-system {
  align-self: center;
  max-width: 94%;
  background: var(--ai-chat-accent-soft);
  color: var(--ai-chat-navy-mid);
  border: 1px solid rgba(184, 134, 11, 0.22);
  text-align: center;
  font-size: 12.5px;
}

.ai-chat-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 5px;
  padding: 10px 14px;
  background: var(--ai-chat-white);
  border: 1px solid var(--ai-chat-border);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.ai-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ai-chat-steel);
  opacity: 0.45;
  animation: ai-chat-bounce 1.2s ease infinite;
}

.ai-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ai-chat-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-4px); opacity: 0.9; }
}

.ai-chat-lead-form {
  margin: 0 14px 10px;
  padding: 14px;
  border-radius: 12px;
  background: var(--ai-chat-white);
  border: 1px solid var(--ai-chat-border);
  display: none;
  animation: ai-chat-fade-in 0.28s ease;
}

.ai-chat-lead-form.ai-chat-visible {
  display: block;
}

.ai-chat-lead-title {
  margin: 0 0 10px;
  font-family: var(--ai-chat-font-display);
  font-size: 14px;
  color: var(--ai-chat-navy);
}

.ai-chat-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.ai-chat-field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ai-chat-steel);
  letter-spacing: 0.02em;
}

.ai-chat-field input,
.ai-chat-field textarea {
  width: 100%;
  border: 1px solid var(--ai-chat-border);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--ai-chat-navy);
  background: var(--ai-chat-panel);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
}

.ai-chat-field input:focus,
.ai-chat-field textarea:focus {
  border-color: rgba(184, 134, 11, 0.55);
  box-shadow: 0 0 0 3px var(--ai-chat-accent-soft);
}

.ai-chat-lead-actions {
  display: flex;
  gap: 8px;
}

.ai-chat-btn {
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.ai-chat-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ai-chat-btn-primary {
  flex: 1;
  padding: 10px 12px;
  background: var(--ai-chat-accent);
  color: var(--ai-chat-white);
}

.ai-chat-btn-primary:hover:not(:disabled) {
  background: var(--ai-chat-accent-hover);
}

.ai-chat-btn-ghost {
  padding: 10px 12px;
  background: transparent;
  color: var(--ai-chat-steel);
  border: 1px solid var(--ai-chat-border);
}

.ai-chat-btn-ghost:hover:not(:disabled) {
  background: var(--ai-chat-mist);
}

.ai-chat-footer {
  flex: 0 0 auto;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--ai-chat-border);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
}

.ai-chat-quote-btn {
  width: 100%;
  margin-bottom: 10px;
  padding: 11px 12px;
  background: linear-gradient(135deg, #c9a227, var(--ai-chat-accent));
  color: #fff;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 18px rgba(184, 134, 11, 0.28);
}

.ai-chat-quote-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #b8931f, var(--ai-chat-accent-hover));
}

.ai-chat-composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.ai-chat-input {
  flex: 1;
  min-height: 42px;
  max-height: 96px;
  resize: none;
  border: 1px solid var(--ai-chat-border);
  border-radius: 11px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ai-chat-navy);
  background: var(--ai-chat-panel);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ai-chat-input:focus {
  border-color: rgba(22, 50, 74, 0.35);
  box-shadow: 0 0 0 3px rgba(22, 50, 74, 0.08);
}

.ai-chat-send {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ai-chat-navy);
  color: var(--ai-chat-white);
  border-radius: 11px;
}

.ai-chat-send:hover:not(:disabled) {
  background: var(--ai-chat-navy-mid);
}

.ai-chat-send svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-chat-powered {
  margin: 8px 0 0;
  text-align: center;
  font-size: 10.5px;
  color: var(--ai-chat-steel);
  letter-spacing: 0.03em;
}

@media (max-width: 480px) {
  .ai-chat-root {
    right: 12px;
    bottom: 12px;
  }

  .ai-chat-panel {
    width: calc(100vw - 24px);
    height: min(72vh, 620px);
    bottom: 70px;
  }
}

.ai-chat-root{--ai-chat-font:Arial,"Microsoft YaHei",sans-serif;--ai-chat-font-display:Arial,sans-serif}.ai-chat-header{position:relative;padding-right:48px}.ai-chat-close{position:absolute;top:10px;right:12px;color:#fff;background:transparent;border:0;font:28px/1 Arial;cursor:pointer;padding:8px}.ai-chat-honey{display:none!important}.ai-chat-consent{display:flex;flex-wrap:wrap;align-items:flex-start;gap:6px;font:12px/1.5 Arial;margin:12px 0}.ai-chat-consent input{width:16px;height:16px;flex:none}.ai-chat-consent a{color:#a54b21;text-decoration:underline}.ai-chat-panel{max-height:calc(100dvh - 110px)}.ai-chat-root button:focus-visible,.ai-chat-root input:focus-visible,.ai-chat-root textarea:focus-visible{outline:2px solid #ed7435;outline-offset:2px}.ai-chat-lead-form{overflow-y:auto;max-height:60dvh}.ai-chat-root .ai-chat-brand{color:#fff;line-height:1.3;margin:0;font-size:22px}.ai-chat-root .ai-chat-subtitle{color:#fff;margin:8px 0;font-size:13px}.ai-chat-root .ai-chat-lead-title{font-size:18px;line-height:1.4;margin:0 0 14px}.ai-chat-root .ai-chat-powered{margin:8px 0 0;font-size:11px}@media(max-width:480px){.ai-chat-root{right:12px;bottom:12px}.ai-chat-panel{width:min(380px,calc(100vw - 24px));max-height:calc(100dvh - 100px)}}
