.tari-chatbot {
  --chat-green: #267447;
  --chat-green-dark: #1c5d38;
  --chat-ink: #20352a;
  --chat-muted: #748279;
  --chat-line: #e6ece7;
  --chat-shadow: 0 18px 55px rgba(27, 55, 38, .2);
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99999;
  color: var(--chat-ink);
  font-family: inherit;
}

.tari-chatbot *,
.tari-chatbot *::before,
.tari-chatbot *::after {
  box-sizing: border-box;
}

.tari-chatbot [hidden] {
  display: none !important;
}

.tari-chatbot__panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  display: flex;
  flex-direction: column;
  width: 380px;
  height: min(570px, calc(100vh - 120px));
  min-height: 390px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(32, 53, 42, .08);
  border-radius: 20px;
  box-shadow: var(--chat-shadow);
  animation: tari-chatbot-arrive .18s ease-out;
}

.tari-chatbot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  color: #fff;
  background: linear-gradient(120deg, var(--chat-green-dark), var(--chat-green));
}

.tari-chatbot__identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tari-chatbot__avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  color: #e6f5b8;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 14px;
}

.tari-chatbot__avatar svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.tari-chatbot__title {
  margin: 0;
  color: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
}

.tari-chatbot__status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  color: rgba(255, 255, 255, .82);
  font-size: 12px;
  line-height: 1.2;
}

.tari-chatbot__status span {
  width: 7px;
  height: 7px;
  background: #b9e568;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(185, 229, 104, .16);
}

.tari-chatbot__close,
.tari-chatbot__send,
.tari-chatbot__launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
}

.tari-chatbot__close {
  width: 34px;
  height: 34px;
  padding: 7px;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border-radius: 10px;
  transition: background .15s ease;
}

.tari-chatbot__close:hover {
  background: rgba(255, 255, 255, .22);
}

.tari-chatbot__close svg,
.tari-chatbot__send svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.tari-chatbot__messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 20px 18px;
  background:
    radial-gradient(ellipse at top left, rgba(231, 243, 222, .38), transparent 48%),
    #fbfcfa;
  overscroll-behavior: contain;
}

.tari-chatbot__welcome {
  padding: 15px;
  background: #fff;
  border: 1px solid var(--chat-line);
  border-radius: 5px 16px 16px 16px;
  box-shadow: 0 3px 12px rgba(31, 58, 40, .035);
}

.tari-chatbot__eyebrow {
  color: var(--chat-green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
}

.tari-chatbot__welcome p {
  margin: 7px 0 12px;
  color: var(--chat-ink);
  font-size: 14px;
  line-height: 1.55;
}

.tari-chatbot__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tari-chatbot__suggestions button {
  padding: 7px 10px;
  color: var(--chat-green-dark);
  background: #f3f8ed;
  border: 1px solid #dce9d2;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  line-height: 1.25;
  transition: background .15s ease, border-color .15s ease;
}

.tari-chatbot__suggestions button:hover {
  background: #eaf3df;
  border-color: #bfd5ac;
}

.tari-chatbot__message {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 15px;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.tari-chatbot__message--user {
  align-self: flex-end;
  color: #fff;
  background: var(--chat-green);
  border-bottom-right-radius: 5px;
}

.tari-chatbot__message--assistant {
  align-self: flex-start;
  color: var(--chat-ink);
  background: #fff;
  border: 1px solid var(--chat-line);
  border-bottom-left-radius: 5px;
}

.tari-chatbot__message--error {
  color: #8a3d2a;
  background: #fff5f1;
  border-color: #f0d8ce;
}

.tari-chatbot__message--loading {
  color: var(--chat-muted);
}

.tari-chatbot__composer {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 14px 16px 10px;
  background: #fff;
  border-top: 1px solid var(--chat-line);
}

.tari-chatbot__composer textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  max-height: 110px;
  resize: none;
  padding: 12px 13px;
  color: var(--chat-ink);
  background: #f7f9f6;
  border: 1px solid #e5ebe4;
  border-radius: 13px;
  outline: none;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.tari-chatbot__composer textarea::placeholder {
  color: #929e95;
}

.tari-chatbot__composer textarea:focus {
  background: #fff;
  border-color: #8ab58e;
  box-shadow: 0 0 0 3px rgba(38, 116, 71, .1);
}

.tari-chatbot__send {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  color: #fff;
  background: var(--chat-green);
  border-radius: 13px;
  transition: background .15s ease, transform .15s ease;
}

.tari-chatbot__send:hover:not(:disabled) {
  background: var(--chat-green-dark);
  transform: translateY(-1px);
}

.tari-chatbot__send:disabled {
  cursor: wait;
  opacity: .65;
}

.tari-chatbot__hint {
  position: absolute;
  right: 70px;
  bottom: -1px;
  left: 17px;
  margin: 0;
  color: #87938a;
  font-size: 10px;
  line-height: 1.2;
  pointer-events: none;
}

.tari-chatbot__composer {
  padding-bottom: 23px;
}

.tari-chatbot__launcher {
  gap: 9px;
  min-height: 56px;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(120deg, var(--chat-green-dark), var(--chat-green));
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(28, 93, 56, .32);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  transition: box-shadow .2s ease, transform .2s ease;
}

.tari-chatbot__launcher:hover {
  box-shadow: 0 11px 28px rgba(28, 93, 56, .38);
  transform: translateY(-2px);
}

.tari-chatbot__launcher-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.tari-chatbot__launcher-icon--close {
  display: none;
}

.tari-chatbot.is-open .tari-chatbot__launcher-icon--chat {
  display: none;
}

.tari-chatbot.is-open .tari-chatbot__launcher-icon--close {
  display: block;
}

.tari-chatbot__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.tari-chatbot button:focus-visible {
  outline: 3px solid #c4e58d;
  outline-offset: 3px;
}

@keyframes tari-chatbot-arrive {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 520px) {
  .tari-chatbot {
    right: 14px;
    bottom: 14px;
  }

  .tari-chatbot__panel {
    position: fixed;
    right: 10px;
    bottom: 82px;
    left: 10px;
    width: auto;
    height: min(610px, calc(100vh - 105px));
    min-height: 360px;
    border-radius: 18px;
  }

  .tari-chatbot__launcher {
    min-height: 52px;
    padding: 0 15px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tari-chatbot *,
  .tari-chatbot *::before,
  .tari-chatbot *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
