.global-live-chat {
  position: fixed;
  z-index: 90;
  right: clamp(18px, 2.7vw, 42px);
  bottom: clamp(18px, 2.7vw, 34px);
  width: min(348px, calc(100vw - 32px));
  color: #f4f0e8;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.global-live-chat.is-collapsed {
  width: max-content;
}

.global-live-chat.is-moving {
  user-select: none;
}

.global-live-chat * {
  box-sizing: border-box;
}

.global-live-chat-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: min(620px, calc(100vh - 64px));
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,0) 32%),
    rgba(18,20,20,.96);
  box-shadow: 0 28px 80px rgba(0,0,0,.5);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.global-live-chat-card.is-collapsed {
  display: none;
}

.global-live-chat-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 19px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.global-live-chat-heading h2 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0;
}

.global-live-chat-heading p {
  margin: 0;
  color: rgba(255,255,255,.65);
  font-size: 12px;
}

.global-live-chat-heading p span {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #37d36b;
  box-shadow: 0 0 12px rgba(55,211,107,.72);
}

.global-live-chat-heading button,
.global-chat-input button,
.global-quick-questions button,
.global-chat-attachment-preview button,
.global-live-chat-launcher {
  cursor: pointer;
}

.global-live-chat-heading button {
  border: 0;
  color: #fff;
  background: transparent;
  font-size: 24px;
  line-height: 1;
}

.global-chat-box {
  position: relative;
  min-height: 0;
  height: min(540px, calc(100vh - 150px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(208,170,112,.58) rgba(255,255,255,.05);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  padding: 18px 16px 0 20px;
}

.global-chat-box::-webkit-scrollbar {
  width: 8px;
}

.global-chat-box::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255,255,255,.04);
}

.global-chat-box::-webkit-scrollbar-thumb {
  border: 2px solid rgba(18,20,20,.96);
  border-radius: 999px;
  background: rgba(208,170,112,.56);
}

.global-chat-box::-webkit-scrollbar-thumb:hover {
  background: rgba(208,170,112,.82);
}

.global-message-row,
.global-support-message {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.global-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 34%, #f1c2aa 0 16%, transparent 17%),
    radial-gradient(circle at 50% 62%, #f6d6c2 0 26%, transparent 27%),
    linear-gradient(135deg, #8fa5b5, #d7c0ad);
}

.global-message-row strong,
.global-message-row small {
  display: block;
}

.global-message-row strong {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.global-message-row small,
.global-message-row time,
.global-support-message time,
.global-user-message time {
  color: rgba(255,255,255,.46);
  font-size: 11px;
}

.global-message-bubble {
  display: inline-block;
  margin: 18px 0 8px;
  padding: 13px 15px;
  border-radius: 8px;
  color: rgba(255,255,255,.86);
  background: rgba(255,255,255,.08);
  font-size: 13px;
  line-height: 1.55;
}

.global-quick-questions {
  display: grid;
  gap: 10px;
  margin: 16px 0 22px;
}

.global-quick-questions button {
  justify-self: start;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  background: transparent;
  font-size: 12px;
}

.global-quick-questions button:hover {
  border-color: rgba(208,170,112,.75);
  color: #d0aa70;
}

.global-user-message {
  display: grid;
  justify-items: end;
  gap: 6px;
  margin: 12px 0;
}

.global-user-message > span {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: 8px;
  color: #111;
  background: #d0aa70;
  font-size: 13px;
}

.global-chat-status {
  margin: 10px 0;
  color: rgba(255,255,255,.62);
  font-size: 12px;
  text-align: center;
}

.global-chat-status.error {
  color: #ffb7aa;
}

.global-chat-input {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 28px 28px 28px;
  gap: 6px;
  align-items: center;
  margin: 10px -16px 0 -20px;
  padding: 14px 16px 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  background: rgba(18,20,20,.98);
}

.global-chat-input input {
  min-width: 0;
  border: 0;
  color: #fff;
  background: transparent;
  outline: none;
}

.global-chat-input button {
  border: 0;
  color: rgba(255,255,255,.68);
  background: transparent;
}

.global-chat-input button[type="submit"] {
  color: #d0aa70;
}

.global-chat-attachment-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.14);
}

.global-chat-attachment-preview img {
  width: 42px;
  height: 42px;
  object-fit: cover;
}

.global-chat-attachment-preview button {
  margin-left: auto;
  border: 0;
  color: #fff;
  background: transparent;
}

.global-chat-message-image {
  display: block;
  margin-top: 8px;
}

.global-chat-message-image img {
  display: block;
  width: min(148px, 100%);
  max-height: 148px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
}

.global-emoji-panel {
  position: absolute;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(6, 28px);
  gap: 4px;
  padding: 8px;
  background: #111;
  border: 1px solid rgba(255,255,255,.18);
}

.global-emoji-panel[hidden] {
  display: none;
}

.global-emoji-panel button {
  border: 0;
  background: transparent;
}

.global-live-chat-launcher {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin-left: auto;
  padding: 0 17px;
  border: 1px solid rgba(208,170,112,.55);
  border-radius: 999px;
  color: #fff;
  background: rgba(18,20,20,.96);
  box-shadow: 0 18px 48px rgba(0,0,0,.42);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  touch-action: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.global-live-chat-launcher.is-visible {
  display: inline-flex;
}

.global-live-chat-launcher:hover,
.global-live-chat-launcher.is-dragging {
  border-color: rgba(208,170,112,.9);
  box-shadow: 0 22px 58px rgba(0,0,0,.52), 0 0 18px rgba(208,170,112,.14);
}

.global-live-chat-launcher.is-dragging {
  cursor: grabbing;
  transform: scale(.98);
}

.global-live-chat-launcher:not(.is-dragging) {
  cursor: grab;
}

.global-live-chat-launcher span {
  display: inline-grid;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #37d36b;
  box-shadow: 0 0 12px rgba(55,211,107,.72);
}

@media (max-width: 760px) {
  .global-live-chat {
    right: 14px;
    bottom: 14px;
    width: min(330px, calc(100vw - 28px));
  }

  .global-live-chat-card {
    max-height: min(600px, calc(100vh - 28px));
  }

  .global-chat-box {
    height: calc(100vh - 130px);
  }
}
