.upibot-chatbot {
  --upibot-blue: #0d2b44;
  --upibot-blue-strong: #003976;
  --upibot-yellow: #fcc000;
  bottom: 1.25rem;
  font-family: "DM Sans", Arial, sans-serif;
  position: fixed;
  right: 1.25rem;
  z-index: 9999;
}

.upibot-chatbot * {
  box-sizing: border-box;
}

.upibot-chatbot__toggle {
  align-items: center;
  background: var(--upibot-blue);
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  box-shadow: 0 16px 34px rgba(0, 31, 71, 0.32);
  cursor: pointer;
  display: flex;
  height: 72px;
  justify-content: center;
  padding: 0;
  position: relative;
  width: 72px;
}

.upibot-chatbot__avatar {
  align-items: center;
  animation: upibotFloat 3s ease-in-out infinite;
  background: #fff;
  border-radius: 50%;
  color: var(--upibot-blue);
  display: flex;
  font-weight: 800;
  height: 58px;
  justify-content: center;
  overflow: hidden;
  width: 58px;
}

.upibot-chatbot__avatar img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.upibot-chatbot__pulse {
  animation: upibotPulse 2s ease-out infinite;
  border: 2px solid rgba(252, 192, 0, 0.72);
  border-radius: 999px;
  inset: -7px;
  position: absolute;
}

.upibot-chatbot__panel {
  background: #fff;
  border: 1px solid #d8e3f2;
  border-radius: 18px;
  bottom: 88px;
  box-shadow: 0 22px 50px rgba(0, 31, 71, 0.26);
  display: flex;
  flex-direction: column;
  max-height: min(620px, calc(100vh - 130px));
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  right: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
  width: min(380px, calc(100vw - 2rem));
}

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

.upibot-chatbot__header {
  align-items: center;
  background: linear-gradient(135deg, var(--upibot-blue), var(--upibot-blue-strong));
  color: #fff;
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.1rem;
}

.upibot-chatbot__header p,
.upibot-chatbot__header h2 {
  margin: 0;
}

.upibot-chatbot__header p {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.upibot-chatbot__header h2 {
  font-family: "Sora", Arial, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.upibot-chatbot__close {
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  font-size: 1.5rem;
  height: 34px;
  line-height: 1;
  width: 34px;
}

.upibot-chatbot__messages {
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  padding: 1rem;
}

.upibot-chatbot__message {
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 88%;
  padding: 0.8rem 0.9rem;
}

.upibot-chatbot__message p {
  margin: 0;
}

.upibot-chatbot__message--bot {
  align-self: flex-start;
  background: #eef4fb;
  color: #18324a;
}

.upibot-chatbot__message--user {
  align-self: flex-end;
  background: var(--upibot-blue);
  color: #fff;
}

.upibot-chatbot__sources {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
}

.upibot-chatbot__sources li + li {
  margin-top: 0.4rem;
}

.upibot-chatbot__sources a {
  color: var(--upibot-blue-strong);
  font-weight: 700;
  text-decoration: none;
}

.upibot-chatbot__sources a:hover {
  text-decoration: underline;
}

.upibot-chatbot__form {
  background: #fff;
  border-top: 1px solid #e2ebf5;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1fr auto;
  padding: 0.85rem;
}

.upibot-chatbot__form input {
  border: 1px solid #cbd8e8;
  border-radius: 999px;
  color: #18324a;
  font: inherit;
  min-width: 0;
  padding: 0.75rem 1rem;
}

.upibot-chatbot__form input:focus {
  border-color: var(--upibot-blue-strong);
  box-shadow: 0 0 0 3px rgba(0, 57, 118, 0.12);
  outline: 0;
}

.upibot-chatbot__form button {
  background: var(--upibot-yellow);
  border: 0;
  border-radius: 999px;
  color: #001f47;
  cursor: pointer;
  font-weight: 800;
  padding: 0.75rem 1rem;
}

@keyframes upibotFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

@keyframes upibotPulse {
  0% {
    opacity: 0.8;
    transform: scale(0.95);
  }

  100% {
    opacity: 0;
    transform: scale(1.25);
  }
}

@media (max-width: 576px) {
  .upibot-chatbot {
    bottom: 0.85rem;
    right: 0.85rem;
  }

  .upibot-chatbot__toggle {
    height: 64px;
    width: 64px;
  }

  .upibot-chatbot__avatar {
    height: 50px;
    width: 50px;
  }

  .upibot-chatbot__panel {
    bottom: 78px;
    max-height: calc(100vh - 105px);
    width: calc(100vw - 1.7rem);
  }

  .upibot-chatbot__form {
    grid-template-columns: 1fr;
  }
}
