.exin-chat-launcher {
  position: fixed;
  right: 10px;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  z-index: 10050;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--exin-accent, #ff4600);
  color: #fff;
  border: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  padding: 0;
}
.exin-chat-launcher:hover {
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
}
.exin-chat-launcher .exin-chat-launcher__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1fb855;
  border: 2px solid #fff;
}
.exin-chat-launcher .exin-chat-launcher__close-icon,
.exin-chat-launcher.is-open .exin-chat-launcher__chat-icon {
  display: none;
}
.exin-chat-launcher.is-open .exin-chat-launcher__close-icon {
  display: block;
}

.exin-chat-panel {
  position: fixed;
  right: 58px;
  top: 50%;
  bottom: auto;
  z-index: 10051;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 80px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-50%) translateX(8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.exin-chat-panel.is-open {
  opacity: 1;
  transform: translateY(-50%) translateX(0) scale(1);
  pointer-events: auto;
}

.exin-chat-panel__header {
  background: var(--exin-accent, #ff4600);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.exin-chat-panel__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.exin-chat-panel__title {
  flex: 1;
  min-width: 0;
}
.exin-chat-panel__name {
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.exin-chat-panel__status {
  font-size: 11.5px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 5px;
}
.exin-chat-panel__status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}
.exin-chat-panel__close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  opacity: 0.85;
}
.exin-chat-panel__close:hover {
  opacity: 1;
}

.exin-chat-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f6f3;
}

.exin-chat-msg {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.exin-chat-msg--assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #ebe9e3;
  border-bottom-left-radius: 4px;
  color: #1c1c1c;
}
.exin-chat-msg--user {
  align-self: flex-end;
  background: var(--exin-accent, #ff4600);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.exin-chat-msg--off-topic {
  opacity: 0.92;
  font-style: italic;
}

.exin-chat-msg-products {
  align-self: flex-start;
  max-width: 92%;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.exin-chat-typing {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #ebe9e3;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 10px 14px;
  display: flex;
  gap: 4px;
}
.exin-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b9b6ad;
  display: inline-block;
  animation: exinChatTyping 1.1s infinite ease-in-out;
}
.exin-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.exin-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes exinChatTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.exin-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 2px 2px 4px;
}
.exin-chat-suggestion {
  background: #fff;
  border: 1px solid #e3e1da;
  color: #333;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12.8px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.exin-chat-suggestion:hover {
  border-color: var(--exin-accent, #ff4600);
  color: var(--exin-accent, #ff4600);
}

.exin-chat-handoff {
  align-self: stretch;
  background: #fff;
  border: 1px dashed #d7d4ca;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.exin-chat-handoff__hint {
  font-size: 12.5px;
  color: #5c5951;
}
.exin-chat-handoff__row {
  display: flex;
  gap: 6px;
}
.exin-chat-handoff__row input {
  flex: 1;
  min-width: 0;
  border: 1px solid #ddd9cf;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.exin-chat-handoff__row button {
  background: var(--exin-accent, #ff4600);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.exin-chat-handoff__done {
  font-size: 12.8px;
  color: #1a8a4a;
  font-weight: 600;
}

.exin-chat-panel__footer {
  flex-shrink: 0;
  border-top: 1px solid #ece9e2;
  padding: 10px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: #fff;
}
.exin-chat-panel__input {
  flex: 1;
  resize: none;
  border: 1px solid #e3e1da;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13.8px;
  line-height: 1.4;
  max-height: 90px;
  font-family: inherit;
}
.exin-chat-panel__input:focus {
  outline: none;
  border-color: var(--exin-accent, #ff4600);
}
.exin-chat-panel__send {
  background: var(--exin-accent, #ff4600);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.exin-chat-panel__send:disabled {
  opacity: 0.5;
  cursor: default;
}

@media (max-width: 520px) {
  .exin-chat-panel {
    right: 10px;
    left: 10px;
    top: auto;
    bottom: 86px;
    width: auto;
    max-width: none;
    height: calc(100vh - 170px);
    max-height: none;
    transform: translateY(16px) scale(0.98);
  }
  .exin-chat-panel.is-open {
    transform: translateY(0) scale(1);
  }
  .exin-chat-launcher {
    right: 8px;
  }
}
