:root {
  --teem-chatbot-primary: #722282;
  --teem-chatbot-primary-dark: #591070;
  --teem-chatbot-primary-soft: #f3eaf7;
  --teem-chatbot-border: #e3d8e8;
  --teem-chatbot-text: #2c2430;
  --teem-chatbot-muted: #6f6673;
  --teem-chatbot-white: #ffffff;
  --teem-chatbot-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

#teem-chatbot {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9999;
  font-family: "Fira Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#teem-chatbot-toggle {
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teem-chatbot-primary), var(--teem-chatbot-primary-dark));
  color: var(--teem-chatbot-white);
  cursor: pointer;
  box-shadow: var(--teem-chatbot-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
}

#teem-chatbot-toggle:hover {
  transform: translateY(-2px);
}

#teem-chatbot-toggle:focus-visible,
.teem-chatbot-option:focus-visible,
.teem-chatbot-close:focus-visible,
.teem-chatbot-reset:focus-visible {
  outline: 3px solid rgba(114, 34, 130, 0.2);
  outline-offset: 2px;
}

.teem-chatbot-toggle__icon {
  font-size: 1.6rem;
  line-height: 1;
}

.teem-chatbot-window {
  position: fixed;
  right: 1.25rem;
  bottom: 6.2rem;
  width: 380px;
  max-width: calc(100vw - 2rem);
  height: 560px;
  max-height: calc(100vh - 7rem);
  background: var(--teem-chatbot-white);
  border: 1px solid var(--teem-chatbot-border);
  border-radius: 20px;
  box-shadow: var(--teem-chatbot-shadow);
  overflow: hidden;
  display: none;
  flex-direction: column;
  z-index: 10000;
}

.teem-chatbot-window.is-open {
  display: flex;
}

.teem-chatbot-header {
  background: linear-gradient(135deg, var(--teem-chatbot-primary), var(--teem-chatbot-primary-dark));
  color: var(--teem-chatbot-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem .9rem;
}

.teem-chatbot-header__info {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.teem-chatbot-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, .15);
  border: 2px solid rgba(255, 255, 255, .35);
}

.teem-chatbot-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: white;
}

.teem-chatbot-subtitle {
  margin: .15rem 0 0;
  font-size: .85rem;
  opacity: .92;
}

.teem-chatbot-close {
  border: none;
  background: transparent;
  color: var(--teem-chatbot-white);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: .25rem .35rem;
}

.teem-chatbot-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background:
    radial-gradient(circle at top right, rgba(114, 34, 130, 0.04), transparent 30%),
    #fcfbfd;
   scroll-behavior: smooth;
}

.teem-chatbot-message {
  display: flex;
  gap: .65rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.teem-chatbot-message__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--teem-chatbot-border);
  background: #fff;
  flex-shrink: 0;
}

.teem-chatbot-message__bubble {
  max-width: 85%;
  padding: .8rem .95rem;
  border-radius: 16px;
  font-size: .82rem;
  line-height: 1.45;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .05);
  white-space: pre-line;
}

.teem-chatbot-message--bot .teem-chatbot-message__bubble {
  background: var(--teem-chatbot-white);
  color: var(--teem-chatbot-text);
  border: 1px solid var(--teem-chatbot-border);
  border-top-left-radius: 6px;
}

.teem-chatbot-message--user {
  justify-content: flex-end;
}

.teem-chatbot-message--user .teem-chatbot-message__bubble {
  background: var(--teem-chatbot-primary);
  color: var(--teem-chatbot-white);
  border-top-right-radius: 6px;
}

.teem-chatbot-options {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin: .2rem 0 .8rem 2.7rem; 
}

.teem-chatbot-option {
  border: 1px solid var(--teem-chatbot-border);
  background: var(--teem-chatbot-white);
  color: var(--teem-chatbot-primary-dark);
  text-align: left;
  padding: .5rem .7rem;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: .85rem;
  line-height: 1.3;
  transition: all .15s ease;
}

.teem-chatbot-option:hover {
  background: var(--teem-chatbot-primary-soft);
  border-color: #c8a9d2;
}

.teem-chatbot-option[disabled] {
  opacity: .7;
  cursor: default;
}

.teem-chatbot-footer {
  border-top: 1px solid var(--teem-chatbot-border);
  background: var(--teem-chatbot-white);
  padding: .85rem 1rem;
  display: flex;
  justify-content: flex-end;
}

.teem-chatbot-reset {
  border: 1px solid var(--teem-chatbot-border);
  background: var(--teem-chatbot-white);
  color: var(--teem-chatbot-primary-dark);
  border-radius: 999px;
  padding: .6rem 1rem;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.teem-chatbot-reset:hover {
  background: var(--teem-chatbot-primary-soft);
}

@media (max-width: 640px) {
  #teem-chatbot {
    right: 1rem;
    bottom: 1rem;
  }

  .teem-chatbot-window {
    right: 1rem;
    bottom: 5.6rem;
    width: min(92vw, 380px);
    height: min(70vh, 560px);
  }

  #teem-chatbot-toggle {
    width: 58px;
    height: 58px;
  }
}

.teem-chatbot-message {
  display: flex;
  gap: .65rem;
  margin-bottom: 1rem;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(14px);
  animation: teemChatMessageIn .28s ease forwards;
}

.teem-chatbot-options {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin: .2rem 0 .8rem 2.7rem;
  opacity: 0;
  transform: translateY(10px);
  animation: teemChatOptionsIn .24s ease forwards;
}

@keyframes teemChatMessageIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes teemChatOptionsIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.teem-chatbot-message {
  display: flex;
  gap: .65rem;
  margin-bottom: 1rem;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(14px);
  animation: teemChatMessageIn .28s ease forwards;
}

.teem-chatbot-options {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin: .2rem 0 .8rem 2.7rem;
  opacity: 0;
  transform: translateY(10px);
  animation: teemChatOptionsIn .24s ease forwards;
}

.teem-chatbot-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background:
    radial-gradient(circle at top right, rgba(114, 34, 130, 0.04), transparent 30%),
    #fcfbfd;
  scroll-behavior: smooth;
}

.teem-chatbot-typing {
  display: flex;
  gap: .65rem;
  margin-bottom: 1rem;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(10px);
  animation: teemChatTypingIn .2s ease forwards;
}

.teem-chatbot-typing__bubble {
  background: var(--teem-chatbot-white);
  border: 1px solid var(--teem-chatbot-border);
  border-radius: 16px;
  border-top-left-radius: 6px;
  padding: .7rem .9rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .05);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 42px;
}

.teem-chatbot-typing__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b58bc3;
  animation: teemChatTypingDots 1.2s infinite ease-in-out;
}

.teem-chatbot-typing__dot:nth-child(2) {
  animation-delay: .15s;
}

.teem-chatbot-typing__dot:nth-child(3) {
  animation-delay: .3s;
}

@keyframes teemChatMessageIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes teemChatOptionsIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes teemChatTypingIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes teemChatTypingDots {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: .45;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}