.serenity-bot {
  position: fixed;
  left: 22px;
  right: auto;
  bottom: 22px;
  z-index: 1200;
  font-family: var(--font, 'Manrope', system-ui, sans-serif);
  color: #f4f0e8;
}

.serenity-bot * {
  box-sizing: border-box;
}

.serenity-bot__panel {
  position: absolute;
  left: 0;
  right: auto;
  bottom: 74px;
  width: min(380px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 120px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 22px;
  background:
    radial-gradient(circle at 20% 0%, rgba(169, 158, 245, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(19, 21, 31, 0.98), rgba(8, 9, 14, 0.98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(73, 55, 184, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.96);
  transform-origin: bottom left;
  transition: opacity 0.22s ease, transform 0.22s ease;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.serenity-bot.is-open .serenity-bot__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.serenity-bot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 15px;
  border-bottom: 1px solid rgba(244, 240, 232, 0.08);
}

.serenity-bot__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.serenity-bot__mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  background: linear-gradient(145deg, #4937b8, #a99ef5);
  color: #08090e;
  font-family: var(--font-heading, 'Sora', system-ui, sans-serif);
  font-weight: 800;
  box-shadow: 0 14px 34px rgba(73, 55, 184, 0.35);
}

.serenity-bot__eyebrow {
  margin: 0 0 2px;
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a99ef5;
}

.serenity-bot__title {
  margin: 0;
  font-family: var(--font-heading, 'Sora', system-ui, sans-serif);
  font-size: 1rem;
  line-height: 1.2;
}

.serenity-bot__close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(244, 240, 232, 0.1);
  border-radius: 999px;
  background: rgba(244, 240, 232, 0.04);
  color: #f4f0e8;
  font-size: 1.15rem;
}

.serenity-bot__messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  scroll-behavior: smooth;
}

.serenity-bot__message {
  width: fit-content;
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.serenity-bot__message--bot {
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  background: rgba(244, 240, 232, 0.08);
  color: #e7e2d8;
}

.serenity-bot__message--user {
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  background: linear-gradient(145deg, #4937b8, #7463da);
  color: white;
}

.serenity-bot__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 14px;
}

.serenity-bot__chip {
  border: 1px solid rgba(169, 158, 245, 0.24);
  border-radius: 999px;
  background: rgba(169, 158, 245, 0.09);
  color: #f4f0e8;
  padding: 8px 11px;
  font-size: 0.78rem;
  line-height: 1;
}

.serenity-bot__chip:hover,
.serenity-bot__close:hover,
.serenity-bot__launcher:hover {
  border-color: rgba(169, 158, 245, 0.5);
}

.serenity-bot__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid rgba(244, 240, 232, 0.08);
  background: rgba(8, 9, 14, 0.64);
}

.serenity-bot__input {
  min-width: 0;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 999px;
  background: rgba(244, 240, 232, 0.06);
  color: #f4f0e8;
  padding: 12px 14px;
  outline: none;
}

.serenity-bot__input:focus {
  border-color: rgba(169, 158, 245, 0.6);
  box-shadow: 0 0 0 4px rgba(169, 158, 245, 0.1);
}

.serenity-bot__send {
  min-width: 46px;
  border: 0;
  border-radius: 999px;
  background: #f4f0e8;
  color: #08090e;
  font-weight: 800;
}

.serenity-bot__send:disabled {
  opacity: 0.55;
  cursor: progress;
}

.serenity-bot__launcher {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 240, 232, 0.13);
  border-radius: 22px;
  background:
    radial-gradient(circle at 28% 20%, rgba(244, 240, 232, 0.24), transparent 32%),
    linear-gradient(145deg, #4937b8, #151725);
  color: white;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38), 0 0 34px rgba(73, 55, 184, 0.28);
}

.serenity-bot__launcher svg {
  width: 28px;
  height: 28px;
}

.serenity-bot__badge {
  position: absolute;
  right: -1px;
  top: -3px;
  width: 15px;
  height: 15px;
  border: 3px solid #090b10;
  border-radius: 50%;
  background: #4ad8b1;
  box-shadow: 0 0 12px rgba(74, 216, 177, 0.8);
}

.serenity-mobile-page .serenity-bot {
  left: 14px;
  right: auto;
}

.serenity-mobile-page .serenity-bot__panel {
  left: -2px;
  right: auto;
  transform-origin: bottom left;
}

@media (max-width: 640px) {
  .serenity-bot {
    left: 14px;
    right: auto;
    bottom: 14px;
  }

  .serenity-bot__panel {
    left: -2px;
    right: auto;
    bottom: 72px;
    width: calc(100vw - 24px);
    height: min(590px, calc(100vh - 104px));
    border-radius: 18px;
    transform-origin: bottom left;
  }

  .serenity-bot__message {
    max-width: 92%;
  }
}
