:root {
  --cvd-chat-ocean: #155a84;
  --cvd-chat-deep: #0f2b46;
  --cvd-chat-gold: #c4a35a;
}

.cvd-chat-fab {
  position: fixed;
  right: 18px;
  bottom: 86px;
  z-index: 1200;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(160deg, #1a6fa0, var(--cvd-chat-deep));
  box-shadow: 0 8px 24px rgba(15, 43, 70, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cvd-chat-fab:hover {
  transform: translateY(-1px);
}

.cvd-chat-fab svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.cvd-chat-panel {
  position: fixed;
  right: 18px;
  bottom: 154px;
  z-index: 1210;
  width: min(380px, calc(100vw - 28px));
  height: min(520px, calc(100vh - 180px));
  display: none;
  flex-direction: column;
  background: #fff;
  border: 1px solid #d8e1e8;
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(15, 43, 70, 0.18);
  overflow: hidden;
  font-family: "Poppins", Arial, sans-serif;
}

.cvd-chat-panel.is-open {
  display: flex;
}

.cvd-chat-head {
  padding: 14px 16px 12px;
  background: var(--cvd-chat-deep);
  color: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.cvd-chat-head strong {
  display: block;
  font-size: 0.95rem;
}

.cvd-chat-head span {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  line-height: 1.4;
  opacity: 0.82;
  font-weight: 400;
}

.cvd-chat-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.cvd-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  background: #f4f8fb;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cvd-chat-bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #17202a;
}

.cvd-chat-bubble p { margin: 0 0 0.55em; }
.cvd-chat-bubble p:last-child { margin-bottom: 0; }
.cvd-chat-bubble ul { margin: 0.2em 0 0.4em; padding-left: 1.15em; }
.cvd-chat-bubble a { color: var(--cvd-chat-ocean); font-weight: 600; }

.cvd-chat-bubble--user {
  align-self: flex-end;
  background: var(--cvd-chat-ocean);
  color: #fff;
}

.cvd-chat-bubble--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #d8e1e8;
}

.cvd-chat-bubble--err {
  background: #fff6f0;
  border-color: #efc8b0;
}

.cvd-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 8px;
  background: #f4f8fb;
}

.cvd-chat-chip {
  border: 1px solid #c5d4e0;
  background: #fff;
  color: var(--cvd-chat-deep);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.74rem;
  cursor: pointer;
  font-family: inherit;
}

.cvd-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #d8e1e8;
  background: #fff;
}

.cvd-chat-form input {
  flex: 1;
  border: 1px solid #c5d4e0;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.88rem;
}

.cvd-chat-form button {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--cvd-chat-ocean);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.cvd-chat-wa {
  display: none;
  margin: 0 12px 10px;
  text-align: center;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.84rem;
  border-radius: 12px;
  padding: 10px;
}

.cvd-chat-wa.is-on { display: block; }

.cvd-chat-typing {
  font-size: 0.78rem;
  color: #657383;
  padding: 0 4px;
}

@media (max-width: 640px) {
  .cvd-chat-fab {
    right: 14px;
    bottom: 76px;
    width: 52px;
    height: 52px;
  }
  .cvd-chat-panel {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 138px;
    height: min(70vh, 520px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cvd-chat-fab { transform: none; }
}
