.os-chat-visual {
  --os-chat-text: #263238;
  --os-chat-muted: #71868f;
  --os-chat-client: #e8eef0;
  --os-chat-team: #62d8ec;
  --os-chat-online: #a9efae;
  --os-chat-small-width: 82px;
  --os-chat-small-height: 50px;
  --os-chat-reply-width: 204px;
  --os-chat-reply-height: 112px;
  container-type: inline-size;
}

.os-chat-stage {
  display: grid;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  place-items: end center;
  padding-bottom: 18px;
  overflow: hidden;
  pointer-events: none;
}

.os-chat-thread {
  position: relative;
  width: 308px;
  height: 240px;
  flex: none;
}

.os-chat-hover-zone {
  position: absolute;
  z-index: 10;
  top: -16px;
  right: 0;
  bottom: -16px;
  left: -14px;
  background: transparent;
  border: 0;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .os-chat-hover-zone {
    pointer-events: auto;
  }
}

.os-chat-bubble {
  position: absolute;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
  color: var(--os-chat-text);
  box-shadow: 0 5px 12px rgba(36, 57, 64, 0.07);
  font-family: inherit;
}

.os-chat-bubble p,
.os-chat-bubble time {
  margin: 0;
}

.os-chat-bubble p {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.42;
  letter-spacing: 0;
}

.os-chat-bubble time {
  display: block;
  margin-top: 7px;
  color: var(--os-chat-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
}

.os-chat-bubble--client {
  top: 0;
  left: 54px;
  width: 204px;
  height: 104px;
  padding: 17px 18px 15px;
  border-radius: 24px;
  background: var(--os-chat-client);
}

.os-chat-interaction {
  position: absolute;
  top: 120px;
  left: 0;
  width: 270px;
  height: 120px;
  pointer-events: auto;
}

.os-chat-bubble--team {
  bottom: 62px;
  left: 54px;
  display: block;
  width: var(--os-chat-small-width);
  height: var(--os-chat-small-height);
  padding: 0;
  border-radius: 25px;
  background: var(--os-chat-team);
  transform-origin: left bottom;
  will-change: width, height, border-radius;
}

.os-chat-avatar {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(31, 49, 56, 0.12);
}

.os-chat-avatar svg {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.os-chat-avatar--client {
  top: 62px;
  left: 266px;
}

.os-chat-avatar--team {
  top: 12px;
  left: 0;
}

.os-chat-online {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  box-sizing: content-box;
  border: 2px solid #a8bac1;
  border-radius: 50%;
  background: var(--os-chat-online);
}

.os-chat-avatar--team .os-chat-online {
  right: auto;
  left: -2px;
}

.os-chat-typing {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  z-index: 1;
}

.os-chat-typing i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #23363b;
}

.os-chat-reply {
  position: absolute;
  top: 17px;
  left: 18px;
  width: 168px;
  z-index: 2;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}

.os-chat-bubble--team time {
  color: #397786;
}

@container (max-width: 320px) {
  .os-chat-thread {
    transform: scale(0.92);
    transform-origin: bottom center;
  }
}

@container (max-width: 290px) {
  .os-chat-thread {
    transform: scale(0.84);
  }
}

@media (max-width: 767px) {
  .os-chat-stage {
    padding-bottom: clamp(14px, 5cqw, 18px);
  }

  .os-chat-thread {
    transform: translateY(6px) scale(0.84);
    transform-origin: bottom center;
  }
}
