.cvc-chatbot {
  position: fixed;
  right: 18px;
  bottom: 164px;
  z-index: 2200;
  font-family: inherit;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

body.ui-nav-open .cvc-chatbot {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

body.cvc-chat-open .ui-newsletter-modal,
body.cvc-chat-open .modal-backdrop {
  display: none !important;
  pointer-events: none !important;
}

.cvc-chatbot__toggle {
  width: 66px;
  height: 66px;
  border-radius: 999px;
  border: 1px solid rgba(86, 147, 178, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  color: #17374e;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.10) inset;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
}

.cvc-chatbot__toggle::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 30% 30%, rgba(121, 174, 200, 0.34), rgba(121, 174, 200, 0.10) 58%, rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle at 72% 76%, rgba(236, 185, 88, 0.18), rgba(236, 185, 88, 0) 62%);
  opacity: 0.98;
}

.cvc-chatbot__toggle-inner {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: 0 8px 22px rgba(23, 55, 78, 0.16);
}

.cvc-chatbot__toggle-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}

.cvc-chatbot__toggle-dot {
  position: absolute;
  right: -2px;
  bottom: 0;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: #22c55e;
  border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: cvcChatPulse 1.7s infinite;
}

.cvc-chatbot__toggle-live {
  position: absolute;
  top: -8px;
  right: -10px;
  z-index: 2;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(135deg, #204d6b, #3f7f9f 60%, #e0b35d);
  border-radius: 999px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
}

.cvc-chatbot__toggle:hover,
.cvc-chatbot__toggle:focus-visible {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(86, 147, 178, 0.42);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
}

.cvc-chatbot__toggle:focus-visible {
  outline: 2px solid rgba(63, 127, 159, 0.34);
  outline-offset: 3px;
}

.cvc-chatbot__panel {
  width: min(92vw, 380px);
  height: min(70vh, 520px);
  background: #fff;
  border: 1px solid rgba(16, 36, 70, 0.16);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(6, 18, 38, 0.26);
  display: none;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.cvc-chatbot--open .cvc-chatbot__panel {
  display: flex;
}

.cvc-chatbot__header {
  background: linear-gradient(140deg, #0d294a, #103b6d 56%, #16518a);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.cvc-chatbot__header-main {
  min-width: 0;
}

.cvc-chatbot__title {
  font-weight: 700;
  margin: 0;
  font-size: 17px;
}

.cvc-chatbot__sub {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.9;
}

.cvc-chatbot__presence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  padding: 5px 8px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.08);
}

.cvc-chatbot__presence--live {
  border-color: rgba(255, 207, 159, 0.9);
  background: rgba(244, 123, 32, 0.2);
}

.cvc-chatbot__presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: cvcChatPulse 1.7s infinite;
}

.cvc-chatbot__messages {
  flex: 1;
  overflow-y: auto;
  background: linear-gradient(180deg, #f5f8fd, #eef3f9 55%, #edf2f8);
  padding: 12px;
}

.cvc-chatbot__msg {
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.cvc-chatbot__msg--user {
  justify-content: flex-end;
  flex-direction: row-reverse;
}

.cvc-chatbot__avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  flex: 0 0 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cvc-chatbot__avatar--bot {
  color: #0f1b2d;
  background: #fff;
  border: 1px solid #d5dde8;
}

.cvc-chatbot__avatar--user {
  color: #0f1b2d;
  background: #ffdcbf;
}

.cvc-chatbot__avatar--staff {
  color: #0f1b2d;
  background: #fff;
  border: 1px solid #d5dde8;
}

.cvc-chatbot__avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  display: block;
}

.cvc-chatbot__msg-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 88%;
}

.cvc-chatbot__msg--user .cvc-chatbot__msg-content {
  align-items: flex-end;
}

.cvc-chatbot__bubble {
  border-radius: 14px;
  padding: 9px 11px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.cvc-chatbot__msg--bot .cvc-chatbot__bubble {
  background: #fff;
  border: 1px solid rgba(196, 207, 223, 0.7);
  box-shadow: 0 8px 18px rgba(18, 40, 76, 0.08);
}

.cvc-chatbot__msg--user .cvc-chatbot__bubble {
  background: #f47b20;
  color: #fff;
  box-shadow: 0 8px 18px rgba(244, 123, 32, 0.28);
}

.cvc-chatbot__msg--staff .cvc-chatbot__bubble {
  background: #0f4f87;
  color: #fff;
  box-shadow: 0 8px 18px rgba(17, 74, 127, 0.28);
}

.cvc-chatbot__msg-time {
  margin-top: 4px;
  font-size: 11px;
  color: #6b7280;
}

.cvc-chatbot__meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cvc-chatbot__actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cvc-chatbot__action-btn {
  border: 1px solid #f1cfb4;
  background: #fffaf5;
  color: #9f4f11;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
}

.cvc-chatbot__action-btn:hover {
  border-color: #f47b20;
  background: #fff3e7;
}

.cvc-chatbot__chip {
  font-size: 12px;
  border: 1px solid #d8dce3;
  background: #fff;
  border-radius: 999px;
  padding: 3px 8px;
  text-decoration: none;
  color: #1f2937;
}

.cvc-chatbot__source-row {
  margin-top: 4px;
}

.cvc-chatbot__sources {
  margin-top: 6px;
  font-size: 12px;
}

.cvc-chatbot__sources a {
  color: #0b5ed7;
  text-decoration: none;
}

.cvc-chatbot__quick {
  border-top: 1px solid #e6e6e6;
  padding: 8px 10px;
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cvc-chatbot__quick button {
  border: 1px solid #f1cfb4;
  background: #fffaf5;
  color: #ba5b14;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.cvc-chatbot__quick button:hover {
  border-color: #f47b20;
  color: #9f4f11;
  background: #fff3e7;
}

.cvc-chatbot__notice {
  margin: 0 16px 10px;
  color: #5f6d7e;
  font-size: 11px;
  line-height: 1.4;
}

.cvc-chatbot__form {
  border-top: 1px solid #e6e6e6;
  background: #fff;
  padding: 8px;
  display: flex;
  gap: 8px;
}

.cvc-chatbot__input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
}

.cvc-chatbot__input:focus {
  outline: 0;
  border-color: #f47b20;
  box-shadow: 0 0 0 3px rgba(244, 123, 32, 0.18);
}

.cvc-chatbot__send {
  border: 0;
  border-radius: 10px;
  background: #f47b20;
  color: #fff;
  padding: 0 12px;
  font-size: 14px;
  min-width: 82px;
  position: relative;
}

.cvc-chatbot__send.is-loading {
  opacity: 0.9;
}

.cvc-chatbot__send.is-loading::after {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-top-color: #fff;
  border-radius: 999px;
  position: absolute;
  right: 8px;
  top: calc(50% - 6px);
  animation: cvcChatSpin 0.75s linear infinite;
}

.cvc-chatbot__toast {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  background: rgba(13, 41, 74, 0.92);
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: none;
}

.cvc-chatbot__toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cvc-chatbot__bubble--typing {
  opacity: 0.96;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cvc-chatbot__typing-dots {
  display: inline-flex;
  gap: 3px;
}

.cvc-chatbot__typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #90a1ba;
  animation: cvcTypingBounce 0.9s infinite ease-in-out;
}

.cvc-chatbot__typing-dots span:nth-child(2) {
  animation-delay: 0.12s;
}

.cvc-chatbot__typing-dots span:nth-child(3) {
  animation-delay: 0.24s;
}

.cvc-chatbot__typing-text {
  color: #52627c;
  font-size: 12px;
}

.cvc-chatbot__copy-wrap {
  margin-top: 8px;
  border: 1px solid #e8eaef;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.cvc-chatbot__copy-text {
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  max-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
}

.cvc-chatbot__copy-btn {
  width: 100%;
  border: 0;
  border-top: 1px solid #e8eaef;
  background: #f9fafb;
  padding: 6px 10px;
  font-size: 12px;
}

@keyframes cvcChatSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes cvcChatPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

@keyframes cvcTypingBounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-2px);
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .cvc-chatbot {
    right: 8px;
    left: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 152px);
  }

  .cvc-chatbot__panel {
    width: min(92vw, 360px);
    height: min(56dvh, 480px);
    max-height: calc(100dvh - 210px);
    border-radius: 16px;
  }

  .cvc-chatbot__toggle {
    position: absolute;
    right: 0;
    bottom: -54px;
    width: 58px;
    height: 58px;
  }

  .cvc-chatbot__toggle-inner {
    width: 40px;
    height: 40px;
  }

  .cvc-chatbot__toggle-logo {
    width: 36px;
    height: 36px;
  }

  .cvc-chatbot__toggle-live {
    top: -8px;
    right: -6px;
    font-size: 10px;
    padding: 4px 6px;
  }

  .cvc-chatbot__toggle-dot {
    width: 12px;
    height: 12px;
  }

  .cvc-chatbot__header {
    padding: 9px 10px;
    align-items: center;
    gap: 8px;
  }

  .cvc-chatbot__title {
    font-size: 15px;
    line-height: 1.2;
  }

  .cvc-chatbot__sub {
    display: none;
  }

  .cvc-chatbot__presence {
    gap: 5px;
    font-size: 10px;
    padding: 4px 7px;
  }

  .cvc-chatbot__messages {
    padding: 10px;
  }

  .cvc-chatbot__bubble {
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.38;
  }

  .cvc-chatbot__actions {
    margin-top: 7px;
    gap: 5px;
  }

  .cvc-chatbot__action-btn {
    font-size: 11px;
    padding: 4px 8px;
  }

  .cvc-chatbot__quick {
    padding: 5px 7px;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .cvc-chatbot__quick::-webkit-scrollbar {
    display: none;
  }

  .cvc-chatbot__quick button {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 10px;
    padding: 4px 8px;
  }

  .cvc-chatbot__notice {
    display: none;
  }

  .cvc-chatbot__form {
    padding: 6px;
    gap: 6px;
  }

  .cvc-chatbot__input {
    padding: 7px 8px;
    font-size: 12px;
  }

  .cvc-chatbot__send {
    min-width: 66px;
    padding: 0 9px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cvc-chatbot__typing-dots span,
  .cvc-chatbot__toggle-dot,
  .cvc-chatbot__toast {
    animation: none !important;
    transition: none !important;
  }
}
