.rexity-chatbot {
  --rx-black: #050505;
  --rx-ink: #111214;
  --rx-muted: #686b72;
  --rx-line: rgba(16, 18, 22, 0.1);
  --rx-red: #ff2d2d;
  --rx-panel: #ffffff;
  --rx-soft: #f5f5f3;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999999;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--rx-ink);
}

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

.rexity-chatbot__pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 168px;
  min-height: 54px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.88);
  color: #fff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.rexity-chatbot__pill:hover {
  transform: translateY(-2px);
  background: #000;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
}

.rexity-chatbot__mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
}

.rexity-chatbot__mark svg {
  width: 18px;
  height: 18px;
  color: #000;
}

.rexity-chatbot__pill-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.rexity-chatbot__pill-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.rexity-chatbot__pill-subtitle {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 500;
}

.rexity-chatbot__panel {
  display: none;
  width: min(420px, calc(100vw - 32px));
  height: min(690px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  background: var(--rx-panel);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.36);
}

.rexity-chatbot.is-open .rexity-chatbot__pill {
  display: none;
}

.rexity-chatbot.is-open .rexity-chatbot__panel {
  display: flex;
  flex-direction: column;
  animation: rexityChatOpen 220ms ease both;
}

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

.rexity-chatbot__hero {
  position: relative;
  min-height: 178px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 30%, rgba(255, 45, 45, 0.55), transparent 18%),
    radial-gradient(circle at 68% 72%, rgba(255, 255, 255, 0.18), transparent 22%),
    linear-gradient(135deg, #050505 0%, #111114 52%, #050505 100%);
}

.rexity-chatbot__hero::before,
.rexity-chatbot__hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.rexity-chatbot__hero::before {
  right: -54px;
  top: 22px;
  width: 260px;
  height: 118px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.1), rgba(255, 45, 45, 0.16));
  transform: rotate(-22deg);
}

.rexity-chatbot__hero::after {
  right: -20px;
  bottom: -28px;
  width: 220px;
  height: 86px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.18));
  transform: rotate(-22deg);
}

.rexity-chatbot__top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.rexity-chatbot__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.rexity-chatbot__brand svg {
  width: 28px;
  height: 28px;
}

.rexity-chatbot__close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  cursor: pointer;
}

.rexity-chatbot__intro {
  position: relative;
  z-index: 2;
  max-width: 250px;
  padding: 34px 24px 0;
  color: rgba(255, 255, 255, 0.92);
}

.rexity-chatbot__intro-title {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.rexity-chatbot__intro-copy {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  line-height: 1.35;
}

.rexity-chatbot__quick {
  display: flex;
  gap: 8px;
  padding: 16px 18px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--rx-line);
  scrollbar-width: none;
}

.rexity-chatbot__quick::-webkit-scrollbar {
  display: none;
}

.rexity-chatbot__chip {
  flex: 0 0 auto;
  border: 1px solid rgba(17, 18, 20, 0.09);
  border-radius: 999px;
  background: #fff;
  color: var(--rx-ink);
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.rexity-chatbot__chip:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 45, 45, 0.34);
  background: #fff7f7;
}

.rexity-chatbot__messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background: linear-gradient(#fff, #f8f8f6);
}

.rexity-chatbot__message {
  max-width: 86%;
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.42;
}

.rexity-chatbot__message--bot {
  border-top-left-radius: 6px;
  background: #f0f0ed;
  color: #202124;
}

.rexity-chatbot__message--user {
  margin-left: auto;
  border-top-right-radius: 6px;
  background: #0b0b0c;
  color: #fff;
}

.rexity-chatbot__message--loading {
  color: var(--rx-muted);
}

.rexity-chatbot__form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--rx-line);
  background: #fff;
}

.rexity-chatbot__input {
  min-width: 0;
  flex: 1;
  height: 48px;
  border: 1px solid rgba(17, 18, 20, 0.12);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--rx-ink);
  background: var(--rx-soft);
  font-size: 14px;
  outline: none;
}

.rexity-chatbot__input:focus {
  border-color: rgba(255, 45, 45, 0.52);
  background: #fff;
}

.rexity-chatbot__send {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--rx-black);
  color: #fff;
  cursor: pointer;
}

.rexity-chatbot__send:disabled {
  cursor: default;
  opacity: 0.42;
}

.rexity-chatbot__footnote {
  padding: 0 18px 14px;
  color: #8b8d93;
  background: #fff;
  font-size: 10px;
  line-height: 1.3;
}

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

  .rexity-chatbot__panel {
    width: calc(100vw - 20px);
    height: min(720px, calc(100vh - 20px));
    border-radius: 26px;
  }
}
