.bee-chat-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 12000;
  border: 0;
  border-radius: 999px;
  width: 3.75rem;
  height: 3.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffd33d 0%, #ffbe00 100%);
  color: #161616;
  box-shadow: 0 18px 40px rgba(24, 18, 0, 0.24);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.bee-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(24, 18, 0, 0.3);
}

.bee-chat-launcher svg {
  width: 1.45rem;
  height: 1.45rem;
}

.bee-chat-shell {
  position: fixed;
  right: 1.25rem;
  bottom: 5.25rem;
  z-index: 12000;
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(34rem, calc(100vh - 7rem));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 198, 0, 0.24);
  border-radius: 1.5rem;
  background: rgba(14, 14, 17, 0.94);
  color: #f8f5eb;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
}

.bee-chat-shell.is-open {
  display: flex;
}

.bee-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid rgba(255, 198, 0, 0.14);
  background: linear-gradient(180deg, rgba(255, 198, 0, 0.12), transparent);
}

.bee-chat-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #fff3c3;
}

.bee-chat-subtitle {
  margin: 0.25rem 0 0;
  color: rgba(248, 245, 235, 0.72);
  font-size: 0.82rem;
  line-height: 1.45;
}

.bee-chat-icon-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.bee-chat-body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 0.9rem;
  min-height: 0;
}

.bee-chat-auth-card,
.bee-chat-empty-card {
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bee-chat-login-form {
  display: grid;
  gap: 0.55rem;
}

.bee-chat-login-form input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  padding: 0.75rem 0.9rem;
  font-family: inherit;
  outline: none;
}

.bee-chat-login-form input::placeholder {
  color: rgba(248, 245, 235, 0.48);
}

.bee-chat-auth-card p,
.bee-chat-empty-card p {
  margin: 0 0 0.8rem;
  color: rgba(248, 245, 235, 0.82);
  font-size: 0.92rem;
  line-height: 1.6;
}

.bee-chat-login-btn,
.bee-chat-send-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.bee-chat-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffd33d;
  color: #141414;
  text-decoration: none;
}

.bee-chat-login-btn:hover,
.bee-chat-send-btn:hover {
  transform: translateY(-1px);
}

.bee-chat-thread {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 16rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding-inline-end: 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 211, 61, 0.58) rgba(255, 255, 255, 0.06);
}

.bee-chat-thread::-webkit-scrollbar {
  width: 0.48rem;
}

.bee-chat-thread::-webkit-scrollbar-track {
  margin-block: 0.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.bee-chat-thread::-webkit-scrollbar-thumb {
  border: 2px solid rgba(18, 18, 20, 0.9);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe16d 0%, #ffbe00 100%);
}

.bee-chat-thread::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #fff0a8 0%, #ffd33d 100%);
}

.bee-chat-message {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-width: 88%;
}

.bee-chat-message.me {
  align-self: flex-start;
}

.bee-chat-message.support {
  align-self: flex-end;
}

.bee-chat-bubble {
  padding: 0.82rem 0.95rem;
  border-radius: 1rem;
  font-size: 0.92rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.bee-chat-bubble-media {
  padding: 0.16rem;
  background: transparent;
  line-height: 1;
}

.bee-chat-attachment-bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
}

.bee-chat-attachment-bubble::before {
  content: "";
  width: 0.62rem;
  height: 0.62rem;
  flex: 0 0 auto;
  border-radius: 0.18rem;
  background: currentColor;
  opacity: 0.55;
}

.bee-chat-attachment-pending {
  opacity: 0.78;
}

.bee-chat-image-preview {
  display: block;
  width: min(14rem, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.035);
  padding: 0;
  cursor: pointer;
}

.bee-chat-image-preview img {
  display: block;
  width: 100%;
  max-height: 11rem;
  object-fit: cover;
}

.bee-chat-image-preview.is-broken {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.85rem 1rem;
  color: inherit;
  font-weight: 800;
}

.bee-chat-image-preview.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 4.5rem;
  padding: 0.85rem 1rem;
  color: rgba(248, 245, 235, 0.78);
  font-weight: 800;
}

.bee-chat-bubble-text {
  margin-top: 0.45rem;
}

.bee-chat-message.me .bee-chat-bubble {
  background: linear-gradient(135deg, #ffd33d 0%, #f2bf1f 100%);
  color: #1c1a12;
  border-bottom-left-radius: 0.35rem;
}

.bee-chat-message.support .bee-chat-bubble {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-bottom-right-radius: 0.35rem;
}

.bee-chat-message.me .bee-chat-bubble-media,
.bee-chat-message.support .bee-chat-bubble-media {
  background: transparent;
  color: inherit;
  border-radius: 1rem;
}

.bee-chat-meta {
  color: rgba(248, 245, 235, 0.56);
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: flex-end;
}

.bee-chat-meta.is-pending {
  color: #ffe59a;
}

.bee-chat-meta.is-failed {
  color: #ffb4b4;
}

.bee-chat-composer {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  padding-top: 0.25rem;
}

.bee-chat-attach-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.06);
  color: #ffe59a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.bee-chat-attach-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.bee-chat-attach-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.bee-chat-input-wrap {
  flex: 1;
  min-width: 0;
}

.bee-chat-input {
  width: 100%;
  min-height: 3rem;
  max-height: 8rem;
  resize: none;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  padding: 0.85rem 0.95rem;
  line-height: 1.6;
  font-family: inherit;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 211, 61, 0.58) rgba(255, 255, 255, 0.06);
}

.bee-chat-input::placeholder {
  color: rgba(248, 245, 235, 0.48);
}

.bee-chat-input::-webkit-scrollbar {
  width: 0.42rem;
}

.bee-chat-input::-webkit-scrollbar-track {
  margin-block: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.bee-chat-input::-webkit-scrollbar-thumb {
  border: 2px solid rgba(18, 18, 20, 0.9);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe16d 0%, #ffbe00 100%);
}

.bee-chat-selected-file {
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  max-width: 100%;
  border: 1px solid rgba(255, 211, 61, 0.18);
  border-radius: 0.85rem;
  background: rgba(255, 211, 61, 0.1);
  color: #ffe59a;
  padding: 0.5rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

.bee-chat-selected-file[hidden] {
  display: none;
}

.bee-chat-selected-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bee-chat-remove-file {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  cursor: pointer;
  flex: 0 0 auto;
}

.bee-chat-send-btn {
  min-width: 4.9rem;
  background: #ffd33d;
  color: #161616;
}

.bee-chat-error {
  margin: 0;
  color: #ffcdcd;
  font-size: 0.84rem;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .bee-chat-shell {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 5rem;
    width: auto;
  }

  .bee-chat-launcher {
    right: 0.9rem;
    bottom: 0.9rem;
  }
}

.bee-chat-error p {
  margin: 0;
}

.bee-chat-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.bee-chat-recovery-btn {
  border: 0;
  border-radius: 999px;
  background: #ffd33d;
  color: #161616;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.55rem 0.85rem;
  transition: opacity 160ms ease, transform 160ms ease;
}

.bee-chat-recovery-btn:hover,
.bee-chat-recovery-btn:focus-visible {
  opacity: 0.9;
  transform: translateY(-1px);
}
.bee-chat-unread-badge {
  position: absolute;
  top: -0.35rem;
  inset-inline-end: -0.25rem;
  min-width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #161616;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  padding: 0 0.32rem;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.38);
}

.bee-chat-unread-badge[hidden] {
  display: none;
}

/* Guest Chat image and file attachment rendering */
.bee-chat-image-attachment {
  display: grid;
  gap: 0.35rem;
  max-width: min(17.5rem, 100%);
}

.bee-chat-image-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(17.5rem, 100%);
  max-width: 100%;
  min-height: 5rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.035);
  padding: 0;
  color: inherit;
  cursor: pointer;
}

.bee-chat-image-preview-img,
.bee-chat-image-preview img {
  display: block;
  width: 100%;
  max-width: min(17.5rem, 100%);
  max-height: 16.25rem;
  object-fit: contain;
  border-radius: inherit;
}

.bee-chat-image-caption {
  display: block;
  max-width: min(17.5rem, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
  line-height: 1.4;
  opacity: 0.72;
}

.bee-chat-image-preview.is-broken,
.bee-chat-image-preview.is-loading {
  min-height: 4.5rem;
  padding: 0.85rem 1rem;
  text-align: center;
  font-weight: 800;
  line-height: 1.5;
}

.bee-chat-image-preview.is-loading {
  color: rgba(248, 245, 235, 0.78);
}

.bee-chat-file-attachment {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  max-width: min(16rem, 100%);
  min-width: 0;
  font-weight: 800;
}

.bee-chat-file-icon {
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border-radius: 0.55rem;
  background: currentColor;
  opacity: 0.55;
  clip-path: polygon(0 0, 72% 0, 100% 28%, 100% 100%, 0 100%);
}

.bee-chat-file-meta {
  display: grid;
  min-width: 0;
  gap: 0.1rem;
}

.bee-chat-file-type {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  opacity: 0.72;
}

.bee-chat-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 360px) {
  .bee-chat-image-attachment,
  .bee-chat-image-preview,
  .bee-chat-image-preview-img,
  .bee-chat-image-preview img,
  .bee-chat-image-caption,
  .bee-chat-file-attachment {
    max-width: 100%;
  }
}
