.support-chat {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 130;
  font-family: Inter, Arial, sans-serif;
  transition: bottom 180ms ease;
}

body.has-quote-dock .support-chat {
  bottom: 100px;
}

.support-chat__launcher {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid #111;
  border-radius: 4px;
  background: #111;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  box-shadow: 0 10px 28px rgb(0 0 0 / 15%);
  cursor: pointer;
}

.support-chat__launcher svg {
  width: 18px;
  height: 18px;
}

.support-chat__panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(390px, calc(100vw - 32px));
  height: min(590px, calc(100vh - 104px));
  min-height: 420px;
  border: 1px solid #d9d9d7;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 22px 65px rgb(0 0 0 / 20%);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transform-origin: bottom right;
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.support-chat[data-open="true"] .support-chat__launcher {
  opacity: 0;
  pointer-events: none;
}

.support-chat[data-open="true"] .support-chat__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.support-chat__header {
  min-height: 72px;
  padding: 14px 16px;
  border-bottom: 1px solid #e8e8e5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.support-chat__identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.support-chat__identity > b {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.support-chat__identity > span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.support-chat__identity strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-chat__identity small {
  color: #686864;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.support-chat__identity small i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #28784c;
}

.support-chat__close,
.support-chat__form button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #111;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.support-chat__close:hover {
  background: #f2f2ef;
}

.support-chat__messages {
  min-height: 0;
  padding: 18px 16px;
  background: #f7f7f4;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.support-chat__message {
  width: fit-content;
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 4px;
  box-shadow: 0 1px 0 rgb(0 0 0 / 4%);
}

.support-chat__message p {
  margin: 0;
  color: inherit;
  font-size: 13px;
  line-height: 1.55;
}

.support-chat__message small {
  margin-top: 7px;
  color: inherit;
  display: block;
  font-size: 10px;
  line-height: 1.4;
  opacity: 0.7;
}

.support-chat__message--assistant {
  align-self: flex-start;
  border: 1px solid #e1e1dd;
  background: #fff;
  color: #171717;
}

.support-chat__message--customer {
  align-self: flex-end;
  background: #171717;
  color: #fff;
}

.support-chat__form {
  min-height: 68px;
  padding: 10px 12px;
  border-top: 1px solid #e8e8e5;
  background: #fff;
  display: grid;
  grid-template-columns: 1fr 42px;
  align-items: center;
  gap: 8px;
}

.support-chat__form label {
  min-width: 0;
}

.support-chat__form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #d6d6d2;
  border-radius: 3px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0;
  outline: none;
}

.support-chat__form input:focus {
  border-color: #111;
  box-shadow: 0 0 0 1px #111;
}

.support-chat__form button {
  background: #111;
  color: #fff;
}

.support-chat__form button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.support-chat__form button[data-loading="true"] svg {
  animation: support-chat-spin 800ms linear infinite;
}

@keyframes support-chat-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  .support-chat {
    right: 12px;
    bottom: 12px;
  }

  body.has-quote-dock .support-chat {
    bottom: 88px;
  }

  .support-chat__launcher {
    width: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .support-chat__close,
  .support-chat__form button {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .support-chat__launcher span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .support-chat__panel {
    position: fixed;
    inset: 10px;
    width: auto;
    height: auto;
    min-height: 0;
    transform-origin: bottom center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-chat__panel {
    transition: none;
  }
}
