.dp-bot {
  position: fixed;
  left: 22px;
  bottom: 28px;
  z-index: 1002;
  font-family: var(--default-font);
}

.dp-bot-launcher {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--primary-color);
  color: var(--white-color);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(29, 28, 80, 0.28);
  transition: background 0.25s ease, transform 0.25s ease;
}

.dp-bot-launcher:hover {
  background: #2a2870;
  transform: translateY(-2px);
}

.dp-bot-panel {
  position: absolute;
  left: 0;
  bottom: 70px;
  width: min(380px, calc(100vw - 44px));
  height: min(560px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  background: var(--bg-color);
  color: var(--primary-color);
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(29, 28, 80, 0.08);
  box-shadow: 0 24px 60px rgba(29, 28, 80, 0.22);
}

.dp-bot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 14px;
  background: var(--primary-color);
  color: var(--white-color);
}

.dp-bot-head-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dp-bot-kicker {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-color);
}

.dp-bot-head strong {
  font-family: var(--heading-font);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
}

.dp-bot-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white-color);
  cursor: pointer;
}

.dp-bot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dp-bot-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}

.dp-bot-row.is-user {
  justify-content: flex-end;
}

.dp-bot-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-color);
  color: var(--white-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.dp-bot-bubble {
  margin: 0;
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--white-color);
  color: var(--text-color);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid rgba(29, 28, 80, 0.06);
}

.dp-bot-row.is-user .dp-bot-bubble {
  background: var(--primary-color);
  color: var(--white-color);
  border-color: transparent;
  border-bottom-right-radius: 6px;
}

.dp-bot-row.is-bot .dp-bot-bubble {
  border-bottom-left-radius: 6px;
}

.dp-bot-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 54px;
  min-height: 22px;
}

.dp-bot-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-color);
  opacity: 0.35;
  animation: dp-bot-dot 1s infinite ease-in-out;
}

.dp-bot-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.dp-bot-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes dp-bot-dot {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.dp-bot-status {
  margin: 4px 0 0;
  text-align: center;
  color: var(--text-color);
  font-size: 13px;
}

.dp-bot-status button {
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--primary-color);
  color: var(--white-color);
  padding: 7px 14px;
  font-size: 12px;
  cursor: pointer;
}

.dp-bot-follow {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
  background: var(--white-color);
  border-top: 1px solid rgba(29, 28, 80, 0.08);
}

.dp-bot-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--primary-color);
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.dp-bot-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dp-bot-chip {
  appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  outline: none;
  box-shadow: none;
  background: #f3f0e6;
  color: var(--primary-color);
  border-radius: 12px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  white-space: normal;
  transition: background 0.2s ease, color 0.2s ease;
}

.dp-bot-chip:hover:not(:disabled),
.dp-bot-chip:focus-visible:not(:disabled) {
  background: var(--primary-color);
  color: var(--white-color);
}

.dp-bot-chip:disabled {
  opacity: 0.55;
  cursor: default;
}

.dp-bot-leaf {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.dp-bot-leaf p {
  margin: 0;
  color: var(--text-color);
  font-size: 13px;
}

.dp-bot-leaf button {
  border: 0;
  border-radius: 999px;
  background: var(--primary-color);
  color: var(--white-color);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 575px) {
  .dp-bot {
    left: 16px;
    bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .dp-bot-panel {
    height: min(520px, calc(100vh - 180px));
  }
}
