
.chat-widget { position: fixed; right: 22px; bottom: 22px; z-index: 1500; }

.chat-toggle {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, var(--orange), var(--orange-dark));
  color: var(--paper);
  font-size: 24px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: transform .25s ease, box-shadow .25s ease;
}
.chat-toggle:hover { transform: translateY(-3px) scale(1.04); }
.chat-toggle-icon-close { display: none; }
.chat-toggle.open .chat-toggle-icon-open { display: none; }
.chat-toggle.open .chat-toggle-icon-close { display: block; }

.chat-hint {
  position: absolute;
  right: 70px;
  bottom: 16px;
  background: var(--paper);
  color: var(--charcoal);
  padding: 10px 12px 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s;
  cursor: pointer;
}
.chat-hint.show { opacity: 1; visibility: visible; transform: translateX(0); }
.chat-hint::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px;
  background: var(--paper);
  clip-path: polygon(0 0, 0 100%, 100% 50%);
}
.chat-hint-close {
  background: none;
  border: none;
  color: var(--steel-light);
  font-size: 12px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  flex: none;
}
.chat-hint-close:hover { color: var(--charcoal); }

.chat-toggle.chat-pulse::before {
  content: "";
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--blue-light);
  animation: chatPulse 1.8s ease-out 3;
}
@keyframes chatPulse {
  0% { transform: scale(.9); opacity: .9; }
  100% { transform: scale(1.35); opacity: 0; }
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: 372px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 140px);
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}
.chat-panel.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.chat-header {
  background: var(--navy);
  color: var(--paper);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
}
.chat-header-info { display: flex; align-items: center; gap: 12px; }
.chat-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  flex: none;
  overflow: hidden;
  padding: 6px;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: contain; }
.chat-title { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 14.5px; }
.chat-subtitle { font-size: 12px; color: var(--plate); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.chat-dot { width: 7px; height: 7px; border-radius: 50%; background: #33d17a; display: inline-block; }
.chat-close {
  background: rgba(255,255,255,.1);
  border: none;
  color: var(--paper);
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  transition: background .2s ease;
}
.chat-close:hover { background: rgba(255,255,255,.2); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--grey-bg);
}
.chat-msg { display: flex; }
.chat-msg-bot { justify-content: flex-start; }
.chat-msg-user { justify-content: flex-end; }
.chat-msg-bot .chat-bubble {
  background: var(--paper);
  color: var(--charcoal);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.chat-msg-user .chat-bubble {
  background: var(--blue);
  color: var(--paper);
  border-bottom-right-radius: 4px;
}
.chat-bubble {
  max-width: 84%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg-links { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-width: 84%; }
.chat-msg-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background .15s ease, border-color .15s ease;
}
.chat-msg-links a:hover { background: var(--grey-bg); border-color: var(--blue); }

.chat-typing { display: flex; align-items: center; gap: 4px; padding: 13px 16px; }
.chat-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--steel-light);
  display: inline-block;
  animation: chatTyping 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chatTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 12px;
  flex: none;
  background: var(--grey-bg);
}
.chat-chip {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.chat-chip:hover { background: var(--orange); color: var(--paper); border-color: var(--orange); }

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  flex: none;
}
.chat-input-row input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 14px;
  font-family: inherit;
  background: var(--grey-bg);
  color: var(--charcoal);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.chat-input-row input:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(63,72,204,.15);
}
.chat-send {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--orange);
  color: var(--paper);
  font-size: 15px;
  cursor: pointer;
  flex: none;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s ease, transform .2s ease;
}
.chat-send:hover { background: var(--orange-dark); transform: scale(1.05); }

@media (max-width: 480px) {
  .chat-widget { right: 14px; bottom: 14px; }
  .chat-panel { width: calc(100vw - 24px); right: -8px; height: calc(100vh - 120px); }
  .chat-toggle { width: 54px; height: 54px; font-size: 21px; }
  .chat-hint {
    right: auto;
    left: -10px;
    max-width: calc(100vw - 90px);
    white-space: normal;
    font-size: 12.5px;
    padding: 8px 10px 8px 12px;
  }
  .chat-hint::after { display: none; }
}
