.buyerMessageFab {
  position: fixed;
  top: calc(158px + env(safe-area-inset-top));
  right: 14px;
  z-index: 34;
  width: 60px;
  height: 60px;
  border: 1px solid rgba(229, 188, 96, 0.34);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background:
    radial-gradient(circle at 32% 25%, rgba(255, 225, 164, 0.2), transparent 48%),
    linear-gradient(180deg, rgba(33, 37, 44, 0.96), rgba(9, 10, 14, 0.98));
  box-shadow:
    0 16px 28px rgba(5, 6, 10, 0.34),
    inset 0 1px 0 rgba(255, 232, 182, 0.16);
  color: #f6dba0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.buyerMessageFab:hover,
.buyerMessageFab:focus-visible {
  transform: translateY(-1px) scale(1.02);
  box-shadow:
    0 18px 34px rgba(5, 6, 10, 0.38),
    inset 0 1px 0 rgba(255, 232, 182, 0.22);
  filter: brightness(1.05);
}

.buyerMessageFab.has-unread::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff4b34;
  box-shadow: 0 0 0 0 rgba(255, 75, 52, 0.76);
  animation: buyerMessagePulse 1.15s ease-out infinite;
}

.buyerMessageFab__icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.buyerMessageFab__icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.buyerMessageModal {
  z-index: 60;
}

.buyerMessageModal__sheet {
  position: relative;
  width: min(100%, 390px);
  max-width: 390px;
  height: min(78vh, 700px);
  max-height: min(78vh, 700px);
  margin: auto;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr) auto auto;
  overflow: hidden;
  border-radius: 28px;
  background: #ececec;
  box-shadow: 0 28px 70px rgba(4, 6, 10, 0.34);
}

.buyerMessageModal__topbar {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.buyerMessageModal__back {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #1f1f1f;
}

.buyerMessageModal__back svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.buyerMessageModal__titleWrap {
  min-width: 0;
  text-align: center;
}

.buyerMessageModal__title {
  margin: 0;
  color: #1f1f1f;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
}

.buyerMessageModal__topbarSpacer {
  width: 38px;
  height: 38px;
}

.buyerMessageModal__thread {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #ececec;
}

.buyerMessageModal__empty {
  margin: auto 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: #5c5c5c;
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.buyerMessageModal__row {
  display: flex;
  justify-content: flex-start;
}

.buyerMessageModal__row--self {
  justify-content: flex-end;
}

.buyerMessageModal__bubbleWrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 78%;
}

.buyerMessageModal__row--self .buyerMessageModal__bubbleWrap {
  align-items: flex-end;
}

.buyerMessageModal__bubble {
  width: fit-content;
  max-width: 100%;
  padding: 10px 12px 8px;
  border-radius: 18px 18px 18px 6px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(24, 24, 24, 0.06);
}

.buyerMessageModal__bubble--self {
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(135deg, #d8ad57, #c8942e);
}

.buyerMessageModal__bubbleBody {
  color: #1f1f1f;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.buyerMessageModal__bubble--self .buyerMessageModal__bubbleBody {
  color: #ffffff;
}

.buyerMessageModal__bubbleMeta {
  margin-top: 4px;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  color: #8a8a8a;
  font-size: 11px;
  line-height: 1.2;
}

.buyerMessageModal__bubbleMeta--self {
  color: #8a8a8a;
}

.buyerMessageModal__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px 12px 10px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.buyerMessageModal__composer textarea {
  width: 100%;
  min-height: 42px;
  max-height: 108px;
  resize: none;
  padding: 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 22px;
  background: #ffffff;
  color: #1f1f1f;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.buyerMessageModal__composer textarea::placeholder {
  color: #9b9b9b;
}

.buyerMessageModal__send {
  min-width: 74px;
  height: 42px;
  border: none;
  border-radius: 999px;
  padding: 0 14px;
  background: #111111;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.buyerMessageModal__send:disabled {
  opacity: 0.72;
  cursor: wait;
}

.buyerMessageModal__status {
  min-height: 18px;
  padding: 0 14px 10px;
  background: rgba(255, 255, 255, 0.96);
  color: #6a6a6a;
  font-size: 11px;
  line-height: 1.4;
}

.buyerMessageModal__status[data-kind="ok"] {
  color: #8d6125;
}

@keyframes buyerMessagePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 75, 52, 0.78);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(255, 75, 52, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 75, 52, 0);
  }
}

@media (max-width: 767px) {
  .buyerMessageFab {
    top: calc(90px + env(safe-area-inset-top));
    right: 10px;
    width: 54px;
    height: 54px;
  }

  .buyerMessageModal__sheet {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .buyerMessageModal__bubbleWrap {
    max-width: 84%;
  }
}
