.planz-chatbot,
.planz-chatbot * {
  box-sizing: border-box;
  letter-spacing: 0;
  min-width: 0;
}

.planz-chatbot {
  --planz-chatbot-ink: #3c3c3c;
  --planz-chatbot-muted: #8b8b8d;
  --planz-chatbot-line: #7d7d80;
  --planz-chatbot-soft-line: #9b9b9d;
  --planz-chatbot-peach: #feb79a;
  --planz-chatbot-peach-soft: #fff0ea;
  --planz-chatbot-bg: #ffffff;
  color: var(--planz-chatbot-ink);
  font-family: "Space Grotesk", Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.25;
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 99999;
  width: calc(100% - 16px);
}

.planz-chatbot :where(button, textarea, form) {
  box-sizing: border-box;
  font-family: inherit;
  letter-spacing: 0;
  text-transform: none;
}

.planz-chatbot :where(button)::before,
.planz-chatbot :where(button)::after {
  content: none;
}

.planz-chatbot-toggle {
  align-items: center;
  background: var(--planz-chatbot-peach);
  border: 1px solid #3C3C3C;
  border-radius: 50%;
  box-shadow: 0 2px 0 #3c3c3c;
  color: #000;
  cursor: pointer;
  display: flex;
  height: 56px;
  justify-content: center;
  padding: 0;
  transition: transform 140ms ease, background 140ms ease;
  width: 56px;
  box-sizing: border-box;
  margin: 0 0 0 auto;
}

.planz-chatbot-toggle:hover,
.planz-chatbot-toggle:focus-visible {
  background: var(--planz-chatbot-peach);
  outline: none;
  transform: translateY(-2px);
}

.planz-chatbot-toggle-close-icon {
  display: none;
}

.planz-chatbot[data-state="open"] .planz-chatbot-toggle-open-icon {
  display: none;
}

.planz-chatbot[data-state="open"] .planz-chatbot-toggle-close-icon {
  display: block;
}

.planz-chatbot-panel {
  background: var(--planz-chatbot-bg);
  border: 1px solid #3C3C3C;
  border-radius: 14px;
  bottom: 66px;
  box-shadow: 0 2px 0 #3C3C3C;
  display: flex;
  flex-direction: column;
  height: 75dvh;
  max-height: min(640px, calc(100dvh - 98px));
  min-height: min(448px, calc(100dvh - 98px));
  overflow: hidden;
  padding: 12px;
  position: absolute;
  right: 0;
  width: calc(100vw - 24px);
  max-width: 336px;
  transform-origin: bottom right;
}

.planz-chatbot-panel[hidden] {
  display: none;
}

.planz-chatbot-header {
  align-items: center;
  background: #fff;
  color: #3c3c3c;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0;
  width: 100%;
  height: auto;
}

.planz-chatbot-header-main {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.planz-chatbot-brand {
  align-items: center;
  background: var(--planz-chatbot-peach);
  border: 1px solid #3c3c3c;
  border-radius: 50%;
  color: #3c3c3c;
  display: inline-flex;
  flex: 0 0 32px;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.planz-chatbot-heading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.planz-chatbot-title {
  color: #3C3C3C;
  display: block;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 24px;
  margin: 0;
  overflow: hidden;
  padding: 0;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.planz-chatbot-subtitle {
  color: #3c3c3c;
  display: block;
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  margin-top: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planz-chatbot-close {
  align-items: center;
  background: #fff;
  border: 1px solid #3c3c3c;
  border-radius: 50%;
  color: rgba(60, 60, 60, 0.6);
  cursor: pointer;
  display: flex;
  flex: 0 0 32px;
  height: 32px;
  justify-content: center;
  line-height: 1;
  margin: 0 0 0 auto;
  padding: 0;
  width: 32px;
  box-sizing: border-box;
}

.planz-chatbot-close:hover,
.planz-chatbot-close:focus-visible {
  background: rgba(0, 0, 0, 0.05);
  outline: none;
}

.planz-chatbot-close:active {
  transform: translateY(1px);
}

.planz-chatbot-content {
  background: transparent;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 16px;
  justify-content: safe flex-end;
  margin-top: 12px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 4px 4px 0;
  scroll-behavior: smooth;
}

.planz-chatbot-messages {
  background: transparent;
  margin-bottom: 0;
  min-height: 0;
  overflow: visible;
  padding: 0;
}

.planz-chatbot-messages:empty {
  display: none;
}

.planz-chatbot-intro {
  background: #fff;
  border: 1px solid #3C3C3C;
  border-radius: 0 10px 10px 10px;
  color: #3C3C3C;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  margin: 0;
  padding: 8px 12px;
  text-transform: none;
}

.planz-chatbot-intro[hidden] {
  display: none;
}

.planz-chatbot-message {
  display: flex;
  margin-bottom: 16px;
}

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

.planz-chatbot-message-assistant,
.planz-chatbot-message-system {
  justify-content: flex-start;
}

.planz-chatbot-message:last-child {margin: 0}

.planz-chatbot-bubble {
  border: 1px solid #3C3C3C;
  border-radius: 0 10px 10px 10px;
  box-shadow: none;
  color: #3C3C3C;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  max-width: 86%;
  overflow-wrap: anywhere;
  padding: 8px 12px;
  text-transform: none;
}

.planz-chatbot-message-user .planz-chatbot-bubble {
  background: #FDDCCE;
  max-width: 70%;
  border-radius: 12px 0 12px 12px;
}

.planz-chatbot-message-assistant .planz-chatbot-bubble {
  background: #fff;
  border: 1px solid #3C3C3C;
  color: #3C3C3C;
}

.planz-chatbot-message-system .planz-chatbot-bubble {
  background: #fff7f2;
  border-color: #d59986;
  color: #7a4d3e;
}

.planz-chatbot-bubble p {
  margin: 0;
}

.planz-chatbot-bubble p + p,
.planz-chatbot-bubble ul + p,
.planz-chatbot-bubble p + ul {
  margin-top: 8px;
}

.planz-chatbot-bubble ul {
  margin: 0;
  padding-left: 16px;
}

.planz-chatbot-bubble li + li {
  margin-top: 3px;
}

.planz-chatbot-bubble a {
  color: #3b7f76;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.planz-chatbot-bubble-streaming {
  white-space: pre-wrap;
}

.planz-chatbot-stream-token {
  animation: planz-chatbot-token-in 160ms ease forwards;
  display: inline;
  opacity: 0;
}

@keyframes planz-chatbot-token-in {
  from {
    opacity: 0;
    transform: translateY(2px);
  }

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

@media (prefers-reduced-motion: reduce) {
  .planz-chatbot-stream-token {
    animation: none;
    opacity: 1;
  }
}

.planz-chatbot-message-thinking {
  background: #fff;
  border: 1.5px solid var(--planz-chatbot-line);
  border-radius: 8px;
  padding: 10px 12px;
  width: fit-content;
}

.planz-chatbot-dots {
  align-items: center;
  display: flex;
  gap: 4px;
  height: 14px;
}

.planz-chatbot-dots i {
  animation: planz-chatbot-bounce 1s infinite ease-in-out;
  background: #7d7d80;
  border-radius: 50%;
  display: block;
  height: 5px;
  width: 5px;
}

.planz-chatbot-dots i:nth-child(2) {
  animation-delay: 120ms;
}

.planz-chatbot-dots i:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes planz-chatbot-bounce {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.planz-chatbot-quick-actions {
  background: transparent;
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.planz-chatbot-quick-actions::before {
  color: #3C3C3C;
  content: attr(data-label);
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  margin: 0;
}

.planz-chatbot-quick-actions[hidden] {
  display: none;
}

.planz-chatbot-quick-action {
  background: #fff8f5;
  border: 1px solid #3C3C3C;
  border-radius: 8px;
  color: #3C3C3C;
  display: block;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  min-height: 32px;
  padding: 8px 12px;
  text-align: left;
  text-transform: none;
  transition: background 140ms ease, border-color 140ms ease;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

.planz-chatbot-quick-action:hover,
.planz-chatbot-quick-action:focus-visible {
  background: #fff0ea;
  border-color: #77777a;
  outline: none;
}

.planz-chatbot-footer {
  background: #fff;
  flex: 0 0 auto;
  min-height: 0;
}

.planz-chatbot-form {
  align-items: stretch;
  background: #fff;
  border: 1px solid #3C3C3C;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 0;
  padding: 8px;
  box-sizing: border-box;
  height: 142px;
  width: 100%;
}

.planz-chatbot-input {
  background: transparent;
  border: 0;
  color: #3C3C3C;
  flex: 0 0 80px;
  font-weight: 500;
  line-height: 20px;
  height: 80px;
  min-height: 80px;
  max-height: 80px;
  margin: 0;
  overflow-y: auto;
  outline: none;
  padding: 0;
  resize: none;
  width: 100%;
  box-sizing: border-box;
  text-transform: none;
  font-size: 14px;
  font-weight: normal;
}

.planz-chatbot-input::placeholder {
  color: #9a9a9d;
  opacity: 1;
}

.planz-chatbot-input:disabled {
  color: #9a9a9d;
}

.planz-chatbot-send {
  align-items: center;
  background: var(--planz-chatbot-peach);
  border: 1px solid #3C3C3C;
  border-radius: 10px;
  color: #3C3C3C;
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
  height: 36px;
  justify-content: center;
  line-height: 20px;
  padding: 0 12px;
  text-transform: none !important;
  transition: background 140ms ease, transform 140ms ease;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0px 2px 0px 0px #3C3C3C;
  margin: 0;
}

.planz-chatbot-send:hover,
.planz-chatbot-send:focus-visible {
  background: var(--planz-chatbot-peach);
  opacity: 0.9;
  outline: none;
  transform: translateY(-1px);
}

.planz-chatbot-send:disabled {
  background: #e6b8a9;
  cursor: not-allowed;
  transform: none;
}

.planz-chatbot-note {
  color: #3C3C3C;
  font-size: 12px;
  line-height: 16px;
  margin-top: 8px;
  overflow-wrap: anywhere;
  padding: 0;
  text-align: center;
}

@media (max-width: 640px) {
  .planz-chatbot {
    bottom: 16px;
    right: 16px;
  }
}

@media (max-width: 440px) {
  .planz-chatbot {
    bottom: 16px;
    left: auto;
    right: 8px;
  }

  .planz-chatbot-toggle {
    bottom: 0;
    position: absolute;
    right: 8px;
    width: 56px;
    height: 56px;
    padding: 0;
  }
}

@keyframes planz-chatbot-panel-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.planz-chatbot[data-state="open"] .planz-chatbot-panel {
  animation: planz-chatbot-panel-in 200ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .planz-chatbot[data-state="open"] .planz-chatbot-panel {
    animation: none;
  }
}
