/* ============================================================
   Teledyne LeCroy — Interactive Product Guide
   chatbot.css — Tely Fox Chatbot Overlay
   ============================================================ */

/* ============================================================
   1. CHATBOT TOGGLE BUTTON
   ============================================================ */

.chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 600;
  width: 90px;
  height: 90px;
  border-radius: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition:
    transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 250ms ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.chatbot-toggle:hover {
  transform: scale(1.12);
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.35));
}

.chatbot-toggle:hover .tely-toggle-img {
  animation: telyWiggle 0.5s ease-in-out;
}

@keyframes telyWiggle {
  0%   { transform: scaleX(-1) rotate(0deg); }
  20%  { transform: scaleX(-1) rotate(-6deg); }
  40%  { transform: scaleX(-1) rotate(5deg); }
  60%  { transform: scaleX(-1) rotate(-3deg); }
  80%  { transform: scaleX(-1) rotate(2deg); }
  100% { transform: scaleX(-1) rotate(0deg); }
}

.chatbot-toggle:active {
  transform: scale(0.92);
}

.chatbot-toggle.panel-open {
  transform: scale(0.85);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

/* Fox PNG inside toggle — borderless, no background */
.chatbot-toggle-icon {
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.tely-toggle-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  border-radius: 0;
  pointer-events: none;
  transform: scaleX(-1);
  animation: telyBreathe 3s ease-in-out infinite;
}

@keyframes telyBreathe {
  0%, 100% { transform: scaleX(-1) translateY(0) scale(1); }
  50%      { transform: scaleX(-1) translateY(-4px) scale(1.04); }
}

.chatbot-toggle:hover .tely-toggle-img {
  filter: brightness(1.05);
}

.chatbot-toggle.panel-open .tely-toggle-img {
  animation: none;
  transform: scaleX(-1);
}

.chatbot-toggle-icon svg {
  display: none;
}

/* Pulse ring animations removed — clean borderless toggle */

/* Notification dot badge */
.chatbot-toggle-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: #F47920;
  border-radius: 50%;
  border: 2px solid #ffffff;
  opacity: 0;
  transform: scale(0);
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 150ms ease;
}

.chatbot-toggle.has-message .chatbot-toggle-badge {
  opacity: 1;
  transform: scale(1);
}

/* ============================================================
   2. CHATBOT PANEL
   ============================================================ */

.chatbot-panel {
  position: fixed;
  bottom: 120px;
  right: 24px;
  z-index: 599;
  width: 380px;
  height: 520px;
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 200ms ease;
  border: 1px solid rgba(0, 118, 192, 0.12);
}

.chatbot-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   3. CHATBOT HEADER
   ============================================================ */

.chatbot-header {
  position: relative;
  flex-shrink: 0;
  background: linear-gradient(135deg, #003f6b 0%, #005a94 40%, #0076C0 100%);
  padding: 16px 16px 12px;
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-height: 80px;
}

/* Fox portrait overflow */
.tely-portrait-wrap {
  position: relative;
  width: 80px;
  height: 88px;
  flex-shrink: 0;
  margin-bottom: -4px;
}

.tely-portrait {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tely-header-img {
  width: 44px;
  height: 44px;
  border-radius: 0;
  object-fit: contain;
  border: none;
  transform: scaleX(-1);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));

}

.tely-portrait svg {
  display: none;
}

.chatbot-header-info {
  flex: 1;
  min-width: 0;
  padding-bottom: 4px;
}

.chatbot-header-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 3px;
}

.chatbot-header-title {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.chatbot-header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}

.chatbot-status-dot {
  width: 7px;
  height: 7px;
  background-color: #5CC151;
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.chatbot-status-text {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
}

.chatbot-header-actions {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  flex-shrink: 0;
  padding-top: 4px;
}

.chatbot-header-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.chatbot-header-btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

.chatbot-header-btn svg {
  width: 14px;
  height: 14px;
}

/* ============================================================
   4. MESSAGE STREAM
   ============================================================ */

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #f8fafb;
  scrollbar-width: thin;
  scrollbar-color: #C8C8C8 transparent;
}

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

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background-color: #C8C8C8;
  border-radius: 9999px;
}

/* Message groups */
.chat-message-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-message-group.bot {
  align-items: flex-start;
}

.chat-message-group.user {
  align-items: flex-end;
}

/* Message row (avatar + bubble) */
.chat-message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 88%;
}

.chat-message-group.bot .chat-message-row {
  flex-direction: row;
}

.chat-message-group.user .chat-message-row {
  flex-direction: row-reverse;
}

/* Bot avatar */
.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #005a94, #0076C0);
  overflow: hidden;
}

.chat-avatar svg {
  width: 20px;
  height: 20px;
  color: #ffffff;
}

.chat-message-group.user .chat-avatar {
  background: linear-gradient(135deg, #58595B, #3a3b3d);
}

/* Bubble */
.chat-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
  animation: chatBubbleIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.chat-message-group.bot .chat-bubble {
  background-color: #ffffff;
  color: #3a3b3d;
  border: 1px solid #e8f4fc;
  border-left: 3px solid #0076C0;
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
}

.chat-message-group.user .chat-bubble {
  background: linear-gradient(135deg, #005a94, #0076C0);
  color: #ffffff;
  border-radius: 16px 4px 16px 16px;
  box-shadow: 0 2px 8px rgba(0, 118, 192, 0.3);
}

@keyframes chatBubbleIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Bubble content elements */
.chat-bubble p {
  font-size: 13.5px;
  color: inherit;
  margin-bottom: 0;
}

.chat-bubble p + p {
  margin-top: 6px;
}

.chat-bubble ul {
  margin-top: 6px;
  padding-left: 16px;
  list-style: disc;
}

.chat-bubble ul li {
  font-size: 13px;
  margin-bottom: 3px;
}

.chat-bubble strong {
  font-weight: 700;
}

.chat-bubble .chat-link {
  color: #1a8fd1;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-message-group.user .chat-bubble .chat-link {
  color: rgba(255, 255, 255, 0.85);
}

/* Timestamp */
.chat-timestamp {
  font-size: 10.5px;
  color: #a0a0a0;
  padding: 0 8px;
  margin-top: 2px;
}

.chat-message-group.user .chat-timestamp {
  text-align: right;
}

/* Product suggestion card inside bubble */
.chat-product-card {
  margin-top: 10px;
  background-color: #f0f8ff;
  border: 1px solid #b3d9ef;
  border-radius: 10px;
  padding: 10px 12px;
}

.chat-product-card-model {
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #0076C0;
  margin-bottom: 3px;
}

.chat-product-card-desc {
  font-size: 12px;
  color: #58595B;
  line-height: 1.4;
}

.chat-product-card-specs {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.chat-product-card-spec {
  font-size: 11px;
  font-weight: 700;
  color: #005a94;
  background-color: #e8f4fc;
  padding: 2px 7px;
  border-radius: 9999px;
}

/* System / info message */
.chat-system-msg {
  text-align: center;
  font-size: 11px;
  color: #a0a0a0;
  padding: 4px 12px;
  position: relative;
}

.chat-system-msg::before,
.chat-system-msg::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background-color: #e8e8e8;
}

.chat-system-msg::before { left: 0; }
.chat-system-msg::after  { right: 0; }

/* ============================================================
   5. QUICK REPLIES
   ============================================================ */

.quick-replies {
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid #f0f0f0;
  background-color: #ffffff;
  overflow-y: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  max-height: 40%;
}

.quick-replies::-webkit-scrollbar {
  display: none;
}

.quick-reply-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 500;
  color: #0076C0;
  background-color: #ffffff;
  border: 1.5px solid #b3d9ef;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
  animation: chipStaggerIn 0.3s ease backwards;
  flex-shrink: 0;
}

.quick-reply-chip:nth-child(1) { animation-delay: 0.05s; }
.quick-reply-chip:nth-child(2) { animation-delay: 0.1s; }
.quick-reply-chip:nth-child(3) { animation-delay: 0.15s; }
.quick-reply-chip:nth-child(4) { animation-delay: 0.2s; }
.quick-reply-chip:nth-child(5) { animation-delay: 0.25s; }
.quick-reply-chip:nth-child(6) { animation-delay: 0.3s; }

@keyframes chipStaggerIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quick-reply-chip:hover {
  background-color: #0076C0;
  border-color: #0076C0;
  color: #ffffff;
  transform: translateY(-1px);
}

.quick-reply-chip:active {
  transform: scale(0.95);
}

.quick-reply-chip svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* ============================================================
   6. INPUT AREA
   ============================================================ */

.chat-input-area {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 14px;
  background-color: #ffffff;
  border-top: 1px solid #f0f0f0;
}

.chat-input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  background-color: #f5f5f5;
  border: 1.5px solid #e8e8e8;
  border-radius: 9999px;
  font-size: 13.5px;
  color: #3a3b3d;
  outline: none;
  font-family: 'Roboto', sans-serif;
  transition: border-color 200ms ease, box-shadow 200ms ease, background-color 150ms ease;
}

.chat-input::placeholder {
  color: #a0a0a0;
}

.chat-input:focus {
  border-color: #0076C0;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 118, 192, 0.12);
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #005a94, #0076C0);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 150ms ease;
  box-shadow: 0 2px 8px rgba(0, 118, 192, 0.35);
}

.chat-send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 118, 192, 0.5);
}

.chat-send-btn:active {
  transform: scale(0.92);
}

.chat-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.chat-send-btn svg {
  width: 18px;
  height: 18px;
}

/* ============================================================
   7. TELY STATES
   ============================================================ */

.tely-fox-container {
  display: block;
  position: relative;
  transform-origin: bottom center;
}

/* Idle — gentle breathing */
.tely-fox-container.tely-idle {
  animation: telyIdle 4s ease-in-out infinite;
}

@keyframes telyIdle {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50%       { transform: translateY(-2px) scaleY(1.01); }
}

/* Thinking — gentle bob */
.tely-fox-container.tely-thinking {
  animation: telyThinking 1.2s ease-in-out infinite;
}

@keyframes telyThinking {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30%       { transform: translateY(-4px) rotate(-2deg); }
  60%       { transform: translateY(-2px) rotate(1deg); }
}

/* Talking — subtle scale pulse */
.tely-fox-container.tely-talking {
  animation: telyTalking 0.6s ease-in-out infinite;
}

@keyframes telyTalking {
  0%, 100% { transform: scaleY(1) translateY(0); }
  50%       { transform: scaleY(1.03) translateY(-1px); }
}

/* Happy — quick bounce */
.tely-fox-container.tely-happy {
  animation: telyHappy 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes telyHappy {
  0%   { transform: translateY(0) scale(1); }
  30%  { transform: translateY(-10px) scale(1.05); }
  60%  { transform: translateY(-4px) scale(0.98); }
  80%  { transform: translateY(-7px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}

/* Excited — fast bounce + scale */
.tely-fox-container.tely-excited {
  animation: telyExcited 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

@keyframes telyExcited {
  0%   { transform: translateY(0) scale(1) rotate(0deg); }
  25%  { transform: translateY(-12px) scale(1.08) rotate(-3deg); }
  50%  { transform: translateY(-6px) scale(0.97) rotate(3deg); }
  75%  { transform: translateY(-10px) scale(1.05) rotate(-2deg); }
  100% { transform: translateY(0) scale(1) rotate(0deg); }
}

/* Eye expressions via SVG class on the portrait */
.tely-portrait svg .tely-eye {
  transition: transform 300ms ease, cy 300ms ease;
}

.tely-fox-container.tely-thinking .tely-portrait svg .tely-eye {
  cy: 38;
}

.tely-fox-container.tely-happy .tely-portrait svg .tely-eye {
  transform: scaleY(0.5);
}

/* ============================================================
   8. TYPING INDICATOR
   ============================================================ */

.chat-typing-indicator {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: chatBubbleIn 0.3s ease forwards;
}

.chat-typing-bubble {
  background-color: #ffffff;
  border: 1px solid #e8f4fc;
  border-left: 3px solid #0076C0;
  border-radius: 4px 16px 16px 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
}

.typing-dot {
  width: 7px;
  height: 7px;
  background-color: #b3d9ef;
  border-radius: 50%;
  animation: typingDot 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% {
    transform: translateY(0);
    background-color: #b3d9ef;
  }
  30% {
    transform: translateY(-6px);
    background-color: #0076C0;
  }
}

/* ============================================================
   9. PROGRESS STEPS IN CHAT
   ============================================================ */

.chat-progress-steps {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 12px;
  background-color: #f8fafb;
  border-top: 1px solid #e8f4fc;
  flex-shrink: 0;
}

.chat-step {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}

.chat-step-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  background-color: #e8e8e8;
  color: #a0a0a0;
  flex-shrink: 0;
  transition: background-color 300ms ease, color 300ms ease, transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-step.active .chat-step-pill {
  background-color: #0076C0;
  color: #ffffff;
  transform: scale(1.15);
  box-shadow: 0 0 0 3px rgba(0, 118, 192, 0.2);
}

.chat-step.completed .chat-step-pill {
  background-color: #5CC151;
  color: #ffffff;
}

.chat-step-connector {
  flex: 1;
  height: 2px;
  background-color: #e8e8e8;
  transition: background-color 400ms ease;
  margin: 0 2px;
}

.chat-step.completed + .chat-step .chat-step-connector,
.chat-step.completed ~ .chat-step-connector {
  background-color: #5CC151;
}

.chat-step-label {
  font-size: 10px;
  font-weight: 500;
  color: #a0a0a0;
  margin-top: 4px;
  text-align: center;
  white-space: nowrap;
  display: none;
}

.chat-step.active .chat-step-label {
  color: #0076C0;
  display: block;
}

/* ============================================================
   10. PRODUCT BASKET PREVIEW IN CHAT
   ============================================================ */

.chat-basket-preview {
  flex-shrink: 0;
  border-top: 1px solid #e8f4fc;
  background-color: #ffffff;
  overflow: hidden;
}

.chat-basket-preview-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  cursor: pointer;
  user-select: none;
  transition: background-color 150ms ease;
}

.chat-basket-preview-toggle:hover {
  background-color: #f0f8ff;
}

.chat-basket-preview-toggle-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-basket-preview-toggle-left svg {
  width: 16px;
  height: 16px;
  color: #0076C0;
}

.chat-basket-preview-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #3a3b3d;
}

.chat-basket-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background-color: #0076C0;
  color: #ffffff;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
}

.chat-basket-chevron {
  width: 14px;
  height: 14px;
  color: #a0a0a0;
  transition: transform 250ms ease;
}

.chat-basket-preview.expanded .chat-basket-chevron {
  transform: rotate(180deg);
}

.chat-basket-preview-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 350ms cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-basket-preview.expanded .chat-basket-preview-body {
  max-height: 180px;
}

.chat-basket-item-list {
  padding: 0 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 130px;
  overflow-y: auto;
}

.chat-basket-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #3a3b3d;
}

.chat-basket-item-qty {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background-color: #e8f4fc;
  color: #0076C0;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-basket-item-name {
  flex: 1;
  font-family: 'Roboto Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #005a94;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-basket-view-link {
  display: block;
  text-align: center;
  padding: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #0076C0;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 150ms ease;
}

.chat-basket-view-link:hover {
  color: #005a94;
}

/* ============================================================
   11. CHAT INTRO / WELCOME CARD
   ============================================================ */

.chat-welcome {
  background: linear-gradient(135deg, #e8f4fc, #f0f8ff);
  border-radius: 12px;
  border: 1px solid #b3d9ef;
  padding: 14px;
  margin-bottom: 4px;
  animation: chatBubbleIn 0.4s ease forwards;
}

.chat-welcome-greeting {
  font-size: 14px;
  font-weight: 700;
  color: #003f6b;
  margin-bottom: 6px;
}

.chat-welcome-desc {
  font-size: 12.5px;
  color: #58595B;
  line-height: 1.5;
}

.chat-welcome-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chat-capability-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  background-color: #ffffff;
  color: #0076C0;
  border: 1px solid #b3d9ef;
}

.chat-capability-tag svg {
  width: 11px;
  height: 11px;
}

/* ============================================================
   12. CHAT PANEL FOOTER LEGAL
   ============================================================ */

.chat-footer-legal {
  padding: 5px 12px 10px;
  text-align: center;
  font-size: 10px;
  color: #C8C8C8;
  flex-shrink: 0;
  background-color: #ffffff;
}

/* ============================================================
   13. RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 480px) {
  .chatbot-panel {
    width: calc(100vw - 16px);
    height: 75vh;
    right: 8px;
    bottom: 90px;
    border-radius: 20px;
  }

  .chatbot-toggle {
    right: 12px;
    bottom: 12px;
    width: 70px;
    height: 70px;
  }

  .chatbot-toggle-icon {
    width: 70px;
    height: 70px;
  }

  .tely-toggle-img {
    width: 70px;
    height: 70px;
  }
}

@media (max-width: 768px) {
  .chatbot-panel {
    width: min(380px, calc(100vw - 32px));
    height: min(560px, 75vh);
  }
}

/* ============================================================
   14. REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .tely-toggle-img {
    animation: none;
    transform: scaleX(-1);
  }

  .chatbot-toggle:hover .tely-toggle-img {
    animation: none;
  }

  .chatbot-toggle::before,
  .chatbot-toggle::after {
    animation: none;
  }

  .tely-fox-container.tely-idle,
  .tely-fox-container.tely-thinking,
  .tely-fox-container.tely-talking,
  .tely-fox-container.tely-happy,
  .tely-fox-container.tely-excited {
    animation: none;
  }

  .typing-dot {
    animation: none;
    opacity: 0.5;
  }

  .typing-dot:nth-child(2) { opacity: 0.7; }
  .typing-dot:nth-child(3) { opacity: 0.9; }

  .chat-bubble {
    animation: none;
  }

  .quick-reply-chip {
    animation: none;
  }
}

/* ============================================================
   15. DARK MODE OVERRIDES — Match site dark theme
   ============================================================ */

/* Panel background */
.chatbot-panel {
  background-color: #1a2332;
  border-color: rgba(0, 118, 192, 0.2);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Header — alias HTML class names to existing styles */
.chatbot-panel-header {
  position: relative;
  flex-shrink: 0;
  background: linear-gradient(135deg, #003f6b 0%, #005a94 40%, #0076C0 100%);
  padding: 16px 16px 12px;
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}

.tely-info {
  flex: 1;
  min-width: 0;
}

.tely-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.tely-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.chatbot-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.chatbot-ctrl-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.chatbot-ctrl-btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

.chatbot-ctrl-btn svg,
.chatbot-ctrl-btn i {
  width: 14px;
  height: 14px;
}

/* Messages area — dark */
.chat-messages {
  background-color: #0f1626;
  scrollbar-color: #334155 transparent;
}

/* Bot bubble — dark */
.chat-message-group.bot .chat-bubble {
  background-color: #1e293b;
  color: #e8edf5;
  border-color: rgba(0, 118, 192, 0.2);
  border-left-color: #0076C0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Product card in chat — dark */
.chat-product-card {
  background-color: rgba(0, 118, 192, 0.1);
  border-color: rgba(0, 118, 192, 0.2);
}

.chat-product-card-desc {
  color: #94a3b8;
}

.chat-product-card-spec {
  color: #0076C0;
  background-color: rgba(0, 118, 192, 0.15);
}

/* System message — dark */
.chat-system-msg {
  color: #64748b;
}

.chat-system-msg::before,
.chat-system-msg::after {
  background-color: #334155;
}

/* Quick replies — dark */
.quick-replies {
  border-top-color: #334155;
  background-color: #1a2332;
}

.quick-reply-chip,
.chatbot-chip {
  color: #0076C0;
  background-color: rgba(0, 118, 192, 0.08);
  border-color: rgba(0, 118, 192, 0.3);
}

.quick-reply-chip:hover,
.chatbot-chip:hover {
  background-color: #0076C0;
  border-color: #0076C0;
  color: #ffffff;
}

/* Input area — dark */
.chat-input-area {
  background-color: #1a2332;
  border-top-color: #334155;
}

.chat-input {
  background-color: #0f1626;
  border-color: #334155;
  color: #e8edf5;
}

.chat-input::placeholder {
  color: #64748b;
}

.chat-input:focus {
  border-color: #0076C0;
  background-color: #111827;
  box-shadow: 0 0 0 3px rgba(0, 118, 192, 0.2);
}

/* Typing indicator — dark */
.chat-typing-bubble {
  background-color: #1e293b;
  border-color: rgba(0, 118, 192, 0.2);
  border-left-color: #0076C0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.typing-dot {
  background-color: #334155;
}

/* Progress steps — dark */
.chat-progress-steps {
  background-color: #111827;
  border-top-color: #334155;
}

.chat-step-pill {
  background-color: #334155;
  color: #64748b;
}

.chat-step-connector {
  background-color: #334155;
}

.chat-step-label {
  color: #64748b;
}

/* Basket preview — dark */
.chat-basket-preview {
  border-top-color: #334155;
  background-color: #1a2332;
}

.chat-basket-preview-toggle:hover {
  background-color: rgba(0, 118, 192, 0.08);
}

.chat-basket-preview-title {
  color: #e8edf5;
}

.chat-basket-item {
  color: #e8edf5;
}

.chat-basket-item-qty {
  background-color: rgba(0, 118, 192, 0.15);
}

.chat-basket-item-name {
  color: #0076C0;
}

/* Welcome card — dark */
.chat-welcome {
  background: linear-gradient(135deg, rgba(0, 118, 192, 0.15), rgba(0, 118, 192, 0.05));
  border-color: rgba(0, 118, 192, 0.2);
}

.chat-welcome-greeting {
  color: #e8edf5;
}

.chat-welcome-desc {
  color: #94a3b8;
}

.chat-capability-tag {
  background-color: rgba(0, 118, 192, 0.1);
  color: #0076C0;
  border-color: rgba(0, 118, 192, 0.2);
}

/* Footer legal — dark */
.chat-footer-legal {
  background-color: #1a2332;
  color: #64748b;
}

/* Chatbot-specific chips (scope select, checkboxes) — dark */
.chatbot-scope-input {
  background-color: #0f1626;
  border: 1px solid #334155;
  color: #e8edf5;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  width: 100%;
}

.chatbot-scope-input::placeholder {
  color: #64748b;
}

.chatbot-scope-input:focus {
  border-color: #0076C0;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 118, 192, 0.2);
}

.chatbot-scope-input-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.chatbot-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chatbot-checkbox-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}

.chatbot-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #e8edf5;
  cursor: pointer;
}

.chatbot-checkbox-item:hover {
  background-color: rgba(0, 118, 192, 0.08);
}

.chatbot-sw-label {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 8px;
}

/* ============================================================
   16. CHATBOT.JS MESSAGE CLASSES — match JS-generated DOM
   ============================================================ */

/* Message rows generated by chatbot.js _appendMessage() */
.chatbot-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chatbot-message--bot {
  align-items: flex-start;
}

.chatbot-message--user {
  align-items: flex-end;
}

/* Bubble — mirrors .chat-bubble styling */
.chatbot-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
  animation: chatBubbleIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  max-width: 88%;
}

.chatbot-message--bot .chatbot-bubble {
  background-color: #1e293b;
  color: #e8edf5;
  border: 1px solid rgba(0, 118, 192, 0.2);
  border-left: 3px solid #0076C0;
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.chatbot-message--user .chatbot-bubble {
  background: linear-gradient(135deg, #005a94, #0076C0);
  color: #ffffff;
  border-radius: 16px 4px 16px 16px;
  box-shadow: 0 2px 8px rgba(0, 118, 192, 0.3);
}

/* Typing indicator dots — match the chatbot.js format */
.chatbot-typing .chatbot-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.chatbot-typing .chatbot-bubble span {
  width: 7px;
  height: 7px;
  background-color: #334155;
  border-radius: 50%;
  animation: typingDot 1.4s ease-in-out infinite;
}

.chatbot-typing .chatbot-bubble span:nth-child(1) { animation-delay: 0s; }
.chatbot-typing .chatbot-bubble span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing .chatbot-bubble span:nth-child(3) { animation-delay: 0.4s; }

/* Chip groups in quick replies */
.chatbot-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  margin-bottom: 4px;
}

.chatbot-chip-group-label {
  width: 100%;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 2px;
}

.chatbot-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  color: #0076C0;
  background-color: rgba(0, 118, 192, 0.08);
  border: 1.5px solid rgba(0, 118, 192, 0.3);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
  font-family: 'Roboto', sans-serif;
}

.chatbot-chip:hover {
  background-color: #0076C0;
  border-color: #0076C0;
  color: #ffffff;
  transform: translateY(-1px);
}

.chatbot-chip:active {
  transform: scale(0.95);
}

/* Badge on toggle for unread messages */
.chatbot-toggle-label {
  display: none;
}

/* Notification dot */
.chatbot-toggle-badge {
  border-color: #1a2332;
}
