/* FABs: bottom TG · above support chat · sound higher */

.tg-fab {
  position: fixed;
  z-index: 70;
  right: 1.1rem;
  bottom: 1.1rem;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(160deg, #2aabee 0%, #229ed9 55%, #1b8fc5 100%);
  box-shadow:
    0 10px 28px rgba(34, 158, 217, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  display: grid;
  place-items: center;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tg-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 34px rgba(34, 158, 217, 0.55);
  color: #fff;
}

.tg-fab svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.support-fab {
  position: fixed;
  z-index: 70;
  right: 1.1rem;
  bottom: 5.5rem;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(160deg, #3d3d3d 0%, #1a1a1a 55%, #0f0f0f 100%);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.support-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

.support-fab svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.support-fab__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font: 700 11px/18px "IBM Plex Sans", sans-serif;
  display: none;
}

.support-fab__badge.is-on {
  display: grid;
  place-items: center;
}

.sound-fab {
  right: 1.1rem !important;
  bottom: 9.9rem !important;
}

.support-chat {
  position: fixed;
  z-index: 80;
  right: 1.1rem;
  bottom: 10rem;
  width: min(380px, calc(100vw - 1.4rem));
  height: min(520px, calc(100vh - 11rem));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: #0e1621;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

.support-chat.is-open {
  display: flex;
}

.support-chat__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  background: #17212b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.support-chat__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: #0e1621;
}

.support-chat__meta {
  flex: 1;
  min-width: 0;
}

.support-chat__name {
  margin: 0;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
}

.support-chat__status {
  margin: 0.15rem 0 0;
  color: #6abf6a;
  font-size: 0.78rem;
}

.support-chat__status.is-typing {
  color: #8b9bab;
}

.support-chat__close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8b9bab;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.support-chat__close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.support-chat__body {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background:
    radial-gradient(ellipse at top, rgba(42, 171, 238, 0.06), transparent 50%),
    #0e1621;
}

.support-msg {
  max-width: 82%;
  padding: 0.55rem 0.7rem 0.35rem;
  border-radius: 14px;
  position: relative;
}

.support-msg--user {
  align-self: flex-end;
  background: #2b5278;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.support-msg--support {
  align-self: flex-start;
  background: #182533;
  color: #e8eef4;
  border-bottom-left-radius: 4px;
}

.support-msg__text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.support-msg__photo {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  margin-bottom: 0.35rem;
}

.support-msg__time {
  display: block;
  text-align: right;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.2rem;
}

.support-chat__composer {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  background: #17212b;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.support-chat__attach,
.support-chat__send {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #6ab3e0;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.support-chat__attach:hover,
.support-chat__send:hover {
  background: rgba(255, 255, 255, 0.06);
}

.support-chat__attach svg,
.support-chat__send svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.support-chat__input {
  flex: 1;
  min-height: 40px;
  max-height: 110px;
  resize: none;
  border: 0;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: #242f3d;
  color: #fff;
  font: 400 0.95rem/1.3 "IBM Plex Sans", sans-serif;
  outline: none;
}

.support-chat__input::placeholder {
  color: #6b7c8d;
}

.support-chat__preview {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: #17212b;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.support-chat__preview.is-on {
  display: flex;
}

.support-chat__preview img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
}

.support-chat__preview button {
  border: 0;
  background: transparent;
  color: #8b9bab;
  cursor: pointer;
  font-size: 0.85rem;
}

@media (max-width: 560px) {
  .support-chat {
    right: 0.55rem;
    left: 0.55rem;
    width: auto;
    bottom: 9.4rem;
    height: min(62vh, 520px);
  }
  .tg-fab {
    right: 0.85rem;
    bottom: 0.85rem;
  }
  .support-fab {
    right: 0.85rem;
    bottom: 5.2rem;
  }
  .sound-fab {
    right: 0.85rem !important;
    bottom: 9.5rem !important;
  }
}
