/* Amphenol Procom site theme: white header, deep navy, vibrant green accent */
.waveseek-chat {
  --color-primary: #0a1628;
  --color-primary-alt: #0f2137;
  --color-accent: #00a651;
  --color-accent-muted: #00c853;
  --color-bg: #ffffff;
  --color-bg-alt: #f8f9fa;
  --color-border: #e1e4e8;
  --color-text-primary: #1a1a2e;
  --color-text-secondary: #5c6f82;
  --color-text-on-primary: #ffffff;

  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

.waveseek-chat *,
.waveseek-chat *::before,
.waveseek-chat *::after {
  box-sizing: border-box;
}

.waveseek-chat__fab-wrap {
  position: relative;
  display: inline-flex;
}

.waveseek-chat__fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(10, 22, 40, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.waveseek-chat__fab:hover {
  background: var(--color-primary-alt);
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(10, 22, 40, 0.45);
}

.waveseek-chat__fab-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.waveseek-chat__hint {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  padding: 16px 22px;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  border-radius: 18px 18px 6px 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--color-border);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.95);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  pointer-events: none;
  border: 1px solid var(--color-border);
  z-index: 10;
}

.waveseek-chat__hint::before {
  content: '';
  position: absolute;
  right: 14px;
  bottom: -10px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--color-bg);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.waveseek-chat__hint::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 19px 19px 7px 19px;
  border: 2px solid var(--color-accent);
  opacity: 0;
  pointer-events: none;
}

.waveseek-chat__hint--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  animation: waveseek-chat-hint-attention 1.5s ease-in-out infinite;
}

.waveseek-chat__hint--visible::after {
  animation: waveseek-chat-hint-ring 1.5s ease-in-out infinite;
}

@keyframes waveseek-chat-hint-attention {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--color-border);
    transform: translateY(0) scale(1);
  }
  15% {
    box-shadow: 0 8px 32px rgba(0, 166, 81, 0.35), 0 0 0 2px rgba(0, 166, 81, 0.5);
    transform: translateY(0) scale(1.06);
  }
  30% {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--color-border);
    transform: translateY(0) scale(1);
  }
  45% {
    box-shadow: 0 8px 32px rgba(0, 166, 81, 0.35), 0 0 0 2px rgba(0, 166, 81, 0.5);
    transform: translateY(0) scale(1.06);
  }
  60%, 100% {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--color-border);
    transform: translateY(0) scale(1);
  }
}

@keyframes waveseek-chat-hint-ring {
  0%, 100% { opacity: 0; transform: scale(1); border-color: var(--color-accent); }
  15% { opacity: 0.9; transform: scale(1.06); border-color: rgba(0, 166, 81, 0.9); }
  30% { opacity: 0; transform: scale(1); border-color: var(--color-accent); }
  45% { opacity: 0.9; transform: scale(1.06); border-color: rgba(0, 166, 81, 0.9); }
  60%, 100% { opacity: 0; transform: scale(1); border-color: var(--color-accent); }
}

.waveseek-chat__hint--hidden {
  display: none !important;
}

.waveseek-chat__panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 400px;
  height: 540px;
  background: var(--color-bg);
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(10, 22, 40, 0.06), 0 12px 40px rgba(10, 22, 40, 0.12), 0 0 0 1px var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.25s ease, visibility 0.25s, transform 0.25s ease, width 0.25s, height 0.25s;
}

.waveseek-chat__panel--open {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.waveseek-chat__panel--expanded {
  width: 60vw;
  /* Never shorter than the default panel (540px); 60vh alone was often smaller on wide screens */
  height: max(60vh, 540px);
  max-width: 800px;
  max-height: 90vh;
}

@media (max-width: 480px) {
  .waveseek-chat {
    right: 8px;
    bottom: 8px;
  }

  .waveseek-chat.waveseek-chat--panel-open {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    padding: 0;
  }

  .waveseek-chat__panel {
    width: 100%;
    max-width: none;
    height: 70vh;
    max-height: calc(100vh - 16px);
    right: 0;
    bottom: 0;
    border-radius: 12px 12px 0 0;
  }

  .waveseek-chat.waveseek-chat--panel-open .waveseek-chat__panel--expanded {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    right: auto;
    bottom: auto;
  }
}

.waveseek-chat--panel-open .waveseek-chat__fab-wrap {
  display: none;
}

.waveseek-chat__header {
  padding: 16px 20px;
  background: var(--color-bg);
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

.waveseek-chat__header-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

.waveseek-chat__header-logo {
  height: 28px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  object-position: left center;
  display: block;
  padding: 0;
  box-sizing: content-box;
}

.waveseek-chat__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.waveseek-chat__header-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.waveseek-chat__header-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.waveseek-chat__header-btn:hover {
  background: var(--color-bg-alt);
  color: var(--color-text-primary);
}

.waveseek-chat__header-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.waveseek-chat__messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--color-bg-alt);
  scroll-behavior: smooth;
}

.waveseek-chat__messages::-webkit-scrollbar {
  width: 8px;
}

.waveseek-chat__messages::-webkit-scrollbar-track {
  background: transparent;
}

.waveseek-chat__messages::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.waveseek-chat__messages::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}

.waveseek-chat__message {
  flex-shrink: 0;
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 10px;
  line-height: 1.52;
  word-wrap: break-word;
  overflow-wrap: break-word;
  transition: box-shadow 0.2s ease;
}

.waveseek-chat__message--user {
  align-self: flex-end;
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  box-shadow: 0 2px 8px rgba(10, 22, 40, 0.2);
}

.waveseek-chat__message--bot {
  align-self: flex-start;
  background: var(--color-bg);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.waveseek-chat__message--streaming {
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
}

.waveseek-chat__message-content {
  flex: 1 1 100%;
  min-width: 0;
  min-height: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.waveseek-chat__message-content p {
  margin: 0 0 0.5em 0;
}

.waveseek-chat__message-content p:last-child {
  margin-bottom: 0;
}

.waveseek-chat__message-content strong {
  font-weight: 700;
  display: inline-block;
  margin-top: 0.75em;
}

.waveseek-chat__message-content strong:first-of-type {
  margin-top: 0;
}

.waveseek-chat__message-content em {
  font-style: italic;
}

.waveseek-chat__message-content ul,
.waveseek-chat__message-content ol {
  margin: 0.25em 0;
  padding-left: 1.25em;
}

.waveseek-chat__message--md strong {
  font-weight: 700;
}

.waveseek-chat__message--md em {
  font-style: italic;
}

.waveseek-chat__link {
  color: var(--color-accent);
  text-decoration: underline;
  cursor: pointer;
}

.waveseek-chat__link:hover {
  text-decoration: underline;
  opacity: 0.9;
}

.waveseek-chat__img-link {
  display: inline-block;
  margin: 4px 0 10px 0;
}

.waveseek-chat__product-img {
  display: block;
  max-width: 160px;
  max-height: 160px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  object-fit: contain;
  background: white;
  transition: opacity 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.waveseek-chat__product-img:hover {
  opacity: 0.85;
}

.waveseek-chat__typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 0;
}

.waveseek-chat__typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-secondary);
  opacity: 0.5;
  animation: waveseek-typing-bounce 1.2s ease-in-out infinite both;
}

.waveseek-chat__typing-dot:nth-child(1) { animation-delay: 0s; }
.waveseek-chat__typing-dot:nth-child(2) { animation-delay: 0.15s; }
.waveseek-chat__typing-dot:nth-child(3) { animation-delay: 0.3s; }

.waveseek-chat__status-text {
  margin-left: 4px;
  font-size: 0.95em;
  color: var(--color-text-secondary, #666);
}

@keyframes waveseek-typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.waveseek-chat__input-row {
  padding: 16px 20px;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.waveseek-chat__clear {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
  border: 1px solid var(--color-border);
}

.waveseek-chat__clear:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

.waveseek-chat__clear svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.waveseek-chat__input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--color-text-primary);
  background: var(--color-bg);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.waveseek-chat__input::placeholder {
  color: var(--color-text-secondary);
}

.waveseek-chat__input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(10, 22, 40, 0.1);
}

.waveseek-chat__send {
  padding: 12px 18px;
  border: none;
  border-radius: 8px;
  background: var(--color-accent);
  color: var(--color-text-on-primary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 166, 81, 0.3);
}

.waveseek-chat__send:hover {
  background: var(--color-accent-muted);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 166, 81, 0.4);
}

.waveseek-chat__disclaimer {
  flex-shrink: 0;
  padding: 4px 20px 10px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--color-text-secondary);
  text-align: center;
  opacity: 0.85;
  background: var(--color-bg);
  border-top: 1px solid transparent;
}

/* Guided follow-up UI cards */
.waveseek-chat__message--ui {
  max-width: 92%;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.waveseek-chat__ui-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 14px 14px 12px 14px;
  box-shadow: 0 10px 30px rgba(10, 22, 40, 0.10), 0 0 0 1px rgba(0,0,0,0.02);
}

.waveseek-chat__ui-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 33, 55, 0.08);
  overflow: hidden;
  margin-bottom: 10px;
}

.waveseek-chat__ui-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-accent), rgba(0, 166, 81, 0.55));
  border-radius: 999px;
  transition: width 0.25s ease;
}

.waveseek-chat__ui-title {
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}

.waveseek-chat__ui-prompt {
  color: var(--color-text-secondary);
  margin-bottom: 12px;
  line-height: 1.45;
}

.waveseek-chat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.waveseek-chat__chip {
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  color: var(--color-text-primary);
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}

.waveseek-chat__chip:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 166, 81, 0.6);
  box-shadow: 0 6px 18px rgba(0, 166, 81, 0.12);
}

.waveseek-chat__chip:active {
  transform: translateY(0);
}

.waveseek-chat__ui-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.waveseek-chat__ui-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.waveseek-chat__ui-input:focus {
  border-color: rgba(10, 22, 40, 0.55);
  box-shadow: 0 0 0 3px rgba(10, 22, 40, 0.10);
}

@keyframes waveseek-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-3px); }
}

.waveseek-chat__ui-input--shake {
  animation: waveseek-shake 0.28s ease-in-out;
}

.waveseek-chat__ui-submit {
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 6px 18px rgba(10, 22, 40, 0.14);
}

.waveseek-chat__ui-submit:hover {
  background: var(--color-primary-alt);
  transform: translateY(-1px);
}

.waveseek-chat__ui-skip {
  margin-top: 10px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
}

.waveseek-chat__ui-skip:hover {
  color: var(--color-text-primary);
  text-decoration: underline;
}

.waveseek-chat__ui-hint {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--color-text-secondary);
}
