.support-button {
  position: relative;
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  color: #89577c;
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 255, 255, 0.96), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(248, 238, 247, 0.9));
  border: 1px solid rgba(118, 75, 108, 0.12);
  box-shadow: 0 0.25rem 0.8rem rgba(77, 32, 67, 0.06), inset 0 1px rgba(255, 255, 255, 0.8);
  transition: color 160ms ease, border-color 160ms ease, box-shadow 180ms ease, transform 160ms ease;
}

.support-button::before {
  position: absolute;
  inset: 0.23rem;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 0.58rem;
  pointer-events: none;
}

.support-button .icon {
  position: relative;
  z-index: 1;
  width: 1.22rem;
  height: 1.22rem;
  stroke-width: 1.65;
}

.support-button:hover,
.support-button[aria-expanded="true"] {
  color: #bd3155;
  background: linear-gradient(145deg, #ffffff, #fbf0f5);
  border-color: rgba(196, 42, 81, 0.17);
  box-shadow: 0 0.45rem 1.15rem rgba(125, 42, 76, 0.13), inset 0 1px rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.support-button.has-reply {
  color: #c22948;
  background: rgba(255, 249, 250, 0.96);
  border-color: rgba(215, 47, 72, 0.14);
  box-shadow: 0 0 0 0.28rem rgba(215, 47, 72, 0.055), 0 0 1.25rem rgba(215, 47, 72, 0.22), inset 0 0 0.8rem rgba(255, 218, 224, 0.24);
  animation: support-reply-glow 3s ease-in-out infinite;
}

@keyframes support-reply-glow {
  0%, 100% { box-shadow: 0 0 0 0.24rem rgba(215, 47, 72, 0.04), 0 0 0.85rem rgba(215, 47, 72, 0.14); }
  50% { box-shadow: 0 0 0 0.32rem rgba(215, 47, 72, 0.07), 0 0 1.45rem rgba(215, 47, 72, 0.28); }
}

.support-backdrop {
  position: fixed;
  inset: 0;
  z-index: 49;
  padding: 0;
  background: rgba(44, 27, 33, 0.13);
  border: 0;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(2.5px);
  transition: opacity 180ms ease;
}

.support-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.support-panel {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 50;
  display: flex;
  width: min(27rem, calc(100vw - 1.5rem));
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 2%, rgba(186, 103, 171, 0.1), transparent 18rem),
    radial-gradient(circle at 3% 96%, rgba(235, 75, 103, 0.08), transparent 16rem),
    rgba(255, 253, 253, 0.985);
  border: 1px solid rgba(77, 32, 56, 0.09);
  border-radius: 1.45rem;
  box-shadow: -1.1rem 1.2rem 4.5rem rgba(67, 32, 48, 0.17), inset 0 1px rgba(255, 255, 255, 0.95);
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 1.35rem)) scale(0.985);
  transform-origin: right center;
  transition: opacity 180ms ease, transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.support-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.support-panel__header {
  display: flex;
  min-height: 5.25rem;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.05rem 1rem 1.2rem;
  border-bottom: 1px solid rgba(77, 32, 52, 0.065);
}

.support-panel__mark {
  position: relative;
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  place-items: center;
  color: #a7355c;
  background: linear-gradient(145deg, #fff, #f6e7ef);
  border: 1px solid rgba(169, 53, 92, 0.1);
  border-radius: 0.8rem;
  box-shadow: 0 0.45rem 1.05rem rgba(129, 49, 77, 0.09);
}

.support-panel__mark .icon {
  width: 1.2rem;
  height: 1.2rem;
}

.support-panel__title {
  display: grid;
  min-width: 0;
  gap: 0.16rem;
}

.support-panel__title strong {
  font-size: 0.92rem;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.support-panel__title span {
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: 580;
}

.support-panel__close {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  margin-left: auto;
  place-items: center;
  padding: 0;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(77, 32, 45, 0.08);
  border-radius: 0.72rem;
  cursor: pointer;
}

.support-panel__close:hover {
  color: var(--color-text);
  background: #fff;
}

.support-thread {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.2rem 1.05rem 1.6rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(117, 100, 104, 0.2) transparent;
  scrollbar-width: thin;
}

.support-day {
  align-self: center;
  margin: 0.15rem 0 0.3rem;
  color: var(--color-text-muted);
  font-size: 0.62rem;
  font-weight: 650;
}

.support-message {
  display: grid;
  max-width: 84%;
  gap: 0.28rem;
}

.support-message--team {
  align-self: flex-start;
}

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

.support-message__bubble {
  margin: 0;
  padding: 0.78rem 0.9rem;
  color: #49383d;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(77, 32, 45, 0.07);
  border-radius: 0.98rem 0.98rem 0.98rem 0.32rem;
  box-shadow: 0 0.45rem 1.2rem rgba(77, 32, 45, 0.045);
  font-size: 0.82rem;
  line-height: 1.48;
  white-space: pre-wrap;
}

.support-message--customer .support-message__bubble {
  color: #fff;
  background: linear-gradient(135deg, #d83a58, #ad2144);
  border-color: transparent;
  border-radius: 0.98rem 0.98rem 0.32rem 0.98rem;
  box-shadow: 0 0.55rem 1.2rem rgba(173, 33, 68, 0.16), inset 0 1px rgba(255, 255, 255, 0.18);
}

.support-message time {
  padding: 0 0.28rem;
  color: var(--color-text-muted);
  font-size: 0.6rem;
}

.support-message--customer time {
  justify-self: end;
}

.support-composer-wrap {
  padding: 0.82rem;
  background: rgba(255, 253, 253, 0.78);
  border-top: 1px solid rgba(77, 32, 52, 0.065);
  backdrop-filter: blur(15px);
}

.support-composer {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  min-height: 3.3rem;
  padding: 0.46rem 0.48rem 0.46rem 0.78rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(77, 32, 52, 0.1);
  border-radius: 1rem;
  box-shadow: 0 0.5rem 1.3rem rgba(77, 32, 45, 0.05), inset 0 1px rgba(255, 255, 255, 0.9);
}

.support-composer:focus-within {
  border-color: rgba(199, 42, 76, 0.22);
  box-shadow: 0 0 0 0.2rem rgba(215, 47, 72, 0.055), 0 0.6rem 1.5rem rgba(77, 32, 45, 0.06);
}

.support-composer textarea {
  width: 100%;
  min-height: 2.35rem;
  max-height: 7rem;
  padding: 0.55rem 0;
  resize: none;
  color: var(--color-text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 0.8rem;
  line-height: 1.42;
}

.support-composer textarea::placeholder {
  color: #a59398;
}

.support-send {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  color: #fff;
  background: linear-gradient(135deg, #df415d, #ad1c3d);
  border: 0;
  border-radius: 0.76rem;
  box-shadow: 0 0.45rem 0.9rem rgba(173, 28, 61, 0.18), inset 0 1px rgba(255, 255, 255, 0.24);
  cursor: pointer;
  transition: filter 150ms ease, transform 150ms ease;
}

.support-send:hover {
  filter: brightness(1.04) saturate(1.04);
  transform: translateY(-1px);
}

.support-send:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.support-send .icon {
  width: 1.05rem;
  height: 1.05rem;
  stroke-width: 1.8;
}

.support-status {
  min-height: 1rem;
  margin: 0.38rem 0.32rem 0;
  color: var(--color-text-muted);
  font-size: 0.62rem;
  line-height: 1.35;
}

@media (max-width: 32rem) {
  .support-panel {
    inset: 0.5rem;
    width: auto;
  }
}

@media (max-width: 25rem) {
  .support-button {
    width: 2.35rem;
    height: 2.35rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .support-panel,
  .support-backdrop,
  .support-button,
  .support-send {
    transition-duration: 0.01ms;
  }

  .support-button.has-reply {
    animation: none;
  }
}
