.ava-live-chat {
  bottom: 20px;
  color: #111827;
  font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: fixed;
  right: 20px;
  z-index: 1000;
}

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

.ava-live-chat__button {
  align-items: center;
  background: linear-gradient(135deg, #5044e5, #f527c5);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 18px 40px rgba(80, 68, 229, 0.3);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 15px;
  font-weight: 700;
  gap: 10px;
  height: 76px;
  justify-content: center;
  min-height: 76px;
  overflow: hidden;
  padding: 9px;
  width: 76px;
}

.ava-live-chat__button-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.ava-live-chat__button-logo {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.ava-live-chat__prompt {
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 8px;
  bottom: 92px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  cursor: pointer;
  max-width: min(338px, calc(100vw - 112px));
  min-width: min(338px, calc(100vw - 112px));
  padding: 34px 42px 22px 22px;
  position: absolute;
  right: 0;
}

.ava-live-chat__prompt[hidden] {
  display: none;
}

.ava-live-chat__prompt-avatar {
  align-items: center;
  background: #eef2f7;
  border-radius: 999px;
  display: flex;
  height: 58px;
  justify-content: center;
  left: 50%;
  overflow: hidden;
  padding: 8px;
  position: absolute;
  top: -32px;
  transform: translateX(-50%);
  width: 58px;
}

.ava-live-chat__prompt-avatar img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.ava-live-chat__prompt-avatar span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.ava-live-chat__prompt-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #111827;
  cursor: pointer;
  display: inline-flex;
  font-size: 24px;
  height: 32px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 8px;
  top: 8px;
  width: 32px;
}

.ava-live-chat__prompt p {
  color: #1f2937;
  font-size: 16px;
  line-height: 1.7;
  margin: 0;
}

.ava-live-chat__panel {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  bottom: 68px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  max-height: min(620px, calc(100vh - 110px));
  overflow: hidden;
  position: absolute;
  right: 0;
  width: min(380px, calc(100vw - 32px));
}

.ava-live-chat__panel[hidden] {
  display: none;
}

.ava-live-chat__header {
  align-items: center;
  background: linear-gradient(135deg, #0f172a, #312e81);
  color: #fff;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 16px;
}

.ava-live-chat__title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
}

.ava-live-chat__status {
  color: #cbd5e1;
  font-size: 12px;
  margin: 4px 0 0;
}

.ava-live-chat__status::before {
  background: #94a3b8;
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 7px;
  margin-right: 7px;
  width: 7px;
}

.ava-live-chat__status[data-online="true"]::before {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.ava-live-chat__close {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 22px;
  height: 34px;
  justify-content: center;
  line-height: 1;
  width: 34px;
}

.ava-live-chat__messages {
  background: #f8fafc;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-height: 210px;
  overflow-y: auto;
  padding: 16px;
}

.ava-live-chat__message {
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
  max-width: 86%;
  padding: 10px 12px;
  word-break: break-word;
}

.ava-live-chat__message--admin {
  align-self: flex-start;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.ava-live-chat__message--visitor {
  align-self: flex-end;
  background: linear-gradient(90deg, #5044e5, #f527c5);
  color: #fff;
}

.ava-live-chat__message-meta {
  display: block;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 5px;
  opacity: 0.72;
}

.ava-live-chat__message-body {
  display: block;
  white-space: pre-wrap;
}

.ava-live-chat__empty {
  color: #475569;
  font-size: 14px;
  line-height: 1.5;
  margin: auto 0;
}

.ava-live-chat__form {
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  display: grid;
  gap: 10px;
  padding: 14px;
}

.ava-live-chat__field {
  display: grid;
  gap: 5px;
}

.ava-live-chat__label {
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.ava-live-chat__input,
.ava-live-chat__textarea {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #111827;
  font: inherit;
  font-size: 14px;
  outline: none;
  padding: 10px 11px;
  width: 100%;
}

.ava-live-chat__textarea {
  max-height: 140px;
  min-height: 76px;
  resize: vertical;
}

.ava-live-chat__input:focus,
.ava-live-chat__textarea:focus {
  border-color: #5044e5;
  box-shadow: 0 0 0 3px rgba(80, 68, 229, 0.14);
}

.ava-live-chat__send {
  background: linear-gradient(90deg, #5044e5, #f527c5);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  min-height: 42px;
  padding: 0 14px;
}

.ava-live-chat__send:disabled {
  cursor: wait;
  opacity: 0.65;
}

.ava-live-chat__notice {
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.ava-live-chat__error {
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

@media (max-width: 640px) {
  .ava-live-chat {
    bottom: 14px;
    right: 14px;
  }

  .ava-live-chat__button {
    height: 68px;
    min-height: 68px;
    width: 68px;
  }

  .ava-live-chat__prompt {
    bottom: 84px;
    max-width: calc(100vw - 96px);
    min-width: calc(100vw - 96px);
  }

  .ava-live-chat__panel {
    bottom: 64px;
    max-height: calc(100vh - 92px);
    width: calc(100vw - 28px);
  }
}
